14 #ifndef LLVM_LIB_TARGET_AARCH64_AARCH64ISELLOWERING_H 15 #define LLVM_LIB_TARGET_AARCH64_AARCH64ISELLOWERING_H 26 namespace AArch64ISD {
291 static inline bool isDef32(
const SDNode &
N) {
293 return Opc !=
ISD::TRUNCATE && Opc != TargetOpcode::EXTRACT_SUBREG &&
316 const APInt &DemandedElts,
318 unsigned Depth = 0)
const override;
328 bool targetShrinkDemandedConstant(
SDValue Op,
const APInt &Demanded,
335 bool allowsMisalignedMemoryAccesses(
336 EVT VT,
unsigned AddrSpace = 0,
unsigned Align = 1,
338 bool *
Fast =
nullptr)
const override;
340 bool allowsMisalignedMemoryAccesses(
342 bool *
Fast =
nullptr)
const override;
347 const char *getTargetNodeName(
unsigned Opcode)
const override;
365 bool ForCodeSize)
const override;
373 EVT VT)
const override;
392 unsigned Intrinsic)
const override;
395 EVT NewVT)
const override;
397 bool isTruncateFree(
Type *Ty1,
Type *Ty2)
const override;
398 bool isTruncateFree(
EVT VT1,
EVT VT2)
const override;
400 bool isProfitableToHoist(
Instruction *I)
const override;
402 bool isZExtFree(
Type *Ty1,
Type *Ty2)
const override;
403 bool isZExtFree(
EVT VT1,
EVT VT2)
const override;
404 bool isZExtFree(
SDValue Val,
EVT VT2)
const override;
409 bool hasPairedLoad(
EVT LoadedType,
unsigned &RequiredAligment)
const override;
413 bool lowerInterleavedLoad(
LoadInst *LI,
416 unsigned Factor)
const override;
418 unsigned Factor)
const override;
420 bool isLegalAddImmediate(int64_t)
const override;
421 bool isLegalICmpImmediate(int64_t)
const override;
423 bool shouldConsiderGEPOffsetSplit()
const override;
425 EVT getOptimalMemOpType(uint64_t
Size,
unsigned DstAlign,
unsigned SrcAlign,
426 bool IsMemset,
bool ZeroMemset,
bool MemcpyStrSrc,
429 LLT getOptimalMemOpLLT(uint64_t Size,
unsigned DstAlign,
unsigned SrcAlign,
430 bool IsMemset,
bool ZeroMemset,
bool MemcpyStrSrc,
445 unsigned AS)
const override;
451 EVT VT)
const override;
452 bool isFMAFasterThanFMulAndFAdd(
const Function &
F,
Type *Ty)
const override;
457 bool isDesirableToCommuteWithShift(
const SDNode *N,
462 bool shouldConvertConstantLoadToIntImm(
const APInt &Imm,
463 Type *Ty)
const override;
467 bool isExtractSubvectorCheap(
EVT ResVT,
EVT SrcVT,
468 unsigned Index)
const override;
475 void emitAtomicCmpXchgNoStoreLLBalance(
IRBuilder<> &Builder)
const override;
478 shouldExpandAtomicLoadInIR(
LoadInst *LI)
const override;
479 bool shouldExpandAtomicStoreInIR(
StoreInst *SI)
const override;
486 bool useLoadStackGuardNode()
const override;
488 getPreferredVectorAction(
MVT VT)
const override;
494 void insertSSPDeclarations(
Module &M)
const override;
495 Value *getSDagStackGuard(
const Module &M)
const override;
526 Attribute::NoImplicitFloat);
541 bool isMaskAndCmp0FoldingBeneficial(
const Instruction &AndI)
const override;
552 return hasAndNotCompare(Y);
557 bool shouldProduceAndByConstByHoistingConstFromShiftsLHSOfAnd(
559 unsigned OldShiftOpcode,
unsigned NewShiftOpcode,
565 unsigned KeptBits)
const override {
570 auto VTIsOk = [](
EVT VT) ->
bool {
578 return VTIsOk(XVT) && VTIsOk(KeptBitsVT);
581 bool preferIncOfAddToSubOfNot(
EVT VT)
const override;
593 void insertCopiesSplitCSR(
602 bool enableAggressiveFMAFusion(
EVT VT)
const override;
605 unsigned getVaListSizeInBits(
const DataLayout &DL)
const override;
610 bool isLegalInterleavedAccessType(
VectorType *VecTy,
615 unsigned getNumInterleavedAccesses(
VectorType *VecTy,
620 bool functionArgumentNeedsConsecutiveRegisters(
Type *Ty,
622 bool isVarArg)
const override;
624 bool needsFixedCatchObjects()
const override;
632 void addTypeForNEON(
MVT VT,
MVT PromotedBitwiseVT);
633 void addDRTypeForNEON(
MVT VT);
634 void addQRTypeForNEON(
MVT VT);
656 bool isEligibleForTailCallOptimization(
668 bool DoesCalleeRestoreStack(
CallingConv::ID CallCC,
bool TailCallOpt)
const;
684 unsigned Flag)
const;
686 unsigned Flag)
const;
688 unsigned Flag)
const;
690 unsigned Flag)
const;
691 template <
class NodeTy>
693 template <
class NodeTy>
695 template <
class NodeTy>
697 template <
class NodeTy>
764 int &ExtraSteps,
bool &UseOneConst,
765 bool Reciprocal)
const override;
767 int &ExtraSteps)
const override;
768 unsigned combineRepeatedFPDivisors()
const override;
771 Register getRegisterByName(
const char* RegName,
LLT VT,
778 const char *constraint)
const override;
780 std::pair<unsigned, const TargetRegisterClass *>
784 const char *LowerXConstraint(
EVT ConstraintVT)
const override;
786 void LowerAsmOperandForConstraint(
SDValue Op, std::string &Constraint,
787 std::vector<SDValue> &Ops,
790 unsigned getInlineAsmMemConstraint(
StringRef ConstraintCode)
const override {
791 if (ConstraintCode ==
"Q")
799 bool isVectorLoadExtDesirable(
SDValue ExtVal)
const override;
800 bool isUsedByReturnOnly(
SDNode *N,
SDValue &Chain)
const override;
801 bool mayBeEmittedAsTailCall(
const CallInst *CI)
const override;
815 bool shouldNormalizeToSelectSequence(
LLVMContext &,
EVT)
const override;
static MVT getIntegerVT(unsigned BitWidth)
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.
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...
A parsed version of the target data layout string in and methods for querying it. ...
static SDValue LowerVSETCC(SDValue Op, SelectionDAG &DAG, const ARMSubtarget *ST)
static SDValue LowerEXTRACT_SUBVECTOR(SDValue Op, SelectionDAG &DAG, const ARMSubtarget *ST)
EVT getValueType() const
Return the ValueType of the referenced return value.
This represents an addressing mode of: BaseGV + BaseOffs + BaseReg + Scale*ScaleReg If BaseGV is null...
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
unsigned getOpcode() const
Return the SelectionDAG opcode value for this node.
bool supportSplitCSR(MachineFunction *MF) const override
Return true if the target supports that a subset of CSRs for the given machine function is handled ex...
This class represents lattice values for constants.
A Module instance is used to store all the information related to an LLVM module. ...
An instruction that atomically checks whether a specified value is in a memory location, and, if it is, stores a new value there.
static SDValue LowerVACOPY(SDValue Op, const X86Subtarget &Subtarget, SelectionDAG &DAG)
static SDValue LowerEXTRACT_VECTOR_ELT(SDValue Op, SelectionDAG &DAG, const ARMSubtarget *ST)
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.
Libcall
RTLIB::Libcall enum - This enum defines all of the runtime library calls the backend can emit...
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 hasAndNotCompare(SDValue V) const override
Return true if the target should transform: (X & Y) == Y —> (~X & Y) == 0 (X & Y) != Y —> (~X & Y) ...
bool supportSwiftError() const override
Return true if the target supports swifterror attribute.
A convenience struct that encapsulates a DAG, and two SDValues for returning information from TargetL...
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml", "ocaml 3.10-compatible collector")
MVT getPointerTy(const DataLayout &DL, uint32_t AS=0) const override
Return the pointer type for the given address space, defaults to the pointer type from the data layou...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
static SDValue LowerRETURNADDR(SDValue Op, SelectionDAG &DAG, const SparcTargetLowering &TLI, const SparcSubtarget *Subtarget)
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted...
static const int FIRST_TARGET_STRICTFP_OPCODE
FIRST_TARGET_STRICTFP_OPCODE - Target-specific pre-isel operations which cannot raise FP exceptions s...
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
bool isNoopAddrSpaceCast(unsigned SrcAS, unsigned DestAS) const override
Returns true if a cast between SrcAS and DestAS is a noop.
AtomicOrdering
Atomic ordering for LLVM's memory model.
This is a fast-path instruction selection class that generates poor code and doesn't support illegal ...
MachineFunction & getMachineFunction() const
static SDValue LowerVectorFP_TO_INT(SDValue Op, SelectionDAG &DAG)
This contains information for each constraint that we are lowering.
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
FastISel * createFastISel(FunctionLoweringInfo &funcInfo, const TargetLibraryInfo *libInfo)
Analysis containing CSE Info
unsigned getExceptionPointerRegister(const Constant *PersonalityFn) const override
If a physical register, this returns the register that receives the exception address on entry to an ...
Flag
These should be considered private to the implementation of the MCInstrDesc class.
static SDValue LowerVECTOR_SHUFFLE(SDValue Op, SelectionDAG &DAG, const ARMSubtarget *ST)
static SDValue LowerSTORE(SDValue Op, SelectionDAG &DAG)
static SDValue LowerCONCAT_VECTORS(SDValue Op, SelectionDAG &DAG, const ARMSubtarget *ST)
static SDValue LowerVASTART(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.
LoadExtType
LoadExtType enum - This enum defines the three variants of LOADEXT (load with extension).
static SDValue LowerFRAMEADDR(SDValue Op, SelectionDAG &DAG, const SparcSubtarget *Subtarget)
static SDValue LowerDYNAMIC_STACKALLOC(SDValue Op, SelectionDAG &DAG, const SparcSubtarget *Subtarget)
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...
TypeSize getSizeInBits() const
Return the size of the specified value type in bits.
This structure contains all information that is necessary for lowering calls.
This struct is a compact representation of a valid (non-zero power of two) alignment.
static Value * LowerCTPOP(LLVMContext &Context, Value *V, Instruction *IP)
Emit the code to lower ctpop of V before the specified instruction IP.
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...
Provides information about what library functions are available for the current target.
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.
const Function & getFunction() const
Return the LLVM function that this machine code represents.
bool hasBitPreservingFPLogic(EVT VT) const override
Return true if it is safe to transform an integer-domain bitwise operation into the equivalent floati...
Class to represent vector types.
Class for arbitrary precision integers.
bool canMergeStoresTo(unsigned AddressSpace, EVT MemVT, const SelectionDAG &DAG) const override
Returns if it's reasonable to merge stores to MemVT size.
amdgpu Simplify well known AMD library false FunctionCallee Callee
static SDValue LowerVAARG(SDValue Op, SelectionDAG &DAG)
static SDValue LowerSELECT_CC(SDValue Op, SelectionDAG &DAG, const SparcTargetLowering &TLI, bool hasHardQuad)
Flags
Flags values. These may be or'd together.
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)
bool isVector() const
Return true if this is a vector value type.
FunctionLoweringInfo - This contains information that is global to a function that is used when lower...
bool hasAndNot(SDValue Y) const override
Return true if the target has a bitwise and-not operation: X = ~A & B This can be used to simplify se...
CopyFromReg - This node indicates that the input value is a virtual or physical register that is defi...
LegalizeTypeAction
This enum indicates whether a types are legal for a target, and if not, what action should be used to...
LLVM Value Representation.
Fast - This calling convention attempts to make calls as fast as possible (e.g.
static SDValue LowerFCOPYSIGN(SDValue Op, SelectionDAG &DAG)
bool shouldTransformSignedTruncationCheck(EVT XVT, unsigned KeptBits) const override
Should we tranform the IR-optimal check for whether given truncation down into KeptBits would be trun...
unsigned getMaxSupportedInterleaveFactor() const override
Get the maximum supported factor for interleaved memory accesses.
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 isCheapToSpeculateCttz() const override
Return true if it is cheap to speculate a call to intrinsic cttz.
TRUNCATE - Completely drop the high bits.
bool isCheapToSpeculateCtlz() const override
Return true if it is cheap to speculate a call to intrinsic ctlz.
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation...
static SDValue LowerSCALAR_TO_VECTOR(SDValue Op, const X86Subtarget &Subtarget, SelectionDAG &DAG)
Wrapper class representing virtual and physical registers.
This file describes how to lower LLVM code to machine code.
MemIndexedMode
MemIndexedMode enum - This enum defines the load / store indexed addressing modes.