19 #ifndef LLVM_CODEGEN_SELECTIONDAGNODES_H
20 #define LLVM_CODEGEN_SELECTIONDAGNODES_H
36 #include "llvm/Support/DataTypes.h"
44 class MachineBasicBlock;
45 class MachineConstantPoolValue;
49 template <
typename T>
struct DenseMapInfo;
50 template <
typename T>
struct simplify_type;
51 template <
typename T>
struct ilist_traits;
126 return Node == O.Node && ResNo == O.ResNo;
132 return std::tie(Node, ResNo) < std::tie(O.Node, O.ResNo);
134 explicit operator bool()
const {
135 return Node !=
nullptr;
172 inline void dump()
const;
173 inline void dumpr()
const;
181 unsigned Depth = 2)
const;
203 return ((
unsigned)((uintptr_t)Val.
getNode() >> 4) ^
243 void operator=(
const SDUse &U) =
delete;
246 SDUse() : Val(),
User(nullptr), Prev(nullptr), Next(nullptr) {}
249 operator const SDValue&()
const {
return Val; }
291 inline void set(
const SDValue &V);
294 inline void setInitial(
const SDValue &V);
297 inline void setNode(
SDNode *
N);
301 if (Next) Next->Prev = &Next;
306 void removeFromList() {
308 if (Next) Next->Prev = Prev;
331 uint16_t OperandsNeedDelete : 1;
335 uint16_t HasDebugValue : 1;
352 const EVT *ValueList;
358 unsigned short NumOperands, NumValues;
371 static const EVT *getValueTypeList(
EVT VT);
460 :
public std::iterator<std::forward_iterator_tag, SDUse, ptrdiff_t> {
466 typedef std::iterator<std::forward_iterator_tag,
468 typedef std::iterator<std::forward_iterator_tag,
482 bool atEnd()
const {
return Op ==
nullptr; }
486 assert(Op &&
"Cannot increment end iterator!");
497 assert(Op &&
"Cannot dereference end iterator!");
507 assert(Op &&
"Cannot dereference end iterator!");
508 return (
unsigned)(Op - Op->
getUser()->OperandList);
573 assert(Num < NumOperands &&
"Invalid child # of SDNode!");
574 return OperandList[Num];
585 std::random_access_iterator_tag, SDValue,
586 ptrdiff_t, value_op_iterator *,
587 value_op_iterator *> {
616 const SDNode *FoundNode =
this;
633 if (UI.getUse().get().getValueType() ==
MVT::Glue)
643 assert(ResNo < NumValues &&
"Illegal result number!");
644 return ValueList[ResNo];
684 unsigned depth = 100)
const;
715 unsigned depth = 100)
const;
731 : NodeType(Opc), OperandsNeedDelete(
true), HasDebugValue(
false),
734 ValueList(VTs.VTs), UseList(nullptr), NumOperands(Ops.
size()),
735 NumValues(VTs.NumVTs), IROrder(Order), debugLoc(std::move(dl)) {
737 assert(NumOperands == Ops.
size() &&
738 "NumOperands wasn't wide enough for its operands!");
739 assert(NumValues == VTs.
NumVTs &&
740 "NumValues wasn't wide enough for its operands!");
741 for (
unsigned i = 0; i != Ops.
size(); ++i) {
742 assert(OperandList &&
"no operands available");
743 OperandList[i].setUser(
this);
744 OperandList[i].setInitial(Ops[i]);
752 : NodeType(Opc), OperandsNeedDelete(
false), HasDebugValue(
false),
753 SubclassData(0), NodeId(-1), OperandList(nullptr), ValueList(VTs.VTs),
754 UseList(nullptr), NumOperands(0), NumValues(VTs.NumVTs),
755 IROrder(Order), debugLoc(std::move(dl)) {
757 assert(NumValues == VTs.
NumVTs &&
758 "NumValues wasn't wide enough for its operands!");
763 Ops[0].setUser(
this);
764 Ops[0].setInitial(Op0);
772 Ops[0].setUser(
this);
773 Ops[0].setInitial(Op0);
774 Ops[1].setUser(
this);
775 Ops[1].setInitial(Op1);
784 Ops[0].setUser(
this);
785 Ops[0].setInitial(Op0);
786 Ops[1].setUser(
this);
787 Ops[1].setInitial(Op1);
788 Ops[2].setUser(
this);
789 Ops[2].setInitial(Op2);
798 Ops[0].setUser(
this);
799 Ops[0].setInitial(Op0);
800 Ops[1].setUser(
this);
801 Ops[1].setInitial(Op1);
802 Ops[2].setUser(
this);
803 Ops[2].setInitial(Op2);
804 Ops[3].setUser(
this);
805 Ops[3].setInitial(Op3);
813 for (
unsigned i = 0; i !=
N; ++i) {
814 Ops[i].setUser(
this);
815 Ops[i].setInitial(Vals[i]);
818 assert(NumOperands == N &&
819 "NumOperands wasn't wide enough for its operands!");
845 SDLoc() : Ptr(nullptr), IROrder(0) {}
847 assert(N &&
"null SDNode");
850 assert(Ptr &&
"null SDNode");
853 assert(Order >= 0 &&
"bad IROrder");
856 if (IROrder >= 0 || Ptr ==
nullptr) {
857 return (
unsigned)IROrder;
879 : Node(node), ResNo(resno) {
880 assert((!Node || ResNo < Node->getNumValues()) &&
881 "Invalid result number for the given node!");
882 assert(ResNo < -2U &&
"Cannot use result numbers reserved for DenseMaps.");
925 return Node->
dumpr();
929 inline void SDUse::set(
const SDValue &V) {
930 if (Val.
getNode()) removeFromList();
935 inline void SDUse::setInitial(
const SDValue &V) {
940 inline void SDUse::setNode(SDNode *
N) {
941 if (Val.
getNode()) removeFromList();
943 if (N) N->addUse(*
this);
951 bool NoUnsignedWrap : 1;
952 bool NoSignedWrap : 1;
954 bool UnsafeAlgebra : 1;
957 bool NoSignedZeros : 1;
958 bool AllowReciprocal : 1;
963 NoUnsignedWrap =
false;
964 NoSignedWrap =
false;
966 UnsafeAlgebra =
false;
969 NoSignedZeros =
false;
970 AllowReciprocal =
false;
996 return (NoUnsignedWrap << 0) | (NoSignedWrap << 1) | (Exact << 2) |
997 (UnsafeAlgebra << 3) | (NoNaNs << 4) | (NoInfs << 5) |
998 (NoSignedZeros << 6) | (AllowReciprocal << 7);
1009 :
SDNode(Opc, Order, dl, VTs) {
1021 :
SDNode(Opc, Order, dl, VTs) {
1068 :
SDNode(Opc, Order, dl, VTs) {
1091 unsigned SrcAddrSpace;
1092 unsigned DestAddrSpace;
1096 unsigned SrcAS,
unsigned DestAS);
1235 assert((SuccessOrdering & 15) == SuccessOrdering &&
1236 "Ordering may not require more than 4 bits!");
1237 assert((FailureOrdering & 15) == FailureOrdering &&
1238 "Ordering may not require more than 4 bits!");
1239 assert((SynchScope & 1) == SynchScope &&
1240 "SynchScope may not require more than 1 bit!");
1243 this->FailureOrdering = FailureOrdering;
1245 "Ordering encoding error!");
1247 "Ordering encoding error!");
1248 assert(
getSynchScope() == SynchScope &&
"Synch-scope encoding error!");
1264 :
MemSDNode(Opc, Order, dl, VTL, MemVT, MMO) {
1265 InitAtomic(Ordering, Ordering, SynchScope);
1273 :
MemSDNode(Opc, Order, dl, VTL, MemVT, MMO) {
1274 InitAtomic(Ordering, Ordering, SynchScope);
1282 :
MemSDNode(Opc, Order, dl, VTL, MemVT, MMO) {
1283 InitAtomic(Ordering, Ordering, SynchScope);
1291 :
MemSDNode(Opc, Order, dl, VTL, MemVT, MMO) {
1292 InitAtomic(SuccessOrdering, FailureOrdering, SynchScope);
1294 "Too many ops for internal storage!");
1308 return FailureOrdering;
1345 :
MemSDNode(Opc, Order, dl, VTs, Ops, MemoryVT, MMO) {
1387 assert(Idx <
getValueType(0).getVectorNumElements() &&
"Idx out of range!");
1393 assert(
isSplat() &&
"Cannot get splat index for non-splat!");
1406 unsigned NumElems = Mask.
size();
1407 for (
unsigned i = 0; i != NumElems; ++i) {
1411 else if (idx < (
int)NumElems)
1412 Mask[i] = idx + NumElems;
1414 Mask[i] = idx - NumElems;
1503 unsigned char TargetFlags;
1507 unsigned char TargetFlags);
1543 unsigned char TargetFlags;
1567 unsigned char TargetFlags;
1570 unsigned Align,
unsigned char TF)
1574 assert(Offset >= 0 &&
"Offset is too large");
1578 EVT VT,
int o,
unsigned Align,
unsigned char TF)
1582 assert(Offset >= 0 &&
"Offset is too large");
1583 Val.MachineCPVal = v;
1584 Offset |= 1 << (
sizeof(
unsigned)*CHAR_BIT-1);
1594 return Val.ConstVal;
1599 return Val.MachineCPVal;
1603 return Offset & ~(1 << (
sizeof(
unsigned)*CHAR_BIT-1));
1621 unsigned char TargetFlags;
1629 TargetFlags(TF), Index(Idx), Offset(Ofs) {}
1674 unsigned &SplatBitSize,
bool &HasAnyUndefs,
1675 unsigned MinSplatBits = 0,
1676 bool isBigEndian =
false)
const;
1759 const uint32_t *RegMask;
1776 unsigned char TargetFlags;
1779 int64_t o,
unsigned char Flags)
1781 BA(ba), Offset(o), TargetFlags(Flags) {
1812 unsigned char TargetFlags;
1870 assert(Ops.
size() == 5 &&
"wrong number of operations");
1912 :
MemSDNode(NodeTy, Order, dl, VTs, MemVT, MMO) {
1917 "Only indexed loads and stores have a non-undef offset operand");
1948 :
LSBaseSDNode(ISD::
LOAD, Order, dl, ChainPtrOff, 3, VTs, AM, MemVT, MMO) {
1951 assert(
readMem() &&
"Load MachineMemOperand is not a load!");
1952 assert(!
writeMem() &&
"Load MachineMemOperand is a store!");
1977 VTs, AM, MemVT, MMO) {
1980 assert(!
readMem() &&
"Store MachineMemOperand is a load!");
1981 assert(
writeMem() &&
"Store MachineMemOperand is not a store!");
2008 :
MemSDNode(NodeTy, Order, dl, VTs, MemVT, MMO) {
2052 unsigned numOperands,
SDVTList VTs,
bool isTrunc,
EVT MemVT,
2081 :
MemSDNode(NodeTy, Order, dl, VTs, MemVT, MMO) {
2082 assert(Operands.
size() == 5 &&
"Incompatible number of operands");
2111 "Incompatible type of the PathThru value in MaskedGatherSDNode");
2114 "Vector width mismatch between mask and data");
2116 "Vector width mismatch between mask and data");
2136 "Vector width mismatch between mask and data");
2138 "Vector width mismatch between mask and data");
2156 :
SDNode(Opc, Order, DL, VTs), MemRefs(nullptr), MemRefsEnd(nullptr) {}
2160 SDUse LocalOperands[4];
2174 for (
mmo_iterator MMI = NewMemRefs, MME = NewMemRefsEnd; MMI != MME; ++MMI)
2175 assert(*MMI &&
"Null mem ref detected!");
2176 MemRefs = NewMemRefs;
2177 MemRefsEnd = NewMemRefsEnd;
2186 SDNode, ptrdiff_t> {
2193 return Operand == x.Operand;
2210 assert(Node == Other.Node &&
2211 "Cannot compare iterators of two different nodes!");
2212 return Operand - Other.Operand;
2252 return isa<LoadSDNode>(
N) &&
2258 return isa<LoadSDNode>(
N) &&
2259 cast<LoadSDNode>(N)->getExtensionType() ==
ISD::EXTLOAD;
2264 return isa<LoadSDNode>(
N) &&
2270 return isa<LoadSDNode>(
N) &&
2276 return isa<LoadSDNode>(
N) &&
2290 return isa<StoreSDNode>(
N) && !cast<StoreSDNode>(N)->isTruncatingStore();
2295 return isa<StoreSDNode>(
N) && cast<StoreSDNode>(N)->isTruncatingStore();
2300 return isa<StoreSDNode>(
N) &&
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.
BUILTIN_OP_END - This must be the last enum value in this list.
unsigned getRawFlags() const
Return a raw encoding of the flags.
MCSymbol * getLabel() const
SDValue getValue(unsigned R) const
const SDValue & getValue() const
const DebugLoc & getDebugLoc() const
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)
PointerUnion< const Value *, const PseudoSourceValue * > ValueType
void dumprFull(const SelectionDAG *G=nullptr) const
printrFull to dbgs().
void dump() const
Dump this node, for debugging.
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 InitOperands(SDUse *Ops, const SDValue &Op0, const SDValue &Op1, const SDValue &Op2, const SDValue &Op3)
Initialize the operands list of this with 4 operands.
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 ...
void InitOperands(SDUse *Ops, const SDValue *Vals, unsigned N)
Initialize the operands list of this with N operands.
bool hasOneUse() const
Return true if there is exactly one node using value ResNo of Node.
This class is used for three-operand SDNodes.
DominatorTree GraphTraits specialization so the DominatorTree can be iterable by generic graph iterat...
const Value * getValue() const
Return the contained Value.
SDVTList getVTList() const
AtomicOrdering getSuccessOrdering() const
const SDValue & getVal() const
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.
static bool isBinOpWithFlags(unsigned Opcode)
Returns true if the opcode is a binary operation with flags.
unsigned getSrcAddressSpace() const
const GlobalValue * getGlobal() const
Completely target-dependent object reference.
unsigned getOpcode() const
Return the SelectionDAG opcode value for this node.
UnarySDNode(unsigned Opc, unsigned Order, DebugLoc dl, SDVTList VTs, SDValue X)
bool operator!=(const SDNodeIterator &x) const
bool getHasDebugValue() const
Get this bit.
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, which contains an encoding of the volatile flag, as well as bits used ...
static bool classof(const SDNode *N)
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
BinarySDNode(unsigned Opc, unsigned Order, DebugLoc dl, SDVTList VTs, SDValue X, SDValue Y)
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.
CvtCode
CvtCode enum - This enum defines the various converts CONVERT_RNDSAT supports.
const MachinePointerInfo & getPointerInfo() const
const SDValue & getValue() const
void setNoSignedZeros(bool b)
const SDValue & getBasePtr() const
static SimpleType getSimplifiedValue(SDUse &Val)
MachineMemOperand ** mmo_iterator
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
int64_t getSrcValueOffset() const
void InitOperands(SDUse *Ops, const SDValue &Op0, const SDValue &Op1, const SDValue &Op2)
Initialize the operands list of this with 3 operands.
This SDNode is used to implement the code generator support for the llvm IR shufflevector instruction...
bool isAllOnesValue() const
static bool classof(const SDNode *N)
bool operator!=(const SDValue &V) const
Convenience function for get().operator!=.
NOTE: avoid using this node as this may disappear in the future and most targets don't support it...
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
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
BlockAddress - The address of a basic block.
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().
MachineMemOperand - A description of a memory reference used in the backend.
mmo_iterator memoperands_begin() const
static bool classof(const SDNode *N)
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.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
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.
bool hasPredecessorHelper(const SDNode *N, SmallPtrSetImpl< const SDNode * > &Visited, SmallVectorImpl< const SDNode * > &Worklist) const
Return true if N is a predecessor of this node.
unsigned getOperand() const
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
MaskedGatherScatterSDNode(ISD::NodeType NodeTy, unsigned Order, DebugLoc dl, ArrayRef< SDValue > Operands, SDVTList VTs, EVT MemVT, MachineMemOperand *MMO)
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
static unsigned getHashValue(const SDValue &Val)
This represents a list of ValueType's that has been intern'd by a SelectionDAG.
This class is used to represent an MSTORE node.
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
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
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
const SDNode * getGluedMachineNode() const
static bool classof(const SDNode *N)
static bool classof(const SDNode *N)
uint64_t getAlignment() const
getAlignment - 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
uint16_t SubclassData
This member is defined by this class, but is not used for anything.
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.
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
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...
LLVM_CONSTEXPR size_t array_lengthof(T(&)[N])
Find the length of an array.
LSBaseSDNode(ISD::NodeType NodeTy, unsigned Order, DebugLoc dl, SDValue *Operands, unsigned numOperands, SDVTList VTs, ISD::MemIndexedMode AM, EVT MemVT, MachineMemOperand *MMO)
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.
A self-contained host- and target-independent arbitrary-precision floating-point software implementat...
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
const SDValue & getBasePtr() const
bool isZero() const
Return true if the value is positive or negative zero.
AddrSpaceCastSDNode(unsigned Order, DebugLoc dl, EVT VT, SDValue X, unsigned SrcAS, unsigned DestAS)
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
Simple binary floating point operators.
bool isNonTemporal() const
AAMDNodes getAAInfo() const
getAAInfo - Return the AA tags for the memory reference.
CRTP base class for adapting an iterator to a different type.
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].
This is a base class used to represent MGATHER and MSCATTER nodes.
unsigned getScalarValueSizeInBits() const
AtomicOrdering getFailureOrdering() const
MaskedGatherSDNode(unsigned Order, DebugLoc dl, ArrayRef< SDValue > Operands, SDVTList VTs, EVT MemVT, MachineMemOperand *MMO)
static ChildIteratorType child_begin(NodeType *N)
const DebugLoc & getDebugLoc() const
getDebugLoc - Return the debug location for this node as a DebugLoc.
This class is used for two-operand SDNodes.
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")
MaskedLoadSDNode(unsigned Order, DebugLoc dl, SDValue *Operands, unsigned numOperands, SDVTList VTs, ISD::LoadExtType ETy, EVT MemVT, MachineMemOperand *MMO)
opStatus convert(const fltSemantics &, roundingMode, bool *)
APFloat::convert - convert a value of one floating point type to another.
SDNode(unsigned Opc, unsigned Order, DebugLoc dl, SDVTList VTs)
This constructor adds no operands itself; operands can be set later with InitOperands.
unsigned getOpcode() const
TargetIndex - Like a constant pool entry, but with completely target-dependent semantics.
const SDValue & getBasePtr() const
MCSymbol * getMCSymbol() const
void InitOperands(SDUse *Ops, const SDValue &Op0)
Initialize the operands list of this with 1 operand.
static bool classof(const SDNode *N)
MaskedStoreSDNode(unsigned Order, DebugLoc dl, SDValue *Operands, unsigned numOperands, SDVTList VTs, bool isTrunc, EVT MemVT, MachineMemOperand *MMO)
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)
This class is used for single-operand SDNodes.
MaskedScatterSDNode(unsigned Order, DebugLoc dl, ArrayRef< SDValue > Operands, SDVTList VTs, EVT MemVT, MachineMemOperand *MMO)
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.
MemSDNode(unsigned Opc, unsigned Order, DebugLoc dl, SDVTList VTs, EVT MemoryVT, MachineMemOperand *MMO)
const SDValue & getValue() const
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)
MachinePointerInfo - This class contains a discriminated union of information about pointers in memor...
uint64_t getConstantOperandVal(unsigned Num) const
Helper method returns the integer value of a ConstantSDNode operand.
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)
refineAlignment - Update this MachineMemOperand to reflect the alignment of MMO, if it has a greater ...
bool isEXTLoad(const SDNode *N)
Returns true if the specified node is a EXTLOAD.
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
static void commuteMask(SmallVectorImpl< int > &Mask)
Change values in a shuffle permute mask assuming the two vector operands have swapped position...
bool isBuildVectorAllOnes(const SDNode *N)
Node predicates.
BinaryWithFlagsSDNode(unsigned Opc, unsigned Order, DebugLoc dl, SDVTList VTs, SDValue X, SDValue Y, const SDNodeFlags &NodeFlags)
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)
This is the shared class of boolean and integer constants.
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...
void InitOperands(SDUse *Ops, const SDValue &Op0, const SDValue &Op1)
Initialize the operands list of this with 2 operands.
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...
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
getAddrSpace - 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
Represents one node in the SelectionDAG.
bool use_empty() const
Return true if there are no nodes using value ResNo of Node.
static cl::opt< AlignMode > Align(cl::desc("Load/store alignment support"), cl::Hidden, cl::init(NoStrictAlign), cl::values(clEnumValN(StrictAlign,"aarch64-strict-align","Disallow all unaligned memory accesses"), clEnumValN(NoStrictAlign,"aarch64-no-strict-align","Allow unaligned memory accesses"), clEnumValEnd))
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()
static NodeType * getEntryNode(SDNode *N)
AtomicSDNode(unsigned Opc, unsigned Order, DebugLoc dl, SDVTList VTL, EVT MemVT, SDValue Chain, SDValue Ptr, MachineMemOperand *MMO, AtomicOrdering Ordering, SynchronizationScope SynchScope)
LLVM_ATTRIBUTE_UNUSED_RESULT std::enable_if< !is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
const EVT * value_iterator
static SDValue getEmptyKey()
static bool classof(const SDNode *N)
iterator_range< value_op_iterator > op_values() const
AtomicSDNode(unsigned Opc, unsigned Order, DebugLoc dl, SDVTList VTL, EVT MemVT, SDValue Chain, SDValue Ptr, SDValue Val, MachineMemOperand *MMO, AtomicOrdering Ordering, SynchronizationScope SynchScope)
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
These are IR-level optimization flags that may be propagated to SDNodes.
bool isScalarToVector(const SDNode *N)
Return true if the specified node is a ISD::SCALAR_TO_VECTOR node or a BUILD_VECTOR node where only t...
Represents a use of a SDNode.
uint64_t getConstantOperandVal(unsigned i) const
static bool classof(const SDNode *N)
ISD::CvtCode getCvtCode() const
bool hasAnyUseOfValue(unsigned Value) const
Return true if there are any use of the indicated value.
ShuffleVectorSDNode(EVT VT, unsigned Order, DebugLoc dl, SDValue N1, SDValue N2, const int *M)
TernarySDNode(unsigned Opc, unsigned Order, DebugLoc dl, SDVTList VTs, SDValue X, SDValue Y, SDValue Z)
ilist_node - Base class that provides next/prev services for nodes that use ilist_nextprev_traits or ...
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 SimpleType getSimplifiedValue(SDValue &Val)
MemIntrinsicSDNode(unsigned Opc, unsigned Order, DebugLoc dl, SDVTList VTs, ArrayRef< SDValue > Ops, EVT MemoryVT, MachineMemOperand *MMO)
ArrayRef< SDUse > ops() const
bool isOperandOf(const SDNode *N) const
isOperand - 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
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.
MaskedLoadStoreSDNode(ISD::NodeType NodeTy, unsigned Order, DebugLoc dl, SDValue *Operands, unsigned numOperands, SDVTList VTs, EVT MemVT, MachineMemOperand *MMO)
use_iterator & operator++()
This class is used to represent an MSCATTER node.
const SDValue & getIndex() const
int getNodeId() const
Return the unique node id.
EVT getValueType() const
Return the ValueType of the referenced return value.
SDNode * getNode() const
Convenience function for get().getNode().
void setUnsafeAlgebra(bool b)
CONVERT_RNDSAT - This operator is used to support various conversions between various types (float...
const DebugLoc & getDebugLoc() const
Return the source location info.
const Constant * ConstVal
const MDNode * getMD() const
This class is used to form a handle around another node that is persistent and is updated across invo...
This class is used to represent an MLOAD node.
bool atEnd() const
Return true if this iterator is at the end of uses list.
unsigned getAlignment() const
const MDNode * getRanges() const
getRanges - Return the range tag for the memory reference.
LLVM Value Representation.
AtomicSDNode(unsigned Opc, unsigned Order, DebugLoc dl, SDVTList VTL, EVT MemVT, SDValue Chain, SDValue Ptr, SDValue Cmp, SDValue Swp, MachineMemOperand *MMO, AtomicOrdering Ordering, SynchronizationScope SynchScope)
const SDValue & getBasePtr() const
static bool isEqual(const SDValue &LHS, const SDValue &RHS)
static SDNodeIterator end(const SDNode *N)
int64_t getOffset() const
getOffset - For normal values, this is a byte offset added to the base address.
SDNode(unsigned Opc, unsigned Order, DebugLoc dl, SDVTList VTs, ArrayRef< SDValue > Ops)
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.
PREFETCH - This corresponds to a prefetch intrinsic.
void setHasDebugValue(bool b)
Set this bit.
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...
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)
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml","ocaml 3.10-compatible collector")
static ChildIteratorType child_end(NodeType *N)
MaskedGatherScatterSDNode LargestSDNode
The largest SDNode class.
OUTCHAIN = ATOMIC_STORE(INCHAIN, ptr, val) This corresponds to "store atomic" instruction.
SDNode * getUser()
This returns the SDNode that contains this Use.
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
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.
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.
AtomicSDNode(unsigned Opc, unsigned Order, DebugLoc dl, SDVTList VTL, EVT MemVT, const SDValue *AllOps, SDUse *DynOps, unsigned NumOps, MachineMemOperand *MMO, AtomicOrdering SuccessOrdering, AtomicOrdering FailureOrdering, SynchronizationScope SynchScope)
bool isMachineOpcode() const
Test if this node has a post-isel opcode, directly corresponding to a MachineInstr opcode...
unsigned char getTargetFlags() const
unsigned getMachineOpcode() const
This may only be called if isMachineOpcode returns true.
uint64_t getBaseAlignment() const
getBaseAlignment - 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
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.