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) {}
458 NoUnsignedWrap &= Flags.NoUnsignedWrap;
459 NoSignedWrap &= Flags.NoSignedWrap;
460 Exact &= Flags.Exact;
461 Disjoint &= Flags.Disjoint;
462 NonNeg &= Flags.NonNeg;
463 NoNaNs &= Flags.NoNaNs;
464 NoInfs &= Flags.NoInfs;
465 NoSignedZeros &= Flags.NoSignedZeros;
466 AllowReciprocal &= Flags.AllowReciprocal;
467 AllowContract &= Flags.AllowContract;
468 ApproximateFuncs &= Flags.ApproximateFuncs;
469 AllowReassociation &= Flags.AllowReassociation;
470 NoFPExcept &= Flags.NoFPExcept;
471 Unpredictable &= Flags.Unpredictable;
489#if defined(_AIX) && (!defined(__GNUC__) || defined(__clang__))
492#define BEGIN_TWO_BYTE_PACK() _Pragma("pack(2)")
493#define END_TWO_BYTE_PACK() _Pragma("pack(pop)")
495#define BEGIN_TWO_BYTE_PACK()
496#define END_TWO_BYTE_PACK()
596#undef BEGIN_TWO_BYTE_PACK
597#undef END_TWO_BYTE_PACK
602 static_assert(
sizeof(SDNodeBitfields) <= 2,
"field too wide");
603 static_assert(
sizeof(ConstantSDNodeBitfields) <= 2,
"field too wide");
604 static_assert(
sizeof(MemSDNodeBitfields) <= 2,
"field too wide");
605 static_assert(
sizeof(LSBaseSDNodeBitfields) <= 2,
"field too wide");
606 static_assert(
sizeof(LoadSDNodeBitfields) <= 2,
"field too wide");
607 static_assert(
sizeof(StoreSDNodeBitfields) <= 2,
"field too wide");
626 SDUse *OperandList =
nullptr;
630 const EVT *ValueList;
633 SDUse *UseList =
nullptr;
636 unsigned short NumOperands = 0;
637 unsigned short NumValues;
650 static const EVT *getValueTypeList(
EVT VT);
655 int CombinerWorklistIndex = -1;
668 unsigned getOpcode()
const {
return (
unsigned)NodeType; }
713#define DAG_INSTRUCTION(NAME, NARG, ROUND_MODE, INTRINSIC, DAGN) \
714 case ISD::STRICT_##DAGN:
715#include "llvm/IR/ConstrainedOps.def"
805 assert(
Op &&
"Cannot increment end iterator!");
816 assert(
Op &&
"Cannot dereference end iterator!");
817 return Op->getUser();
826 assert(
Op &&
"Cannot dereference end iterator!");
827 return (
unsigned)(
Op -
Op->getUser()->OperandList);
863 return N->hasPredecessor(
this);
884 unsigned int MaxSteps = 0,
885 bool TopologicalPrune =
false) {
901 int NId =
N->getNodeId();
907 while (!Worklist.
empty()) {
909 int MId = M->getNodeId();
911 (MId > 0) && (MId < NId)) {
915 for (
const SDValue &OpV : M->op_values()) {
924 if (MaxSteps != 0 && Visited.
size() >= MaxSteps)
930 if (MaxSteps != 0 && Visited.
size() >= MaxSteps)
944 return std::numeric_limits<
decltype(SDNode::NumOperands)>
::max();
960 assert(Num < NumOperands &&
"Invalid child # of SDNode!");
961 return OperandList[Num];
973 std::random_access_iterator_tag, SDValue,
974 ptrdiff_t, value_op_iterator *,
975 value_op_iterator *> {
1005 if (UI.getUse().get().getValueType() == MVT::Glue)
1019 return Flags.hasNoUnsignedWrap() || Flags.hasNoSignedWrap() ||
1020 Flags.hasExact() || Flags.hasDisjoint() || Flags.hasNonNeg() ||
1021 Flags.hasNoNaNs() || Flags.hasNoInfs();
1032 assert(ResNo < NumValues &&
"Illegal result number!");
1033 return ValueList[ResNo];
1081 unsigned depth = 100)
const;
1111 unsigned depth = 100)
const;
1121 SDVTList Ret = { getValueTypeList(VT), 1 };
1130 : NodeType(Opc), ValueList(VTs.VTs), NumValues(VTs.NumVTs),
1131 IROrder(Order), debugLoc(
std::
move(dl)) {
1135 "NumValues wasn't wide enough for its operands!");
1161 assert(Order >= 0 &&
"bad IROrder");
1163 DL =
I->getDebugLoc();
1173 :
Node(node), ResNo(resno) {
1177 assert((!
Node || !ResNo || ResNo < Node->getNumValues()) &&
1178 "Invalid result number for the given node!");
1179 assert(ResNo < -2U &&
"Cannot use result numbers reserved for DenseMaps.");
1183 return Node->getOpcode();
1187 return Node->getValueType(ResNo);
1191 return Node->getNumOperands();
1195 return Node->getOperand(i);
1199 return Node->getConstantOperandVal(i);
1203 return Node->getConstantOperandAPInt(i);
1207 return Node->isTargetOpcode();
1211 return Node->isTargetMemoryOpcode();
1215 return Node->isMachineOpcode();
1219 return Node->getMachineOpcode();
1223 return Node->isUndef();
1227 return !
Node->hasAnyUseOfValue(ResNo);
1231 return Node->hasNUsesOfValue(1, ResNo);
1235 return Node->getDebugLoc();
1247 return Node->dumpr();
1251 return Node->dumpr(
G);
1256inline void SDUse::set(
const SDValue &V) {
1257 if (Val.
getNode()) removeFromList();
1263inline void SDUse::setInitial(
const SDValue &V) {
1268inline void SDUse::setNode(SDNode *
N) {
1269 if (Val.
getNode()) removeFromList();
1271 if (
N)
N->addUse(*
this);
1304 unsigned SrcAddrSpace;
1305 unsigned DestAddrSpace;
1309 unsigned SrcAS,
unsigned DestAS)
1310 :
SDNode(ISD::ADDRSPACECAST, Order, dl, VTs), SrcAddrSpace(SrcAS),
1311 DestAddrSpace(DestAS) {}
1433 case ISD::VP_SCATTER:
1434 case ISD::EXPERIMENTAL_VP_STRIDED_STORE:
1449 switch (
N->getOpcode()) {
1481 case ISD::VP_GATHER:
1482 case ISD::VP_SCATTER:
1483 case ISD::EXPERIMENTAL_VP_STRIDED_LOAD:
1484 case ISD::EXPERIMENTAL_VP_STRIDED_STORE:
1490 return N->isMemIntrinsic() ||
N->isTargetMemoryOpcode();
1502 MMO->
isAtomic()) &&
"then why are we using an AtomicSDNode?");
1580 return N->isMemIntrinsic() ||
1582 N->isTargetMemoryOpcode();
1604 :
SDNode(ISD::VECTOR_SHUFFLE, Order, dl, VTs), Mask(M) {}
1620 assert(
isSplat() &&
"Cannot get splat index for non-splat!");
1636 unsigned NumElems = Mask.size();
1637 for (
unsigned i = 0; i != NumElems; ++i) {
1641 else if (idx < (
int)NumElems)
1642 Mask[i] = idx + NumElems;
1644 Mask[i] = idx - NumElems;
1672 return Value->getLimitedValue(Limit);
1692 return cast<ConstantSDNode>(
getOperand(Num))->getZExtValue();
1696 return cast<ConstantSDNode>(
this)->getZExtValue();
1700 return cast<ConstantSDNode>(
getOperand(Num))->getAPIntValue();
1704 return cast<ConstantSDNode>(
this)->getAPIntValue();
1742 return Value->getValueAPF().isExactlyValue(V);
1776 unsigned OperandNo);
1805 bool AllowTruncation =
false);
1810 bool AllowUndefs =
false,
1811 bool AllowTruncation =
false);
1819 bool AllowUndefs =
false);
1839 return isa<ConstantSDNode>(V) || isa<ConstantFPSDNode>(V);
1847 unsigned TargetFlags;
1852 :
SDNode(Opc, Order,
DL, VTs), TheGlobal(GA),
Offset(o), TargetFlags(TF) {
1876 :
SDNode(isTarg ? ISD::TargetFrameIndex : ISD::FrameIndex, 0,
DebugLoc(),
1901 return cast<FrameIndexSDNode>(
getOperand(1))->getIndex();
1951 unsigned TargetFlags;
1954 :
SDNode(isTarg ? ISD::TargetJumpTable : ISD::JumpTable, 0,
DebugLoc(),
1956 JTI(jti), TargetFlags(TF) {}
1977 unsigned TargetFlags;
1980 Align Alignment,
unsigned TF)
1983 Offset(o), Alignment(Alignment), TargetFlags(TF) {
1984 assert(Offset >= 0 &&
"Offset is too large");
1988 ConstantPoolSDNode(
bool isTarget, MachineConstantPoolValue *v, SDVTList VTs,
1989 int o, Align Alignment,
unsigned TF)
1990 : SDNode(isTarget ? ISD::TargetConstantPool : ISD::ConstantPool, 0,
1992 Offset(o), Alignment(Alignment), TargetFlags(TF) {
1993 assert(Offset >= 0 &&
"Offset is too large");
1994 Val.MachineCPVal = v;
1995 Offset |= 1 << (
sizeof(
unsigned)*CHAR_BIT-1);
2005 return Val.ConstVal;
2010 return Val.MachineCPVal;
2014 return Offset & ~(1 << (
sizeof(
unsigned)*CHAR_BIT-1));
2034 unsigned TargetFlags;
2088 unsigned &SplatBitSize,
bool &HasAnyUndefs,
2089 unsigned MinSplatBits = 0,
2099 BitVector *UndefElements =
nullptr)
const;
2120 BitVector *UndefElements =
nullptr)
const;
2132 BitVector *UndefElements =
nullptr)
const;
2142 BitVector *UndefElements =
nullptr)
const;
2160 BitVector *UndefElements =
nullptr)
const;
2196 static void recastRawBits(
bool IsLittleEndian,
unsigned DstEltSizeInBits,
2285 unsigned TargetFlags;
2288 int64_t o,
unsigned Flags)
2290 TargetFlags(Flags) {}
2326 unsigned TargetFlags;
2330 :
SDNode(isTarget ? ISD::TargetExternalSymbol : ISD::ExternalSymbol, 0,
2332 Symbol(
Sym), TargetFlags(TF) {}
2438 assert(
readMem() &&
"Load MachineMemOperand is not a load!");
2528 case ISD::EXPERIMENTAL_VP_STRIDED_LOAD:
2530 case ISD::EXPERIMENTAL_VP_STRIDED_STORE:
2541 case ISD::EXPERIMENTAL_VP_STRIDED_LOAD:
2543 case ISD::EXPERIMENTAL_VP_STRIDED_STORE:
2561 return N->getOpcode() == ISD::EXPERIMENTAL_VP_STRIDED_LOAD ||
2562 N->getOpcode() == ISD::EXPERIMENTAL_VP_STRIDED_STORE ||
2563 N->getOpcode() == ISD::VP_LOAD ||
N->getOpcode() == ISD::VP_STORE;
2590 return N->getOpcode() == ISD::VP_LOAD;
2620 return N->getOpcode() == ISD::EXPERIMENTAL_VP_STRIDED_LOAD;
2656 return N->getOpcode() == ISD::VP_STORE;
2669 VTs, AM, MemVT,
MMO) {
2693 return N->getOpcode() == ISD::EXPERIMENTAL_VP_STRIDED_STORE;
2822 return !cast<ConstantSDNode>(
getScale())->isOne();
2847 return N->getOpcode() == ISD::VP_GATHER ||
2848 N->getOpcode() == ISD::VP_SCATTER;
2864 return N->getOpcode() == ISD::VP_GATHER;
2882 return N->getOpcode() == ISD::VP_SCATTER;
2906 return !cast<ConstantSDNode>(
getScale())->isOne();
2983 :
MemSDNode(ISD::EXPERIMENTAL_VECTOR_HISTOGRAM, Order,
DL, VTs, MemVT,
3012 "Expected FP state access node");
3062 if (NumMemRefs == 0)
3064 if (NumMemRefs == 1)
3068 return ArrayRef(cast<MachineMemOperand **>(MemRefs), NumMemRefs);
3081 return N->isMachineOpcode();
3092 :
SDNode(ISD::AssertAlign, Order,
DL, VTs), Alignment(
A) {}
3115 return Operand == x.Operand;
3120 return Node->getOperand(Operand).getNode();
3133 "Cannot compare iterators of two different nodes!");
3134 return Operand -
Other.Operand;
3177 auto *Ld = dyn_cast<LoadSDNode>(
N);
3184 auto *Ld = dyn_cast<LoadSDNode>(
N);
3190 auto *Ld = dyn_cast<LoadSDNode>(
N);
3196 auto *Ld = dyn_cast<LoadSDNode>(
N);
3202 auto *Ld = dyn_cast<LoadSDNode>(
N);
3208 auto *Ld = dyn_cast<LoadSDNode>(
N);
3215 auto *St = dyn_cast<StoreSDNode>(
N);
3216 return St && !St->isTruncatingStore() &&
3222 auto *St = dyn_cast<StoreSDNode>(
N);
3229 template <
typename ConstNodeType>
3231 std::function<
bool(ConstNodeType *)>
Match,
3232 bool AllowUndefs =
false);
3237 bool AllowUndefs =
false) {
3238 return matchUnaryPredicateImpl<ConstantSDNode>(
Op,
Match, AllowUndefs);
3245 bool AllowUndefs =
false) {
3246 return matchUnaryPredicateImpl<ConstantFPSDNode>(
Op,
Match, AllowUndefs);
3256 bool AllowUndefs =
false,
bool AllowTypeMismatch =
false);
3261 unsigned Opc =
Op.getOpcode();
3262 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.
TargetIndexSDNode(int Idx, SDVTList VTs, int64_t Ofs, unsigned TF)
static bool classof(const SDNode *N)
int64_t getOffset() const
unsigned getTargetFlags() const
The instances of the Type class are immutable: once they are created, they are never changed.
This base class is used to represent VP_LOAD, VP_STORE, EXPERIMENTAL_VP_STRIDED_LOAD and EXPERIMENTAL...
const SDValue & getMask() const
static bool classof(const SDNode *N)