15 #ifndef LLVM_LIB_TARGET_AARCH64_AARCH64ISELLOWERING_H 16 #define LLVM_LIB_TARGET_AARCH64_AARCH64ISELLOWERING_H 27 namespace AArch64ISD {
230 static inline bool isDef32(
const SDNode &
N) {
232 return Opc !=
ISD::TRUNCATE && Opc != TargetOpcode::EXTRACT_SUBREG &&
255 const APInt &DemandedElts,
257 unsigned Depth = 0)
const override;
259 bool targetShrinkDemandedConstant(
SDValue Op,
const APInt &Demanded,
266 bool allowsMisalignedMemoryAccesses(
EVT VT,
unsigned AddrSpace = 0,
268 bool *
Fast =
nullptr)
const override;
273 const char *getTargetNodeName(
unsigned Opcode)
const override;
290 bool isFPImmLegal(
const APFloat &Imm,
EVT VT)
const override;
298 EVT VT)
const override;
317 unsigned Intrinsic)
const override;
320 EVT NewVT)
const override;
322 bool isTruncateFree(
Type *Ty1,
Type *Ty2)
const override;
323 bool isTruncateFree(
EVT VT1,
EVT VT2)
const override;
325 bool isProfitableToHoist(
Instruction *I)
const override;
327 bool isZExtFree(
Type *Ty1,
Type *Ty2)
const override;
328 bool isZExtFree(
EVT VT1,
EVT VT2)
const override;
329 bool isZExtFree(
SDValue Val,
EVT VT2)
const override;
331 bool hasPairedLoad(
EVT LoadedType,
unsigned &RequiredAligment)
const override;
335 bool lowerInterleavedLoad(
LoadInst *LI,
338 unsigned Factor)
const override;
340 unsigned Factor)
const override;
342 bool isLegalAddImmediate(int64_t)
const override;
343 bool isLegalICmpImmediate(int64_t)
const override;
345 bool shouldConsiderGEPOffsetSplit()
const override;
347 EVT getOptimalMemOpType(uint64_t
Size,
unsigned DstAlign,
unsigned SrcAlign,
348 bool IsMemset,
bool ZeroMemset,
bool MemcpyStrSrc,
363 unsigned AS)
const override;
368 bool isFMAFasterThanFMulAndFAdd(
EVT VT)
const override;
373 bool isDesirableToCommuteWithShift(
const SDNode *N,
378 bool shouldConvertConstantLoadToIntImm(
const APInt &Imm,
379 Type *Ty)
const override;
383 bool isExtractSubvectorCheap(
EVT ResVT,
EVT SrcVT,
384 unsigned Index)
const override;
391 void emitAtomicCmpXchgNoStoreLLBalance(
IRBuilder<> &Builder)
const override;
394 shouldExpandAtomicLoadInIR(
LoadInst *LI)
const override;
395 bool shouldExpandAtomicStoreInIR(
StoreInst *SI)
const override;
402 bool useLoadStackGuardNode()
const override;
404 getPreferredVectorAction(
MVT VT)
const override;
410 void insertSSPDeclarations(
Module &M)
const override;
411 Value *getSDagStackGuard(
const Module &M)
const override;
412 Value *getSSPStackGuardCheck(
const Module &M)
const override;
457 bool isMaskAndCmp0FoldingBeneficial(
const Instruction &AndI)
const override;
468 return hasAndNotCompare(Y);
474 unsigned KeptBits)
const override {
479 auto VTIsOk = [](
EVT VT) ->
bool {
487 return VTIsOk(XVT) && VTIsOk(KeptBitsVT);
500 void insertCopiesSplitCSR(
509 bool enableAggressiveFMAFusion(
EVT VT)
const override;
512 unsigned getVaListSizeInBits(
const DataLayout &DL)
const override;
517 bool isLegalInterleavedAccessType(
VectorType *VecTy,
522 unsigned getNumInterleavedAccesses(
VectorType *VecTy,
527 bool functionArgumentNeedsConsecutiveRegisters(
Type *Ty,
529 bool isVarArg)
const override;
531 bool needsFixedCatchObjects()
const override;
539 void addTypeForNEON(
MVT VT,
MVT PromotedBitwiseVT);
540 void addDRTypeForNEON(
MVT VT);
541 void addQRTypeForNEON(
MVT VT);
563 bool isEligibleForTailCallOptimization(
575 bool DoesCalleeRestoreStack(
CallingConv::ID CallCC,
bool TailCallOpt)
const;
591 unsigned Flag)
const;
593 unsigned Flag)
const;
595 unsigned Flag)
const;
597 unsigned Flag)
const;
598 template <
class NodeTy>
600 template <
class NodeTy>
602 template <
class NodeTy>
604 template <
class NodeTy>
668 int &ExtraSteps,
bool &UseOneConst,
669 bool Reciprocal)
const override;
671 int &ExtraSteps)
const override;
672 unsigned combineRepeatedFPDivisors()
const override;
675 unsigned getRegisterByName(
const char* RegName,
EVT VT,
682 const char *constraint)
const override;
684 std::pair<unsigned, const TargetRegisterClass *>
688 const char *LowerXConstraint(
EVT ConstraintVT)
const override;
690 void LowerAsmOperandForConstraint(
SDValue Op, std::string &Constraint,
691 std::vector<SDValue> &Ops,
694 unsigned getInlineAsmMemConstraint(
StringRef ConstraintCode)
const override {
695 if (ConstraintCode ==
"Q")
703 bool isUsedByReturnOnly(
SDNode *N,
SDValue &Chain)
const override;
704 bool mayBeEmittedAsTailCall(
const CallInst *CI)
const override;
718 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...
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)
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)
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.
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
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 ...
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.
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)
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.