15 #ifndef LLVM_LIB_TARGET_AARCH64_AARCH64ISELLOWERING_H 16 #define LLVM_LIB_TARGET_AARCH64_AARCH64ISELLOWERING_H 27 namespace AArch64ISD {
229 static inline bool isDef32(
const SDNode &
N) {
231 return Opc !=
ISD::TRUNCATE && Opc != TargetOpcode::EXTRACT_SUBREG &&
254 const APInt &DemandedElts,
256 unsigned Depth = 0)
const override;
258 bool targetShrinkDemandedConstant(
SDValue Op,
const APInt &Demanded,
265 bool allowsMisalignedMemoryAccesses(
EVT VT,
unsigned AddrSpace = 0,
267 bool *
Fast =
nullptr)
const override;
272 const char *getTargetNodeName(
unsigned Opcode)
const override;
289 bool isFPImmLegal(
const APFloat &Imm,
EVT VT)
const override;
297 EVT VT)
const override;
310 unsigned Intrinsic)
const override;
313 EVT NewVT)
const override;
315 bool isTruncateFree(
Type *Ty1,
Type *Ty2)
const override;
316 bool isTruncateFree(
EVT VT1,
EVT VT2)
const override;
318 bool isProfitableToHoist(
Instruction *I)
const override;
320 bool isZExtFree(
Type *Ty1,
Type *Ty2)
const override;
321 bool isZExtFree(
EVT VT1,
EVT VT2)
const override;
322 bool isZExtFree(
SDValue Val,
EVT VT2)
const override;
324 bool hasPairedLoad(
EVT LoadedType,
unsigned &RequiredAligment)
const override;
328 bool lowerInterleavedLoad(
LoadInst *LI,
331 unsigned Factor)
const override;
333 unsigned Factor)
const override;
335 bool isLegalAddImmediate(int64_t)
const override;
336 bool isLegalICmpImmediate(int64_t)
const override;
338 bool shouldConsiderGEPOffsetSplit()
const override;
340 EVT getOptimalMemOpType(uint64_t
Size,
unsigned DstAlign,
unsigned SrcAlign,
341 bool IsMemset,
bool ZeroMemset,
bool MemcpyStrSrc,
356 unsigned AS)
const override;
361 bool isFMAFasterThanFMulAndFAdd(
EVT VT)
const override;
366 bool isDesirableToCommuteWithShift(
const SDNode *N)
const override;
370 bool shouldConvertConstantLoadToIntImm(
const APInt &Imm,
371 Type *Ty)
const override;
375 bool isExtractSubvectorCheap(
EVT ResVT,
EVT SrcVT,
376 unsigned Index)
const override;
383 void emitAtomicCmpXchgNoStoreLLBalance(
IRBuilder<> &Builder)
const override;
386 shouldExpandAtomicLoadInIR(
LoadInst *LI)
const override;
387 bool shouldExpandAtomicStoreInIR(
StoreInst *SI)
const override;
393 bool useLoadStackGuardNode()
const override;
395 getPreferredVectorAction(
EVT VT)
const override;
429 Attribute::NoImplicitFloat);
444 bool isMaskAndCmp0FoldingBeneficial(
const Instruction &AndI)
const override;
455 return hasAndNotCompare(Y);
461 unsigned KeptBits)
const override {
466 auto VTIsOk = [](
EVT VT) ->
bool {
474 return VTIsOk(XVT) && VTIsOk(KeptBitsVT);
487 void insertCopiesSplitCSR(
496 bool enableAggressiveFMAFusion(
EVT VT)
const override;
499 unsigned getVaListSizeInBits(
const DataLayout &DL)
const override;
504 bool isLegalInterleavedAccessType(
VectorType *VecTy,
509 unsigned getNumInterleavedAccesses(
VectorType *VecTy,
514 bool functionArgumentNeedsConsecutiveRegisters(
Type *Ty,
516 bool isVarArg)
const override;
524 void addTypeForNEON(
MVT VT,
MVT PromotedBitwiseVT);
525 void addDRTypeForNEON(
MVT VT);
526 void addQRTypeForNEON(
MVT VT);
548 bool isEligibleForTailCallOptimization(
560 bool DoesCalleeRestoreStack(
CallingConv::ID CallCC,
bool TailCallOpt)
const;
576 unsigned Flag)
const;
578 unsigned Flag)
const;
580 unsigned Flag)
const;
582 unsigned Flag)
const;
583 template <
class NodeTy>
585 template <
class NodeTy>
587 template <
class NodeTy>
649 int &ExtraSteps,
bool &UseOneConst,
650 bool Reciprocal)
const override;
652 int &ExtraSteps)
const override;
653 unsigned combineRepeatedFPDivisors()
const override;
656 unsigned getRegisterByName(
const char* RegName,
EVT VT,
663 const char *constraint)
const override;
665 std::pair<unsigned, const TargetRegisterClass *>
669 const char *LowerXConstraint(
EVT ConstraintVT)
const override;
671 void LowerAsmOperandForConstraint(
SDValue Op, std::string &Constraint,
672 std::vector<SDValue> &Ops,
675 unsigned getInlineAsmMemConstraint(
StringRef ConstraintCode)
const override {
676 if (ConstraintCode ==
"Q")
684 bool isUsedByReturnOnly(
SDNode *N,
SDValue &Chain)
const override;
685 bool mayBeEmittedAsTailCall(
const CallInst *CI)
const override;
699 bool shouldNormalizeToSelectSequence(
LLVMContext &,
EVT)
const override;
static SDValue LowerEXTRACT_VECTOR_ELT(SDValue Op, SelectionDAG &DAG)
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. ...
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
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...
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...
Compute iterated dominance frontiers using a linear time algorithm.
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)
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 SDValue LowerCONCAT_VECTORS(SDValue Op, SelectionDAG &DAG)
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml", "ocaml 3.10-compatible collector")
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...
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...
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.
static SDValue LowerINSERT_VECTOR_ELT(SDValue Op, SelectionDAG &DAG)
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.
MachineFunction & getMachineFunction() const
static SDValue LowerVECTOR_SHUFFLE(SDValue Op, SelectionDAG &DAG)
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)...
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
static SDValue LowerVSETCC(SDValue Op, SelectionDAG &DAG)
FastISel * createFastISel(FunctionLoweringInfo &funcInfo, const TargetLibraryInfo *libInfo)
amdgpu Simplify well known AMD library false Value * Callee
unsigned getExceptionPointerRegister(const Constant *PersonalityFn) const override
If a physical register, this returns the register that receives the exception address on entry to an ...
static SDValue LowerFP_EXTEND(SDValue Op, SelectionDAG &DAG)
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
Flag
These should be considered private to the implementation of the MCInstrDesc class.
static SDValue LowerSTORE(SDValue Op, SelectionDAG &DAG)
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)
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.
Fast - This calling convention attempts to make calls as fast as possible (e.g.
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.
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 LowerEXTRACT_SUBVECTOR(SDValue Op, const X86Subtarget &Subtarget, SelectionDAG &DAG)
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.
static SDValue LowerFCOPYSIGN(SDValue Op, SelectionDAG &DAG)
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
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)
This file describes how to lower LLVM code to machine code.
MemIndexedMode
MemIndexedMode enum - This enum defines the load / store indexed addressing modes.