15 #ifndef LLVM_LIB_TARGET_MIPS_MIPSISELLOWERING_H 16 #define LLVM_LIB_TARGET_MIPS_MIPSISELLOWERING_H 47 class FunctionLoweringInfo;
48 class MachineBasicBlock;
49 class MachineFrameInfo;
52 class MipsFunctionInfo;
54 class MipsTargetMachine;
55 class TargetLibraryInfo;
56 class TargetRegisterClass;
286 bool isCheapToSpeculateCttz()
const override;
287 bool isCheapToSpeculateCtlz()
const override;
292 EVT VT)
const override;
296 unsigned getNumRegistersForCallingConv(
LLVMContext &Context,
298 EVT VT)
const override;
301 unsigned getVectorTypeBreakdownForCallingConv(
303 unsigned &NumIntermediates,
MVT &RegisterVT)
const override;
317 void LowerOperationWrapper(
SDNode *
N,
332 const char *getTargetNodeName(
unsigned Opcode)
const override;
336 EVT VT)
const override;
344 void HandleByVal(
CCState *,
unsigned &,
unsigned)
const override;
346 unsigned getRegisterByName(
const char* RegName,
EVT VT,
353 return ABI.IsN64() ? Mips::A0_64 : Mips::A0;
360 return ABI.IsN64() ? Mips::A1_64 : Mips::A1;
368 return SrcAS < 256 && DestAS < 256;
372 return getTargetMachine().isPositionIndependent();
386 template <
class NodeTy>
388 bool IsN32OrN64)
const {
391 getTargetNode(N, Ty, DAG, GOTFlag));
397 getTargetNode(N, Ty, DAG, LoFlag));
405 template <
class NodeTy>
410 getTargetNode(N, Ty, DAG, Flag));
411 return DAG.
getLoad(Ty, DL, Chain, Tgt, PtrInfo);
418 template <
class NodeTy>
421 unsigned LoFlag,
SDValue Chain,
424 getTargetNode(N, Ty, DAG, HiFlag));
427 getTargetNode(N, Ty, DAG, LoFlag));
428 return DAG.
getLoad(Ty, DL, Chain, Wrapper, PtrInfo);
437 template <
class NodeTy>
454 template <
class NodeTy>
481 template <
class NodeTy>
487 DAG.
getRegister(IsN64 ? Mips::GP_64 : Mips::GP, Ty),
496 std::deque<std::pair<unsigned, SDValue>> &RegsToPass,
497 bool IsPICCall,
bool GlobalOrExternal,
bool InternalLinkage,
513 unsigned Flag)
const;
517 unsigned Flag)
const;
521 unsigned Flag)
const;
525 unsigned Flag)
const;
529 unsigned Flag)
const;
565 isEligibleForTailCallOptimization(
const CCState &CCInfo,
566 unsigned NextStackOffset,
576 const Argument *FuncArg,
unsigned FirstReg,
582 std::deque<std::pair<unsigned, SDValue>> &RegsToPass,
585 unsigned FirstReg,
unsigned LastReg,
592 void writeVarArgRegs(std::vector<SDValue> &OutChains,
SDValue Chain,
622 bool shouldSignExtendTypeInLibCall(
EVT Type,
bool IsSigned)
const override;
634 std::pair<unsigned, const TargetRegisterClass *>
637 std::pair<unsigned, const TargetRegisterClass *>
645 void LowerAsmOperandForConstraint(
SDValue Op,
646 std::string &Constraint,
647 std::vector<SDValue> &Ops,
651 getInlineAsmMemConstraint(
StringRef ConstraintCode)
const override {
652 if (ConstraintCode ==
"R")
654 else if (ConstraintCode ==
"ZC")
665 EVT getOptimalMemOpType(uint64_t
Size,
unsigned DstAlign,
667 bool IsMemset,
bool ZeroMemset,
674 bool isFPImmLegal(
const APFloat &Imm,
EVT VT)
const override;
676 unsigned getJumpTableEncoding()
const override;
677 bool useSoftFloat()
const override;
679 bool shouldInsertFencesForAtomic(
const Instruction *
I)
const override {
686 unsigned Size,
unsigned DstReg,
687 unsigned SrcRec)
const;
693 unsigned Size)
const;
698 unsigned Size)
const;
701 bool isFPCmp,
unsigned Opc)
const;
721 #endif // LLVM_LIB_TARGET_MIPS_MIPSISELLOWERING_H const MipsTargetLowering * createMipsSETargetLowering(const MipsTargetMachine &TM, const MipsSubtarget &STI)
static SDValue LowerCallResult(SDValue Chain, SDValue InFlag, const SmallVectorImpl< CCValAssign > &RVLocs, const SDLoc &dl, SelectionDAG &DAG, SmallVectorImpl< SDValue > &InVals)
LowerCallResult - Lower the result values of a call into the appropriate copies out of appropriate ph...
BUILTIN_OP_END - This must be the last enum value in this list.
A parsed version of the target data layout string in and methods for querying it. ...
FastISel * createFastISel(FunctionLoweringInfo &funcInfo, const TargetLibraryInfo *libInfo)
This represents an addressing mode of: BaseGV + BaseOffs + BaseReg + Scale*ScaleReg If BaseGV is null...
SDValue getAddrGPRel(NodeTy *N, const SDLoc &DL, EVT Ty, SelectionDAG &DAG, bool IsN64) const
This class represents an incoming formal argument to a Function.
const MipsSubtarget & Subtarget
Compute iterated dominance frontiers using a linear time algorithm.
const MipsTargetLowering * createMips16TargetLowering(const MipsTargetMachine &TM, const MipsSubtarget &STI)
Create MipsTargetLowering objects.
MO_HIGHER/HIGHEST - Represents the highest or higher half word of a 64-bit symbol address...
bool CCAssignFn(unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, CCState &State)
CCAssignFn - This function assigns a location for Val, updating State to reflect the change...
Function Alias Analysis Results
unsigned const TargetRegisterInfo * TRI
SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT, ArrayRef< SDUse > Ops)
Gets or creates the specified node.
bool isVectorTy() const
True if this is an instance of VectorType.
SDValue getAddrNonPIC(NodeTy *N, const SDLoc &DL, EVT Ty, SelectionDAG &DAG) const
SDValue getAddrLocal(NodeTy *N, const SDLoc &DL, EVT Ty, SelectionDAG &DAG, bool IsN32OrN64) const
NodeType
ISD::NodeType enum - This enum defines the target-independent operators for a SelectionDAG.
Shift and rotation operations.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted...
SDValue getEntryNode() const
Return the token chain corresponding to the entry of the function.
SDVTList getVTList(EVT VT)
Return an SDVTList that represents the list of values specified.
SDValue getAddrGlobalLargeGOT(NodeTy *N, const SDLoc &DL, EVT Ty, SelectionDAG &DAG, unsigned HiFlag, unsigned LoFlag, SDValue Chain, const MachinePointerInfo &PtrInfo) const
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
MO_ABS_HI/LO - Represents the hi or low part of an absolute symbol address.
This is a fast-path instruction selection class that generates poor code and doesn't support illegal ...
MachineFunction & getMachineFunction() const
unsigned getABIAlignmentForCallingConv(Type *ArgTy, DataLayout DL) const override
Return the correct alignment for the current calling convention.
SDValue getAddrNonPICSym64(NodeTy *N, const SDLoc &DL, EVT Ty, SelectionDAG &DAG) const
This contains information for each constraint that we are lowering.
Simple integer binary arithmetic operators.
virtual unsigned getInlineAsmMemConstraint(StringRef ConstraintCode) const
amdgpu Simplify well known AMD library false Value * Callee
MO_GPREL - Represents the offset from the current gp value to be used for the relocatable object file...
Flag
These should be considered private to the implementation of the MCInstrDesc class.
The instances of the Type class are immutable: once they are created, they are never changed...
This is an important class for using LLVM in a threaded context.
This is an important base class in LLVM.
unsigned getExceptionPointerRegister(const Constant *PersonalityFn) const override
If a physical register, this returns the register that receives the exception address on entry to an ...
ISD::NodeType getExtendForAtomicOps() const override
Returns how the platform's atomic operations are extended (ZERO_EXTEND, SIGN_EXTEND, or ANY_EXTEND).
SDValue getAddrGlobal(NodeTy *N, const SDLoc &DL, EVT Ty, SelectionDAG &DAG, unsigned Flag, SDValue Chain, const MachinePointerInfo &PtrInfo) const
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
This structure contains all information that is necessary for lowering calls.
This class contains a discriminated union of information about pointers in memory operands...
SDValue getLoad(EVT VT, const SDLoc &dl, SDValue Chain, SDValue Ptr, MachinePointerInfo PtrInfo, unsigned Alignment=0, MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes(), const MDNode *Ranges=nullptr)
Loads are not normal binary operators: their result type is not determined by their operands...
MO_GOT - Represents the offset into the global offset table at which the address the relocation entry...
CCState - This class holds information needed while lowering arguments and return values...
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
Provides information about what library functions are available for the current target.
CCValAssign - Represent assignment of one arg/retval to a location.
unsigned getABITypeAlignment(Type *Ty) const
Returns the minimum ABI-required alignment for the specified type.
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
static const int FIRST_TARGET_MEMORY_OPCODE
FIRST_TARGET_MEMORY_OPCODE - Target-specific pre-isel operations which do not reference a specific me...
Represents one node in the SelectionDAG.
amdgpu Simplify well known AMD library false Value Value * Arg
Representation of each machine instruction.
bool isNoopAddrSpaceCast(unsigned SrcAS, unsigned DestAS) const override
Returns true if a cast between SrcAS and DestAS is a noop.
static SDValue LowerInterruptReturn(SmallVectorImpl< SDValue > &RetOps, const SDLoc &DL, SelectionDAG &DAG)
FunctionLoweringInfo - This contains information that is global to a function that is used when lower...
bool isJumpTableRelative() const override
MipsFunctionInfo - This class is derived from MachineFunction private Mips target-specific informatio...
SDValue getConstant(uint64_t Val, const SDLoc &DL, EVT VT, bool isTarget=false, bool isOpaque=false)
Create a ConstantSDNode wrapping a constant value.
static MachinePointerInfo getGOT(MachineFunction &MF)
Return a MachinePointerInfo record that refers to a GOT entry.
unsigned getExceptionSelectorRegister(const Constant *PersonalityFn) const override
If a physical register, this returns the register that receives the exception typeid on entry to a la...
SDValue getRegister(unsigned Reg, EVT VT)
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
StringRef - Represent a constant reference to a string, i.e.
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation...
MVT getScalarShiftAmountTy(const DataLayout &, EVT) const override
EVT is not used in-tree, but is used by out-of-tree target.
This file describes how to lower LLVM code to machine code.