15 #ifndef LLVM_LIB_TARGET_MIPS_MIPSISELLOWERING_H
16 #define LLVM_LIB_TARGET_MIPS_MIPSISELLOWERING_H
226 class MipsFunctionInfo;
258 EVT VT)
const override;
263 EVT VT)
const override;
268 unsigned &NumIntermediates,
MVT &RegisterVT)
const override;
301 EVT VT)
const override;
318 return ABI.
IsN64() ? Mips::A0_64 : Mips::A0;
325 return ABI.
IsN64() ? Mips::A1_64 : Mips::A1;
333 return SrcAS < 256 && DestAS < 256;
347 template <
class NodeTy>
349 bool IsN32OrN64)
const {
352 getTargetNode(N, Ty, DAG, GOTFlag));
358 getTargetNode(N, Ty, DAG, LoFlag));
366 template <
class NodeTy>
371 getTargetNode(N, Ty, DAG, Flag));
372 return DAG.
getLoad(Ty, DL, Chain, Tgt, PtrInfo);
379 template <
class NodeTy>
382 unsigned LoFlag,
SDValue Chain,
385 getTargetNode(N, Ty, DAG, HiFlag));
388 getTargetNode(N, Ty, DAG, LoFlag));
389 return DAG.
getLoad(Ty, DL, Chain, Wrapper, PtrInfo);
398 template <
class NodeTy>
415 template <
class NodeTy>
442 template <
class NodeTy>
458 std::deque< std::pair<unsigned, SDValue> > &RegsToPass,
459 bool IsPICCall,
bool GlobalOrExternal,
bool InternalLinkage,
460 bool IsCallReloc, CallLoweringInfo &CLI,
SDValue Callee,
475 unsigned Flag)
const;
479 unsigned Flag)
const;
483 unsigned Flag)
const;
487 unsigned Flag)
const;
491 unsigned Flag)
const;
527 isEligibleForTailCallOptimization(
const CCState &CCInfo,
528 unsigned NextStackOffset,
538 const Argument *FuncArg,
unsigned FirstReg,
544 std::deque<std::pair<unsigned, SDValue>> &RegsToPass,
547 unsigned FirstReg,
unsigned LastReg,
554 void writeVarArgRegs(std::vector<SDValue> &OutChains,
SDValue Chain,
584 bool shouldSignExtendTypeInLibCall(
EVT Type,
bool IsSigned)
const override;
596 std::pair<unsigned, const TargetRegisterClass *>
599 std::pair<unsigned, const TargetRegisterClass *>
607 void LowerAsmOperandForConstraint(
SDValue Op,
608 std::string &Constraint,
609 std::vector<SDValue> &Ops,
613 getInlineAsmMemConstraint(
StringRef ConstraintCode)
const override {
614 if (ConstraintCode ==
"R")
616 else if (ConstraintCode ==
"ZC")
622 Type *Ty,
unsigned AS)
const override;
626 EVT getOptimalMemOpType(uint64_t
Size,
unsigned DstAlign,
628 bool IsMemset,
bool ZeroMemset,
635 bool isFPImmLegal(
const APFloat &Imm,
EVT VT)
const override;
637 unsigned getJumpTableEncoding()
const override;
638 bool useSoftFloat()
const override;
640 bool shouldInsertFencesForAtomic(
const Instruction *
I)
const override {
645 MachineBasicBlock *emitSignExtendToI32InReg(MachineInstr &
MI,
646 MachineBasicBlock *BB,
647 unsigned Size,
unsigned DstReg,
648 unsigned SrcRec)
const;
650 MachineBasicBlock *emitAtomicBinary(MachineInstr &
MI, MachineBasicBlock *BB,
651 unsigned Size,
unsigned BinOpcode,
652 bool Nand =
false)
const;
653 MachineBasicBlock *emitAtomicBinaryPartword(MachineInstr &
MI,
654 MachineBasicBlock *BB,
657 bool Nand =
false)
const;
658 MachineBasicBlock *emitAtomicCmpSwap(MachineInstr &
MI,
659 MachineBasicBlock *BB,
660 unsigned Size)
const;
661 MachineBasicBlock *emitAtomicCmpSwapPartword(MachineInstr &
MI,
662 MachineBasicBlock *BB,
663 unsigned Size)
const;
664 MachineBasicBlock *emitSEL_D(MachineInstr &
MI, MachineBasicBlock *BB)
const;
665 MachineBasicBlock *emitPseudoSELECT(MachineInstr &
MI, MachineBasicBlock *BB,
666 bool isFPCmp,
unsigned Opc)
const;
670 const MipsTargetLowering *
672 const MipsSubtarget &STI);
673 const MipsTargetLowering *
675 const MipsSubtarget &STI);
679 const TargetLibraryInfo *libInfo);
const MipsTargetLowering * createMipsSETargetLowering(const MipsTargetMachine &TM, const MipsSubtarget &STI)
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 class represents an incoming formal argument to a Function.
const MipsSubtarget & Subtarget
virtual MVT getRegisterTypeForCallingConv(MVT VT) const override
Return the register type for a given MVT, ensuring vectors are treated as a series of gpr sized integ...
SDValue getAddrNonPIC(NodeTy *N, const SDLoc &DL, EVT Ty, SelectionDAG &DAG) const
const MipsTargetLowering * createMips16TargetLowering(const MipsTargetMachine &TM, const MipsSubtarget &STI)
Create MipsTargetLowering objects.
const TargetMachine & getTargetMachine() const
MO_HIGHER/HIGHEST - Represents the highest or higher half word of a 64-bit symbol address...
Maximum length of the test input libFuzzer tries to guess a good value based on the corpus and reports it always prefer smaller inputs during the corpus shuffle When libFuzzer itself reports a bug this exit code will be used If indicates the maximal total time in seconds to run the fuzzer minimizes the provided crash input Use with tries to cleanse the provided crash input to make it contain fewer original bytes Use with exact_artifact_path to specify the output Experimental Use value profile to guide fuzzing Number of jobs to run If min(jobs, NumberOfCpuCores()/2)\" is used.") FUZZER_FLAG_INT(reload
MipsTargetLowering(const MipsTargetMachine &TM, const MipsSubtarget &STI)
Function Alias Analysis Results
MachineBasicBlock * EmitInstrWithCustomInserter(MachineInstr &MI, MachineBasicBlock *MBB) const override
This method should be implemented by targets that mark instructions with the 'usesCustomInserter' fla...
SDValue getAddrLocal(NodeTy *N, const SDLoc &DL, EVT Ty, SelectionDAG &DAG, bool IsN32OrN64) const
SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT, ArrayRef< SDUse > Ops)
Gets or creates the specified node.
void ReplaceNodeResults(SDNode *N, SmallVectorImpl< SDValue > &Results, SelectionDAG &DAG) const override
ReplaceNodeResults - Replace the results of node with an illegal result type with new values built ou...
EVT getSetCCResultType(const DataLayout &DL, LLVMContext &Context, EVT VT) const override
getSetCCResultType - get the ISD::SETCC result ValueType
NodeType
ISD::NodeType enum - This enum defines the target-independent operators for a SelectionDAG.
void LowerOperationWrapper(SDNode *N, SmallVectorImpl< SDValue > &Results, SelectionDAG &DAG) const override
This callback is invoked by the type legalizer to legalize nodes with an illegal operand type but leg...
Shift and rotation operations.
MachineFunction & getMachineFunction() const
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
SDValue getGlobalReg(SelectionDAG &DAG, EVT Ty) const
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted...
SDVTList getVTList(EVT VT)
Return an SDVTList that represents the list of values specified.
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.
const AMDGPUAS &AS return SrcAS
This is a fast-path instruction selection class that generates poor code and doesn't support illegal ...
SDValue getAddrGPRel(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.
unsigned getRegisterByName(const char *RegName, EVT VT, SelectionDAG &DAG) const override
Return the register ID of the name passed in.
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.
bool isVectorTy() const
True if this is an instance of VectorType.
This is an important base class in LLVM.
void HandleByVal(CCState *, unsigned &, unsigned) const override
Target-specific cleanup for formal ByVal parameters.
virtual unsigned getVectorTypeBreakdownForCallingConv(LLVMContext &Context, EVT VT, EVT &IntermediateVT, unsigned &NumIntermediates, MVT &RegisterVT) const override
Break down vectors to the correct number of gpr sized integers.
unsigned getExceptionPointerRegister(const Constant *PersonalityFn) const override
If a physical register, this returns the register that receives the exception address on entry to an ...
bool isPositionIndependent() const
ISD::NodeType getExtendForAtomicOps() const override
Returns how the platform's atomic operations are extended (ZERO_EXTEND, SIGN_EXTEND, or ANY_EXTEND).
static const MipsTargetLowering * create(const MipsTargetMachine &TM, const MipsSubtarget &STI)
bool isCheapToSpeculateCttz() const override
Return true if it is cheap to speculate a call to intrinsic cttz.
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...
virtual unsigned getNumRegistersForCallingConv(LLVMContext &Context, EVT VT) const override
Return the number of registers for a given MVT, ensuring vectors are treated as a series of gpr sized...
unsigned getABITypeAlignment(Type *Ty) const
Returns the minimum ABI-required alignment for the specified type.
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...
SDValue getAddrGlobalLargeGOT(NodeTy *N, const SDLoc &DL, EVT Ty, SelectionDAG &DAG, unsigned HiFlag, unsigned LoFlag, SDValue Chain, const MachinePointerInfo &PtrInfo) const
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
SDValue lowerSTORE(SDValue Op, SelectionDAG &DAG) const
virtual unsigned getInlineAsmMemConstraint(StringRef ConstraintCode) const
Provides information about what library functions are available for the current target.
SDValue getAddrGlobal(NodeTy *N, const SDLoc &DL, EVT Ty, SelectionDAG &DAG, unsigned Flag, SDValue Chain, const MachinePointerInfo &PtrInfo) const
CCValAssign - Represent assignment of one arg/retval to a location.
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.
SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const override
LowerOperation - Provide custom lowering hooks for some operations.
FastISel * createFastISel(FunctionLoweringInfo &funcInfo, const TargetLibraryInfo *libInfo) const override
createFastISel - This method returns a target specific FastISel object, or null if the target does no...
AddrMode
ARM Addressing Modes.
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
static std::vector< std::string > Flags
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.
SDValue lowerLOAD(SDValue Op, SelectionDAG &DAG) const
SDValue getAddrNonPICSym64(NodeTy *N, const SDLoc &DL, EVT Ty, SelectionDAG &DAG) const
bool isCheapToSpeculateCtlz() const override
Return true if it is cheap to speculate a call to intrinsic ctlz.
virtual unsigned getABIAlignmentForCallingConv(Type *ArgTy, DataLayout DL) const override
Return the correct alignment for the current calling convention.
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...
virtual void getOpndList(SmallVectorImpl< SDValue > &Ops, std::deque< std::pair< unsigned, SDValue > > &RegsToPass, bool IsPICCall, bool GlobalOrExternal, bool InternalLinkage, bool IsCallReloc, CallLoweringInfo &CLI, SDValue Callee, SDValue Chain) const
This function fills Ops, which is the list of operands that will later be used when a function call n...
SDValue getConstant(uint64_t Val, const SDLoc &DL, EVT VT, bool isTarget=false, bool isOpaque=false)
Create a ConstantSDNode wrapping a constant value.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
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.
SDValue getEntryNode() const
Return the token chain corresponding to the entry of the function.
const char * getTargetNodeName(unsigned Opcode) const override
getTargetNodeName - This method returns the name of a target specific
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation...
SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const override
This method will be invoked for all target nodes and for any target-independent nodes that the target...
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.