14 #ifndef LLVM_LIB_TARGET_HEXAGON_HEXAGONISELLOWERING_H 15 #define LLVM_LIB_TARGET_HEXAGON_HEXAGONISELLOWERING_H 31 namespace HexagonISD {
99 int VarArgsFrameOffset;
103 bool CanReturnSmallStruct(
const Function* CalleeFn,
unsigned& RetSize)
110 bool isHVXVectorType(
MVT Ty)
const;
123 unsigned Intrinsic)
const override;
125 bool isTruncateFree(
Type *Ty1,
Type *Ty2)
const override;
126 bool isTruncateFree(
EVT VT1,
EVT VT2)
const override;
134 bool allowTruncateForTailCall(
Type *Ty1,
Type *Ty2)
const override;
144 bool shouldExpandBuildVectorWithShuffles(
EVT VT,
145 unsigned DefinedValues)
const override;
157 const char *getTargetNodeName(
unsigned Opcode)
const override;
231 bool mayBeEmittedAsTailCall(
const CallInst *CI)
const override;
233 Register getRegisterByName(
const char* RegName,
LLT VT,
255 EVT VT)
const override {
269 std::pair<unsigned, const TargetRegisterClass *>
275 if (ConstraintCode ==
"o")
289 Type *Ty,
unsigned AS,
296 bool ForCodeSize)
const override;
302 bool isLegalICmpImmediate(int64_t Imm)
const override;
304 EVT getOptimalMemOpType(uint64_t
Size,
unsigned DstAlign,
305 unsigned SrcAlign,
bool IsMemset,
bool ZeroMemset,
bool MemcpyStrSrc,
308 bool allowsMisalignedMemoryAccesses(
EVT VT,
unsigned AddrSpace,
317 EVT NewVT)
const override;
325 bool shouldExpandAtomicStoreInIR(
StoreInst *
SI)
const override;
331 return AtomicExpansionKind::LLSC;
335 void initializeHVXLowering();
336 void validateConstPtrAlignment(
SDValue Ptr,
const SDLoc &dl,
337 unsigned NeedAlign)
const;
339 std::pair<SDValue,int> getBaseAndOffset(
SDValue Addr)
const;
370 using VectorPair = std::pair<SDValue, SDValue>;
371 using TypePair = std::pair<MVT, MVT>;
379 TypePair ty(
const VectorPair &Ops)
const {
380 return { Ops.first.getValueType().getSimpleVT(),
381 Ops.second.getValueType().getSimpleVT() };
383 MVT tyScalar(
MVT Ty)
const {
393 assert((TyWidth % ElemWidth) == 0);
397 MVT typeJoin(
const TypePair &Tys)
const;
398 TypePair typeSplit(
MVT Ty)
const;
399 MVT typeExtElem(
MVT VecTy,
unsigned Factor)
const;
400 MVT typeTruncElem(
MVT VecTy,
unsigned Factor)
const;
407 bool isHvxSingleTy(
MVT Ty)
const;
408 bool isHvxPairTy(
MVT Ty)
const;
420 unsigned BitBytes,
bool ZeroFill,
461 std::pair<const TargetRegisterClass*, uint8_t>
465 bool isHvxOperation(
SDValue Op)
const;
473 #endif // LLVM_LIB_TARGET_HEXAGON_HEXAGONISELLOWERING_H
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.
A parsed version of the target data layout string in and methods for querying it. ...
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")
This class represents lattice values for constants.
static SDValue LowerREADCYCLECOUNTER(SDValue Op, const X86Subtarget &Subtarget, SelectionDAG &DAG)
static SDValue LowerATOMIC_FENCE(SDValue Op, SelectionDAG &DAG, const ARMSubtarget *Subtarget)
static MVT getVectorVT(MVT VT, unsigned NumElements)
An instruction that atomically checks whether a specified value is in a memory location, and, if it is, stores a new value there.
bool isVector() const
Return true if this is a vector value type.
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...
static SDValue LowerSIGN_EXTEND(SDValue Op, const X86Subtarget &Subtarget, SelectionDAG &DAG)
TypeSize getSizeInBits() const
Returns the size of the specified MVT in bits.
static SDValue LowerINSERT_SUBVECTOR(SDValue Op, const X86Subtarget &Subtarget, SelectionDAG &DAG)
static SDValue LowerEXTRACT_VECTOR_ELT(SDValue Op, SelectionDAG &DAG, const ARMSubtarget *ST)
This class represents a function call, abstracting a target machine's calling convention.
MVT getSimpleVT() const
Return the SimpleValueType held in the specified simple EVT.
Function Alias Analysis Results
static SDValue LowerPREFETCH(SDValue Op, SelectionDAG &DAG)
unsigned const TargetRegisterInfo * TRI
bool isCheapToSpeculateCttz() const override
Return true if it is cheap to speculate a call to intrinsic cttz.
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.
AtomicExpansionKind shouldExpandAtomicRMWInIR(AtomicRMWInst *AI) const override
Returns how the IR-level AtomicExpand pass should expand the given AtomicRMW, if at all...
unsigned getInlineAsmMemConstraint(StringRef ConstraintCode) const override
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml", "ocaml 3.10-compatible collector")
static SDValue LowerLoad(SDValue Op, const X86Subtarget &Subtarget, SelectionDAG &DAG)
static unsigned getInt(StringRef R)
Get an unsigned integer, including error checks.
MachineSDNode * getMachineNode(unsigned Opcode, const SDLoc &dl, EVT VT)
These are used for target selectors to create a new node with specified return type(s), MachineInstr opcode, and operands.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
bool isCtlzFast() const override
Return true if ctlz instruction is fast.
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.
An instruction for storing to memory.
virtual unsigned getInlineAsmMemConstraint(StringRef ConstraintCode) const
MVT getVectorElementType() const
Analysis containing CSE Info
UNDEF - An undefined node.
bool isCheapToSpeculateCtlz() const override
Return true if it is cheap to speculate a call to intrinsic ctlz.
static SDValue LowerVECTOR_SHUFFLE(SDValue Op, SelectionDAG &DAG, const ARMSubtarget *ST)
static SDValue LowerCONCAT_VECTORS(SDValue Op, SelectionDAG &DAG, const ARMSubtarget *ST)
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
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.
bool isMachineOpcode() const
unsigned getVectorNumElements() const
Given a vector type, return the number of elements it contains.
This is an important base class in LLVM.
LoadExtType
LoadExtType enum - This enum defines the three variants of LOADEXT (load with extension).
OperandFlags
These are flags set on operands, but should be considered private, all access should go through the M...
unsigned getMachineOpcode() const
static SDValue LowerFRAMEADDR(SDValue Op, SelectionDAG &DAG, const SparcSubtarget *Subtarget)
static SDValue LowerStore(SDValue Op, const X86Subtarget &Subtarget, SelectionDAG &DAG)
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.
This struct is a compact representation of a valid (non-zero power of two) alignment.
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 bool isUndef(ArrayRef< int > Mask)
static SDValue LowerBITCAST(SDValue Op, SelectionDAG &DAG)
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
static Value * insertVector(IRBuilderTy &IRB, Value *Old, Value *V, unsigned BeginIndex, const Twine &Name)
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
Represents one node in the SelectionDAG.
EVT getSetCCResultType(const DataLayout &, LLVMContext &C, EVT VT) const override
Return the ValueType of the result of SETCC operations.
static EVT getVectorVT(LLVMContext &Context, EVT VT, unsigned NumElements, bool IsScalable=false)
Returns the EVT that represents a vector NumElements in length, where each element is of type VT...
amdgpu Simplify well known AMD library false FunctionCallee Callee
static SDValue LowerANY_EXTEND(SDValue Op, const X86Subtarget &Subtarget, SelectionDAG &DAG)
Flags
Flags values. These may be or'd together.
bool isVector() const
Return true if this is a vector value type.
static SDValue LowerZERO_EXTEND(SDValue Op, const X86Subtarget &Subtarget, SelectionDAG &DAG)
unsigned getOpcode() const
static Value * extractVector(IRBuilderTy &IRB, Value *V, unsigned BeginIndex, unsigned EndIndex, const Twine &Name)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
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.
std::underlying_type< E >::type Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
Primary interface to the complete machine description for the target machine.
StringRef - Represent a constant reference to a string, i.e.
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation...
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.