19 #ifndef LLVM_CODEGEN_SELECTIONDAGNODES_H
20 #define LLVM_CODEGEN_SELECTIONDAGNODES_H
58 class MachineBasicBlock;
59 class MachineConstantPoolValue;
63 template <
typename T>
struct DenseMapInfo;
140 return Node == O.Node && ResNo == O.ResNo;
146 return std::tie(Node, ResNo) < std::tie(O.Node, O.ResNo);
148 explicit operator bool()
const {
149 return Node !=
nullptr;
187 inline void dump()
const;
188 inline void dumpr()
const;
196 unsigned Depth = 2)
const;
219 return ((
unsigned)((uintptr_t)Val.
getNode() >> 4) ^
259 void operator=(
const SDUse &U) =
delete;
262 SDUse() :
User(nullptr), Prev(nullptr), Next(nullptr) {}
265 operator const SDValue&()
const {
return Val; }
309 inline void set(
const SDValue &V);
312 inline void setInitial(
const SDValue &V);
315 inline void setNode(
SDNode *
N);
319 if (Next) Next->Prev = &Next;
324 void removeFromList() {
326 if (Next) Next->Prev = Prev;
344 bool NoUnsignedWrap : 1;
345 bool NoSignedWrap : 1;
347 bool UnsafeAlgebra : 1;
350 bool NoSignedZeros : 1;
351 bool AllowReciprocal : 1;
352 bool VectorReduction : 1;
357 NoUnsignedWrap =
false;
358 NoSignedWrap =
false;
360 UnsafeAlgebra =
false;
363 NoSignedZeros =
false;
364 AllowReciprocal =
false;
365 VectorReduction =
false;
392 NoUnsignedWrap &= Flags->NoUnsignedWrap;
393 NoSignedWrap &= Flags->NoSignedWrap;
394 Exact &= Flags->Exact;
395 UnsafeAlgebra &= Flags->UnsafeAlgebra;
396 NoNaNs &= Flags->NoNaNs;
397 NoInfs &= Flags->NoInfs;
398 NoSignedZeros &= Flags->NoSignedZeros;
399 AllowReciprocal &= Flags->AllowReciprocal;
420 uint16_t HasDebugValue : 1;
421 uint16_t IsMemIntrinsic : 1;
430 uint16_t IsOpaque : 1;
440 uint16_t IsVolatile : 1;
441 uint16_t IsNonTemporal : 1;
442 uint16_t IsDereferenceable : 1;
443 uint16_t IsInvariant : 1;
451 uint16_t AddressingMode : 3;
462 uint16_t IsExpanding : 1;
471 uint16_t IsTruncating : 1;
472 uint16_t IsCompressing : 1;
488 static_assert(
sizeof(SDNodeBitfields) <= 2,
"field too wide");
489 static_assert(
sizeof(ConstantSDNodeBitfields) <= 2,
"field too wide");
490 static_assert(
sizeof(MemSDNodeBitfields) <= 2,
"field too wide");
491 static_assert(
sizeof(LSBaseSDNodeBitfields) <= 2,
"field too wide");
492 static_assert(
sizeof(LoadSDNodeBitfields) <= 4,
"field too wide");
493 static_assert(
sizeof(StoreSDNodeBitfields) <= 2,
"field too wide");
504 const EVT *ValueList;
510 unsigned short NumOperands, NumValues;
523 static const EVT *getValueTypeList(
EVT VT);
618 :
public std::iterator<std::forward_iterator_tag, SDUse, ptrdiff_t> {
626 typedef std::iterator<std::forward_iterator_tag,
628 typedef std::iterator<std::forward_iterator_tag,
646 assert(
Op &&
"Cannot increment end iterator!");
657 assert(
Op &&
"Cannot dereference end iterator!");
658 return Op->getUser();
667 assert(
Op &&
"Cannot dereference end iterator!");
668 return (
unsigned)(
Op -
Op->getUser()->OperandList);
722 if (Visited.
count(N))
724 while (!Worklist.
empty()) {
729 if (Visited.
insert(Op).second)
747 assert(Num < NumOperands &&
"Invalid child # of SDNode!");
748 return OperandList[Num];
760 std::random_access_iterator_tag, SDValue,
761 ptrdiff_t, value_op_iterator *,
762 value_op_iterator *> {
792 if (UI.getUse().get().getValueType() ==
MVT::Glue)
809 assert(ResNo < NumValues &&
"Illegal result number!");
810 return ValueList[ResNo];
850 unsigned depth = 100)
const;
880 unsigned depth = 100)
const;
899 : NodeType(Opc), NodeId(-1), OperandList(nullptr), ValueList(VTs.VTs),
900 UseList(nullptr), NumOperands(0), NumValues(VTs.NumVTs), IROrder(Order),
901 debugLoc(std::move(dl)) {
905 "NumValues wasn't wide enough for its operands!");
931 assert(Order >= 0 &&
"bad IROrder");
943 : Node(node), ResNo(resno) {
947 assert((!Node || !ResNo || ResNo < Node->getNumValues()) &&
948 "Invalid result number for the given node!");
949 assert(ResNo < -2U &&
"Cannot use result numbers reserved for DenseMaps.");
1005 return Node->
dump();
1009 return Node->
dumpr();
1014 inline void SDUse::set(
const SDValue &V) {
1015 if (Val.
getNode()) removeFromList();
1020 inline void SDUse::setInitial(
const SDValue &V) {
1025 inline void SDUse::setNode(SDNode *
N) {
1026 if (Val.
getNode()) removeFromList();
1028 if (N) N->addUse(*
this);
1061 :
SDNode(Opc, Order, dl, VTs),
Flags(NodeFlags) {}
1098 unsigned SrcAddrSpace;
1099 unsigned DestAddrSpace;
1103 unsigned SrcAS,
unsigned DestAS);
1242 :
MemSDNode(Opc, Order, dl, VTL, MemVT, MMO) {}
1290 :
MemSDNode(Opc, Order, dl, VTs, MemoryVT, MMO) {
1337 assert(
isSplat() &&
"Cannot get splat index for non-splat!");
1351 unsigned NumElems = Mask.
size();
1352 for (
unsigned i = 0;
i != NumElems; ++
i) {
1356 else if (idx < (
int)NumElems)
1357 Mask[
i] = idx + NumElems;
1359 Mask[
i] = idx - NumElems;
1476 unsigned char TargetFlags;
1518 unsigned char TargetFlags;
1544 unsigned char TargetFlags;
1549 unsigned Align,
unsigned char TF)
1558 EVT VT,
int o,
unsigned Align,
unsigned char TF)
1563 Val.MachineCPVal = v;
1574 return Val.ConstVal;
1579 return Val.MachineCPVal;
1601 unsigned char TargetFlags;
1657 unsigned &SplatBitSize,
bool &HasAnyUndefs,
1658 unsigned MinSplatBits = 0,
1659 bool isBigEndian =
false)
const;
1774 unsigned char TargetFlags;
1779 int64_t o,
unsigned char Flags)
1813 unsigned char TargetFlags;
1888 :
MemSDNode(NodeTy, Order, dl, VTs, MemVT, MMO) {
1924 assert(
readMem() &&
"Load MachineMemOperand is not a load!");
1979 :
MemSDNode(NodeTy, Order, dl, VTs, MemVT, MMO) {}
2024 bool isTrunc,
bool isCompressing,
EVT MemVT,
2059 :
MemSDNode(NodeTy, Order, dl, VTs, MemVT, MMO) {}
2117 :
SDNode(Opc, Order, DL, VTs), MemRefs(nullptr), MemRefsEnd(nullptr) {}
2131 for (
mmo_iterator MMI = NewMemRefs, MME = NewMemRefsEnd; MMI != MME; ++MMI)
2132 assert(*MMI &&
"Null mem ref detected!");
2133 MemRefs = NewMemRefs;
2134 MemRefsEnd = NewMemRefsEnd;
2143 SDNode, ptrdiff_t> {
2151 return Operand == x.Operand;
2168 assert(Node == Other.Node &&
2169 "Cannot compare iterators of two different nodes!");
2170 return Operand - Other.Operand;
2199 typedef AlignedCharArrayUnion<AtomicSDNode, TargetIndexSDNode,
2200 BlockAddressSDNode, GlobalAddressSDNode>
2217 return isa<LoadSDNode>(
N) &&
2223 return isa<LoadSDNode>(
N) &&
2224 cast<LoadSDNode>(N)->getExtensionType() ==
ISD::EXTLOAD;
2229 return isa<LoadSDNode>(
N) &&
2235 return isa<LoadSDNode>(
N) &&
2241 return isa<LoadSDNode>(
N) &&
2255 return isa<StoreSDNode>(
N) && !cast<StoreSDNode>(N)->isTruncatingStore();
2260 return isa<StoreSDNode>(
N) && cast<StoreSDNode>(N)->isTruncatingStore();
2265 return isa<StoreSDNode>(
N) &&
2273 #endif // LLVM_CODEGEN_SELECTIONDAGNODES_H
MVT getSimpleValueType() const
Return the simple ValueType of the referenced return value.
value_iterator value_begin() const
Iterator for directly iterating over the operand SDValue's.
bool hasNoUnsignedWrap() const
void setAllowReciprocal(bool b)
pointer operator->() const
unsigned getValueSizeInBits(unsigned ResNo) const
Returns MVT::getSizeInBits(getValueType(ResNo)).
bool use_empty() const
Return true if there are no uses of this node.
void push_back(const T &Elt)
BUILTIN_OP_END - This must be the last enum value in this list.
MCSymbol * getLabel() const
SDValue getValue(unsigned R) const
const SDValue & getValue() const
const DebugLoc & getDebugLoc() const
static void commuteMask(MutableArrayRef< int > Mask)
Change values in a shuffle permute mask assuming the two vector operands have swapped position...
ConstantFPSDNode * getConstantFPSplatNode(BitVector *UndefElements=nullptr) const
Returns the splatted constant FP or null if this is not a constant FP splat.
bool isTruncatingStore() const
Return true if the op does a truncation before store.
const SDValue & operator*() const
const char * getSymbol() const
This SDNode is used for target intrinsics that touch memory and need an associated MachineMemOperand...
bool isExactlyValue(double V) const
We don't rely on operator== working on double values, as it returns true for things that are clearly ...
SDValue getSplatValue(BitVector *UndefElements=nullptr) const
Returns the splatted value or a null value if this is not a splat.
bool hasNoSignedZeros() const
bool isBuildVectorOfConstantSDNodes(const SDNode *N)
Return true if the specified node is a BUILD_VECTOR node of all ConstantSDNode or undef...
static bool classof(const SDNode *N)
Atomic ordering constants.
void dumprFull(const SelectionDAG *G=nullptr) const
printrFull to dbgs().
SDNode * operator->() const
MDNODE_SDNODE - This is a node that holdes an MDNode*, which is used to reference metadata in the IR...
bool isNON_TRUNCStore(const SDNode *N)
Returns true if the specified node is a non-truncating store.
void intersectWith(const SDNodeFlags *Flags)
Clear any flags in this flag set that aren't also set in Flags.
void setMemRefs(mmo_iterator NewMemRefs, mmo_iterator NewMemRefsEnd)
Assign this MachineSDNodes's memory reference descriptor list.
bool hasOneUse() const
Return true if there is exactly one use of this node.
unsigned getDestAddressSpace() const
bool hasNUsesOfValue(unsigned NUses, unsigned Value) const
Return true if there are exactly NUSES uses of the indicated value.
VECTOR_SHUFFLE(VEC1, VEC2) - Returns a vector, of the same type as VEC1/VEC2.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
bool hasOneUse() const
Return true if there is exactly one node using value ResNo of Node.
const Value * getValue() const
Return the contained Value.
SDVTList getVTList() const
const SDValue & getVal() const
BinaryWithFlagsSDNode(unsigned Opc, unsigned Order, const DebugLoc &dl, SDVTList VTs, const SDNodeFlags &NodeFlags)
int getSplatIndex() const
This provides a very simple, boring adaptor for a begin and end iterator into a range type...
bool operator!=(const use_iterator &x) const
SDNode * getGluedNode() const
If this node has a glue operand, return the node to which the glue operand points.
StoreSDNodeBitfields StoreSDNodeBits
static bool isBinOpWithFlags(unsigned Opcode)
Returns true if the opcode is a binary operation with flags.
unsigned getSrcAddressSpace() const
size_type count(PtrType Ptr) const
count - Return 1 if the specified pointer is in the set, 0 otherwise.
const GlobalValue * getGlobal() const
Completely target-dependent object reference.
unsigned getOpcode() const
Return the SelectionDAG opcode value for this node.
bool operator!=(const SDNodeIterator &x) const
bool getHasDebugValue() const
const SDValue & getSrc0() const
static bool classof(const SDNode *N)
TargetGlobalAddress - Like GlobalAddress, but the DAG does no folding or anything else with this node...
bool isUnindexed() const
Return true if this is NOT a pre/post inc/dec load/store.
unsigned getRawSubclassData() const
Return the SubclassData value, without HasDebugValue.
bool isBitwiseNot(SDValue V)
Returns true if V is a bitwise not operation.
Val, Success, OUTCHAIN = ATOMIC_CMP_SWAP_WITH_SUCCESS(INCHAIN, ptr, cmp, swap) N.b.
unsigned getNumOperands() const
Return the number of values used by this operation.
SDNode * operator->() const
unsigned getNumOperands() const
unsigned getValueSizeInBits() const
Returns the size of the value in bits.
int64_t getOffset() const
const SDValue & getOffset() const
This class is an extension of BinarySDNode used from those opcodes that have associated extra flags...
const SDValue & getOperand(unsigned Num) const
mmo_iterator memoperands_end() const
const uint32_t * getRegMask() const
void setNodeId(int Id)
Set unique node id.
static bool classof(const SDNode *N)
ConstantSDNode * getConstantSplatNode(BitVector *UndefElements=nullptr) const
Returns the splatted constant or null if this is not a constant splat.
const MachinePointerInfo & getPointerInfo() const
const SDValue & getValue() const
void setNoSignedZeros(bool b)
const SDValue & getBasePtr() const
static ChildIteratorType child_end(NodeRef N)
static SimpleType getSimplifiedValue(SDUse &Val)
MachineMemOperand ** mmo_iterator
uint16_t PersistentId
Unique and persistent id per SDNode in the DAG.
NodeType
ISD::NodeType enum - This enum defines the target-independent operators for a SelectionDAG.
unsigned getResNo() const
get the index which selects a specific result in the SDNode
bool isUndef() const
Return true if the type of the node type undefined.
int64_t getSrcValueOffset() const
This SDNode is used to implement the code generator support for the llvm IR shufflevector instruction...
bool isAllOnesValue() const
char RawSDNodeBits[sizeof(uint16_t)]
static bool classof(const SDNode *N)
bool operator!=(const SDValue &V) const
Convenience function for get().operator!=.
MemSDNode(unsigned Opc, unsigned Order, const DebugLoc &dl, SDVTList VTs, EVT MemoryVT, MachineMemOperand *MMO)
RESULT,OUTCHAIN = INTRINSIC_W_CHAIN(INCHAIN, INTRINSICID, arg1, ...) This node represents a target in...
A templated base class for SmallPtrSet which provides the typesafe interface that is common across al...
bool isTargetOpcode() const
static bool hasPredecessorHelper(const SDNode *N, SmallPtrSetImpl< const SDNode * > &Visited, SmallVectorImpl< const SDNode * > &Worklist)
Returns true if N is a predecessor of any node in Worklist.
void dumpr() const
Dump (recursively) this node and its use-def subgraph.
static SDVTList getSDVTList(EVT VT)
void setNoSignedWrap(bool b)
void print_types(raw_ostream &OS, const SelectionDAG *G) const
The address of a basic block.
AtomicOrdering getOrdering() const
Return the atomic ordering requirements for this memory operation.
static bool classof(const SDNode *N)
bool isSEXTLoad(const SDNode *N)
Returns true if the specified node is a SEXTLOAD.
bool isNegative() const
Return true if the value is negative.
void dumprWithDepth(const SelectionDAG *G=nullptr, unsigned depth=100) const
printrWithDepth to dbgs().
A description of a memory reference used in the backend.
mmo_iterator memoperands_begin() const
AddrSpaceCastSDNode(unsigned Order, const DebugLoc &dl, EVT VT, unsigned SrcAS, unsigned DestAS)
static bool classof(const SDNode *N)
struct fuzzer::@269 Flags
void setVectorReduction(bool b)
int64_t getOffset() const
static SDValue getTombstoneKey()
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.
Base class for LoadSDNode and StoreSDNode.
bool isBuildVectorAllZeros(const SDNode *N)
Return true if the specified node is a BUILD_VECTOR where all of the elements are 0 or undef...
EVT getValueType(unsigned ResNo) const
Return the type of a specified result.
unsigned getOperand() const
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
bool isZEXTLoad(const SDNode *N)
Returns true if the specified node is a ZEXTLOAD.
unsigned getAddressSpace() const
Reg
All possible values of the reg field in the ModR/M byte.
bool memoperands_empty() const
EVT getScalarType() const
getScalarType - If this is a vector type, return the element type, otherwise return this...
Val, OUTCHAIN = ATOMIC_SWAP(INCHAIN, ptr, amt) Val, OUTCHAIN = ATOMIC_LOAD_[OpName](INCHAIN, ptr, amt) For double-word atomic operations: ValLo, ValHi, OUTCHAIN = ATOMIC_SWAP(INCHAIN, ptr, amtLo, amtHi) ValLo, ValHi, OUTCHAIN = ATOMIC_LOAD_[OpName](INCHAIN, ptr, amtLo, amtHi) These correspond to the atomicrmw instruction.
unsigned getMachineOpcode() const
bool isTRUNCStore(const SDNode *N)
Returns true if the specified node is a truncating store.
int getMaskElt(unsigned Idx) const
This class is used to represent EVT's, which are used to parameterize some operations.
This is an SDNode representing atomic operations.
ISD::LoadExtType getExtensionType() const
ShuffleVectorSDNode(EVT VT, unsigned Order, const DebugLoc &dl, const int *M)
static unsigned getHashValue(const SDValue &Val)
This represents a list of ValueType's that has been intern'd by a SelectionDAG.
bool isConstantSplatVector(const SDNode *N, APInt &SplatValue)
Node predicates.
LLVM_NODISCARD bool empty() const
This class is used to represent an MSTORE node.
AtomicOrdering
Atomic ordering for LLVM's memory model.
LoadSDNodeBitfields LoadSDNodeBits
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...
EVT getValueType() const
Convenience function for get().getValueType().
bool hasTrivialDestructor() const
Check whether this has a trivial destructor.
bool operator!=(const SDValue &O) const
static bool classof(const SDNode *N)
static bool classof(const SDNode *N)
void checkForCycles(const SelectionDAG *DAG, bool force=false)
unsigned getIROrder() const
Return the node ordering.
bool operator==(const use_iterator &x) const
opStatus convert(const fltSemantics &ToSemantics, roundingMode RM, bool *losesInfo)
static SDNodeIterator begin(const SDNode *N)
bool isUNINDEXEDStore(const SDNode *N)
Returns true if the specified node is an unindexed store.
unsigned getNumValues() const
Return the number of values defined/returned by this operator.
iterator_range< use_iterator > uses() const
static bool classof(const SDNode *N)
static bool classof(const SDNode *N)
value_iterator value_end() const
Simple integer binary arithmetic operators.
static SimpleType getSimplifiedValue(const SDValue &Val)
AtomicOrdering getOrdering() const
Return the atomic ordering requirements for this memory operation.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
static bool classof(const SDNode *N)
static bool classof(const SDNode *N)
uint64_t getAlignment() const
Return the minimum known alignment in bytes of the actual memory reference.
bool isTargetOpcode() const
Test if this node has a target-specific opcode (in the <target>ISD namespace).
const SDValue & getBasePtr() const
MachineConstantPoolValue * getMachineCPVal() const
CondCode
ISD::CondCode enum - These are ordered carefully to make the bitfields below work out...
const APInt & getAPIntValue() const
TargetConstant* - Like Constant*, but the DAG does not do any folding, simplification, or lowering of the constant.
EVT getMemoryVT() const
Return the type of the in-memory value.
static const char * getIndexedModeName(ISD::MemIndexedMode AM)
MachineConstantPoolValue * MachineCPVal
const ConstantInt * getConstantIntValue() const
void setIROrder(unsigned Order)
Set the node ordering.
pointer operator*() const
size_t size() const
size - Get the array size.
SDNodeBitfields SDNodeBits
unsigned char getTargetFlags() const
static bool classof(const SDNode *N)
static bool classof(const SDNode *N)
UNDEF - An undefined node.
This class is used to represent ISD::STORE nodes.
const SDValue & getBasePtr() const
MaskedStoreSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs, bool isTrunc, bool isCompressing, EVT MemVT, MachineMemOperand *MMO)
std::string getOperationName(const SelectionDAG *G=nullptr) const
Return the opcode of this operation for printing.
BUILD_VECTOR(ELT0, ELT1, ELT2, ELT3,...) - Return a vector with the specified, possibly variable...
bool isOneConstant(SDValue V)
Returns true if V is a constant integer one.
SDNode * getNode() const
get the SDNode which holds the desired result
FoldingSetNodeID - This class is used to gather all the unique data bits of a node.
bool isNaN() const
Return true if the value is a NaN.
bool hasPredecessor(const SDNode *N) const
Return true if N is a predecessor of this node.
static bool classof(const SDNode *N)
bool isOnlyUserOf(const SDNode *N) const
Return true if this node is the only use of N.
bool isNormalLoad(const SDNode *N)
Returns true if the specified node is a non-extending and unindexed load.
bool operator==(const SDValue &V) const
Convenience function for get().operator==.
OUTCHAIN = INTRINSIC_VOID(INCHAIN, INTRINSICID, arg1, arg2, ...) This node represents a target intrin...
SynchronizationScope getSynchScope() const
Return the synchronization scope for this memory operation.
const SDValue & getBasePtr() const
bool isZero() const
Return true if the value is positive or negative zero.
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
value_op_iterator(SDUse *U=nullptr)
SDNodeIterator ChildIteratorType
size_t use_size() const
Return the number of uses of this node.
bool isMachineConstantPoolEntry() const
bool isTargetMemoryOpcode() const
MVT - Machine Value Type.
static bool classof(const SDNode *N)
LLVM Basic Block Representation.
const SDValue & getOperand(unsigned i) const
The instances of the Type class are immutable: once they are created, they are never changed...
bool isCompareAndSwap() const
Returns true if this SDNode represents cmpxchg atomic operation, false otherwise. ...
bool isCompressingStore() const
Returns true if the op does a compression to the vector before storing.
Simple binary floating point operators.
bool isNonTemporal() const
AAMDNodes getAAInfo() const
Return the AA tags for the memory reference.
CRTP base class for adapting an iterator to a different type.
SynchronizationScope getSynchScope() const
Return the synchronization scope for this memory operation.
void DropOperands()
Release the operands and set this node to have zero operands.
unsigned getOperandNo() const
Retrieve the operand # of this use in its user.
This is an important base class in LLVM.
static bool classof(const SDNode *N)
LoadExtType
LoadExtType enum - This enum defines the three variants of LOADEXT (load with extension).
MachineBasicBlock * getBasicBlock() const
const Constant * getConstVal() const
This file contains the declarations for the subclasses of Constant, which represent the different fla...
use_iterator operator++(int)
ConstantFP - Floating Point Values [float, double].
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
This is a base class used to represent MGATHER and MSCATTER nodes.
unsigned getScalarValueSizeInBits() const
AtomicOrdering getFailureOrdering() const
For cmpxchg atomic operations, return the atomic ordering requirements when store does not occur...
bool hasVectorReduction() const
const DebugLoc & getDebugLoc() const
Return the debug location for this node as a DebugLoc.
This file declares a class to represent arbitrary precision floating point values and provide a varie...
This class provides iterator support for SDUse operands that use a specific SDNode.
unsigned getOriginalAlignment() const
Returns alignment and volatility of the memory access.
bool hasAllowReciprocal() const
static bool classof(const SDNode *N)
void printrFull(raw_ostream &O, const SelectionDAG *G=nullptr) const
Print a SelectionDAG node and all children down to the leaves.
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang","erlang-compatible garbage collector")
SDNode(unsigned Opc, unsigned Order, DebugLoc dl, SDVTList VTs)
Create an SDNode.
unsigned getOpcode() const
TargetIndex - Like a constant pool entry, but with completely target-dependent semantics.
const SDValue & getBasePtr() const
MCSymbol * getMCSymbol() const
static bool classof(const SDNode *N)
SDNodeIterator & operator++()
SDNodeIterator operator++(int)
unsigned char getTargetFlags() const
std::iterator< std::forward_iterator_tag, SDUse, ptrdiff_t >::pointer pointer
static bool classof(const SDNode *N)
static bool classof(const SDNode *N)
const SDNode * getNode() const
static bool classof(const SDNode *N)
use_iterator use_begin() const
Provide iteration support to walk over all uses of an SDNode.
const SDValue & getValue() const
ConstantSDNode * isConstOrConstSplat(SDValue V)
Returns the SDNode if it is a constant splat BuildVector or constant int.
unsigned char getTargetFlags() const
bool operator<(const SDValue &V) const
Convenience function for get().operator<.
static bool isValueValidForType(EVT VT, const APFloat &Val)
GlobalAddressSDNode MostAlignedSDNode
The SDNode class with the greatest alignment requirement.
Val, OUTCHAIN = ATOMIC_CMP_SWAP(INCHAIN, ptr, cmp, swap) For double-word atomic operations: ValLo...
void addUse(SDUse &U)
This method should only be used by the SDUse class.
static bool classof(const SDNode *N)
EVT - Extended Value Type.
static bool classof(const SDNode *N)
const SDValue & getMask() const
const APFloat & getValueAPF() const
const ConstantFP * getConstantFPValue() const
std::iterator< std::forward_iterator_tag, SDUse, ptrdiff_t >::reference reference
Abstract base class for all machine specific constantpool value subclasses.
static bool classof(const SDNode *N)
ISD::MemIndexedMode getAddressingMode() const
Return the addressing mode for this load or store: unindexed, pre-inc, pre-dec, post-inc, or post-dec.
static bool classof(const SDNode *N)
This class contains a discriminated union of information about pointers in memory operands...
uint64_t getConstantOperandVal(unsigned Num) const
Helper method returns the integer value of a ConstantSDNode operand.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
HANDLENODE node - Used as a handle for various purposes.
const BlockAddress * getBlockAddress() const
bool operator<(const SDValue &O) const
EH_LABEL - Represents a label in mid basic block used to track locations needed for debug and excepti...
void print(raw_ostream &OS, const SelectionDAG *G=nullptr) const
void refineAlignment(const MachineMemOperand *MMO)
Update this MachineMemOperand to reflect the alignment of MMO, if it has a greater alignment...
bool isEXTLoad(const SDNode *N)
Returns true if the specified node is a EXTLOAD.
void intersectFlagsWith(const SDNodeFlags *Flags)
Clear any flags in this node that aren't also set in Flags.
const MachinePointerInfo & getPointerInfo() const
MachineMemOperand * MMO
Memory reference information.
static bool classof(const SDNode *N)
const MDNode * getRanges() const
Returns the Ranges that describes the dereference.
bool isUNINDEXEDLoad(const SDNode *N)
Returns true if the specified node is an unindexed load.
const SDValue & getOffset() const
ArrayRef< int > getMask() const
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
bool isBuildVectorAllOnes(const SDNode *N)
Return true if the specified node is a BUILD_VECTOR where all of the elements are ~0 or undef...
ConstantSDNodeBitfields ConstantSDNodeBits
static bool classof(const SDNode *N)
isPodLike - This is a type trait that is used to determine whether a given type can be copied around ...
void setNoUnsignedWrap(bool b)
const DebugLoc & getDebugLoc() const
This is the shared class of boolean and integer constants.
void dump() const
Dump this node, for debugging.
void setNode(SDNode *N)
set the SDNode
bool isInfinity() const
Return true if the value is an infinity.
use_iterator(const use_iterator &I)
TargetIndexSDNode(int Idx, EVT VT, int64_t Ofs, unsigned char TF)
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
ADDRSPACECAST - This operator converts between pointers of different address spaces.
static bool classof(const SDNode *N)
bool isPredecessorOf(const SDNode *N) const
Return true if this node is a predecessor of N.
bool allOperandsUndef(const SDNode *N)
Return true if the node has at least one operand and all operands of the specified node are ISD::UNDE...
SDNode * getGluedUser() const
If this node has a glue value with a user, return the user (there is at most one).
An SDNode that represents everything that will be needed to construct a MachineInstr.
const SDValue & getChain() const
Promote Memory to Register
A collection of metadata nodes that might be associated with a memory access used by the alias-analys...
LLVM_NODISCARD T pop_back_val()
MachineMemOperand * getMemOperand() const
Return a MachineMemOperand object describing the memory reference performed by operation.
unsigned char getTargetFlags() const
This is an abstract virtual class for memory operations.
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
bool isMachineOpcode() const
unsigned getAddrSpace() const
Return the LLVM IR address space number that this pointer points into.
static const int FIRST_TARGET_MEMORY_OPCODE
FIRST_TARGET_MEMORY_OPCODE - Target-specific pre-isel operations which do not reference a specific me...
bool hasNoSignedWrap() const
bool isDereferenceable() const
Represents one node in the SelectionDAG.
bool use_empty() const
Return true if there are no nodes using value ResNo of Node.
AAMDNodes getAAInfo() const
Returns the AA info that describes the dereference.
static bool classof(const SDNode *N)
void print_details(raw_ostream &OS, const SelectionDAG *G) const
Node - This class is used to maintain the singly linked bucket list in a folding set.
const SDValue & getValue() const
A range adaptor for a pair of iterators.
ISD::LoadExtType getExtensionType() const
Return whether this is a plain node, or one of the varieties of value-extending loads.
Class for arbitrary precision integers.
bool isBuildVectorOfConstantFPSDNodes(const SDNode *N)
Return true if the specified node is a BUILD_VECTOR node of all ConstantFPSDNode or undef...
iterator_range< use_iterator > uses()
void printr(raw_ostream &OS, const SelectionDAG *G=nullptr) const
A "pseudo-class" with methods for operating on BUILD_VECTORs.
int64_t getSExtValue() const
op_iterator op_begin() const
static use_iterator use_end()
bool isNullFPConstant(SDValue V)
Returns true if V is an FP constant with a value of positive zero.
const EVT * value_iterator
LSBaseSDNodeBitfields LSBaseSDNodeBits
static SDValue getEmptyKey()
static bool classof(const SDNode *N)
iterator_range< value_op_iterator > op_values() const
static bool classof(const SDNode *N)
unsigned getAddressSpace() const
Return the address space for the associated pointer.
SDNode * operator*() const
Retrieve a pointer to the current user node.
const SDValue & getMask() const
static bool classof(const SDNode *N)
int64_t getOffset() const
unsigned char getTargetFlags() const
ConstantFPSDNode * isConstOrConstSplatFP(SDValue V)
Returns the SDNode if it is a constant splat BuildVector or constant float.
These are IR-level optimization flags that may be propagated to SDNodes.
Represents a use of a SDNode.
unsigned getIROrder() const
uint64_t getConstantOperandVal(unsigned i) const
static bool classof(const SDNode *N)
bool hasAnyUseOfValue(unsigned Value) const
Return true if there are any use of the indicated value.
This base class is used to represent MLOAD and MSTORE nodes.
LOAD and STORE have token chains as their first operand, then the same operands as an LLVM load/store...
unsigned getSizeInBits() const
getSizeInBits - Return the size of the specified value type in bits.
static NodeRef getEntryNode(SDNode *N)
static SimpleType getSimplifiedValue(SDValue &Val)
ArrayRef< SDUse > ops() const
bool isOperandOf(const SDNode *N) const
Return true if this node is an operand of N.
void Profile(FoldingSetNodeID &ID) const
Gather unique data for the node.
bool isIndexed() const
Return true if this is a pre/post inc/dec load/store.
op_iterator op_end() const
An SDNode that holds an arbitrary LLVM IR Value.
bool operator==(const SDNodeIterator &x) const
const SDValue & getOffset() const
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
bool isExpandingLoad() 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 hasUnsafeAlgebra() const
bool isNON_EXTLoad(const SDNode *N)
Returns true if the specified node is a non-extending load.
SDUse * getNext() const
Get the next SDUse in the use list.
use_iterator & operator++()
This class is used to represent an MSCATTER node.
const SDValue & getIndex() const
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, return the log base 2 integer value.
int getNodeId() const
Return the unique node id.
static ChildIteratorType child_begin(NodeRef N)
EVT getValueType() const
Return the ValueType of the referenced return value.
SDNode * getNode() const
Convenience function for get().getNode().
void setUnsafeAlgebra(bool b)
const DebugLoc & getDebugLoc() const
Return the source location info.
const Constant * ConstVal
AlignedCharArrayUnion< AtomicSDNode, TargetIndexSDNode, BlockAddressSDNode, GlobalAddressSDNode > LargestSDNode
A representation of the largest SDNode, for use in sizeof().
const MDNode * getMD() const
MaskedGatherScatterSDNode(ISD::NodeType NodeTy, unsigned Order, const DebugLoc &dl, SDVTList VTs, EVT MemVT, MachineMemOperand *MMO)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This class is used to form a handle around another node that is persistent and is updated across invo...
bool isAllOnesConstant(SDValue V)
Returns true if V is an integer constant with all bits set.
This class is used to represent an MLOAD node.
MaskedScatterSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs, EVT MemVT, MachineMemOperand *MMO)
bool atEnd() const
Return true if this iterator is at the end of uses list.
unsigned getAlignment() const
const MDNode * getRanges() const
Return the range tag for the memory reference.
LLVM Value Representation.
const SDValue & getBasePtr() const
static bool isEqual(const SDValue &LHS, const SDValue &RHS)
static SDNodeIterator end(const SDNode *N)
int64_t getOffset() const
For normal values, this is a byte offset added to the base address.
MemSDNodeBitfields MemSDNodeBits
bool isNullConstant(SDValue V)
Returns true if V is a constant integer zero.
bool isTruncatingStore() const
Return true if the op does a truncation before store.
void setDebugLoc(DebugLoc dl)
Set source location info.
This class is used to represent an MGATHER node.
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.
PREFETCH - This corresponds to a prefetch intrinsic.
void setHasDebugValue(bool b)
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...
LSBaseSDNode(ISD::NodeType NodeTy, unsigned Order, const DebugLoc &dl, SDVTList VTs, ISD::MemIndexedMode AM, EVT MemVT, MachineMemOperand *MMO)
This class implements an extremely fast bulk output stream that can only output to a stream...
SDNodeFlags()
Default constructor turns off all optimization flags.
size_t operator-(SDNodeIterator Other) const
SDLoc(const Instruction *I, int Order)
static bool classof(const SDNode *N)
AtomicOrdering getFailureOrdering() const
For cmpxchg atomic operations, return the atomic ordering requirements when store does not occur...
OUTCHAIN = ATOMIC_STORE(INCHAIN, ptr, val) This corresponds to "store atomic" instruction.
SDNode * getUser()
This returns the SDNode that contains this Use.
MaskedLoadSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs, ISD::LoadExtType ETy, bool IsExpanding, EVT MemVT, MachineMemOperand *MMO)
bool isOperandOf(const SDNode *N) const
Return true if this node is an operand of N.
bool isTargetMemoryOpcode() const
Test if this node has a target-specific memory-referencing opcode (in the <target>ISD namespace and g...
unsigned getAlignment() const
AtomicSDNode(unsigned Opc, unsigned Order, const DebugLoc &dl, SDVTList VTL, EVT MemVT, MachineMemOperand *MMO)
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation...
MVT getSimpleValueType(unsigned ResNo) const
Return the type of a specified result as a simple type.
MemIntrinsicSDNode(unsigned Opc, unsigned Order, const DebugLoc &dl, SDVTList VTs, EVT MemoryVT, MachineMemOperand *MMO)
Val, OUTCHAIN = ATOMIC_LOAD(INCHAIN, ptr) This corresponds to "load atomic" instruction.
bool isMemIntrinsic() const
Test if this node is a memory intrinsic (with valid pointer information).
bool operator==(const SDValue &O) const
static bool isSplatMask(const int *Mask, EVT VT)
unsigned getResNo() const
Convenience function for get().getResNo().
MVT getSimpleVT() const
getSimpleVT - Return the SimpleValueType held in the specified simple EVT.
const SDNodeFlags * getFlags() const
This could be defined as a virtual function and implemented more simply and directly, but it is not to avoid creating a vtable for this class.
bool isMachineOpcode() const
Test if this node has a post-isel opcode, directly corresponding to a MachineInstr opcode...
unsigned char getTargetFlags() const
MaskedGatherSDNode(unsigned Order, const DebugLoc &dl, SDVTList VTs, EVT MemVT, MachineMemOperand *MMO)
unsigned getMachineOpcode() const
This may only be called if isMachineOpcode returns true.
uint64_t getBaseAlignment() const
Return the minimum known alignment in bytes of the base address, without the offset.
void refineAlignment(const MachineMemOperand *NewMMO)
Update this MemSDNode's MachineMemOperand information to reflect the alignment of NewMMO...
uint64_t getZExtValue() const
MaskedLoadStoreSDNode(ISD::NodeType NodeTy, unsigned Order, const DebugLoc &dl, SDVTList VTs, EVT MemVT, MachineMemOperand *MMO)
MemIndexedMode
MemIndexedMode enum - This enum defines the load / store indexed addressing modes.
unsigned getVectorNumElements() const
getVectorNumElements - Given a vector type, return the number of elements it contains.
SRCVALUE - This is a node type that holds a Value* that is used to make reference to a value in the L...
This class is used to represent ISD::LOAD nodes.