39 #include "AMDGPUGenCallingConv.inc" 47 assert(StoreSize % 32 == 0 &&
"Store size not a multiple of 32");
306 for (
MVT VT : ScalarIntVTs) {
360 for (
MVT VT : VectorIntTypes) {
402 for (
MVT VT : FloatVectorTypes) {
451 for (
int I = 0;
I < RTLIB::UNKNOWN_LIBCALL; ++
I)
553 if (isa<MemSDNode>(N))
572 switch (cast<ConstantSDNode>(N->
getOperand(0))->getZExtValue()) {
573 case Intrinsic::amdgcn_interp_p1:
574 case Intrinsic::amdgcn_interp_p2:
575 case Intrinsic::amdgcn_interp_mov:
576 case Intrinsic::amdgcn_interp_p1_f16:
577 case Intrinsic::amdgcn_interp_p2_f16:
589 unsigned CostThreshold) {
595 unsigned NumMayIncreaseSize = 0;
604 if (++NumMayIncreaseSize > CostThreshold)
623 bool ForCodeSize)
const {
655 if (OldSize >= 32 && NewSize < 32 && MN->
getAlignment() >= 4 &&
658 (isa<LoadSDNode>(N) &&
670 return (OldSize < 32);
685 if ((LScalarSize >= CastScalarSize) && (CastScalarSize < 32))
690 CastTy, MMO, &
Fast) &&
715 unsigned IntrID = cast<ConstantSDNode>(N->
getOperand(0))->getZExtValue();
719 case Intrinsic::amdgcn_readfirstlane:
720 case Intrinsic::amdgcn_readlane:
727 if (cast<LoadSDNode>(N)->getMemOperand()->
getAddrSpace() ==
779 return DestSize < SrcSize && DestSize % 32 == 0 ;
789 return SrcSize >= 32;
791 return DestSize < SrcSize && DestSize % 32 == 0;
799 return DestSize >= 32;
801 return SrcSize == 32 && DestSize == 64;
848 return CC_AMDGPU_Func;
869 return RetCC_SI_Shader;
873 return RetCC_AMDGPU_Func;
915 unsigned MaxAlign = 1;
916 uint64_t ExplicitArgOffset = 0;
919 unsigned InIndex = 0;
922 Type *BaseArgTy =
Arg.getType();
924 MaxAlign =
std::max(Align, MaxAlign);
927 uint64_t ArgOffset =
alignTo(ExplicitArgOffset, Align) + ExplicitOffset;
928 ExplicitArgOffset =
alignTo(ExplicitArgOffset, Align) + AllocSize;
941 for (
unsigned Value = 0, NumValues = ValueVTs.
size();
943 uint64_t BasePartOffset = Offsets[
Value];
982 assert(MemoryBits % NumElements == 0);
986 MemoryBits / NumElements);
1004 unsigned PartOffset = 0;
1005 for (
unsigned i = 0; i != NumRegs; ++i) {
1007 BasePartOffset + PartOffset,
1046 int ClobberedFI)
const {
1049 int64_t LastByte = FirstByte + MFI.
getObjectSize(ClobberedFI) - 1;
1060 if (
LoadSDNode *L = dyn_cast<LoadSDNode>(*U)) {
1062 if (FI->getIndex() < 0) {
1064 int64_t InLastByte = InFirstByte;
1067 if ((InFirstByte <= FirstByte && FirstByte <= InLastByte) ||
1068 (FirstByte <= InFirstByte && InFirstByte <= LastByte))
1090 FuncName =
G->getSymbol();
1092 FuncName =
G->getGlobal()->getName();
1099 for (
unsigned I = 0,
E = CLI.
Ins.size();
I !=
E; ++
I)
1128 "instruction is not implemented yet!");
1201 Fn,
"local memory global used by non-kernel function",
SDLoc(Op).
getDebugLoc());
1207 "Do not know what to do with an non-zero offset");
1247 unsigned Start = cast<ConstantSDNode>(Op.
getOperand(1))->getZExtValue();
1261 if (!(LHS == True && RHS == False) && !(LHS == False && RHS == True))
1329 std::pair<SDValue, SDValue>
1341 return std::make_pair(Lo, Hi);
1370 HiVT = NumElts - LoNumElts == 1
1373 return std::make_pair(LoVT, HiVT);
1378 std::pair<SDValue, SDValue>
1380 const EVT &LoVT,
const EVT &HiVT,
1385 "More vector elements requested than available!");
1392 return std::make_pair(Lo, Hi);
1404 if (VT.getVectorNumElements() == 2) {
1416 EVT LoMemVT, HiMemVT;
1421 std::tie(Lo, Hi) =
splitVector(Op, SL, LoVT, HiVT, DAG);
1425 unsigned HiAlign =
MinAlign(BaseAlign, Size);
1428 Load->
getChain(), BasePtr, SrcValue, LoMemVT,
1433 HiPtr, SrcValue.getWithOffset(LoMemVT.getStoreSize()),
1446 SL, VT, Join, HiLoad,
1447 DAG.
getConstant(LoVT.getVectorNumElements(), SL, IdxTy));
1461 assert(VT.getVectorNumElements() == 3);
1486 EVT VT = Val.getValueType();
1499 EVT LoMemVT, HiMemVT;
1504 std::tie(Lo, Hi) =
splitVector(Val, SL, LoVT, HiVT, DAG);
1511 unsigned HiAlign =
MinAlign(BaseAlign, Size);
1514 DAG.
getTruncStore(Chain, SL, Lo, BasePtr, SrcValue, LoMemVT, BaseAlign,
1536 if (LHSSignBits < 9)
1540 if (RHSSignBits < 9)
1544 unsigned SignBits = std::min(LHSSignBits, RHSSignBits);
1545 unsigned DivBits = BitSize - SignBits;
1819 for (
unsigned i = 0; i < halfBitWidth; ++i) {
1820 const unsigned bitPos = halfBitWidth - i - 1;
2066 const unsigned FractBits = 52;
2067 const unsigned ExpBits = 11;
2096 const unsigned FractBits = 52;
2292 double Log2BaseInverted)
const {
2300 return DAG.
getNode(
ISD::FMUL, SL, VT, Log2Operand, Log2BaseInvertedOperand);
2328 unsigned ISDOpc, NewOpc;
2390 SrcIsZero, Bits32, NewOpr);
2626 const unsigned ExpMask = 0x7ff;
2627 const unsigned ExpBiasf64 = 1023;
2628 const unsigned ExpBiasf16 = 15;
2772 for (
unsigned I = 0;
I < NElts; ++
I)
2800 unsigned NewOpcode = Node24->
getOpcode();
2802 unsigned IID = cast<ConstantSDNode>(Node24->
getOperand(0))->getZExtValue();
2803 NewOpcode = IID == Intrinsic::amdgcn_mul_i24 ?
2814 if (DemandedLHS || DemandedRHS)
2816 DemandedLHS ? DemandedLHS : LHS,
2817 DemandedRHS ? DemandedRHS : RHS);
2830 template <
typename IntTy>
2833 if (Width + Offset < 32) {
2835 IntTy Result =
static_cast<IntTy
>(Shl) >> (32 - Width);
2844 if (
MemSDNode *M = dyn_cast<MemSDNode>(U)) {
2845 if (M->isVolatile())
2863 if ((Size == 1 || Size == 2 || Size == 4) && !VT.
isVector())
2866 if (Size == 3 || (Size > 4 && (Size % 4 != 0)))
2994 EVT ExtVT = cast<VTSDNode>(N1)->getVT();
2999 if (SrcVT.
bitsGE(ExtVT)) {
3010 unsigned IID = cast<ConstantSDNode>(N->
getOperand(0))->getZExtValue();
3012 case Intrinsic::amdgcn_mul_i24:
3013 case Intrinsic::amdgcn_mul_u24:
3156 unsigned ShiftAmt = RHS->getZExtValue();
3164 if (
Mask->getAPIntValue().isShiftedMask() &&
3165 Mask->getAPIntValue().countTrailingZeros() == ShiftAmt) {
3339 Mul =
getMul24(DAG, DL, N0, N1, Size,
false);
3343 Mul =
getMul24(DAG, DL, N0, N1, Size,
true);
3426 return C->isAllOnesValue();
3433 unsigned Opc)
const {
3477 return getFFBX_U32(DAG, CmpLHS, SL, Opc);
3486 return getFFBX_U32(DAG, CmpLHS, SL, Opc);
3504 return DAG.
getNode(Op, SL, VT, NewSelect);
3525 SDLoc(N), Cond, LHS, RHS);
3544 bool ShouldFoldNeg =
true;
3549 ShouldFoldNeg =
false;
3551 ShouldFoldNeg =
false;
3554 if (ShouldFoldNeg) {
3564 Cond, NewLHS, NewRHS);
3634 if (
C->isZero() && !
C->isNegative())
3795 for (
unsigned I = 0;
I < 3; ++
I)
3897 const APFloat &Val = CFP->getValueAPF();
3950 uint64_t CVal =
C->getZExtValue();
3959 const APInt &Val =
C->getValueAPF().bitcastToAPInt();
4017 "Vector handling of BFE not implemented");
4022 uint32_t WidthVal = Width->getZExtValue() & 0x1f;
4035 if (OffsetVal == 0) {
4037 unsigned SignBits = Signed ? (32 - WidthVal + 1) : (32 - WidthVal);
4040 if (OpSignBits >= SignBits)
4060 return constantFoldBFE<int32_t>(DAG,
4061 CVal->getSExtValue(),
4067 return constantFoldBFE<uint32_t>(DAG,
4068 CVal->getZExtValue(),
4074 if ((OffsetVal + WidthVal) >= 32 &&
4075 !(Subtarget->
hasSDWA() && OffsetVal == 16 && WidthVal == 16)) {
4078 BitsFrom, ShiftVal);
4084 OffsetVal + WidthVal);
4090 if (TLI.ShrinkDemandedConstant(BitsFrom, Demanded, TLO) ||
4091 TLI.SimplifyDemandedBits(BitsFrom, Demanded, Known, TLO)) {
4122 bool RawReg)
const {
4188 assert(Arg &&
"Attempting to load missing argument");
4198 unsigned Shift = countTrailingZeros<unsigned>(
Mask);
4211 const Align Alignment = ST.getAlignmentForImplicitArgPtr();
4218 return ArgOffset + 4;
4223 #define NODE_NAME_CASE(node) case AMDGPUISD::node: return #node; 4387 int &RefinementSteps,
4388 bool &UseOneConstNR,
4389 bool Reciprocal)
const {
4393 RefinementSteps = 0;
4405 int &RefinementSteps)
const {
4414 RefinementSteps = 0;
4474 LHSKnown = LHSKnown.
trunc(24);
4475 RHSKnown = RHSKnown.
trunc(24);
4480 unsigned MaxValBits = std::min(LHSValBits + RHSValBits, 32u);
4481 if (MaxValBits >= 32)
4490 if ((LHSNonNegative && RHSNonNegative) || (LHSNegative && RHSNegative))
4492 else if ((LHSNegative && RHSPositive) || (LHSPositive && RHSNegative))
4497 unsigned MaxValBits = std::min(LHSValBits + RHSValBits, 32u);
4498 if (MaxValBits >= 32)
4513 for (
unsigned I = 0;
I < 32;
I += 8) {
4514 unsigned SelBits = Sel & 0xff;
4519 }
else if (SelBits < 7) {
4520 SelBits = (SelBits & 3) * 8;
4523 }
else if (SelBits == 0x0c) {
4524 Known.
Zero |= 0xFFull <<
I;
4525 }
else if (SelBits > 0x0c) {
4526 Known.
One |= 0xFFull <<
I;
4542 unsigned Align = GA->getGlobal()->getAlignment();
4550 unsigned IID = cast<ConstantSDNode>(Op.
getOperand(0))->getZExtValue();
4552 case Intrinsic::amdgcn_mbcnt_lo:
4553 case Intrinsic::amdgcn_mbcnt_hi: {
4570 unsigned Depth)
const {
4583 return std::max(SignBits, Op0SignBits);
4588 return Width ? 32 - (Width->
getZExtValue() & 0x1f) : 1;
4613 unsigned Depth)
const {
4677 unsigned IntrinsicID
4678 = cast<ConstantSDNode>(Op.
getOperand(0))->getZExtValue();
4680 switch (IntrinsicID) {
4681 case Intrinsic::amdgcn_cubeid:
4684 case Intrinsic::amdgcn_frexp_mant: {
4689 case Intrinsic::amdgcn_cvt_pkrtz: {
4695 case Intrinsic::amdgcn_fdot2:
unsigned ComputeNumSignBitsForTargetNode(SDValue Op, const APInt &DemandedElts, const SelectionDAG &DAG, unsigned Depth=0) const override
This method can be implemented by targets that want to expose additional information about sign bits ...
SDValue getStore(SDValue Chain, const SDLoc &dl, SDValue Val, SDValue Ptr, MachinePointerInfo PtrInfo, unsigned Alignment=0, MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes())
Helper function to build ISD::STORE nodes.
BITCAST - This operator converts between integer, vector and FP values, as if the value was stored to...
X = FP_ROUND(Y, TRUNC) - Rounding 'Y' from a larger floating point type down to the precision of the ...
SDValue LowerFRINT(SDValue Op, SelectionDAG &DAG) const
SDValue LowerINT_TO_FP64(SDValue Op, SelectionDAG &DAG, bool Signed) const
SDValue LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg, const SmallVectorImpl< ISD::OutputArg > &Outs, const SmallVectorImpl< SDValue > &OutVals, const SDLoc &DL, SelectionDAG &DAG) const override
This hook must be implemented to lower outgoing return values, described by the Outs array...
A parsed version of the target data layout string in and methods for querying it. ...
FMINNUM/FMAXNUM - Perform floating-point minimum or maximum on two values.
EVT getValueType() const
Return the ValueType of the referenced return value.
SDValue performStoreCombine(SDNode *N, DAGCombinerInfo &DCI) const
bool isInteger() const
Return true if this is an integer or a vector integer type.
Calling convention used for Mesa/AMDPAL hull shaders (= tessellation control shaders).
SDValue LowerFREM(SDValue Op, SelectionDAG &DAG) const
Split a vector store into multiple scalar stores.
SDValue performCtlz_CttzCombine(const SDLoc &SL, SDValue Cond, SDValue LHS, SDValue RHS, DAGCombinerInfo &DCI) const
Register getRegister() const
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
void setLoadExtAction(unsigned ExtType, MVT ValVT, MVT MemVT, LegalizeAction Action)
Indicate that the specified load with extension does not work with the specified type and indicate wh...
raw_ostream & errs()
This returns a reference to a raw_ostream for standard error.
bool shouldCombineMemoryType(EVT VT) const
CombineLevel getDAGCombineLevel()
unsigned allocateLDSGlobal(const DataLayout &DL, const GlobalValue &GV)
const GlobalValue * getGlobal() const
EXTRACT_ELEMENT - This is used to get the lower or upper (determined by a Constant, which is required to be operand #1) half of the integer or float value specified as operand #0.
uint64_t getZExtValue() const
Get zero extended value.
unsigned getOpcode() const
Return the SelectionDAG opcode value for this node.
static SDValue distributeOpThroughSelect(TargetLowering::DAGCombinerInfo &DCI, unsigned Op, const SDLoc &SL, SDValue Cond, SDValue N1, SDValue N2)
This class represents an incoming formal argument to a Function.
Diagnostic information for unsupported feature in backend.
bool isPow2VectorType() const
Returns true if the given vector is a power of 2.
SDValue CreateLiveInRegister(SelectionDAG &DAG, const TargetRegisterClass *RC, unsigned Reg, EVT VT, const SDLoc &SL, bool RawReg=false) const
Helper function that adds Reg to the LiveIn list of the DAG's MachineFunction.
SDValue performFAbsCombine(SDNode *N, DAGCombinerInfo &DCI) const
AMDGPU specific subclass of TargetSubtarget.
SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const override
This method will be invoked for all target nodes and for any target-independent nodes that the target...
SDValue CombineTo(SDNode *N, ArrayRef< SDValue > To, bool AddTo=true)
SDValue getHiHalf64(SDValue Op, SelectionDAG &DAG) const
static bool hasDefinedInitializer(const GlobalValue *GV)
SDValue LowerFLOG(SDValue Op, SelectionDAG &DAG, double Log2BaseInverted) const
const Constant * getInitializer() const
getInitializer - Return the initializer for this global variable.
bool shouldReduceLoadWidth(SDNode *Load, ISD::LoadExtType ExtType, EVT ExtVT) const override
Return true if it is profitable to reduce a load to a smaller type.
EXTRACT_SUBVECTOR(VECTOR, IDX) - Returns a subvector from VECTOR (an vector value) starting with the ...
CondCode getSetCCInverse(CondCode Operation, EVT Type)
Return the operation corresponding to !(X op Y), where 'op' is a valid SetCC operation.
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
This class represents lattice values for constants.
void analyzeFormalArgumentsCompute(CCState &State, const SmallVectorImpl< ISD::InputArg > &Ins) const
The SelectionDAGBuilder will automatically promote function arguments with illegal types...
SDValue LowerFFLOOR(SDValue Op, SelectionDAG &DAG) const
VECTOR_SHUFFLE(VEC1, VEC2) - Returns a vector, of the same type as VEC1/VEC2.
SDValue performMulhsCombine(SDNode *N, DAGCombinerInfo &DCI) const
EVT getScalarType() const
If this is a vector type, return the element type, otherwise return this.
SDValue LowerFP_TO_FP16(SDValue Op, SelectionDAG &DAG) const
SDValue scalarizeVectorStore(StoreSDNode *ST, SelectionDAG &DAG) const
Register createVirtualRegister(const TargetRegisterClass *RegClass, StringRef Name="")
createVirtualRegister - Create and return a new virtual register in the function with the specified r...
bool isVector() const
Return true if this is a vector value type.
void addLiveIn(unsigned Reg, unsigned vreg=0)
addLiveIn - Add the specified register as a live-in.
const SDValue & getBasePtr() const
constexpr uint32_t Lo_32(uint64_t Value)
Return the low 32 bits of a 64 bit value.
bool isNegative() const
Return true if the value is negative.
Carry-setting nodes for multiple precision addition and subtraction.
SDValue loadInputValue(SelectionDAG &DAG, const TargetRegisterClass *RC, EVT VT, const SDLoc &SL, const ArgDescriptor &Arg) const
void push_back(const T &Elt)
EVT getValueType(unsigned ResNo) const
Return the type of a specified result.
This file describes how to lower LLVM calls to machine code calls.
const SDValue & getValue() const
SDVTList getVTList() const
static int getOrCreateFixedStackObject(MachineFrameInfo &MFI, unsigned Size, int64_t Offset)
static CCAssignFn * CCAssignFnForReturn(CallingConv::ID CC, bool IsVarArg)
Address space for global memory (RAT0, VTX0).
static APInt getLowBitsSet(unsigned numBits, unsigned loBitsSet)
Get a value with low bits set.
MVT getSimpleVT() const
Return the SimpleValueType held in the specified simple EVT.
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...
unsigned getVectorNumElements() const
const SDValue & getChain() const
Function Alias Analysis Results
unsigned getAlignment() const
static CCAssignFn * CCAssignFnForCall(CallingConv::ID CC, bool IsVarArg)
C - The default llvm calling convention, compatible with C.
SDValue performAssertSZExtCombine(SDNode *N, DAGCombinerInfo &DCI) const
SDValue getSelect(const SDLoc &DL, EVT VT, SDValue Cond, SDValue LHS, SDValue RHS)
Helper function to make it easier to build Select's if you just have operands and don't want to check...
const fltSemantics & getSemantics() const
SDValue LowerFROUND_LegalFTRUNC(SDValue Op, SelectionDAG &DAG) const
static SDValue extractF64Exponent(SDValue Hi, const SDLoc &SL, SelectionDAG &DAG)
[US]{MIN/MAX} - Binary minimum or maximum or signed or unsigned integers.
const SDNodeFlags getFlags() const
an instruction that atomically reads a memory location, combines it with another value, and then stores the result back.
MachineFunction & getMachineFunction() const
SDNode * getNode() const
get the SDNode which holds the desired result
Calling convention used for AMDPAL vertex shader if tessellation is in use.
SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT, ArrayRef< SDUse > Ops)
Gets or creates the specified node.
SDValue LowerCall(CallLoweringInfo &CLI, SmallVectorImpl< SDValue > &InVals) const override
This hook must be implemented to lower calls into the specified DAG.
void computeKnownBitsForTargetNode(const SDValue Op, KnownBits &Known, const APInt &DemandedElts, const SelectionDAG &DAG, unsigned Depth=0) const override
Determine which of the bits specified in Mask are known to be either zero or one and return them in t...
AtomicExpansionKind
Enum that specifies what an atomic load/AtomicRMWInst is expanded to, if at all.
bool isByteSized() const
Return true if the bit size is a multiple of 8.
MachineMemOperand * getMemOperand() const
Return a MachineMemOperand object describing the memory reference performed by operation.
CLAMP value between 0.0 and 1.0.
INSERT_SUBVECTOR(VECTOR1, VECTOR2, IDX) - Returns a vector with VECTOR2 inserted into VECTOR1 at the ...
unsigned getBitWidth() const
Get the bit width of this value.
SDValue LowerSIGN_EXTEND_INREG(SDValue Op, SelectionDAG &DAG) const
uint64_t getExplicitKernArgSize() const
EntryToken - This is the marker used to indicate the start of a region.
Select with condition operator - This selects between a true value and a false value (ops #2 and #3) ...
bool hasOneUse() const
Return true if there is exactly one node using value ResNo of Node.
NodeType
ISD::NodeType enum - This enum defines the target-independent operators for a SelectionDAG.
SDValue performSrlCombine(SDNode *N, DAGCombinerInfo &DCI) const
Calling convention used for Mesa/AMDPAL geometry shaders.
std::pair< EVT, EVT > getSplitDestVTs(const EVT &VT, SelectionDAG &DAG) const
Split a vector type into two parts.
EVT getPow2VectorType(LLVMContext &Context) const
Widens the length of the given vector EVT up to the nearest power of 2 and returns that type...
bool mayIgnoreSignedZero(SDValue Op) const
void setTruncStoreAction(MVT ValVT, MVT MemVT, LegalizeAction Action)
Indicate that the specified truncating store does not work with the specified type and indicate what ...
bool hasVOP3PInsts() const
bool storeOfVectorConstantIsCheap(EVT MemVT, unsigned NumElem, unsigned AS) const override
Return true if it is expected to be cheaper to do a store of a non-zero vector constant with the give...
RESULT,OUTCHAIN = INTRINSIC_W_CHAIN(INCHAIN, INTRINSICID, arg1, ...) This node represents a target in...
static unsigned getAddrSpace(StringRef R)
unsigned countMinTrailingZeros() const
Returns the minimum number of trailing zero bits.
bool isCheapToSpeculateCttz() const override
Return true if it is cheap to speculate a call to intrinsic cttz.
unsigned getAddressSpace() const
Return the address space for the associated pointer.
A convenience struct that encapsulates a DAG, and two SDValues for returning information from TargetL...
std::pair< SDValue, SDValue > splitVector(const SDValue &N, const SDLoc &DL, const EVT &LoVT, const EVT &HighVT, SelectionDAG &DAG) const
Split a vector value into two parts of types LoVT and HiVT.
SDIVREM/UDIVREM - Divide two integers and produce both a quotient and remainder result.
bool isFloatingPoint() const
Return true if this is a FP or a vector FP type.
SDValue performLoadCombine(SDNode *N, DAGCombinerInfo &DCI) const
SDValue getIntPtrConstant(uint64_t Val, const SDLoc &DL, bool isTarget=false)
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml", "ocaml 3.10-compatible collector")
static unsigned numBitsUnsigned(SDValue Op, SelectionDAG &DAG)
static const AMDGPUSubtarget & get(const MachineFunction &MF)
SDValue performTruncateCombine(SDNode *N, DAGCombinerInfo &DCI) const
static uint32_t getAlignment(const MCSectionCOFF &Sec)
bool isBeforeLegalize() const
A description of a memory reference used in the backend.
SPIR_KERNEL - Calling convention for SPIR kernel functions.
Pointer to the start of the shader's constant data.
const DataLayout & getDataLayout() const
Get the data layout for the module's target platform.
void setHighBits(unsigned hiBits)
Set the top hiBits bits.
SDValue performMulhuCombine(SDNode *N, DAGCombinerInfo &DCI) const
ConstantSDNode * isConstOrConstSplat(SDValue N, bool AllowUndefs=false, bool AllowTruncation=false)
Returns the SDNode if it is a constant splat BuildVector or constant int.
Shift and rotation operations.
bool isNormalStore(const SDNode *N)
Returns true if the specified node is a non-truncating and unindexed store.
virtual MVT getRegisterTypeForCallingConv(LLVMContext &Context, CallingConv::ID CC, EVT VT) const
Certain combinations of ABIs, Targets and features require that types are legal for some operations a...
bool isEntryFunction() const
LLVMContext & getContext() const
Get the global data context.
bool isKnownNeverNaNForTargetNode(SDValue Op, const SelectionDAG &DAG, bool SNaN=false, unsigned Depth=0) const override
If SNaN is false,.
BinOp getOperation() const
SDValue getObjectPtrOffset(const SDLoc &SL, SDValue Ptr, int64_t Offset)
Create an add instruction with appropriate flags when used for addressing some offset of an object...
SDValue LowerDYNAMIC_STACKALLOC(SDValue Op, SelectionDAG &DAG) const
BUILD_PAIR - This is the opposite of EXTRACT_ELEMENT in some ways.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
CopyToReg - This node has three operands: a chain, a register number to set to this value...
void addLoc(const CCValAssign &V)
SDValue getRecipEstimate(SDValue Operand, SelectionDAG &DAG, int Enabled, int &RefinementSteps) const override
Return a reciprocal estimate value for the input operand.
int64_t getObjectOffset(int ObjectIdx) const
Return the assigned stack offset of the specified object from the incoming stack pointer.
ISD::LoadExtType getExtensionType() const
Return whether this is a plain node, or one of the varieties of value-extending loads.
static bool isI24(SDValue Op, SelectionDAG &DAG)
The memory access is dereferenceable (i.e., doesn't trap).
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted...
SDValue getEntryNode() const
Return the token chain corresponding to the entry of the function.
void setOperationAction(unsigned Op, MVT VT, LegalizeAction Action)
Indicate that the specified operation does not work with the specified type and indicate what to do a...
TypeSize getValueSizeInBits() const
Returns the size of the value in bits.
Address space for 32-bit constant memory.
const DataLayout & getDataLayout() const
SDValue LowerUINT_TO_FP(SDValue Op, SelectionDAG &DAG) const
SDVTList getVTList(EVT VT)
Return an SDVTList that represents the list of values specified.
void setJumpIsExpensive(bool isExpensive=true)
Tells the code generator not to expand logic operations on comparison predicates into separate sequen...
SDValue loadStackInputValue(SelectionDAG &DAG, EVT VT, const SDLoc &SL, int64_t Offset) const
Similar to CreateLiveInRegister, except value maybe loaded from a stack slot rather than passed in a ...
SDValue LowerFROUND64(SDValue Op, SelectionDAG &DAG) const
Interface to describe a layout of a stack frame on an AMDGPU target.
SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const override
This callback is invoked for operations that are unsupported by the target, which are registered to u...
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
static mvt_range integer_fixedlen_vector_valuetypes()
INLINEASM - Represents an inline asm block.
This represents a list of ValueType's that has been intern'd by a SelectionDAG.
SDValue getExtLoad(ISD::LoadExtType ExtType, const SDLoc &dl, EVT VT, SDValue Chain, SDValue Ptr, MachinePointerInfo PtrInfo, EVT MemVT, unsigned Alignment=0, MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes())
SmallVector< ISD::InputArg, 32 > Ins
SDValue getMergeValues(ArrayRef< SDValue > Ops, const SDLoc &dl)
Create a MERGE_VALUES node from the given operands.
TargetRegisterInfo interface that is implemented by all hw codegen targets.
void ReplaceNodeResults(SDNode *N, SmallVectorImpl< SDValue > &Results, SelectionDAG &DAG) const override
This callback is invoked when a node result type is illegal for the target, and the operation was reg...
Address space for region memory. (GDS)
unsigned countMinSignBits() const
Returns the number of times the sign bit is replicated into the other bits.
SDValue getSExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT)
Convert Op, which must be of integer type, to the integer type VT, by either sign-extending or trunca...
SDValue SplitVectorLoad(SDValue Op, SelectionDAG &DAG) const
Split a vector load into 2 loads of half the vector.
bool isCheapToSpeculateCtlz() const override
Return true if it is cheap to speculate a call to intrinsic ctlz.
MachineFunction & getMachineFunction() const
[SU]INT_TO_FP - These operators convert integers (whose interpreted sign depends on the first letter)...
Select with a vector condition (op #0) and two vector operands (ops #1 and #2), returning a vector re...
Simple integer binary arithmetic operators.
static bool hasVolatileUser(SDNode *Val)
int getObjectIndexBegin() const
Return the minimum frame object index.
SDValue getSetCC(const SDLoc &DL, EVT VT, SDValue LHS, SDValue RHS, ISD::CondCode Cond, SDValue Chain=SDValue(), bool IsSignaling=false)
Helper function to make it easier to build SetCC's if you just have an ISD::CondCode instead of an SD...
uint32_t getImplicitParameterOffset(const MachineFunction &MF, const ImplicitParameter Param) const
Helper function that returns the byte offset of the given type of implicit parameter.
bool FP32Denormals
If this is set, neither input or output denormals are flushed for most f32 instructions.
SDValue getUNDEF(EVT VT)
Return an UNDEF node. UNDEF does not have a useful SDLoc.
bool isKnownNeverNaN(SDValue Op, bool SNaN=false, unsigned Depth=0) const
Test whether the given SDValue is known to never be NaN.
std::pair< SDValue, SDValue > split64BitValue(SDValue Op, SelectionDAG &DAG) const
Return 64-bit value Op as two 32-bit integers.
CondCode
ISD::CondCode enum - These are ordered carefully to make the bitfields below work out...
static const fltSemantics & IEEEdouble() LLVM_READNONE
std::pair< SDValue, SDValue > expandUnalignedLoad(LoadSDNode *LD, SelectionDAG &DAG) const
Expands an unaligned load to 2 half-size loads for an integer, and possibly more for vectors...
static SDValue getMul24(SelectionDAG &DAG, const SDLoc &SL, SDValue N0, SDValue N1, unsigned Size, bool Signed)
SDValue LowerCONCAT_VECTORS(SDValue Op, SelectionDAG &DAG) const
static SDValue simplifyI24(SDNode *Node24, TargetLowering::DAGCombinerInfo &DCI)
ArrayRef< SDUse > ops() const
void setMinCmpXchgSizeInBits(unsigned SizeInBits)
Sets the minimum cmpxchg or ll/sc size supported by the backend.
RESULT = INTRINSIC_WO_CHAIN(INTRINSICID, arg1, arg2, ...) This node represents a target intrinsic fun...
int64_t getObjectSize(int ObjectIdx) const
Return the size of the specified object.
void ComputeValueVTs(const TargetLowering &TLI, const DataLayout &DL, Type *Ty, SmallVectorImpl< EVT > &ValueVTs, SmallVectorImpl< uint64_t > *Offsets=nullptr, uint64_t StartingOffset=0)
ComputeValueVTs - Given an LLVM IR type, compute a sequence of EVTs that represent all the individual...
SDValue performFNegCombine(SDNode *N, DAGCombinerInfo &DCI) const
This class is used to represent ISD::STORE nodes.
FP_TO_[US]INT - Convert a floating point value to a signed or unsigned integer.
This node is for VLIW targets and it is used to represent a vector that is stored in consecutive regi...
static LLVM_READNONE bool fnegFoldsIntoOp(unsigned Opc)
BUILD_VECTOR(ELT0, ELT1, ELT2, ELT3,...) - Return a vector with the specified, possibly variable...
static bool isCtlzOpc(unsigned Opc)
MVT getSimpleValueType() const
Return the simple ValueType of the referenced return value.
Calling convention used for Mesa/AMDPAL compute shaders.
bool isNegative() const
Returns true if this value is known to be negative.
static APInt getHighBitsSet(unsigned numBits, unsigned hiBitsSet)
Get a value with high bits set.
unsigned ComputeNumSignBits(SDValue Op, unsigned Depth=0) const
Return the number of times the sign bit of the register is replicated into the other bits...
static SDValue constantFoldBFE(SelectionDAG &DAG, IntTy Src0, uint32_t Offset, uint32_t Width, const SDLoc &DL)
SDValue LowerINT_TO_FP32(SDValue Op, SelectionDAG &DAG, bool Signed) const
bool isSDNodeAlwaysUniform(const SDNode *N) const override
SDValue LowerFP_TO_UINT(SDValue Op, SelectionDAG &DAG) const
constexpr uint64_t MinAlign(uint64_t A, uint64_t B)
A and B are either alignments or offsets.
const SDValue & getBasePtr() const
bool bitsGE(EVT VT) const
Return true if this has no less bits than VT.
bool isNormalLoad(const SDNode *N)
Returns true if the specified node is a non-extending and unindexed load.
int64_t getOffset() const
unsigned UnsafeFPMath
UnsafeFPMath - This flag is enabled when the -enable-unsafe-fp-math flag is specified on the command ...
SDValue performRcpCombine(SDNode *N, DAGCombinerInfo &DCI) const
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
unsigned const MachineRegisterInfo * MRI
use_iterator use_begin() const
Provide iteration support to walk over all uses of an SDNode.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
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.
Simple binary floating point operators.
bool hasFminFmaxLegacy() const
SDValue performMulCombine(SDNode *N, DAGCombinerInfo &DCI) const
SDValue storeStackInputValue(SelectionDAG &DAG, const SDLoc &SL, SDValue Chain, SDValue ArgVal, int64_t Offset) const
void setTargetDAGCombine(ISD::NodeType NT)
Targets should invoke this method for each target independent node that they want to provide a custom...
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
unsigned getVectorNumElements() const
Given a vector type, return the number of elements it contains.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
void resetAll()
Resets the known state of all bits.
SDValue LowerSDIVREM(SDValue Op, SelectionDAG &DAG) const
const SDValue & getOperand(unsigned Num) const
const APInt & getConstant() const
Returns the value when all bits have a known value.
LoadExtType
LoadExtType enum - This enum defines the three variants of LOADEXT (load with extension).
INSERT_VECTOR_ELT(VECTOR, VAL, IDX) - Returns VECTOR with the element at IDX replaced with VAL...
virtual bool allowsMisalignedMemoryAccesses(EVT, unsigned AddrSpace=0, unsigned Align=1, MachineMemOperand::Flags Flags=MachineMemOperand::MONone, bool *=nullptr) const
Determine if the target supports unaligned memory accesses.
bool bitsLE(EVT VT) const
Return true if this has no more bits than VT.
Carry-using nodes for multiple precision addition and subtraction.
LLVMContext & getContext() const
TypeSize getTypeAllocSize(Type *Ty) const
Returns the offset in bytes between successive objects of the specified type, including alignment pad...
bool has16BitInsts() const
static unsigned inverseMinMax(unsigned Opc)
static bool isUniformMMO(const MachineMemOperand *MMO)
virtual SDValue LowerGlobalAddress(AMDGPUMachineFunction *MFI, SDValue Op, SelectionDAG &DAG) const
SDValue LowerUDIVREM(SDValue Op, SelectionDAG &DAG) const
void AddToWorklist(SDNode *N)
const char * getTargetNodeName(unsigned Opcode) const override
This method returns the name of a target specific DAG node.
SDValue lowerFEXP(SDValue Op, SelectionDAG &DAG) const
bool isStrictlyPositive() const
Returns true if this value is known to be positive.
AMDGPU::SIModeRegisterDefaults getMode() const
This class provides iterator support for SDUse operands that use a specific SDNode.
std::pair< SDValue, SDValue > scalarizeVectorLoad(LoadSDNode *LD, SelectionDAG &DAG) const
Turn load of vector type into a load of the individual elements.
bool isConstant() const
Returns true if we know the value of all bits.
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
void ReplaceAllUsesWith(SDValue From, SDValue To)
Modify anything using 'From' to use 'To' instead.
TypeSize getStoreSize() const
Return the number of bytes overwritten by a store of the specified value type.
TRAP - Trapping instruction.
amdgpu Simplify well known AMD library false FunctionCallee Value * Arg
AssertSext, AssertZext - These nodes record if a register contains a value that has already been zero...
bool isOperationLegal(unsigned Op, EVT VT) const
Return true if the specified operation is legal on this target.
The AMDGPU TargetMachine interface definition for hw codgen targets.
void AddPromotedToType(unsigned Opc, MVT OrigVT, MVT DestVT)
If Opc/OrigVT is specified as being promoted, the promotion code defaults to trying a larger integer/...
unsigned MaxStoresPerMemmove
Specify maximum number of store instructions per memmove call.
Bit counting operators with an undefined result for zero inputs.
Val, OUTCHAIN = ATOMIC_CMP_SWAP(INCHAIN, ptr, cmp, swap) For double-word atomic operations: ValLo...
X = FP_EXTEND(Y) - Extend a smaller FP type into a larger FP type.
TypeSize getSizeInBits() const
Return the size of the specified value type in bits.
bool isConstantCostlierToNegate(SDValue N) const
This structure contains all information that is necessary for lowering calls.
bool isBeforeLegalizeOps() const
const TargetMachine & getTargetMachine() const
This class contains a discriminated union of information about pointers in memory operands...
unsigned getNumOperands() const
Return the number of values used by this operation.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This struct is a compact representation of a valid (non-zero power of two) alignment.
SDValue getZeroExtendInReg(SDValue Op, const SDLoc &DL, EVT VT)
Return the expression required to zero extend the Op value assuming it was the smaller SrcTy value...
unsigned GatherAllAliasesMaxDepth
Depth that GatherAllAliases should should continue looking for chain dependencies when trying to find...
SDValue getLoad(EVT VT, const SDLoc &dl, SDValue Chain, SDValue Ptr, MachinePointerInfo PtrInfo, unsigned Alignment=0, MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes(), const MDNode *Ranges=nullptr)
Loads are not normal binary operators: their result type is not determined by their operands...
static bool isCttzOpc(unsigned Opc)
ConstantFPSDNode * isConstOrConstSplatFP(SDValue N, bool AllowUndefs=false)
Returns the SDNode if it is a constant splat BuildVector or constant float.
static CCAssignFn * CCAssignFnForCall(CallingConv::ID CC, bool IsVarArg)
Selects the correct CCAssignFn for a given CallingConvention value.
unsigned getAddressSpace() const
unsigned getStackOffset() const
SDValue getBitcast(EVT VT, SDValue V)
Return a bitcast using the SDLoc of the value operand, and casting to the provided type...
SDValue addTokenForArgument(SDValue Chain, SelectionDAG &DAG, MachineFrameInfo &MFI, int ClobberedFI) const
bool isFloatingPoint() const
Return true if this is a FP or a vector FP type.
static LLVM_READONLY bool hasSourceMods(const SDNode *N)
bool allowsMemoryAccessForAlignment(LLVMContext &Context, const DataLayout &DL, EVT VT, unsigned AddrSpace=0, unsigned Alignment=1, MachineMemOperand::Flags Flags=MachineMemOperand::MONone, bool *Fast=nullptr) const
This function returns true if the memory access is aligned or if the target allows this specific unal...
static bool isU24(SDValue Op, SelectionDAG &DAG)
TokenFactor - This node takes multiple tokens as input and produces a single token result...
static const fltSemantics & IEEEsingle() LLVM_READNONE
const TargetLowering & getTargetLoweringInfo() const
SDValue LowerDIVREM24(SDValue Op, SelectionDAG &DAG, bool sign) const
bool isFPImmLegal(const APFloat &Imm, EVT VT, bool ForCodeSize) const override
Returns true if the target can instruction select the specified FP immediate natively.
virtual unsigned getNumRegistersForCallingConv(LLVMContext &Context, CallingConv::ID CC, EVT VT) const
Certain targets require unusual breakdowns of certain types.
CCState - This class holds information needed while lowering arguments and return values...
virtual bool shouldReduceLoadWidth(SDNode *Load, ISD::LoadExtType ExtTy, EVT NewVT) const
Return true if it is profitable to reduce a load to a smaller type.
SDValue LowerFP_TO_SINT(SDValue Op, SelectionDAG &DAG) const
static const fltSemantics & IEEEhalf() LLVM_READNONE
Returns platform specific canonical encoding of a floating point number.
Align max(MaybeAlign Lhs, Align Rhs)
bool isFAbsFree(EVT VT) const override
Return true if an fabs operation is free to the point where it is never worthwhile to replace it with...
EXTRACT_VECTOR_ELT(VECTOR, IDX) - Returns a single element from VECTOR identified by the (potentially...
EVT getVectorElementType() const
Given a vector type, return the type of each element.
unsigned getScalarSizeInBits() const LLVM_READONLY
If this is a vector type, return the getPrimitiveSizeInBits value for the element type...
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...
SDValue lowerUnhandledCall(CallLoweringInfo &CLI, SmallVectorImpl< SDValue > &InVals, StringRef Reason) const
Interface definition of the TargetLowering class that is common to all AMD GPUs.
SDValue getZExtOrTrunc(SDValue Op, const SDLoc &DL, EVT VT)
Convert Op, which must be of integer type, to the integer type VT, by either zero-extending or trunca...
Address space for local memory.
unsigned getExplicitKernelArgOffset(const Function &F) const
Returns the offset in bytes from the start of the input buffer of the first explicit kernel argument...
Calling convention used for Mesa/AMDPAL pixel shaders.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
SDValue getBuildVector(EVT VT, const SDLoc &DL, ArrayRef< SDValue > Ops)
Return an ISD::BUILD_VECTOR node.
bool SimplifyDemandedBits(SDValue Op, const APInt &DemandedBits, const APInt &DemandedElts, KnownBits &Known, TargetLoweringOpt &TLO, unsigned Depth=0, bool AssumeSingleUse=false) const
Look at Op.
const DebugLoc & getDebugLoc() const
SDValue LowerFTRUNC(SDValue Op, SelectionDAG &DAG) const
SDValue WidenVectorLoad(SDValue Op, SelectionDAG &DAG) const
Widen a vector load from vec3 to vec4.
unsigned getABITypeAlignment(Type *Ty) const
Returns the minimum ABI-required alignment for the specified type.
FMINNUM_IEEE/FMAXNUM_IEEE - Perform floating-point minimum or maximum on two values, following the IEEE-754 2008 definition.
Byte Swap and Counting operators.
FP16_TO_FP, FP_TO_FP16 - These operators are used to perform promotions and truncation for half-preci...
This is an abstract virtual class for memory operations.
int CreateFixedObject(uint64_t Size, int64_t SPOffset, bool IsImmutable, bool isAliased=false)
Create a new object at a fixed location on the stack.
bool isCalledByLegalizer() const
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
void setHasMultipleConditionRegisters(bool hasManyRegs=true)
Tells the code generator that the target has multiple (allocatable) condition registers that can be u...
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
void ExtractVectorElements(SDValue Op, SmallVectorImpl< SDValue > &Args, unsigned Start=0, unsigned Count=0)
Append the extracted elements from Start to Count out of the vector Op in Args.
Represents one node in the SelectionDAG.
SDValue getNOT(const SDLoc &DL, SDValue Val, EVT VT)
Create a bitwise NOT operation as (XOR Val, -1).
SDValue combineFMinMaxLegacy(const SDLoc &DL, EVT VT, SDValue LHS, SDValue RHS, SDValue True, SDValue False, SDValue CC, DAGCombinerInfo &DCI) const
Generate Min/Max node.
double BitsToDouble(uint64_t Bits)
This function takes a 64-bit integer and returns the bit equivalent double.
const Function & getFunction() const
Return the LLVM function that this machine code represents.
MVT getScalarType() const
If this is a vector, return the element type, otherwise return this.
KnownBits trunc(unsigned BitWidth) const
Truncate the underlying known Zero and One bits.
static mvt_range integer_valuetypes()
static bool allUsesHaveSourceMods(const SDNode *N, unsigned CostThreshold=4)
MachinePointerInfo getWithOffset(int64_t O) const
unsigned Log2_32(uint32_t Value)
Return the floor log base 2 of the specified value, -1 if the value is zero.
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
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...
EVT getMemoryVT() const
Return the type of the in-memory value.
SDValue performShlCombine(SDNode *N, DAGCombinerInfo &DCI) const
bool isTypeLegal(EVT VT) const
Return true if the target has native support for the specified value type.
Class for arbitrary precision integers.
SDValue getConstantFP(double Val, const SDLoc &DL, EVT VT, bool isTarget=false)
Create a ConstantFPSDNode wrapping a constant value.
bool ule(const APInt &RHS) const
Unsigned less or equal comparison.
iterator_range< use_iterator > uses()
amdgpu Simplify well known AMD library false FunctionCallee Callee
Select(COND, TRUEVAL, FALSEVAL).
static use_iterator use_end()
ZERO_EXTEND - Used for integer types, zeroing the new bits.
ANY_EXTEND - Used for integer types. The high bits are undefined.
static unsigned numBitsSigned(SDValue Op, SelectionDAG &DAG)
SDValue performIntrinsicWOChainCombine(SDNode *N, DAGCombinerInfo &DCI) const
SDValue expandUnalignedStore(StoreSDNode *ST, SelectionDAG &DAG) const
Expands an unaligned store to 2 half-size stores for integer values, and possibly more for vectors...
FCOPYSIGN(X, Y) - Return the value of X with the sign of Y.
static APInt getBitsSet(unsigned numBits, unsigned loBit, unsigned hiBit)
Get a value with a block of bits set.
static SDValue stripBitcast(SDValue Val)
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
static CCAssignFn * CCAssignFnForReturn(CallingConv::ID CC, bool IsVarArg)
bool isConstantValueOfAnyType(SDValue N)
BR_JT - Jumptable branch.
bool isLiveIn(unsigned Reg) const
Provides AMDGPU specific target descriptions.
SDValue LowerFNEARBYINT(SDValue Op, SelectionDAG &DAG) const
SDValue LowerFCEIL(SDValue Op, SelectionDAG &DAG) const
Represents a use of a SDNode.
void LowerUDIVREM64(SDValue Op, SelectionDAG &DAG, SmallVectorImpl< SDValue > &Results) const
bool hasInv2PiInlineImm() const
This class keeps track of the SPI_SP_INPUT_ADDR config register, which tells the hardware which inter...
Interface definition for SIInstrInfo.
uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
const MachinePointerInfo & getPointerInfo() const
bool isVector() const
Return true if this is a vector value type.
Bitwise operators - logical and, logical or, logical xor.
bool isNarrowingProfitable(EVT VT1, EVT VT2) const override
Return true if it's profitable to narrow operations of type VT1 to VT2.
SDValue getCopyFromReg(SDValue Chain, const SDLoc &dl, unsigned Reg, EVT VT)
SelectSupportKind
Enum that describes what type of support for selects the target has.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
static DebugLoc getDebugLoc(MachineBasicBlock::instr_iterator FirstMI, MachineBasicBlock::instr_iterator LastMI)
Return the first found DebugLoc that has a DILocation, given a range of instructions.
SDValue getLoHalf64(SDValue Op, SelectionDAG &DAG) const
SMUL_LOHI/UMUL_LOHI - Multiply two integers of type iN, producing a signed/unsigned value of type i[2...
SDValue LowerCTLZ_CTTZ(SDValue Op, SelectionDAG &DAG) const
SDValue performMulLoHi24Combine(SDNode *N, DAGCombinerInfo &DCI) const
SIGN_EXTEND_INREG - This operator atomically performs a SHL/SRA pair to sign extend a small value in ...
static CCValAssign getCustomMem(unsigned ValNo, MVT ValVT, unsigned Offset, MVT LocVT, LocInfo HTP)
LOAD and STORE have token chains as their first operand, then the same operands as an LLVM load/store...
virtual EVT getSetCCResultType(const DataLayout &DL, LLVMContext &Context, EVT VT) const
Return the ValueType of the result of SETCC operations.
SDValue splitBinaryBitConstantOpImpl(DAGCombinerInfo &DCI, const SDLoc &SL, unsigned Opc, SDValue LHS, uint32_t ValLo, uint32_t ValHi) const
Split the 64-bit value LHS into two 32-bit components, and perform the binary operation Opc to it wit...
Calling convention used for Mesa vertex shaders, or AMDPAL last shader stage before rasterization (ve...
Flags getFlags() const
Return the raw flags of the source value,.
The memory access always returns the same value (or traps).
bool isTruncateFree(EVT Src, EVT Dest) const override
AMDGPUTargetLowering(const TargetMachine &TM, const AMDGPUSubtarget &STI)
SDValue getShiftAmountConstant(uint64_t Val, EVT VT, const SDLoc &DL, bool LegalTypes=true)
#define NODE_NAME_CASE(node)
void setLibcallName(RTLIB::Libcall Call, const char *Name)
Rename the default libcall routine name for the specified libcall.
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
SDValue LowerSINT_TO_FP(SDValue Op, SelectionDAG &DAG) const
static bool isInv2Pi(const APFloat &APF)
unsigned getOpcode() const
SDValue getValue(unsigned R) const
unsigned MaxStoresPerMemcpy
Specify maximum number of store instructions per memcpy call.
static bool isNegativeOne(SDValue Val)
void diagnose(const DiagnosticInfo &DI)
Report a message to the currently installed diagnostic handler.
bool isFNegFree(EVT VT) const override
Return true if an fneg operation is free to the point where it is never worthwhile to replace it with...
SDValue getConstant(uint64_t Val, const SDLoc &DL, EVT VT, bool isTarget=false, bool isOpaque=false)
Create a ConstantSDNode wrapping a constant value.
void setSupportsUnalignedAtomics(bool UnalignedSupported)
Sets whether unaligned atomic operations are supported.
CONCAT_VECTORS(VECTOR0, VECTOR1, ...) - Given a number of values of vector type with the same length ...
bool MaskedValueIsZero(SDValue Op, const APInt &Mask, unsigned Depth=0) const
Return true if 'Op & Mask' is known to be zero.
SDValue performSraCombine(SDNode *N, DAGCombinerInfo &DCI) const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
SDValue getTruncStore(SDValue Chain, const SDLoc &dl, SDValue Val, SDValue Ptr, MachinePointerInfo PtrInfo, EVT SVT, unsigned Alignment=0, MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const AAMDNodes &AAInfo=AAMDNodes())
SDValue getFrameIndex(int FI, EVT VT, bool isTarget=false)
INLINEASM_BR - Terminator version of inline asm. Used by asm-goto.
TypeSize getScalarSizeInBits() const
static LLVM_READONLY bool opMustUseVOP3Encoding(const SDNode *N, MVT VT)
returns true if the operation will definitely need to use a 64-bit encoding, and thus will use a VOP3...
void setSchedulingPreference(Sched::Preference Pref)
Specify the target scheduling preference.
void print(raw_ostream &OS, const SelectionDAG *G=nullptr) const
constexpr uint32_t Hi_32(uint64_t Value)
Return the high 32 bits of a 64 bit value.
Module * getParent()
Get the module that this global value is contained inside of...
LLVM Value Representation.
FMA - Perform a * b + c with no intermediate rounding step.
SDValue getRegister(unsigned Reg, EVT VT)
Fast - This calling convention attempts to make calls as fast as possible (e.g.
bool hasInitializer() const
Definitions have initializers, declarations don't.
bool bitwiseIsEqual(const APFloat &RHS) const
EVT changeTypeToInteger()
Return the type converted to an equivalently sized integer or vector with integer element type...
bool isNullConstant(SDValue V)
Returns true if V is a constant integer zero.
SDValue getSelectCC(const SDLoc &DL, SDValue LHS, SDValue RHS, SDValue True, SDValue False, ISD::CondCode Cond)
Helper function to make it easier to build SelectCC's if you just have an ISD::CondCode instead of an...
SDValue getValueType(EVT)
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.
SDValue LowerFP64_TO_INT(SDValue Op, SelectionDAG &DAG, bool Signed) const
void ReplaceAllUsesOfValueWith(SDValue From, SDValue To)
Replace any uses of From with To, leaving uses of other values produced by From.getNode() alone...
static EVT getEquivalentMemType(LLVMContext &Context, EVT VT)
Primary interface to the complete machine description for the target machine.
unsigned countMinLeadingZeros() const
Returns the minimum number of leading zero bits.
static SDValue foldFreeOpFromSelect(TargetLowering::DAGCombinerInfo &DCI, SDValue N)
bool isZExtFree(Type *Src, Type *Dest) const override
Return true if any actual instruction that defines a value of type FromTy implicitly zero-extends the...
bool isLoadBitCastBeneficial(EVT, EVT, const SelectionDAG &DAG, const MachineMemOperand &MMO) const final
Return true if the following transform is beneficial: fold (conv (load x)) -> (load (conv*)x) On arch...
static MachinePointerInfo getStack(MachineFunction &MF, int64_t Offset, uint8_t ID=0)
Stack pointer relative access.
StringRef - Represent a constant reference to a string, i.e.
FMAD - Perform a * b + c, while getting the same result as the separately rounded operations...
bool isNonNegative() const
Returns true if this value is known to be non-negative.
SetCC operator - This evaluates to a true value iff the condition is true.
unsigned MaxStoresPerMemset
Specify maximum number of store instructions per memset call.
SDValue SplitVectorStore(SDValue Op, SelectionDAG &DAG) const
Split a vector store into 2 stores of half the vector.
KnownBits computeKnownBits(SDValue Op, unsigned Depth=0) const
Determine which bits of Op are known to be either zero or one and return them in Known.
const SDValue & getOperand(unsigned i) const
bool aggressivelyPreferBuildVectorSources(EVT VecVT) const override
uint64_t getZExtValue() const
TRUNCATE - Completely drop the high bits.
TypeSize getStoreSizeInBits() const
Return the number of bits overwritten by a store of the specified value type.
SDValue LowerFROUND(SDValue Op, SelectionDAG &DAG) const
AtomicExpansionKind shouldExpandAtomicRMWInIR(AtomicRMWInst *) const override
Returns how the IR-level AtomicExpand pass should expand the given AtomicRMW, if at all...
unsigned getLiveInVirtReg(unsigned PReg) const
getLiveInVirtReg - If PReg is a live-in physical register, return the corresponding live-in physical ...
bool ShouldShrinkFPConstant(EVT VT) const override
If true, then instruction selection should seek to shrink the FP constant of the specified type to a ...
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation...
Perform various unary floating-point operations inspired by libm.
Calling convention for AMDGPU code object kernels.
static EVT getIntegerVT(LLVMContext &Context, unsigned BitWidth)
Returns the EVT that represents an integer with the given number of bits.
EVT getTypeToTransformTo(LLVMContext &Context, EVT VT) const
For types supported by the target, this is an identity function.
MVT getVectorIdxTy(const DataLayout &) const override
Returns the type to be used for the index operand of: ISD::INSERT_VECTOR_ELT, ISD::EXTRACT_VECTOR_ELT...
bool isExtended() const
Test if the given EVT is extended (as opposed to being simple).
unsigned getWavefrontSizeLog2() const
LLVMContext * getContext() const
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
void setLowBits(unsigned loBits)
Set the bottom loBits bits.
SDValue getSqrtEstimate(SDValue Operand, SelectionDAG &DAG, int Enabled, int &RefinementSteps, bool &UseOneConstNR, bool Reciprocal) const override
Hooks for building estimates in place of slower divisions and square roots.
bool PredictableSelectIsExpensive
Tells the code generator that select is more expensive than a branch if the branch is usually predict...
EVT getShiftAmountTy(EVT LHSTy, const DataLayout &DL, bool LegalTypes=true) const
Address space for constant memory (VTX2).
Carry-using nodes for multiple precision addition and subtraction.
iterator_range< arg_iterator > args()
EVT getHalfSizedIntegerVT(LLVMContext &Context) const
Finds the smallest simple value type that is greater than or equal to half the width of this EVT...
Calling convention used for AMDPAL shader stage before geometry shader if geometry is in use...
uint64_t PowerOf2Ceil(uint64_t A)
Returns the power of two which is greater than or equal to the given value.
SDValue GetDemandedBits(SDValue V, const APInt &DemandedBits)
See if the specified operand can be simplified with the knowledge that only the bits specified by Dem...
void CommitTargetLoweringOpt(const TargetLoweringOpt &TLO)
SDValue performSelectCombine(SDNode *N, DAGCombinerInfo &DCI) const
SDValue LowerEXTRACT_SUBVECTOR(SDValue Op, SelectionDAG &DAG) const
bool isSelectSupported(SelectSupportKind) const override
MULHU/MULHS - Multiply high - Multiply two integers of type iN, producing an unsigned/signed value of...
This class is used to represent ISD::LOAD nodes.
DYNAMIC_STACKALLOC - Allocate some number of bytes on the stack aligned to a specified boundary...