14 #ifndef LLVM_LIB_TARGET_MIPS_MIPSISELLOWERING_H 15 #define LLVM_LIB_TARGET_MIPS_MIPSISELLOWERING_H 46 class FunctionLoweringInfo;
47 class MachineBasicBlock;
48 class MachineFrameInfo;
51 class MipsFunctionInfo;
53 class MipsTargetMachine;
54 class TargetLibraryInfo;
55 class TargetRegisterClass;
285 bool isCheapToSpeculateCttz()
const override;
286 bool isCheapToSpeculateCtlz()
const override;
287 bool shouldFoldConstantShiftPairToMask(
const SDNode *
N,
293 EVT VT)
const override;
297 unsigned getNumRegistersForCallingConv(
LLVMContext &Context,
299 EVT VT)
const override;
302 unsigned getVectorTypeBreakdownForCallingConv(
304 unsigned &NumIntermediates,
MVT &RegisterVT)
const override;
311 return std::min(ABIAlign,
Align(8));
319 void LowerOperationWrapper(
SDNode *N,
334 const char *getTargetNodeName(
unsigned Opcode)
const override;
338 EVT VT)
const override;
349 void HandleByVal(
CCState *,
unsigned &,
unsigned)
const override;
351 Register getRegisterByName(
const char* RegName,
LLT VT,
358 return ABI.IsN64() ? Mips::A0_64 : Mips::A0;
365 return ABI.IsN64() ? Mips::A1_64 : Mips::A1;
373 return SrcAS < 256 && DestAS < 256;
377 return getTargetMachine().isPositionIndependent();
391 template <
class NodeTy>
393 bool IsN32OrN64)
const {
410 template <
class NodeTy>
416 return DAG.
getLoad(Ty, DL, Chain, Tgt, PtrInfo);
423 template <
class NodeTy>
426 unsigned LoFlag,
SDValue Chain,
433 return DAG.
getLoad(Ty, DL, Chain, Wrapper, PtrInfo);
442 template <
class NodeTy>
459 template <
class NodeTy>
486 template <
class NodeTy>
492 DAG.
getRegister(IsN64 ? Mips::GP_64 : Mips::GP, Ty),
501 std::deque<std::pair<unsigned, SDValue>> &RegsToPass,
502 bool IsPICCall,
bool GlobalOrExternal,
bool InternalLinkage,
518 unsigned Flag)
const;
522 unsigned Flag)
const;
526 unsigned Flag)
const;
530 unsigned Flag)
const;
534 unsigned Flag)
const;
570 isEligibleForTailCallOptimization(
const CCState &CCInfo,
571 unsigned NextStackOffset,
581 const Argument *FuncArg,
unsigned FirstReg,
587 std::deque<std::pair<unsigned, SDValue>> &RegsToPass,
590 unsigned FirstReg,
unsigned LastReg,
597 void writeVarArgRegs(std::vector<SDValue> &OutChains,
SDValue Chain,
627 bool shouldSignExtendTypeInLibCall(
EVT Type,
bool IsSigned)
const override;
639 std::pair<unsigned, const TargetRegisterClass *>
642 std::pair<unsigned, const TargetRegisterClass *>
650 void LowerAsmOperandForConstraint(
SDValue Op,
651 std::string &Constraint,
652 std::vector<SDValue> &Ops,
656 getInlineAsmMemConstraint(
StringRef ConstraintCode)
const override {
657 if (ConstraintCode ==
"o")
659 if (ConstraintCode ==
"R")
661 if (ConstraintCode ==
"ZC")
667 Type *Ty,
unsigned AS,
672 EVT getOptimalMemOpType(uint64_t
Size,
unsigned DstAlign,
674 bool IsMemset,
bool ZeroMemset,
682 bool ForCodeSize)
const override;
684 unsigned getJumpTableEncoding()
const override;
685 bool useSoftFloat()
const override;
687 bool shouldInsertFencesForAtomic(
const Instruction *
I)
const override {
694 unsigned Size,
unsigned DstReg,
695 unsigned SrcRec)
const;
701 unsigned Size)
const;
706 unsigned Size)
const;
709 bool isFPCmp,
unsigned Opc)
const;
731 #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)
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
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
This class represents lattice values for constants.
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
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
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).
amdgpu Simplify well known AMD library false FunctionCallee Value * Arg
SDValue getAddrGlobal(NodeTy *N, const SDLoc &DL, EVT Ty, SelectionDAG &DAG, unsigned Flag, SDValue Chain, const MachinePointerInfo &PtrInfo) const
static SDValue getTargetNode(GlobalAddressSDNode *N, SDLoc DL, EVT Ty, SelectionDAG &DAG, unsigned Flags)
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...
This struct is a compact representation of a valid (non-zero power of two) alignment.
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 FunctionCallee Callee
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)
StringRef - Represent a constant reference to a string, i.e.
Align getABIAlignmentForCallingConv(Type *ArgTy, DataLayout DL) const override
Return the correct alignment for the current calling convention.
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation...
Wrapper class representing virtual and physical registers.
MVT getScalarShiftAmountTy(const DataLayout &, EVT) const override
EVT is not used in-tree, but is used by out-of-tree target.
static bool isMicroMips(const MCSubtargetInfo *STI)
This file describes how to lower LLVM code to machine code.