15 #ifndef LLVM_LIB_TARGET_ARM_ARMISELLOWERING_H 16 #define LLVM_LIB_TARGET_ARM_ARMISELLOWERING_H 41 class FunctionLoweringInfo;
43 class InstrItineraryData;
45 class MachineBasicBlock;
48 class TargetLibraryInfo;
50 class TargetRegisterInfo;
283 unsigned getJumpTableEncoding()
const override;
284 bool useSoftFloat()
const override;
293 const char *getTargetNodeName(
unsigned Opcode)
const override;
297 return (Kind != ScalarCondVectorVal);
304 EVT VT)
const override;
311 SDNode *Node)
const override;
318 bool isDesirableToTransformToIntegerOp(
unsigned Opc,
EVT VT)
const override;
323 bool allowsMisalignedMemoryAccesses(
EVT VT,
unsigned AddrSpace,
325 bool *
Fast)
const override;
327 EVT getOptimalMemOpType(uint64_t
Size,
328 unsigned DstAlign,
unsigned SrcAlign,
329 bool IsMemset,
bool ZeroMemset,
333 bool isTruncateFree(
Type *SrcTy,
Type *DstTy)
const override;
334 bool isTruncateFree(
EVT SrcVT,
EVT DstVT)
const override;
335 bool isZExtFree(
SDValue Val,
EVT VT2)
const override;
336 bool isFNegFree(
EVT VT)
const override;
338 bool isVectorLoadExtDesirable(
SDValue ExtVal)
const override;
340 bool allowTruncateForTailCall(
Type *Ty1,
Type *Ty2)
const override;
346 Type *Ty,
unsigned AS,
354 unsigned AS)
const override;
356 bool isLegalT2ScaledAddressingMode(
const AddrMode &AM,
EVT VT)
const;
360 bool isLegalT1ScaledAddressingMode(
const AddrMode &AM,
EVT VT)
const;
366 bool isLegalICmpImmediate(int64_t Imm)
const override;
372 bool isLegalAddImmediate(int64_t Imm)
const override;
389 const APInt &DemandedElts,
391 unsigned Depth)
const override;
393 bool targetShrinkDemandedConstant(
SDValue Op,
const APInt &Demanded,
397 bool ExpandInlineAsm(
CallInst *CI)
const override;
406 std::pair<unsigned, const TargetRegisterClass *>
410 const char *LowerXConstraint(
EVT ConstraintVT)
const override;
416 void LowerAsmOperandForConstraint(
SDValue Op, std::string &Constraint,
417 std::vector<SDValue> &Ops,
422 if (ConstraintCode ==
"Q")
424 else if (ConstraintCode ==
"o")
426 else if (ConstraintCode.
size() == 2) {
427 if (ConstraintCode[0] ==
'U') {
428 switch(ConstraintCode[1]) {
465 bool shouldAlignPointerArgs(
CallInst *CI,
unsigned &MinSize,
466 unsigned &PrefAlign)
const override;
482 bool isFPImmLegal(
const APFloat &Imm,
EVT VT)
const override;
487 unsigned Intrinsic)
const override;
491 bool shouldConvertConstantLoadToIntImm(
const APInt &Imm,
492 Type *Ty)
const override;
496 bool isExtractSubvectorCheap(
EVT ResVT,
EVT SrcVT,
497 unsigned Index)
const override;
501 bool functionArgumentNeedsConsecutiveRegisters(
507 getExceptionPointerRegister(
const Constant *PersonalityFn)
const override;
512 getExceptionSelectorRegister(
const Constant *PersonalityFn)
const override;
520 void emitAtomicCmpXchgNoStoreLLBalance(
IRBuilder<> &Builder)
const override;
529 bool lowerInterleavedLoad(
LoadInst *LI,
532 unsigned Factor)
const override;
534 unsigned Factor)
const override;
536 bool shouldInsertFencesForAtomic(
const Instruction *I)
const override;
538 shouldExpandAtomicLoadInIR(
LoadInst *LI)
const override;
539 bool shouldExpandAtomicStoreInIR(
StoreInst *SI)
const override;
545 bool useLoadStackGuardNode()
const override;
547 bool canCombineStoreAndExtract(
Type *VectorTy,
Value *Idx,
548 unsigned &Cost)
const override;
556 bool isCheapToSpeculateCttz()
const override;
557 bool isCheapToSpeculateCtlz()
const override;
568 return HasStandaloneRem;
577 bool isLegalInterleavedAccessType(
VectorType *VecTy,
580 bool alignLoopsWithOptSize()
const override;
584 unsigned getNumInterleavedAccesses(
VectorType *VecTy,
590 unsigned getABIAlignmentForCallingConv(
Type *ArgTy,
593 bool isDesirableToCommuteWithShift(
const SDNode *N,
596 bool shouldFoldShiftPairToMask(
const SDNode *N,
599 std::pair<const TargetRegisterClass *, uint8_t>
601 MVT VT)
const override;
613 unsigned ARMPCLabelIndex;
617 bool InsertFencesForAtomic;
619 bool HasStandaloneRem =
true;
621 void addTypeForNEON(
MVT VT,
MVT PromotedLdStVT,
MVT PromotedBitwiseVT);
622 void addDRTypeForNEON(
MVT VT);
623 void addQRTypeForNEON(
MVT VT);
636 const SDLoc &dl)
const;
639 bool isVarArg)
const;
641 bool isVarArg)
const;
697 unsigned getRegisterByName(
const char* RegName,
EVT VT,
712 bool isFMAFasterThanFMulAndFAdd(
EVT VT)
const override {
return false; }
729 void insertCopiesSplitCSR(
741 unsigned InRegsParamRecordIdx,
int ArgOffset,
742 unsigned ArgSize)
const;
746 unsigned ArgOffset,
unsigned TotalArgRegsSaveSize,
747 bool ForceMutable =
false)
const;
753 void HandleByVal(
CCState *,
unsigned &,
unsigned)
const override;
761 bool isCalleeStructRet,
762 bool isCallerStructRet,
778 bool isUsedByReturnOnly(
SDNode *N,
SDValue &Chain)
const override;
780 bool mayBeEmittedAsTailCall(
const CallInst *CI)
const override;
782 bool shouldConsiderGEPOffsetSplit()
const override {
return true; }
790 const SDLoc &dl,
bool InvalidOnQNaN)
const;
826 #endif // LLVM_LIB_TARGET_ARM_ARMISELLOWERING_H
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. ...
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
This represents an addressing mode of: BaseGV + BaseOffs + BaseReg + Scale*ScaleReg If BaseGV is null...
This class represents lattice values for constants.
an instruction that atomically checks whether a specified value is in a memory location, and, if it is, stores a new value there.
static void LowerMemOpCallTo(SelectionDAG &DAG, MachineFunction &MF, SDValue Chain, SDValue Arg, SDValue PtrOff, int SPDiff, unsigned ArgOffset, bool isPPC64, bool isTailCall, bool isVector, SmallVectorImpl< SDValue > &MemOpChains, SmallVectorImpl< TailCallArgumentInfo > &TailCallArguments, const SDLoc &dl)
LowerMemOpCallTo - Store the argument to the stack or remember it in case of tail calls...
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t size() const
size - Get the string size.
bool isScalarInteger() const
Return true if this is an integer, but not a vector.
This class represents a function call, abstracting a target machine's calling convention.
bool hasStandaloneRem(EVT VT) const override
Return true if the target can handle a standalone remainder operation.
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
This instruction constructs a fixed permutation of two input vectors.
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
unsigned const TargetRegisterInfo * TRI
An instruction for reading from memory.
an instruction that atomically reads a memory location, combines it with another value, and then stores the result back.
AtomicExpansionKind
Enum that specifies what an atomic load/AtomicRMWInst is expanded to, if at all.
bool isNoopAddrSpaceCast(unsigned SrcAS, unsigned DestAS) const override
Returns true if a cast between SrcAS and DestAS is a noop.
A convenience struct that encapsulates a DAG, and two SDValues for returning information from TargetL...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
This provides a uniform API for creating instructions and inserting them into a basic block: either a...
This file contains the simple types necessary to represent the attributes associated with functions a...
static SDValue LowerRETURNADDR(SDValue Op, SelectionDAG &DAG, const SparcTargetLowering &TLI, const SparcSubtarget *Subtarget)
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
AtomicOrdering
Atomic ordering for LLVM's memory model.
Fast - This calling convention attempts to make calls as fast as possible (e.g.
This is a fast-path instruction selection class that generates poor code and doesn't support illegal ...
unsigned getSizeInBits() const
Return the size of the specified value type in bits.
This contains information for each constraint that we are lowering.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Itinerary data supplied by a subtarget to be used by a target.
An instruction for storing to memory.
CondCode
ISD::CondCode enum - These are ordered carefully to make the bitfields below work out...
virtual unsigned getInlineAsmMemConstraint(StringRef ConstraintCode) const
amdgpu Simplify well known AMD library false Value * Callee
Analysis containing CSE Info
static SDValue LowerFP_EXTEND(SDValue Op, SelectionDAG &DAG)
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.
static SDValue LowerFRAMEADDR(SDValue Op, SelectionDAG &DAG, const SparcSubtarget *Subtarget)
const ARMSubtarget * getSubtarget() const
static SDValue LowerDYNAMIC_STACKALLOC(SDValue Op, SelectionDAG &DAG, const SparcSubtarget *Subtarget)
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.
bool canMergeStoresTo(unsigned AddressSpace, EVT MemVT, const SelectionDAG &DAG) const override
Returns if it's reasonable to merge stores to MemVT size.
unsigned getMaxSupportedInterleaveFactor() const override
Get the maximum supported factor for interleaved memory accesses.
CCState - This class holds information needed while lowering arguments and return values...
CallingConv::ID getCallingConv() const
getCallingConv()/setCallingConv(CC) - These method get and set the calling convention of this functio...
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
bool supportSwiftError() const override
Return true if the target supports swifterror attribute.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Provides information about what library functions are available for the current target.
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...
unsigned getInlineAsmMemConstraint(StringRef ConstraintCode) const override
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.
const Function & getFunction() const
Return the LLVM function that this machine code represents.
Class to represent vector types.
Class for arbitrary precision integers.
static SDValue LowerSELECT_CC(SDValue Op, SelectionDAG &DAG, const SparcTargetLowering &TLI, bool hasHardQuad)
amdgpu Simplify well known AMD library false Value Value * Arg
static SDValue LowerBR_CC(SDValue Op, SelectionDAG &DAG, const SparcTargetLowering &TLI, bool hasHardQuad)
Representation of each machine instruction.
static unsigned getScalingFactorCost(const TargetTransformInfo &TTI, const LSRUse &LU, const Formula &F, const Loop &L)
SelectSupportKind
Enum that describes what type of support for selects the target has.
FunctionLoweringInfo - This contains information that is global to a function that is used when lower...
bool isSelectSupported(SelectSupportKind Kind) const override
FastISel * createFastISel(FunctionLoweringInfo &funcInfo, const TargetLibraryInfo *libInfo)
LLVM Value Representation.
static SDValue LowerFCOPYSIGN(SDValue Op, SelectionDAG &DAG)
bool convertSetCCLogicToBitwiseLogic(EVT VT) const override
Use bitwise logic to make pairs of compares more efficient.
Primary interface to the complete machine description for the target machine.
StringRef - Represent a constant reference to a string, i.e.
static SDValue LowerFSINCOS(SDValue Op, const X86Subtarget &Subtarget, SelectionDAG &DAG)
bool isBitFieldInvertedMask(unsigned v)
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation...
This file describes how to lower LLVM code to machine code.
MemIndexedMode
MemIndexedMode enum - This enum defines the load / store indexed addressing modes.