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;
345 SDNode *Node)
const override;
347 void HandleByVal(
CCState *,
unsigned &,
unsigned)
const override;
349 unsigned getRegisterByName(
const char* RegName,
EVT VT,
356 return ABI.IsN64() ? Mips::A0_64 : Mips::A0;
363 return ABI.IsN64() ? Mips::A1_64 : Mips::A1;
371 return SrcAS < 256 && DestAS < 256;
375 return getTargetMachine().isPositionIndependent();
389 template <
class NodeTy>
391 bool IsN32OrN64)
const {
394 getTargetNode(N, Ty, DAG, GOTFlag));
400 getTargetNode(N, Ty, DAG, LoFlag));
408 template <
class NodeTy>
413 getTargetNode(N, Ty, DAG, Flag));
414 return DAG.
getLoad(Ty, DL, Chain, Tgt, PtrInfo);
421 template <
class NodeTy>
424 unsigned LoFlag,
SDValue Chain,
427 getTargetNode(N, Ty, DAG, HiFlag));
430 getTargetNode(N, Ty, DAG, LoFlag));
431 return DAG.
getLoad(Ty, DL, Chain, Wrapper, PtrInfo);
440 template <
class NodeTy>
457 template <
class NodeTy>
484 template <
class NodeTy>
490 DAG.
getRegister(IsN64 ? Mips::GP_64 : Mips::GP, Ty),
499 std::deque<std::pair<unsigned, SDValue>> &RegsToPass,
500 bool IsPICCall,
bool GlobalOrExternal,
bool InternalLinkage,
516 unsigned Flag)
const;
520 unsigned Flag)
const;
524 unsigned Flag)
const;
528 unsigned Flag)
const;
532 unsigned Flag)
const;
568 isEligibleForTailCallOptimization(
const CCState &CCInfo,
569 unsigned NextStackOffset,
579 const Argument *FuncArg,
unsigned FirstReg,
585 std::deque<std::pair<unsigned, SDValue>> &RegsToPass,
588 unsigned FirstReg,
unsigned LastReg,
595 void writeVarArgRegs(std::vector<SDValue> &OutChains,
SDValue Chain,
625 bool shouldSignExtendTypeInLibCall(
EVT Type,
bool IsSigned)
const override;
637 std::pair<unsigned, const TargetRegisterClass *>
640 std::pair<unsigned, const TargetRegisterClass *>
648 void LowerAsmOperandForConstraint(
SDValue Op,
649 std::string &Constraint,
650 std::vector<SDValue> &Ops,
654 getInlineAsmMemConstraint(
StringRef ConstraintCode)
const override {
655 if (ConstraintCode ==
"R")
657 else if (ConstraintCode ==
"ZC")
663 Type *Ty,
unsigned AS,
668 EVT getOptimalMemOpType(uint64_t
Size,
unsigned DstAlign,
670 bool IsMemset,
bool ZeroMemset,
677 bool isFPImmLegal(
const APFloat &Imm,
EVT VT)
const override;
679 unsigned getJumpTableEncoding()
const override;
680 bool useSoftFloat()
const override;
682 bool shouldInsertFencesForAtomic(
const Instruction *
I)
const override {
689 unsigned Size,
unsigned DstReg,
690 unsigned SrcRec)
const;
696 unsigned Size)
const;
701 unsigned Size)
const;
704 bool isFPCmp,
unsigned Opc)
const;
726 #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
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
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)
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.