18#ifndef LLVM_CODEGEN_SELECTIONDAGNODES_H
19#define LLVM_CODEGEN_SELECTIONDAGNODES_H
63class MachineBasicBlock;
64class MachineConstantPoolValue;
97 bool BuildVectorOnly =
false);
103 bool BuildVectorOnly =
false);
167 return Node == O.Node && ResNo == O.ResNo;
173 return std::tie(
Node, ResNo) < std::tie(O.Node, O.ResNo);
175 explicit operator bool()
const {
176 return Node !=
nullptr;
219 inline void dump()
const;
221 inline void dumpr()
const;
230 unsigned Depth = 2)
const;
253 return ((
unsigned)((uintptr_t)Val.
getNode() >> 4) ^
291 SDUse **Prev =
nullptr;
292 SDUse *Next =
nullptr;
300 operator const SDValue&()
const {
return Val; }
345 inline void set(
const SDValue &V);
348 inline void setInitial(
const SDValue &V);
351 inline void setNode(
SDNode *
N);
355 if (Next) Next->Prev = &Next;
360 void removeFromList() {
362 if (Next) Next->Prev = Prev;
381 bool NoUnsignedWrap : 1;
382 bool NoSignedWrap : 1;
388 bool NoSignedZeros : 1;
389 bool AllowReciprocal : 1;
390 bool AllowContract : 1;
391 bool ApproximateFuncs : 1;
392 bool AllowReassociation : 1;
401 bool Unpredictable : 1;
410 Unpredictable(
false) {}
456 return NoUnsignedWrap ==
Other.NoUnsignedWrap &&
457 NoSignedWrap ==
Other.NoSignedWrap && Exact ==
Other.Exact &&
458 Disjoint ==
Other.Disjoint && NonNeg ==
Other.NonNeg &&
459 NoNaNs ==
Other.NoNaNs && NoInfs ==
Other.NoInfs &&
460 NoSignedZeros ==
Other.NoSignedZeros &&
461 AllowReciprocal ==
Other.AllowReciprocal &&
462 AllowContract ==
Other.AllowContract &&
463 ApproximateFuncs ==
Other.ApproximateFuncs &&
464 AllowReassociation ==
Other.AllowReassociation &&
465 NoFPExcept ==
Other.NoFPExcept &&
466 Unpredictable ==
Other.Unpredictable;
472 NoUnsignedWrap &= Flags.NoUnsignedWrap;
473 NoSignedWrap &= Flags.NoSignedWrap;
474 Exact &= Flags.Exact;
475 Disjoint &= Flags.Disjoint;
476 NonNeg &= Flags.NonNeg;
477 NoNaNs &= Flags.NoNaNs;
478 NoInfs &= Flags.NoInfs;
479 NoSignedZeros &= Flags.NoSignedZeros;
480 AllowReciprocal &= Flags.AllowReciprocal;
481 AllowContract &= Flags.AllowContract;
482 ApproximateFuncs &= Flags.ApproximateFuncs;
483 AllowReassociation &= Flags.AllowReassociation;
484 NoFPExcept &= Flags.NoFPExcept;
485 Unpredictable &= Flags.Unpredictable;
503#if defined(_AIX) && (!defined(__GNUC__) || defined(__clang__))
506#define BEGIN_TWO_BYTE_PACK() _Pragma("pack(2)")
507#define END_TWO_BYTE_PACK() _Pragma("pack(pop)")
509#define BEGIN_TWO_BYTE_PACK()
510#define END_TWO_BYTE_PACK()
610#undef BEGIN_TWO_BYTE_PACK
611#undef END_TWO_BYTE_PACK
616 static_assert(
sizeof(SDNodeBitfields) <= 2,
"field too wide");
617 static_assert(
sizeof(ConstantSDNodeBitfields) <= 2,
"field too wide");
618 static_assert(
sizeof(MemSDNodeBitfields) <= 2,
"field too wide");
619 static_assert(
sizeof(LSBaseSDNodeBitfields) <= 2,
"field too wide");
620 static_assert(
sizeof(LoadSDNodeBitfields) <= 2,
"field too wide");
621 static_assert(
sizeof(StoreSDNodeBitfields) <= 2,
"field too wide");
640 SDUse *OperandList =
nullptr;
644 const EVT *ValueList;
647 SDUse *UseList =
nullptr;
650 unsigned short NumOperands = 0;
651 unsigned short NumValues;
664 static const EVT *getValueTypeList(
EVT VT);
669 int CombinerWorklistIndex = -1;
682 unsigned getOpcode()
const {
return (
unsigned)NodeType; }
727#define DAG_INSTRUCTION(NAME, NARG, ROUND_MODE, INTRINSIC, DAGN) \
728 case ISD::STRICT_##DAGN:
729#include "llvm/IR/ConstrainedOps.def"
819 assert(
Op &&
"Cannot increment end iterator!");
830 assert(
Op &&
"Cannot dereference end iterator!");
831 return Op->getUser();
840 assert(
Op &&
"Cannot dereference end iterator!");
841 return (
unsigned)(
Op -
Op->getUser()->OperandList);
877 return N->hasPredecessor(
this);
898 unsigned int MaxSteps = 0,
899 bool TopologicalPrune =
false) {
915 int NId =
N->getNodeId();
921 while (!Worklist.
empty()) {
923 int MId = M->getNodeId();
925 (MId > 0) && (MId < NId)) {
929 for (
const SDValue &OpV : M->op_values()) {
938 if (MaxSteps != 0 && Visited.
size() >= MaxSteps)
944 if (MaxSteps != 0 && Visited.
size() >= MaxSteps)
958 return std::numeric_limits<
decltype(SDNode::NumOperands)>
::max();
974 assert(Num < NumOperands &&
"Invalid child # of SDNode!");
975 return OperandList[Num];
987 std::random_access_iterator_tag, SDValue,
988 ptrdiff_t, value_op_iterator *,
989 value_op_iterator *> {
1019 if (UI.getUse().get().getValueType() == MVT::Glue)
1033 return Flags.hasNoUnsignedWrap() || Flags.hasNoSignedWrap() ||
1034 Flags.hasExact() || Flags.hasDisjoint() || Flags.hasNonNeg() ||
1035 Flags.hasNoNaNs() || Flags.hasNoInfs();
1046 assert(ResNo < NumValues &&
"Illegal result number!");
1047 return ValueList[ResNo];
1095 unsigned depth = 100)
const;
1125 unsigned depth = 100)
const;
1135 SDVTList Ret = { getValueTypeList(VT), 1 };
1144 : NodeType(Opc), ValueList(VTs.VTs), NumValues(VTs.NumVTs),
1145 IROrder(Order), debugLoc(
std::
move(dl)) {
1149 "NumValues wasn't wide enough for its operands!");
1175 assert(Order >= 0 &&
"bad IROrder");
1177 DL =
I->getDebugLoc();
1187 :
Node(node), ResNo(resno) {
1191 assert((!
Node || !ResNo || ResNo < Node->getNumValues()) &&
1192 "Invalid result number for the given node!");
1193 assert(ResNo < -2U &&
"Cannot use result numbers reserved for DenseMaps.");
1197 return Node->getOpcode();
1201 return Node->getValueType(ResNo);
1205 return Node->getNumOperands();
1209 return Node->getOperand(i);
1213 return Node->getConstantOperandVal(i);
1217 return Node->getConstantOperandAPInt(i);
1221 return Node->isTargetOpcode();
1225 return Node->isTargetMemoryOpcode();
1229 return Node->isMachineOpcode();
1233 return Node->getMachineOpcode();
1237 return Node->isUndef();
1241 return !
Node->hasAnyUseOfValue(ResNo);
1245 return Node->hasNUsesOfValue(1, ResNo);
1249 return Node->getDebugLoc();
1261 return Node->dumpr();
1265 return Node->dumpr(
G);
1270inline void SDUse::set(
const SDValue &V) {
1271 if (Val.
getNode()) removeFromList();
1277inline void SDUse::setInitial(
const SDValue &V) {
1282inline void SDUse::setNode(SDNode *
N) {
1283 if (Val.
getNode()) removeFromList();
1285 if (
N)
N->addUse(*
this);
1318 unsigned SrcAddrSpace;
1319 unsigned DestAddrSpace;
1323 unsigned SrcAS,
unsigned DestAS)
1324 :
SDNode(ISD::ADDRSPACECAST, Order, dl, VTs), SrcAddrSpace(SrcAS),
1325 DestAddrSpace(DestAS) {}
1447 case ISD::VP_SCATTER:
1448 case ISD::EXPERIMENTAL_VP_STRIDED_STORE:
1463 switch (
N->getOpcode()) {
1495 case ISD::VP_GATHER:
1496 case ISD::VP_SCATTER:
1497 case ISD::EXPERIMENTAL_VP_STRIDED_LOAD:
1498 case ISD::EXPERIMENTAL_VP_STRIDED_STORE:
1504 return N->isMemIntrinsic() ||
N->isTargetMemoryOpcode();
1516 MMO->
isAtomic()) &&
"then why are we using an AtomicSDNode?");
1594 return N->isMemIntrinsic() ||
1596 N->isTargetMemoryOpcode();
1618 :
SDNode(ISD::VECTOR_SHUFFLE, Order, dl, VTs), Mask(M) {}
1634 assert(
isSplat() &&
"Cannot get splat index for non-splat!");
1650 unsigned NumElems = Mask.size();
1651 for (
unsigned i = 0; i != NumElems; ++i) {
1655 else if (idx < (
int)NumElems)
1656 Mask[i] = idx + NumElems;
1658 Mask[i] = idx - NumElems;
1686 return Value->getLimitedValue(Limit);
1706 return cast<ConstantSDNode>(
getOperand(Num))->getZExtValue();
1710 return cast<ConstantSDNode>(
this)->getZExtValue();
1714 return cast<ConstantSDNode>(
getOperand(Num))->getAPIntValue();
1718 return cast<ConstantSDNode>(
this)->getAPIntValue();
1756 return Value->getValueAPF().isExactlyValue(V);
1790 unsigned OperandNo);
1819 bool AllowTruncation =
false);
1824 bool AllowUndefs =
false,
1825 bool AllowTruncation =
false);
1833 bool AllowUndefs =
false);
1853 return isa<ConstantSDNode>(V) || isa<ConstantFPSDNode>(V);
1861 unsigned TargetFlags;
1866 :
SDNode(Opc, Order,
DL, VTs), TheGlobal(GA),
Offset(o), TargetFlags(TF) {
1890 :
SDNode(isTarg ? ISD::TargetFrameIndex : ISD::FrameIndex, 0,
DebugLoc(),
1915 return cast<FrameIndexSDNode>(
getOperand(1))->getIndex();
1965 unsigned TargetFlags;
1968 :
SDNode(isTarg ? ISD::TargetJumpTable : ISD::JumpTable, 0,
DebugLoc(),
1970 JTI(jti), TargetFlags(TF) {}
1991 unsigned TargetFlags;
1994 Align Alignment,
unsigned TF)
1997 Offset(o), Alignment(Alignment), TargetFlags(TF) {
1998 assert(Offset >= 0 &&
"Offset is too large");
2002 ConstantPoolSDNode(
bool isTarget, MachineConstantPoolValue *v, SDVTList VTs,
2003 int o, Align Alignment,
unsigned TF)
2004 : SDNode(isTarget ? ISD::TargetConstantPool : ISD::ConstantPool, 0,
2006 Offset(o), Alignment(Alignment), TargetFlags(TF) {
2007 assert(Offset >= 0 &&
"Offset is too large");
2008 Val.MachineCPVal = v;
2009 Offset |= 1 << (
sizeof(
unsigned)*CHAR_BIT-1);
2019 return Val.ConstVal;
2024 return Val.MachineCPVal;
2028 return Offset & ~(1 << (
sizeof(
unsigned)*CHAR_BIT-1));
2048 unsigned TargetFlags;
2102 unsigned &SplatBitSize,
bool &HasAnyUndefs,
2103 unsigned MinSplatBits = 0,
2113 BitVector *UndefElements =
nullptr)
const;
2134 BitVector *UndefElements =
nullptr)
const;
2146 BitVector *UndefElements =
nullptr)
const;
2156 BitVector *UndefElements =
nullptr)
const;
2174 BitVector *UndefElements =
nullptr)
const;
2210 static void recastRawBits(
bool IsLittleEndian,
unsigned DstEltSizeInBits,
2299 unsigned TargetFlags;
2302 int64_t o,
unsigned Flags)
2304 TargetFlags(Flags) {}
2340 unsigned TargetFlags;
2344 :
SDNode(isTarget ? ISD::TargetExternalSymbol : ISD::ExternalSymbol, 0,
2346 Symbol(
Sym), TargetFlags(TF) {}
2452 assert(
readMem() &&
"Load MachineMemOperand is not a load!");
2542 case ISD::EXPERIMENTAL_VP_STRIDED_LOAD:
2544 case ISD::EXPERIMENTAL_VP_STRIDED_STORE:
2555 case ISD::EXPERIMENTAL_VP_STRIDED_LOAD:
2557 case ISD::EXPERIMENTAL_VP_STRIDED_STORE:
2575 return N->getOpcode() == ISD::EXPERIMENTAL_VP_STRIDED_LOAD ||
2576 N->getOpcode() == ISD::EXPERIMENTAL_VP_STRIDED_STORE ||
2577 N->getOpcode() == ISD::VP_LOAD ||
N->getOpcode() == ISD::VP_STORE;
2604 return N->getOpcode() == ISD::VP_LOAD;
2634 return N->getOpcode() == ISD::EXPERIMENTAL_VP_STRIDED_LOAD;
2670 return N->getOpcode() == ISD::VP_STORE;
2683 VTs, AM, MemVT,
MMO) {
2707 return N->getOpcode() == ISD::EXPERIMENTAL_VP_STRIDED_STORE;
2836 return !cast<ConstantSDNode>(
getScale())->isOne();
2861 return N->getOpcode() == ISD::VP_GATHER ||
2862 N->getOpcode() == ISD::VP_SCATTER;
2878 return N->getOpcode() == ISD::VP_GATHER;
2896 return N->getOpcode() == ISD::VP_SCATTER;
2920 return !cast<ConstantSDNode>(
getScale())->isOne();
2997 :
MemSDNode(ISD::EXPERIMENTAL_VECTOR_HISTOGRAM, Order,
DL, VTs, MemVT,
3026 "Expected FP state access node");
3076 if (NumMemRefs == 0)
3078 if (NumMemRefs == 1)
3082 return ArrayRef(cast<MachineMemOperand **>(MemRefs), NumMemRefs);
3095 return N->isMachineOpcode();
3106 :
SDNode(ISD::AssertAlign, Order,
DL, VTs), Alignment(
A) {}
3129 return Operand == x.Operand;
3134 return Node->getOperand(Operand).getNode();
3147 "Cannot compare iterators of two different nodes!");
3148 return Operand -
Other.Operand;
3191 auto *Ld = dyn_cast<LoadSDNode>(
N);
3198 auto *Ld = dyn_cast<LoadSDNode>(
N);
3204 auto *Ld = dyn_cast<LoadSDNode>(
N);
3210 auto *Ld = dyn_cast<LoadSDNode>(
N);
3216 auto *Ld = dyn_cast<LoadSDNode>(
N);
3222 auto *Ld = dyn_cast<LoadSDNode>(
N);
3229 auto *St = dyn_cast<StoreSDNode>(
N);
3230 return St && !St->isTruncatingStore() &&
3236 auto *St = dyn_cast<StoreSDNode>(
N);
3243 template <
typename ConstNodeType>
3245 std::function<
bool(ConstNodeType *)>
Match,
3246 bool AllowUndefs =
false);
3251 bool AllowUndefs =
false) {
3252 return matchUnaryPredicateImpl<ConstantSDNode>(
Op,
Match, AllowUndefs);
3259 bool AllowUndefs =
false) {
3260 return matchUnaryPredicateImpl<ConstantFPSDNode>(
Op,
Match, AllowUndefs);
3270 bool AllowUndefs =
false,
bool AllowTypeMismatch =
false);
3275 unsigned Opc =
Op.getOpcode();
3276 return (
Op.getResNo() == 1 &&
static msgpack::DocNode getNode(msgpack::DocNode DN, msgpack::Type Type, MCValue Val)
This file declares a class to represent arbitrary precision floating point values and provide a varie...
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Atomic ordering constants.
This file implements the BitVector class.
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static std::optional< bool > isBigEndian(const SmallDenseMap< int64_t, int64_t, 8 > &MemOffset2Idx, int64_t LowestIdx)
Given a map from byte offsets in memory to indices in a load/store, determine if that map corresponds...
This file contains the declarations for the subclasses of Constant, which represent the different fla...
Returns the sub type a function will return at a given Idx Should correspond to the result type of an ExtractValue instruction executed with just that one unsigned Idx
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
This file defines a hash set that can be used to remove duplication of nodes in a graph.
This file defines the little GraphTraits<X> template class that should be specialized by classes that...
const SmallVectorImpl< MachineOperand > & Cond
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
#define END_TWO_BYTE_PACK()
#define BEGIN_TWO_BYTE_PACK()
This file defines the SmallPtrSet class.
This file defines the SmallVector class.
DEMANGLE_DUMP_METHOD void dump() const
Class for arbitrary precision integers.
unsigned getSrcAddressSpace() const
AddrSpaceCastSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs, unsigned SrcAS, unsigned DestAS)
unsigned getDestAddressSpace() const
static bool classof(const SDNode *N)
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
An SDNode that records if a register contains a value that is guaranteed to be aligned accordingly.
static bool classof(const SDNode *N)
AssertAlignSDNode(unsigned Order, const DebugLoc &DL, SDVTList VTs, Align A)
This is an SDNode representing atomic operations.
void setExtensionType(ISD::LoadExtType ETy)
static bool classof(const SDNode *N)
const SDValue & getBasePtr() const
ISD::LoadExtType getExtensionType() const
AtomicSDNode(unsigned Opc, unsigned Order, const DebugLoc &dl, SDVTList VTL, EVT MemVT, MachineMemOperand *MMO)
AtomicOrdering getFailureOrdering() const
For cmpxchg atomic operations, return the atomic ordering requirements when store does not occur.
bool isCompareAndSwap() const
Returns true if this SDNode represents cmpxchg atomic operation, false otherwise.
const SDValue & getVal() const
MachineBasicBlock * getBasicBlock() const
static bool classof(const SDNode *N)
LLVM Basic Block Representation.
static bool classof(const SDNode *N)
int64_t getOffset() const
unsigned getTargetFlags() const
const BlockAddress * getBlockAddress() const
The address of a basic block.
A "pseudo-class" with methods for operating on BUILD_VECTORs.
BuildVectorSDNode()=delete
bool getConstantRawBits(bool IsLittleEndian, unsigned DstEltSizeInBits, SmallVectorImpl< APInt > &RawBitElements, BitVector &UndefElements) const
Extract the raw bit data from a build vector of Undef, Constant or ConstantFP node elements.
static void recastRawBits(bool IsLittleEndian, unsigned DstEltSizeInBits, SmallVectorImpl< APInt > &DstBitElements, ArrayRef< APInt > SrcBitElements, BitVector &DstUndefElements, const BitVector &SrcUndefElements)
Recast bit data SrcBitElements to DstEltSizeInBits wide elements.
bool getRepeatedSequence(const APInt &DemandedElts, SmallVectorImpl< SDValue > &Sequence, BitVector *UndefElements=nullptr) const
Find the shortest repeating sequence of values in the build vector.
ConstantFPSDNode * getConstantFPSplatNode(const APInt &DemandedElts, BitVector *UndefElements=nullptr) const
Returns the demanded splatted constant FP or null if this is not a constant FP splat.
std::optional< std::pair< APInt, APInt > > isConstantSequence() const
If this BuildVector is constant and represents the numerical series "<a, a+n, a+2n,...
SDValue getSplatValue(const APInt &DemandedElts, BitVector *UndefElements=nullptr) const
Returns the demanded splatted value or a null value if this is not a splat.
bool isConstantSplat(APInt &SplatValue, APInt &SplatUndef, unsigned &SplatBitSize, bool &HasAnyUndefs, unsigned MinSplatBits=0, bool isBigEndian=false) const
Check if this is a constant splat, and if so, find the smallest element size that splats the vector.
ConstantSDNode * getConstantSplatNode(const APInt &DemandedElts, BitVector *UndefElements=nullptr) const
Returns the demanded splatted constant or null if this is not a constant splat.
int32_t getConstantFPSplatPow2ToLog2Int(BitVector *UndefElements, uint32_t BitWidth) const
If this is a constant FP splat and the splatted constant FP is an exact power or 2,...
static bool classof(const SDNode *N)
ISD::CondCode get() const
static bool classof(const SDNode *N)
static bool isValueValidForType(EVT VT, const APFloat &Val)
const APFloat & getValueAPF() const
bool isNaN() const
Return true if the value is a NaN.
const ConstantFP * getConstantFPValue() const
bool isExactlyValue(double V) const
We don't rely on operator== working on double values, as it returns true for things that are clearly ...
bool isNegative() const
Return true if the value is negative.
bool isInfinity() const
Return true if the value is an infinity.
static bool classof(const SDNode *N)
bool isZero() const
Return true if the value is positive or negative zero.
ConstantFP - Floating Point Values [float, double].
This is the shared class of boolean and integer constants.
static bool classof(const SDNode *N)
MachineConstantPoolValue * getMachineCPVal() const
bool isMachineConstantPoolEntry() const
const Constant * ConstVal
MachineConstantPoolValue * MachineCPVal
const Constant * getConstVal() const
unsigned getTargetFlags() const
MaybeAlign getMaybeAlignValue() const
bool isMinSignedValue() const
uint64_t getLimitedValue(uint64_t Limit=UINT64_MAX)
const ConstantInt * getConstantIntValue() const
bool isMaxSignedValue() const
uint64_t getZExtValue() const
Align getAlignValue() const
const APInt & getAPIntValue() const
int64_t getSExtValue() const
static bool classof(const SDNode *N)
This is an important base class in LLVM.
This class represents an Operation in the Expression.
bool hasTrivialDestructor() const
Check whether this has a trivial destructor.
const char * getSymbol() const
static bool classof(const SDNode *N)
unsigned getTargetFlags() const
Utility class for floating point operations which can have information about relaxed accuracy require...
bool hasAllowReassoc() const
Test if this operation may be simplified with reassociative transforms.
bool hasNoNaNs() const
Test if this operation's arguments and results are assumed not-NaN.
bool hasAllowReciprocal() const
Test if this operation can use reciprocal multiply instead of division.
bool hasNoSignedZeros() const
Test if this operation can ignore the sign of zero.
bool hasAllowContract() const
Test if this operation can be floating-point contracted (FMA).
bool hasNoInfs() const
Test if this operation's arguments and results are assumed not-infinite.
bool hasApproxFunc() const
Test if this operation allows approximations of math library functions or intrinsics.
static bool classof(const SDNode *N)
FPStateAccessSDNode(unsigned NodeTy, unsigned Order, const DebugLoc &dl, SDVTList VTs, EVT MemVT, MachineMemOperand *MMO)
Node - This class is used to maintain the singly linked bucket list in a folding set.
FoldingSetNodeID - This class is used to gather all the unique data bits of a node.
static bool classof(const SDNode *N)
int64_t getOffset() const
unsigned getAddressSpace() const
static bool classof(const SDNode *N)
unsigned getTargetFlags() const
const GlobalValue * getGlobal() const
This class is used to form a handle around another node that is persistent and is updated across invo...
const SDValue & getValue() const
static bool classof(const SDNode *N)
unsigned getTargetFlags() const
Base class for LoadSDNode and StoreSDNode.
LSBaseSDNode(ISD::NodeType NodeTy, unsigned Order, const DebugLoc &dl, SDVTList VTs, ISD::MemIndexedMode AM, EVT MemVT, MachineMemOperand *MMO)
ISD::MemIndexedMode getAddressingMode() const
Return the addressing mode for this load or store: unindexed, pre-inc, pre-dec, post-inc,...
const SDValue & getOffset() const
bool isUnindexed() const
Return true if this is NOT a pre/post inc/dec load/store.
bool isIndexed() const
Return true if this is a pre/post inc/dec load/store.
static bool classof(const SDNode *N)
MCSymbol * getLabel() const
static bool classof(const SDNode *N)
This SDNode is used for LIFETIME_START/LIFETIME_END values, which indicate the offet and size that ar...
int64_t getFrameIndex() const
static bool classof(const SDNode *N)
int64_t getOffset() const
This class is used to represent ISD::LOAD nodes.
const SDValue & getBasePtr() const
const SDValue & getOffset() const
ISD::LoadExtType getExtensionType() const
Return whether this is a plain node, or one of the varieties of value-extending loads.
static bool classof(const SDNode *N)
MCSymbol * getMCSymbol() const
static bool classof(const SDNode *N)
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
static bool classof(const SDNode *N)
const MDNode * getMD() const
Abstract base class for all machine specific constantpool value subclasses.
A description of a memory reference used in the backend.
AtomicOrdering getFailureOrdering() const
For cmpxchg atomic operations, return the atomic ordering requirements when store does not occur.
bool isUnordered() const
Returns true if this memory operation doesn't have any ordering constraints other than normal aliasin...
const MDNode * getRanges() const
Return the range tag for the memory reference.
bool isAtomic() const
Returns true if this operation has an atomic ordering requirement of unordered or higher,...
void refineAlignment(const MachineMemOperand *MMO)
Update this MachineMemOperand to reflect the alignment of MMO, if it has a greater alignment.
SyncScope::ID getSyncScopeID() const
Returns the synchronization scope ID for this memory operation.
AtomicOrdering getMergedOrdering() const
Return a single atomic ordering that is at least as strong as both the success and failure orderings ...
AtomicOrdering getSuccessOrdering() const
Return the atomic ordering requirements for this memory operation.
const MachinePointerInfo & getPointerInfo() const
Align getAlign() const
Return the minimum known alignment in bytes of the actual memory reference.
AAMDNodes getAAInfo() const
Return the AA tags for the memory reference.
Align getBaseAlign() const
Return the minimum known alignment in bytes of the base address, without the offset.
int64_t getOffset() const
For normal values, this is a byte offset added to the base address.
An SDNode that represents everything that will be needed to construct a MachineInstr.
ArrayRef< MachineMemOperand * > memoperands() const
bool memoperands_empty() const
void clearMemRefs()
Clear out the memory reference descriptor list.
mmo_iterator memoperands_begin() const
static bool classof(const SDNode *N)
mmo_iterator memoperands_end() const
This class is used to represent an MGATHER node.
static bool classof(const SDNode *N)
MaskedGatherSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs, EVT MemVT, MachineMemOperand *MMO, ISD::MemIndexType IndexType, ISD::LoadExtType ETy)
const SDValue & getPassThru() const
ISD::LoadExtType getExtensionType() const
This is a base class used to represent MGATHER and MSCATTER nodes.
const SDValue & getIndex() const
bool isIndexScaled() const
const SDValue & getScale() const
static bool classof(const SDNode *N)
MaskedGatherScatterSDNode(ISD::NodeType NodeTy, unsigned Order, const DebugLoc &dl, SDVTList VTs, EVT MemVT, MachineMemOperand *MMO, ISD::MemIndexType IndexType)
const SDValue & getBasePtr() const
const SDValue & getMask() const
bool isIndexSigned() const
ISD::MemIndexType getIndexType() const
How is Index applied to BasePtr when computing addresses.
const SDValue & getInc() const
MaskedHistogramSDNode(unsigned Order, const DebugLoc &DL, SDVTList VTs, EVT MemVT, MachineMemOperand *MMO, ISD::MemIndexType IndexType)
const SDValue & getScale() const
static bool classof(const SDNode *N)
const SDValue & getMask() const
const SDValue & getIntID() const
const SDValue & getIndex() const
const SDValue & getBasePtr() const
ISD::MemIndexType getIndexType() const
This class is used to represent an MLOAD node.
MaskedLoadSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs, ISD::MemIndexedMode AM, ISD::LoadExtType ETy, bool IsExpanding, EVT MemVT, MachineMemOperand *MMO)
const SDValue & getBasePtr() const
bool isExpandingLoad() const
ISD::LoadExtType getExtensionType() const
const SDValue & getMask() const
const SDValue & getPassThru() const
static bool classof(const SDNode *N)
const SDValue & getOffset() const
This base class is used to represent MLOAD and MSTORE nodes.
const SDValue & getMask() const
MaskedLoadStoreSDNode(ISD::NodeType NodeTy, unsigned Order, const DebugLoc &dl, SDVTList VTs, ISD::MemIndexedMode AM, EVT MemVT, MachineMemOperand *MMO)
bool isIndexed() const
Return true if this is a pre/post inc/dec load/store.
static bool classof(const SDNode *N)
const SDValue & getOffset() const
bool isUnindexed() const
Return true if this is NOT a pre/post inc/dec load/store.
ISD::MemIndexedMode getAddressingMode() const
Return the addressing mode for this load or store: unindexed, pre-inc, pre-dec, post-inc,...
This class is used to represent an MSCATTER node.
MaskedScatterSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs, EVT MemVT, MachineMemOperand *MMO, ISD::MemIndexType IndexType, bool IsTrunc)
const SDValue & getValue() const
static bool classof(const SDNode *N)
bool isTruncatingStore() const
Return true if the op does a truncation before store.
This class is used to represent an MSTORE node.
bool isCompressingStore() const
Returns true if the op does a compression to the vector before storing.
MaskedStoreSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs, ISD::MemIndexedMode AM, bool isTrunc, bool isCompressing, EVT MemVT, MachineMemOperand *MMO)
const SDValue & getOffset() const
const SDValue & getBasePtr() const
const SDValue & getMask() const
const SDValue & getValue() const
bool isTruncatingStore() const
Return true if the op does a truncation before store.
static bool classof(const SDNode *N)
This SDNode is used for target intrinsics that touch memory and need an associated MachineMemOperand.
MemIntrinsicSDNode(unsigned Opc, unsigned Order, const DebugLoc &dl, SDVTList VTs, EVT MemoryVT, MachineMemOperand *MMO)
static bool classof(const SDNode *N)
This is an abstract virtual class for memory operations.
MachineMemOperand * MMO
Memory reference information.
unsigned getAddressSpace() const
Return the address space for the associated pointer.
const MDNode * getRanges() const
Returns the Ranges that describes the dereference.
AAMDNodes getAAInfo() const
Returns the AA info that describes the dereference.
SyncScope::ID getSyncScopeID() const
Returns the synchronization scope ID for this memory operation.
Align getOriginalAlign() const
Returns alignment and volatility of the memory access.
int64_t getSrcValueOffset() const
bool isSimple() const
Returns true if the memory operation is neither atomic or volatile.
AtomicOrdering getSuccessOrdering() const
Return the atomic ordering requirements for this memory operation.
MachineMemOperand * getMemOperand() const
Return a MachineMemOperand object describing the memory reference performed by operation.
const SDValue & getBasePtr() const
void refineAlignment(const MachineMemOperand *NewMMO)
Update this MemSDNode's MachineMemOperand information to reflect the alignment of NewMMO,...
const MachinePointerInfo & getPointerInfo() const
AtomicOrdering getMergedOrdering() const
Return a single atomic ordering that is at least as strong as both the success and failure orderings ...
const SDValue & getChain() const
bool isNonTemporal() const
bool isDereferenceable() const
bool isUnordered() const
Returns true if the memory operation doesn't imply any ordering constraints on surrounding memory ope...
bool isAtomic() const
Return true if the memory operation ordering is Unordered or higher.
static bool classof(const SDNode *N)
unsigned getRawSubclassData() const
Return the SubclassData value, without HasDebugValue.
EVT getMemoryVT() const
Return the type of the in-memory value.
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
First const * getAddrOfPtr1() const
If the union is set to the first pointer type get an address pointing to it.
This SDNode is used for PSEUDO_PROBE values, which are the function guid and the index of the basic b...
static bool classof(const SDNode *N)
uint32_t getAttributes() const
uint64_t getIndex() const
const uint32_t * getRegMask() const
static bool classof(const SDNode *N)
static bool classof(const SDNode *N)
Wrapper class representing virtual and physical registers.
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
const DebugLoc & getDebugLoc() const
unsigned getIROrder() const
SDLoc(const Instruction *I, int Order)
pointer operator->() const
static SDNodeIterator end(const SDNode *N)
size_t operator-(SDNodeIterator Other) const
SDNodeIterator operator++(int)
std::ptrdiff_t difference_type
std::forward_iterator_tag iterator_category
unsigned getOperand() const
pointer operator*() const
SDNodeIterator & operator++()
bool operator==(const SDNodeIterator &x) const
const SDNode * getNode() const
static SDNodeIterator begin(const SDNode *N)
bool operator!=(const SDNodeIterator &x) const
This class provides iterator support for SDUse operands that use a specific SDNode.
bool operator!=(const use_iterator &x) const
use_iterator & operator=(const use_iterator &)=default
use_iterator & operator++()
unsigned getOperandNo() const
Retrieve the operand # of this use in its user.
std::ptrdiff_t difference_type
std::forward_iterator_tag iterator_category
bool operator==(const use_iterator &x) const
SDNode * operator*() const
Retrieve a pointer to the current user node.
SDNode * operator->() const
bool atEnd() const
Return true if this iterator is at the end of uses list.
use_iterator(const use_iterator &I)=default
use_iterator operator++(int)
Represents one node in the SelectionDAG.
void setDebugLoc(DebugLoc dl)
Set source location info.
uint32_t getCFIType() const
static SDVTList getSDVTList(EVT VT)
void setIROrder(unsigned Order)
Set the node ordering.
bool isStrictFPOpcode()
Test if this node is a strict floating point pseudo-op.
ArrayRef< SDUse > ops() const
char RawSDNodeBits[sizeof(uint16_t)]
const APInt & getAsAPIntVal() const
Helper method returns the APInt value of a ConstantSDNode.
bool isMachineOpcode() const
Test if this node has a post-isel opcode, directly corresponding to a MachineInstr opcode.
void dumprFull(const SelectionDAG *G=nullptr) const
printrFull to dbgs().
int getNodeId() const
Return the unique node id.
void dump() const
Dump this node, for debugging.
iterator_range< value_iterator > values() const
iterator_range< use_iterator > uses() const
unsigned getOpcode() const
Return the SelectionDAG opcode value for this node.
SDNode * getGluedUser() const
If this node has a glue value with a user, return the user (there is at most one).
bool hasOneUse() const
Return true if there is exactly one use of this node.
bool isOnlyUserOf(const SDNode *N) const
Return true if this node is the only use of N.
static const char * getIndexedModeName(ISD::MemIndexedMode AM)
iterator_range< value_op_iterator > op_values() const
unsigned getIROrder() const
Return the node ordering.
LoadSDNodeBitfields LoadSDNodeBits
static constexpr size_t getMaxNumOperands()
Return the maximum number of operands that a SDNode can hold.
int getCombinerWorklistIndex() const
Get worklist index for DAGCombiner.
value_iterator value_end() const
void setHasDebugValue(bool b)
LSBaseSDNodeBitfields LSBaseSDNodeBits
iterator_range< use_iterator > uses()
MemSDNodeBitfields MemSDNodeBits
bool getHasDebugValue() const
void dumpr() const
Dump (recursively) this node and its use-def subgraph.
SDNodeFlags getFlags() const
void setNodeId(int Id)
Set unique node id.
std::string getOperationName(const SelectionDAG *G=nullptr) const
Return the opcode of this operation for printing.
void printrFull(raw_ostream &O, const SelectionDAG *G=nullptr) const
Print a SelectionDAG node and all children down to the leaves.
size_t use_size() const
Return the number of uses of this node.
void intersectFlagsWith(const SDNodeFlags Flags)
Clear any flags in this node that aren't also set in Flags.
void printr(raw_ostream &OS, const SelectionDAG *G=nullptr) const
StoreSDNodeBitfields StoreSDNodeBits
TypeSize getValueSizeInBits(unsigned ResNo) const
Returns MVT::getSizeInBits(getValueType(ResNo)).
MVT getSimpleValueType(unsigned ResNo) const
Return the type of a specified result as a simple type.
static bool hasPredecessorHelper(const SDNode *N, SmallPtrSetImpl< const SDNode * > &Visited, SmallVectorImpl< const SDNode * > &Worklist, unsigned int MaxSteps=0, bool TopologicalPrune=false)
Returns true if N is a predecessor of any node in Worklist.
uint64_t getAsZExtVal() const
Helper method returns the zero-extended integer value of a ConstantSDNode.
bool use_empty() const
Return true if there are no uses of this node.
unsigned getNumValues() const
Return the number of values defined/returned by this operator.
unsigned getNumOperands() const
Return the number of values used by this operation.
unsigned getMachineOpcode() const
This may only be called if isMachineOpcode returns true.
SDVTList getVTList() const
const SDValue & getOperand(unsigned Num) const
bool isMemIntrinsic() const
Test if this node is a memory intrinsic (with valid pointer information).
void setCombinerWorklistIndex(int Index)
Set worklist index for DAGCombiner.
uint64_t getConstantOperandVal(unsigned Num) const
Helper method returns the integer value of a ConstantSDNode operand.
static bool areOnlyUsersOf(ArrayRef< const SDNode * > Nodes, const SDNode *N)
Return true if all the users of N are contained in Nodes.
bool isTargetStrictFPOpcode() const
Test if this node has a target-specific opcode that may raise FP exceptions (in the <target>ISD names...
use_iterator use_begin() const
Provide iteration support to walk over all uses of an SDNode.
bool isOperandOf(const SDNode *N) const
Return true if this node is an operand of N.
void print(raw_ostream &OS, const SelectionDAG *G=nullptr) const
const DebugLoc & getDebugLoc() const
Return the source location info.
void printrWithDepth(raw_ostream &O, const SelectionDAG *G=nullptr, unsigned depth=100) const
Print a SelectionDAG node and children up to depth "depth." The given SelectionDAG allows target-spec...
const APInt & getConstantOperandAPInt(unsigned Num) const
Helper method returns the APInt of a ConstantSDNode operand.
uint16_t PersistentId
Unique and persistent id per SDNode in the DAG.
void dumprWithDepth(const SelectionDAG *G=nullptr, unsigned depth=100) const
printrWithDepth to dbgs().
bool isPredecessorOf(const SDNode *N) const
Return true if this node is a predecessor of N.
bool hasPredecessor(const SDNode *N) const
Return true if N is a predecessor of this node.
void addUse(SDUse &U)
This method should only be used by the SDUse class.
bool hasAnyUseOfValue(unsigned Value) const
Return true if there are any use of the indicated value.
EVT getValueType(unsigned ResNo) const
Return the type of a specified result.
void print_details(raw_ostream &OS, const SelectionDAG *G) const
bool isTargetMemoryOpcode() const
Test if this node has a target-specific memory-referencing opcode (in the <target>ISD namespace and g...
void setCFIType(uint32_t Type)
bool isUndef() const
Return true if the type of the node type undefined.
void print_types(raw_ostream &OS, const SelectionDAG *G) const
bool hasNUsesOfValue(unsigned NUses, unsigned Value) const
Return true if there are exactly NUSES uses of the indicated value.
bool isVPOpcode() const
Test if this node is a vector predication operation.
bool hasPoisonGeneratingFlags() const
void setFlags(SDNodeFlags NewFlags)
SDNode * getGluedNode() const
If this node has a glue operand, return the node to which the glue operand points.
bool isTargetOpcode() const
Test if this node has a target-specific opcode (in the <target>ISD namespace).
op_iterator op_end() const
ConstantSDNodeBitfields ConstantSDNodeBits
value_iterator value_begin() const
op_iterator op_begin() const
static use_iterator use_end()
void DropOperands()
Release the operands and set this node to have zero operands.
SDNode(unsigned Opc, unsigned Order, DebugLoc dl, SDVTList VTs)
Create an SDNode.
SDNodeBitfields SDNodeBits
Represents a use of a SDNode.
const SDNode * getUser() const
SDUse & operator=(const SDUse &)=delete
EVT getValueType() const
Convenience function for get().getValueType().
const SDValue & get() const
If implicit conversion to SDValue doesn't work, the get() method returns the SDValue.
SDUse * getNext() const
Get the next SDUse in the use list.
SDNode * getNode() const
Convenience function for get().getNode().
bool operator!=(const SDValue &V) const
Convenience function for get().operator!=.
SDUse(const SDUse &U)=delete
unsigned getResNo() const
Convenience function for get().getResNo().
bool operator==(const SDValue &V) const
Convenience function for get().operator==.
bool operator<(const SDValue &V) const
Convenience function for get().operator<.
SDNode * getUser()
This returns the SDNode that contains this Use.
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation.
SDNode * getNode() const
get the SDNode which holds the desired result
bool hasOneUse() const
Return true if there is exactly one node using value ResNo of Node.
bool isOperandOf(const SDNode *N) const
Return true if this node is an operand of N.
bool isTargetMemoryOpcode() const
bool reachesChainWithoutSideEffects(SDValue Dest, unsigned Depth=2) const
Return true if this operand (which must be a chain) reaches the specified operand without crossing an...
bool operator!=(const SDValue &O) const
SDValue getValue(unsigned R) const
EVT getValueType() const
Return the ValueType of the referenced return value.
bool isTargetOpcode() const
bool isMachineOpcode() const
TypeSize getValueSizeInBits() const
Returns the size of the value in bits.
const DebugLoc & getDebugLoc() const
SDNode * operator->() const
bool operator==(const SDValue &O) const
const SDValue & getOperand(unsigned i) const
bool use_empty() const
Return true if there are no nodes using value ResNo of Node.
bool operator<(const SDValue &O) const
const APInt & getConstantOperandAPInt(unsigned i) const
uint64_t getScalarValueSizeInBits() const
unsigned getResNo() const
get the index which selects a specific result in the SDNode
uint64_t getConstantOperandVal(unsigned i) const
MVT getSimpleValueType() const
Return the simple ValueType of the referenced return value.
void setNode(SDNode *N)
set the SDNode
unsigned getMachineOpcode() const
unsigned getOpcode() const
unsigned getNumOperands() const
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
This SDNode is used to implement the code generator support for the llvm IR shufflevector instruction...
static bool isSplatMask(const int *Mask, EVT VT)
int getMaskElt(unsigned Idx) const
int getSplatIndex() const
ShuffleVectorSDNode(SDVTList VTs, unsigned Order, const DebugLoc &dl, const int *M)
ArrayRef< int > getMask() const
static void commuteMask(MutableArrayRef< int > Mask)
Change values in a shuffle permute mask assuming the two vector operands have swapped position.
static bool classof(const SDNode *N)
A templated base class for SmallPtrSet which provides the typesafe interface that is common across al...
size_type count(ConstPtrType Ptr) const
count - Return 1 if the specified pointer is in the set, 0 otherwise.
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void append(ItTy in_start, ItTy in_end)
Add the specified range to the end of the SmallVector.
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
An SDNode that holds an arbitrary LLVM IR Value.
const Value * getValue() const
Return the contained Value.
static bool classof(const SDNode *N)
This class is used to represent ISD::STORE nodes.
const SDValue & getBasePtr() const
const SDValue & getOffset() const
const SDValue & getValue() const
bool isTruncatingStore() const
Return true if the op does a truncation before store.
void setTruncatingStore(bool Truncating)
static bool classof(const SDNode *N)
Completely target-dependent object reference.