16 #define AMDGPU_LOG2E_F 1.44269504088896340735992468100189214f 17 #define AMDGPU_LN2_F 0.693147180559945309417232121458176568f 18 #define AMDGPU_LN10_F 2.30258509299404568401799145468436421f 51 if (RegResult == AMDGPU::NoRegister)
69 return allocateCCRegs(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State,
70 &AMDGPU::SGPR_64RegClass, 20);
91 return allocateCCRegs(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State,
92 &AMDGPU::VReg_64RegClass, 31);
98 return allocateCCRegs(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State,
99 &AMDGPU::VReg_128RegClass, 29);
103 return allocateCCRegs(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State,
104 &AMDGPU::VReg_256RegClass, 25);
109 return allocateCCRegs(ValNo, ValVT, LocVT, LocInfo, ArgFlags, State,
110 &AMDGPU::VReg_512RegClass, 17);
118 #include "AMDGPUGenCallingConv.inc" 126 assert(StoreSize % 32 == 0 &&
"Store size not a multiple of 32");
346 for (
MVT VT : ScalarIntVTs) {
400 for (
MVT VT : VectorIntTypes) {
442 for (
MVT VT : FloatVectorTypes) {
485 for (
int I = 0;
I < RTLIB::UNKNOWN_LIBCALL; ++
I)
586 if (isa<MemSDNode>(N))
610 unsigned CostThreshold) {
616 unsigned NumMayIncreaseSize = 0;
625 if (++NumMayIncreaseSize > CostThreshold)
675 if (OldSize >= 32 && NewSize < 32 && MN->
getAlignment() >= 4 &&
678 (isa<LoadSDNode>(N) &&
690 return (OldSize < 32);
704 return (LScalarSize < CastScalarSize) ||
705 (CastScalarSize >= 32);
729 unsigned IntrID = cast<ConstantSDNode>(N->
getOperand(0))->getZExtValue();
794 return DestSize < SrcSize && DestSize % 32 == 0 ;
804 return SrcSize >= 32;
806 return DestSize < SrcSize && DestSize % 32 == 0;
814 return DestSize >= 32;
816 return SrcSize == 32 && DestSize == 64;
866 return CC_AMDGPU_Func;
885 return RetCC_SI_Shader;
889 return RetCC_AMDGPU_Func;
931 unsigned MaxAlign = 1;
932 uint64_t ExplicitArgOffset = 0;
935 unsigned InIndex = 0;
940 MaxAlign =
std::max(Align, MaxAlign);
943 uint64_t ArgOffset =
alignTo(ExplicitArgOffset, Align) + ExplicitOffset;
944 ExplicitArgOffset =
alignTo(ExplicitArgOffset, Align) + AllocSize;
957 for (
unsigned Value = 0, NumValues = ValueVTs.
size();
959 uint64_t BasePartOffset = Offsets[
Value];
998 assert(MemoryBits % NumElements == 0);
1002 MemoryBits / NumElements);
1019 unsigned PartOffset = 0;
1020 for (
unsigned i = 0; i != NumRegs; ++i) {
1022 BasePartOffset + PartOffset,
1061 int ClobberedFI)
const {
1064 int64_t LastByte = FirstByte + MFI.
getObjectSize(ClobberedFI) - 1;
1075 if (
LoadSDNode *L = dyn_cast<LoadSDNode>(*U)) {
1077 if (FI->getIndex() < 0) {
1079 int64_t InLastByte = InFirstByte;
1082 if ((InFirstByte <= FirstByte && FirstByte <= InLastByte) ||
1083 (FirstByte <= InFirstByte && InFirstByte <= LastByte))
1105 FuncName =
G->getSymbol();
1107 FuncName =
G->getGlobal()->getName();
1114 for (
unsigned I = 0,
E = CLI.
Ins.size();
I !=
E; ++
I)
1143 "instruction is not implemented yet!");
1216 Fn,
"local memory global used by non-kernel function",
SDLoc(Op).
getDebugLoc());
1222 "Do not know what to do with an non-zero offset");
1262 unsigned Start = cast<ConstantSDNode>(Op.
getOperand(1))->getZExtValue();
1276 if (!(LHS == True && RHS == False) && !(LHS == False && RHS == True))
1344 std::pair<SDValue, SDValue>
1356 return std::make_pair(Lo, Hi);
1383 if (VT.getVectorNumElements() == 2)
1393 EVT LoMemVT, HiMemVT;
1398 std::tie(Lo, Hi) = DAG.
SplitVector(Op, SL, LoVT, HiVT);
1402 unsigned HiAlign =
MinAlign(BaseAlign, Size);
1405 Load->
getChain(), BasePtr, SrcValue, LoMemVT,
1410 HiPtr, SrcValue.getWithOffset(LoMemVT.getStoreSize()),
1426 EVT VT = Val.getValueType();
1439 EVT LoMemVT, HiMemVT;
1444 std::tie(Lo, Hi) = DAG.
SplitVector(Val, SL, LoVT, HiVT);
1451 unsigned HiAlign =
MinAlign(BaseAlign, Size);
1454 DAG.
getTruncStore(Chain, SL, Lo, BasePtr, SrcValue, LoMemVT, BaseAlign,
1476 if (LHSSignBits < 9)
1480 if (RHSSignBits < 9)
1484 unsigned SignBits = std::min(LHSSignBits, RHSSignBits);
1485 unsigned DivBits = BitSize - SignBits;
1753 for (
unsigned i = 0; i < halfBitWidth; ++i) {
1754 const unsigned bitPos = halfBitWidth - i - 1;
2000 const unsigned FractBits = 52;
2001 const unsigned ExpBits = 11;
2030 const unsigned FractBits = 52;
2225 double Log2BaseInverted)
const {
2233 return DAG.
getNode(
ISD::FMUL, SL, VT, Log2Operand, Log2BaseInvertedOperand);
2240 return DAG.
getConstantFP(1.44269504088896340735992468100189214f, SL, VT);
2278 unsigned ISDOpc, NewOpc;
2340 SrcIsZero, Bits32, NewOpr);
2457 "operation should be legal");
2484 "operation should be legal");
2553 const unsigned ExpMask = 0x7ff;
2554 const unsigned ExpBiasf64 = 1023;
2555 const unsigned ExpBiasf16 = 15;
2699 for (
unsigned I = 0;
I < NElts; ++
I)
2733 if (DemandedLHS || DemandedRHS)
2735 DemandedLHS ? DemandedLHS : LHS,
2736 DemandedRHS ? DemandedRHS : RHS);
2749 template <
typename IntTy>
2752 if (Width + Offset < 32) {
2754 IntTy Result =
static_cast<IntTy
>(Shl) >> (32 - Width);
2763 if (
MemSDNode *M = dyn_cast<MemSDNode>(U)) {
2764 if (M->isVolatile())
2782 if ((Size == 1 || Size == 2 || Size == 4) && !VT.
isVector())
2785 if (Size == 3 || (Size > 4 && (Size % 4 != 0)))
2909 EVT ExtVT = cast<VTSDNode>(N1)->getVT();
2914 if (SrcVT.
bitsGE(ExtVT)) {
3227 Mul =
getMul24(DAG, DL, N0, N1, Size,
false);
3231 Mul =
getMul24(DAG, DL, N0, N1, Size,
true);
3314 return C->isAllOnesValue();
3321 unsigned Opc)
const {
3365 return getFFBX_U32(DAG, CmpLHS, SL, Opc);
3374 return getFFBX_U32(DAG, CmpLHS, SL, Opc);
3392 return DAG.
getNode(Op, SL, VT, NewSelect);
3413 SDLoc(N), Cond, LHS, RHS);
3432 bool ShouldFoldNeg =
true;
3437 ShouldFoldNeg =
false;
3439 ShouldFoldNeg =
false;
3442 if (ShouldFoldNeg) {
3452 Cond, NewLHS, NewRHS);
3524 if (
C->isZero() && !
C->isNegative())
3677 for (
unsigned I = 0;
I < 3; ++
I)
3777 const APFloat &Val = CFP->getValueAPF();
3830 uint64_t CVal =
C->getZExtValue();
3839 const APInt &Val =
C->getValueAPF().bitcastToAPInt();
3897 "Vector handling of BFE not implemented");
3902 uint32_t WidthVal = Width->getZExtValue() & 0x1f;
3915 if (OffsetVal == 0) {
3917 unsigned SignBits = Signed ? (32 - WidthVal + 1) : (32 - WidthVal);
3920 if (OpSignBits >= SignBits)
3940 return constantFoldBFE<int32_t>(DAG,
3941 CVal->getSExtValue(),
3947 return constantFoldBFE<uint32_t>(DAG,
3948 CVal->getZExtValue(),
3954 if ((OffsetVal + WidthVal) >= 32 &&
3955 !(Subtarget->
hasSDWA() && OffsetVal == 16 && WidthVal == 16)) {
3958 BitsFrom, ShiftVal);
3964 OffsetVal + WidthVal);
3970 if (TLI.ShrinkDemandedConstant(BitsFrom, Demanded, TLO) ||
3971 TLI.SimplifyDemandedBits(BitsFrom, Demanded, Known, TLO)) {
4000 bool RawReg)
const {
4052 assert(Arg &&
"Attempting to load missing argument");
4065 unsigned Alignment = ST.getAlignmentForImplicitArgPtr();
4072 return ArgOffset + 4;
4077 #define NODE_NAME_CASE(node) case AMDGPUISD::node: return #node; 4228 int &RefinementSteps,
4229 bool &UseOneConstNR,
4230 bool Reciprocal)
const {
4234 RefinementSteps = 0;
4246 int &RefinementSteps)
const {
4255 RefinementSteps = 0;
4312 LHSKnown = LHSKnown.
trunc(24);
4313 RHSKnown = RHSKnown.
trunc(24);
4315 bool Negative =
false;
4319 unsigned MaxValBits = std::min(LHSValBits + RHSValBits, 32u);
4320 if (MaxValBits >= 32)
4326 if ((!LHSNegative && !LHSPositive) || (!RHSNegative && !RHSPositive))
4328 Negative = (LHSNegative && RHSPositive) || (LHSPositive && RHSNegative);
4336 unsigned MaxValBits = std::min(LHSValBits + RHSValBits, 32u);
4337 if (MaxValBits >= 32)
4352 for (
unsigned I = 0;
I < 32;
I += 8) {
4353 unsigned SelBits = Sel & 0xff;
4358 }
else if (SelBits < 7) {
4359 SelBits = (SelBits & 3) * 8;
4362 }
else if (SelBits == 0x0c) {
4363 Known.
Zero |= 0xff <<
I;
4364 }
else if (SelBits > 0x0c) {
4365 Known.
One |= 0xff <<
I;
4372 unsigned IID = cast<ConstantSDNode>(Op.
getOperand(0))->getZExtValue();
4392 unsigned Depth)
const {
4405 return std::max(SignBits, Op0SignBits);
4410 return Width ? 32 - (Width->
getZExtValue() & 0x1f) : 1;
4427 unsigned Depth)
const {
4491 unsigned IntrinsicID
4492 = cast<ConstantSDNode>(Op.
getOperand(0))->getZExtValue();
4494 switch (IntrinsicID) {
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. ...
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
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.
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
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
C - The default llvm calling convention, compatible with C.
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.
GCNRegPressure max(const GCNRegPressure &P1, const GCNRegPressure &P2)
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.
unsigned getAddrSpace() const
Diagnostic information for unsupported feature in backend.
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 getSetCC(const SDLoc &DL, EVT VT, SDValue LHS, SDValue RHS, ISD::CondCode Cond)
Helper function to make it easier to build SetCC's if you just have an ISD::CondCode instead of an SD...
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
SDValue LowerFLOG(SDValue Op, SelectionDAG &DAG, double Log2BaseInverted) const
static bool allocateVGPRTuple(unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, CCState &State)
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 ...
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.
iterator begin() const
begin/end - Return all of the registers in this class.
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
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 CCAssignFn * CCAssignFnForReturn(CallingConv::ID CC, bool IsVarArg)
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.
static SDValue getLog2EVal(SelectionDAG &DAG, const SDLoc &SL, EVT VT)
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...
Address space for 32-bit constant memory.
unsigned getVectorNumElements() const
const SDValue & getChain() const
Function Alias Analysis Results
unsigned getAlignment() const
static CCAssignFn * CCAssignFnForCall(CallingConv::ID CC, bool IsVarArg)
void setBooleanVectorContents(BooleanContent Ty)
Specify how the target extends the result of a vector boolean value from a vector of i1 to a wider ty...
bool isInteger() const
Return true if this is an integer or a vector integer type.
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
uint64_t alignTo(uint64_t Value, uint64_t Align, uint64_t Skew=0)
Returns the next integer (mod 2**64) that is greater than or equal to Value and is a multiple of Alig...
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
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.
unsigned getBitWidth() const
Get the bit width of this value.
SDValue LowerSIGN_EXTEND_INREG(SDValue Op, SelectionDAG &DAG) const
uint64_t getExplicitKernArgSize() const
unsigned getValueSizeInBits() const
Returns the size of the value in bits.
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
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...
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...
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")
Calling convention used for Mesa/AMDPAL geometry shaders.
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
Pointer to the start of the shader's constant data.
Address space for constant memory (VTX2)
Calling convention used for Mesa/AMDPAL compute shaders.
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
ArrayRef< T > makeArrayRef(const T &OneElt)
Construct an ArrayRef from a single element.
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
SPIR_KERNEL - Calling convention for SPIR kernel functions.
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 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.
unsigned getStoreSize() const
Return the number of bytes overwritten by a store of the specified value type.
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...
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...
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...
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...
static bool allocateCCRegs(unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, CCState &State, const TargetRegisterClass *RC, unsigned NumRegs)
Fast - This calling convention attempts to make calls as fast as possible (e.g.
unsigned getScalarSizeInBits() const
Calling convention used for AMDPAL shader stage before geometry shader if geometry is in use...
unsigned getSizeInBits() const
Return the size of the specified value type in bits.
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.
Type * getType() const
All values are typed, get the type of this value.
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)
uint32_t getImplicitParameterOffset(const MachineFunction &MF, const ImplicitParameter Param) const
Helper function that returns the byte offset of the given type of implicit parameter.
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.
static mvt_range integer_vector_valuetypes()
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
amdgpu Simplify well known AMD library false Value * Callee
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.
Calling convention used for Mesa vertex shaders, or AMDPAL last shader stage before rasterization (ve...
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 GetDemandedBits(SDValue V, const APInt &Mask)
See if the specified operand can be simplified with the knowledge that only the bits specified by Mas...
std::pair< EVT, EVT > GetSplitDestVTs(const EVT &VT) const
Compute the VTs needed for the low/hi parts of a type which is split (or expanded) into two not neces...
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)
static CCValAssign getReg(unsigned ValNo, MVT ValVT, unsigned RegNo, MVT LocVT, LocInfo HTP)
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.
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.
SDValue LowerFROUND32_16(SDValue Op, SelectionDAG &DAG) const
bool hasFP32Denormals() const
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).
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
bool has16BitInsts() const
static unsigned inverseMinMax(unsigned Opc)
static bool isUniformMMO(const MachineMemOperand *MMO)
void setBooleanContents(BooleanContent Ty)
Specify how the target extends the result of integer and floating point boolean values from i1 to a w...
static bool hasDefinedInitializer(const GlobalValue *GV)
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
This class provides iterator support for SDUse operands that use a specific SDNode.
Address space for local memory.
bool isConstant() const
Returns true if we know the value of all bits.
KnownBits trunc(unsigned BitWidth)
Truncate the underlying known Zero and One bits.
Calling convention used for AMDPAL vertex shader if tessellation is in use.
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.
TRAP - Trapping instruction.
static bool allocateSGPRTuple(unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, CCState &State)
AssertSext, AssertZext - These nodes record if a register contains a value that has already been zero...
bool isLoadBitCastBeneficial(EVT, EVT) const final
Return true if the following transform is beneficial: fold (conv (load x)) -> (load (conv*)x) On arch...
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 bytes 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.
Address space for global memory (RAT0, VTX0).
Calling convention used for Mesa/AMDPAL pixel shaders.
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.
bool isFPImmLegal(const APFloat &Imm, EVT VT) const override
Returns true if the target can instruction select the specified FP immediate natively.
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)
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
unsigned getStoreSizeInBits() const
Return the number of bits overwritten by a store of the specified value type.
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...
SDValue scalarizeVectorLoad(LoadSDNode *LD, SelectionDAG &DAG) const
Turn load of vector type into a load of the individual elements.
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.
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...
virtual bool allowsMisalignedMemoryAccesses(EVT, unsigned AddrSpace=0, unsigned Align=1, bool *=nullptr) const
Determine if the target supports unaligned memory accesses.
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.
std::pair< SDValue, SDValue > SplitVector(const SDValue &N, const SDLoc &DL, const EVT &LoVT, const EVT &HiVT)
Split the vector with EXTRACT_SUBVECTOR using the provides VTs and return the low/high part...
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...
unsigned getExplicitKernelArgOffset(const Function &F) const
Returns the offset in bytes from the start of the input buffer of the first explicit kernel argument...
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
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.
CondCode getSetCCInverse(CondCode Operation, bool isInteger)
Return the operation corresponding to !(X op Y), where 'op' is a valid SetCC operation.
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.
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()
Select(COND, TRUEVAL, FALSEVAL).
Interface for the AMDGPU Implementation of the Intrinsic Info class.
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 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.
amdgpu Simplify well known AMD library false Value Value * Arg
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)
uint64_t getTypeAllocSize(Type *Ty) const
Returns the offset in bytes between successive objects of the specified type, including alignment pad...
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
Interface definition for SIInstrInfo.
ConstantSDNode * isConstOrConstSplat(SDValue N, bool AllowUndefs=false)
Returns the SDNode if it is a constant splat BuildVector or constant int.
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)
Calling convention used for Mesa/AMDPAL hull shaders (= tessellation control shaders).
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...
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)
#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 bytes 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.
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.
unsigned getRegister() const
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)
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)
Address space for region memory. (GDS)
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...
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.
SDValue getObjectPtrOffset(const SDLoc &SL, SDValue Op, int64_t Offset)
Create an add instruction with appropriate flags when used for addressing some offset of an object...
SDValue LowerFROUND(SDValue Op, SelectionDAG &DAG) const
unsigned AllocateReg(unsigned Reg)
AllocateReg - Attempt to allocate one register.
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.
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).
Calling convention for AMDGPU code object kernels.
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
unsigned createVirtualRegister(const TargetRegisterClass *RegClass, StringRef Name="")
createVirtualRegister - Create and return a new virtual register in the function with the specified r...
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...
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...