Go to the documentation of this file.
29 #include "llvm/Config/llvm-config.h"
55 cl::desc(
"Display more information when dumping selection "
62 return "<<Unknown DAG Node>>";
68 return "<<Unknown Machine Node #" + utostr(
getOpcode()) +
">>";
73 if (Name)
return Name;
74 return "<<Unknown Target Node #" + utostr(
getOpcode()) +
">>";
76 return "<<Unknown Node #" + utostr(
getOpcode()) +
">>";
100 return "AtomicLoadUIncWrap";
102 return "AtomicLoadUDecWrap";
120 if (cast<ConstantSDNode>(
this)->isOpaque())
121 return "OpaqueConstant";
150 unsigned IID = cast<ConstantSDNode>(
getOperand(OpNo))->getZExtValue();
151 if (IID < Intrinsic::num_intrinsics)
154 return "Unknown intrinsic";
156 return TII->getName(IID);
162 if (cast<ConstantSDNode>(
this)->isOpaque())
163 return "OpaqueTargetConstant";
164 return "TargetConstant";
419 return "pseudoprobe";
449 switch (cast<CondCodeSDNode>(
this)->
get()) {
500 #define BEGIN_REGISTER_VP_SDNODE(SDID, LEGALARG, NAME, ...) \
503 #include "llvm/IR/VPIntrinsics.def"
520 OS <<
't' << Node.PersistentId;
522 OS << (
const void*)&Node;
536 MMO.
print(OS, MST, SSNs, Ctx, MFI,
TII);
545 G->getSubtarget().getInstrInfo(), *
G->getContext());
550 nullptr,
nullptr, Ctx);
553 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
591 if (
getFlags().hasAllowReciprocal())
597 if (
getFlags().hasApproximateFuncs())
600 if (
getFlags().hasAllowReassociation())
606 if (
const MachineSDNode *MN = dyn_cast<MachineSDNode>(
this)) {
607 if (!MN->memoperands_empty()) {
611 e = MN->memoperands_end();
i !=
e; ++
i) {
613 if (std::next(
i) !=
e)
619 dyn_cast<ShuffleVectorSDNode>(
this)) {
621 for (
unsigned i = 0,
e = ValueList[0].getVectorNumElements();
i !=
e; ++
i) {
622 int Idx = SVN->getMaskElt(
i);
630 }
else if (
const ConstantSDNode *CSDN = dyn_cast<ConstantSDNode>(
this)) {
631 OS <<
'<' << CSDN->getAPIntValue() <<
'>';
632 }
else if (
const ConstantFPSDNode *CSDN = dyn_cast<ConstantFPSDNode>(
this)) {
634 OS <<
'<' << CSDN->getValueAPF().convertToFloat() <<
'>';
636 OS <<
'<' << CSDN->getValueAPF().convertToDouble() <<
'>';
639 CSDN->getValueAPF().bitcastToAPInt().print(OS,
false);
643 dyn_cast<GlobalAddressSDNode>(
this)) {
644 int64_t offset = GADN->getOffset();
646 GADN->getGlobal()->printAsOperand(OS);
649 OS << " + " << offset;
652 if (unsigned int TF = GADN->getTargetFlags())
653 OS << " [TF=" << TF << ']
';
654 } else if (const FrameIndexSDNode *FIDN = dyn_cast<FrameIndexSDNode>(this)) {
655 OS << "<" << FIDN->getIndex() << ">";
656 } else if (const JumpTableSDNode *JTDN = dyn_cast<JumpTableSDNode>(this)) {
657 OS << "<" << JTDN->getIndex() << ">";
658 if (unsigned int TF = JTDN->getTargetFlags())
659 OS << " [TF=" << TF << ']
';
660 } else if (const ConstantPoolSDNode *CP = dyn_cast<ConstantPoolSDNode>(this)){
661 int offset = CP->getOffset();
662 if (CP->isMachineConstantPoolEntry())
663 OS << "<" << *CP->getMachineCPVal() << ">";
665 OS << "<" << *CP->getConstVal() << ">";
667 OS << " + " << offset;
670 if (unsigned int TF = CP->getTargetFlags())
671 OS << " [TF=" << TF << ']
';
672 } else if (const TargetIndexSDNode *TI = dyn_cast<TargetIndexSDNode>(this)) {
673 OS << "<" << TI->getIndex() << '+
' << TI->getOffset() << ">";
674 if (unsigned TF = TI->getTargetFlags())
675 OS << " [TF=" << TF << ']
';
676 } else if (const BasicBlockSDNode *BBDN = dyn_cast<BasicBlockSDNode>(this)) {
678 const Value *LBB = (const Value*)BBDN->getBasicBlock()->getBasicBlock();
680 OS << LBB->getName() << " ";
681 OS << (const void*)BBDN->getBasicBlock() << ">";
682 } else if (const RegisterSDNode *R = dyn_cast<RegisterSDNode>(this)) {
683 OS << ' ' << printReg(R->getReg(),
684 G ? G->getSubtarget().getRegisterInfo() : nullptr);
685 } else if (const ExternalSymbolSDNode *ES =
686 dyn_cast<ExternalSymbolSDNode>(this)) {
687 OS << "'" << ES->getSymbol() << "'";
688 if (unsigned int TF = ES->getTargetFlags())
689 OS << " [TF=" << TF << ']
';
690 } else if (const SrcValueSDNode *M = dyn_cast<SrcValueSDNode>(this)) {
692 OS << "<" << M->getValue() << ">";
695 } else if (const MDNodeSDNode *MD = dyn_cast<MDNodeSDNode>(this)) {
697 OS << "<" << MD->getMD() << ">";
700 } else if (const VTSDNode *N = dyn_cast<VTSDNode>(this)) {
701 OS << ":" << N->getVT().getEVTString();
703 else if (const LoadSDNode *LD = dyn_cast<LoadSDNode>(this)) {
706 printMemOperand(OS, *LD->getMemOperand(), G);
709 switch (LD->getExtensionType()) {
710 default: doExt = false; break;
711 case ISD::EXTLOAD: OS << ", anyext"; break;
712 case ISD::SEXTLOAD: OS << ", sext"; break;
713 case ISD::ZEXTLOAD: OS << ", zext"; break;
716 OS << " from " << LD->getMemoryVT().getEVTString();
718 const char *AM = getIndexedModeName(LD->getAddressingMode());
723 } else if (const StoreSDNode *ST = dyn_cast<StoreSDNode>(this)) {
725 printMemOperand(OS, *ST->getMemOperand(), G);
727 if (ST->isTruncatingStore())
728 OS << ", trunc to " << ST->getMemoryVT().getEVTString();
730 const char *AM = getIndexedModeName(ST->getAddressingMode());
735 } else if (const MaskedLoadSDNode *MLd = dyn_cast<MaskedLoadSDNode>(this)) {
738 printMemOperand(OS, *MLd->getMemOperand(), G);
741 switch (MLd->getExtensionType()) {
742 default: doExt = false; break;
743 case ISD::EXTLOAD: OS << ", anyext"; break;
744 case ISD::SEXTLOAD: OS << ", sext"; break;
745 case ISD::ZEXTLOAD: OS << ", zext"; break;
748 OS << " from " << MLd->getMemoryVT().getEVTString();
750 const char *AM = getIndexedModeName(MLd->getAddressingMode());
754 if (MLd->isExpandingLoad())
758 } else if (const MaskedStoreSDNode *MSt = dyn_cast<MaskedStoreSDNode>(this)) {
760 printMemOperand(OS, *MSt->getMemOperand(), G);
762 if (MSt->isTruncatingStore())
763 OS << ", trunc to " << MSt->getMemoryVT().getEVTString();
765 const char *AM = getIndexedModeName(MSt->getAddressingMode());
769 if (MSt->isCompressingStore())
770 OS << ", compressing";
773 } else if (const auto *MGather = dyn_cast<MaskedGatherSDNode>(this)) {
775 printMemOperand(OS, *MGather->getMemOperand(), G);
778 switch (MGather->getExtensionType()) {
779 default: doExt = false; break;
780 case ISD::EXTLOAD: OS << ", anyext"; break;
781 case ISD::SEXTLOAD: OS << ", sext"; break;
782 case ISD::ZEXTLOAD: OS << ", zext"; break;
785 OS << " from " << MGather->getMemoryVT().getEVTString();
787 auto Signed = MGather->isIndexSigned() ? "signed" : "unsigned";
788 auto Scaled = MGather->isIndexScaled() ? "scaled" : "unscaled";
789 OS << ", " << Signed << " " << Scaled << " offset";
792 } else if (const auto *MScatter = dyn_cast<MaskedScatterSDNode>(this)) {
794 printMemOperand(OS, *MScatter->getMemOperand(), G);
796 if (MScatter->isTruncatingStore())
797 OS << ", trunc to " << MScatter->getMemoryVT().getEVTString();
799 auto Signed = MScatter->isIndexSigned() ? "signed" : "unsigned";
800 auto Scaled = MScatter->isIndexScaled() ? "scaled" : "unscaled";
801 OS << ", " << Signed << " " << Scaled << " offset";
804 } else if (const MemSDNode *M = dyn_cast<MemSDNode>(this)) {
806 printMemOperand(OS, *M->getMemOperand(), G);
808 } else if (const BlockAddressSDNode *BA =
809 dyn_cast<BlockAddressSDNode>(this)) {
810 int64_t offset = BA->getOffset();
812 BA->getBlockAddress()->getFunction()->printAsOperand(OS, false);
814 BA->getBlockAddress()->getBasicBlock()->printAsOperand(OS, false);
817 OS << " + " << offset;
820 if (unsigned int TF = BA->getTargetFlags())
821 OS << " [TF=" << TF << ']
';
822 } else if (const AddrSpaceCastSDNode *ASC =
823 dyn_cast<AddrSpaceCastSDNode>(this)) {
825 << ASC->getSrcAddressSpace()
827 << ASC->getDestAddressSpace()
829 } else if (const LifetimeSDNode *LN = dyn_cast<LifetimeSDNode>(this)) {
831 OS << "<" << LN->getOffset() << " to " << LN->getOffset() + LN->getSize() << ">";
832 } else if (const auto *AA = dyn_cast<AssertAlignSDNode>(this)) {
833 OS << '<
' << AA->getAlign().value() << '>
';
836 if (VerboseDAGDumping) {
837 if (unsigned Order = getIROrder())
838 OS << " [ORD=" << Order << ']
';
840 if (getNodeId() != -1)
841 OS << " [ID=" << getNodeId() << ']
';
842 if (!(isa<ConstantSDNode>(this) || (isa<ConstantFPSDNode>(this))))
843 OS << " # D:" << isDivergent();
845 if (G && !G->GetDbgValues(this).empty()) {
846 OS << " [NoOfDbgValues=" << G->GetDbgValues(this).size() << ']
';
847 for (SDDbgValue *Dbg : G->GetDbgValues(this))
848 if (!Dbg->isInvalidated())
850 } else if (getHasDebugValue())
851 OS << " [NoOfDbgValues>0]";
855 LLVM_DUMP_METHOD void SDDbgValue::print(raw_ostream &OS) const {
856 OS << " DbgVal(Order=" << getOrder() << ')
';
858 OS << "(Invalidated)";
863 for (const SDDbgOperand &Op : getLocationOps()) {
866 switch (Op.getKind()) {
867 case SDDbgOperand::SDNODE:
869 OS << "SDNODE=" << PrintNodeId(*Op.getSDNode()) << ':
' << Op.getResNo();
873 case SDDbgOperand::CONST:
876 case SDDbgOperand::FRAMEIX:
877 OS << "FRAMEIX=" << Op.getFrameIx();
879 case SDDbgOperand::VREG:
880 OS << "VREG=" << Op.getVReg();
886 if (isIndirect()) OS << "(Indirect)";
889 OS << ":\"" << Var->getName() << '"';
891 if (Expr->getNumElements())
896 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
897 LLVM_DUMP_METHOD void SDDbgValue::dump() const {
907 static bool shouldPrintInline(const SDNode &Node, const SelectionDAG *G) {
908 // Avoid lots of cluttering when inline printing nodes with associated
909 // DbgValues in verbose mode.
910 if (VerboseDAGDumping && G && !G->GetDbgValues(&Node).empty())
912 if (Node.getOpcode() == ISD::EntryToken)
914 return Node.getNumOperands() == 0;
917 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
918 static void DumpNodes(const SDNode *N, unsigned indent, const SelectionDAG *G) {
919 for (const SDValue &Op : N->op_values()) {
920 if (shouldPrintInline(*Op.getNode(), G))
922 if (Op.getNode()->hasOneUse())
923 DumpNodes(Op.getNode(), indent+2, G);
926 dbgs().indent(indent);
930 LLVM_DUMP_METHOD void SelectionDAG::dump() const {
933 for (const SDNode &N : allnodes()) {
934 if (!N.hasOneUse() && &N != getRoot().getNode() &&
935 (!shouldPrintInline(N, this) || N.use_empty()))
936 DumpNodes(&N, 2, this);
939 if (getRoot().getNode()) DumpNodes(getRoot().getNode(), 2, this);
942 if (VerboseDAGDumping) {
943 if (DbgBegin() != DbgEnd())
944 dbgs() << "SDDbgValues:\
n";
945 for (auto *Dbg : make_range(DbgBegin(), DbgEnd()))
947 if (ByvalParmDbgBegin() != ByvalParmDbgEnd())
948 dbgs() << "Byval SDDbgValues:\
n";
949 for (auto *Dbg : make_range(ByvalParmDbgBegin(), ByvalParmDbgEnd()))
956 void SDNode::printr(raw_ostream &OS, const SelectionDAG *G) const {
957 OS << PrintNodeId(*this) << ":
";
959 OS << " =
" << getOperationName(G);
960 print_details(OS, G);
963 static bool printOperand(raw_ostream &OS, const SelectionDAG *G,
964 const SDValue Value) {
965 if (!Value.getNode()) {
970 if (shouldPrintInline(*Value.getNode(), G)) {
971 OS << Value->getOperationName(G) << ':';
972 Value->print_types(OS, G);
973 Value->print_details(OS, G);
977 OS << PrintNodeId(*Value.getNode());
978 if (unsigned RN = Value.getResNo())
983 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
984 using VisitedSDNodeSet = SmallPtrSet<const SDNode *, 32>;
986 static void DumpNodesr(raw_ostream &OS, const SDNode *N, unsigned indent,
987 const SelectionDAG *G, VisitedSDNodeSet &once) {
988 if (!once.insert(N).second) // If we've been here before, return now.
991 // Dump the current SDNode, but don't end the line yet.
995 // Having printed this SDNode, walk the children:
996 for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) {
1000 const SDValue Op = N->getOperand(i);
1001 bool printedInline = printOperand(OS, G, Op);
1003 once.insert(Op.getNode());
1008 // Dump children that have grandchildren on their own line(s).
1009 for (const SDValue &Op : N->op_values())
1010 DumpNodesr(OS, Op.getNode(), indent+2, G, once);
1013 LLVM_DUMP_METHOD void SDNode::dumpr() const {
1014 VisitedSDNodeSet once;
1015 DumpNodesr(dbgs(), this, 0, nullptr, once);
1018 LLVM_DUMP_METHOD void SDNode::dumpr(const SelectionDAG *G) const {
1019 VisitedSDNodeSet once;
1020 DumpNodesr(dbgs(), this, 0, G, once);
1024 static void printrWithDepthHelper(raw_ostream &OS, const SDNode *N,
1025 const SelectionDAG *G, unsigned depth,
1034 for (const SDValue &Op : N->op_values()) {
1035 // Don't follow chain operands.
1036 if (Op.getValueType() == MVT::Other)
1039 printrWithDepthHelper(OS, Op.getNode(), G, depth - 1, indent + 2);
1043 void SDNode::printrWithDepth(raw_ostream &OS, const SelectionDAG *G,
1044 unsigned depth) const {
1045 printrWithDepthHelper(OS, this, G, depth, 0);
1048 void SDNode::printrFull(raw_ostream &OS, const SelectionDAG *G) const {
1049 // Don't print impossibly deep things.
1050 printrWithDepth(OS, G, 10);
1053 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
1055 void SDNode::dumprWithDepth(const SelectionDAG *G, unsigned depth) const {
1056 printrWithDepth(dbgs(), G, depth);
1059 LLVM_DUMP_METHOD void SDNode::dumprFull(const SelectionDAG *G) const {
1060 // Don't print impossibly deep things.
1061 dumprWithDepth(G, 10);
1065 void SDNode::print(raw_ostream &OS, const SelectionDAG *G) const {
1067 // Under VerboseDAGDumping divergence will be printed always.
1068 if (isDivergent() && !VerboseDAGDumping)
1070 for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {
1071 if (i) OS << ",
"; else OS << " ";
1072 printOperand(OS, G, getOperand(i));
1074 if (DebugLoc DL = getDebugLoc()) {
StringRef getBaseName(ID id)
Return the LLVM name for an intrinsic, without encoded types for overloading, such as "llvm....
@ STRICT_FP_ROUND
X = STRICT_FP_ROUND(Y, TRUNC) - Rounding 'Y' from a larger floating point type down to the precision ...
@ SETCCCARRY
Like SetCC, ops #0 and #1 are the LHS and RHS operands to compare, but op #2 is a boolean indicating ...
@ STRICT_FSETCC
STRICT_FSETCC/STRICT_FSETCCS - Constrained versions of SETCC, used for floating-point operands only.
@ VECTOR_SHUFFLE
VECTOR_SHUFFLE(VEC1, VEC2) - Returns a vector, of the same type as VEC1/VEC2.
@ INTRINSIC_VOID
OUTCHAIN = INTRINSIC_VOID(INCHAIN, INTRINSICID, arg1, arg2, ...) This node represents a target intrin...
MemIndexedMode
MemIndexedMode enum - This enum defines the load / store indexed addressing modes.
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
@ STRICT_FSQRT
Constrained versions of libm-equivalent floating point intrinsics.
This is an optimization pass for GlobalISel generic memory operations.
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
EVT getValueType(unsigned ResNo) const
Return the type of a specified result.
@ VECTOR_REVERSE
VECTOR_REVERSE(VECTOR) - Returns a vector, of the same type as VECTOR, whose elements are shuffled us...
@ BITCAST
BITCAST - This operator converts between integer, vector and FP values, as if the value was stored to...
@ BR_JT
BR_JT - Jumptable branch.
static const fltSemantics & IEEEsingle() LLVM_READNONE
@ FMINNUM
FMINNUM/FMAXNUM - Perform floating-point minimum or maximum on two values.
@ AssertSext
AssertSext, AssertZext - These nodes record if a register contains a value that has already been zero...
@ CONCAT_VECTORS
CONCAT_VECTORS(VECTOR0, VECTOR1, ...) - Given a number of values of vector type with the same length ...
@ LIFETIME_START
This corresponds to the llvm.lifetime.
void print(raw_ostream &OS, ModuleSlotTracker &MST, SmallVectorImpl< StringRef > &SSNs, const LLVMContext &Context, const MachineFrameInfo *MFI, const TargetInstrInfo *TII) const
Support for operator<<.
@ BSWAP
Byte Swap and Counting operators.
@ DYNAMIC_STACKALLOC
DYNAMIC_STACKALLOC - Allocate some number of bytes on the stack aligned to a specified boundary.
@ CTTZ_ZERO_UNDEF
Bit counting operators with an undefined result for zero inputs.
@ ADDC
Carry-setting nodes for multiple precision addition and subtraction.
@ INIT_TRAMPOLINE
INIT_TRAMPOLINE - This corresponds to the init_trampoline intrinsic.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
@ STACKRESTORE
STACKRESTORE has two operands, an input chain and a pointer to restore to it returns an output chain.
@ TargetIndex
TargetIndex - Like a constant pool entry, but with completely target-dependent semantics.
An SDNode that represents everything that will be needed to construct a MachineInstr.
@ SDIVFIX
RESULT = [US]DIVFIX(LHS, RHS, SCALE) - Perform fixed point division on 2 integers with the same width...
@ STEP_VECTOR
STEP_VECTOR(IMM) - Returns a scalable vector whose lanes are comprised of a linear sequence of unsign...
@ EH_LABEL
EH_LABEL - Represents a label in mid basic block used to track locations needed for debug and excepti...
@ ANY_EXTEND
ANY_EXTEND - Used for integer types. The high bits are undefined.
Represents one node in the SelectionDAG.
@ FMA
FMA - Perform a * b + c with no intermediate rounding step.
@ FP_TO_SINT
FP_TO_[US]INT - Convert a floating point value to a signed or unsigned integer.
@ SHL_PARTS
SHL_PARTS/SRA_PARTS/SRL_PARTS - These operators are used for expanded integer shift operations.
A description of a memory reference used in the backend.
@ SETCC
SetCC operator - This evaluates to a true value iff the condition is true.
@ CALLSEQ_START
CALLSEQ_START/CALLSEQ_END - These operators mark the beginning and end of a call sequence,...
@ SPLAT_VECTOR_PARTS
SPLAT_VECTOR_PARTS(SCALAR1, SCALAR2, ...) - Returns a vector with the scalar values joined together a...
@ VECREDUCE_FMAX
FMIN/FMAX nodes can have flags, for NaN/NoNaN variants.
@ MERGE_VALUES
MERGE_VALUES - This node takes multiple discrete operands and returns them all as its individual resu...
void incorporateFunction(const Function &F)
Incorporate the given function.
@ SIGN_EXTEND_VECTOR_INREG
SIGN_EXTEND_VECTOR_INREG(Vector) - This operator represents an in-register sign-extension of the low ...
@ VAEND
VAEND, VASTART - VAEND and VASTART have three operands: an input chain, pointer, and a SRCVALUE.
@ VECREDUCE_SEQ_FADD
Generic reduction nodes.
Manage lifetime of a slot tracker for printing IR.
@ ADDCARRY
Carry-using nodes for multiple precision addition and subtraction.
@ BRCOND
BRCOND - Conditional branch.
@ EH_SJLJ_SETJMP
RESULT, OUTCHAIN = EH_SJLJ_SETJMP(INCHAIN, buffer) This corresponds to the eh.sjlj....
This SDNode is used to implement the code generator support for the llvm IR shufflevector instruction...
@ INLINEASM
INLINEASM - Represents an inline asm block.
@ PSEUDO_PROBE
Pseudo probe for AutoFDO, as a place holder in a basic block to improve the sample counts quality.
TargetIntrinsicInfo - Interface to description of machine instruction set.
@ BRIND
BRIND - Indirect branch.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
@ EH_SJLJ_LONGJMP
OUTCHAIN = EH_SJLJ_LONGJMP(INCHAIN, buffer) This corresponds to the eh.sjlj.longjmp intrinsic.
@ GC_TRANSITION_START
GC_TRANSITION_START/GC_TRANSITION_END - These operators mark the beginning and end of GC transition s...
decltype(auto) get(const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &Pair)
@ BR_CC
BR_CC - Conditional branch.
unsigned getOpcode() const
Return the SelectionDAG opcode value for this node.
@ EH_SJLJ_SETUP_DISPATCH
OUTCHAIN = EH_SJLJ_SETUP_DISPATCH(INCHAIN) The target initializes the dispatch table here.
@ STRICT_FP_TO_SINT
STRICT_FP_TO_[US]INT - Convert a floating point value to a signed or unsigned integer.
@ SELECT_CC
Select with condition operator - This selects between a true value and a false value (ops #2 and #3) ...
TargetInstrInfo - Interface to description of machine instruction set.
static bool hasNoUnsignedWrap(BinaryOperator &I)
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
@ SELECT
Select(COND, TRUEVAL, FALSEVAL).
@ SMULFIXSAT
Same as the corresponding unsaturated fixed point instructions, but the result is clamped between the...
@ ZERO_EXTEND
ZERO_EXTEND - Used for integer types, zeroing the new bits.
@ ABS
ABS - Determine the unsigned absolute value of a signed integer value of the same bitwidth.
@ SMULFIX
RESULT = [US]MULFIX(LHS, RHS, SCALE) - Perform fixed point multiplication on 2 integers with the same...
@ CATCHRET
CATCHRET - Represents a return from a catch block funclet.
@ SIGN_EXTEND_INREG
SIGN_EXTEND_INREG - This operator atomically performs a SHL/SRA pair to sign extend a small value in ...
@ CopyToReg
CopyToReg - This node has three operands: a chain, a register number to set to this value,...
@ ANY_EXTEND_VECTOR_INREG
ANY_EXTEND_VECTOR_INREG(Vector) - This operator represents an in-register any-extension of the low la...
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
@ TRUNCATE
TRUNCATE - Completely drop the high bits.
@ FMINNUM_IEEE
FMINNUM_IEEE/FMAXNUM_IEEE - Perform floating-point minimum or maximum on two values,...
@ GLOBAL_OFFSET_TABLE
The address of the GOT.
const HexagonInstrInfo * TII
@ DELETED_NODE
DELETED_NODE - This is an illegal value that is used to catch errors.
@ ADDRSPACECAST
ADDRSPACECAST - This operator converts between pointers of different address spaces.
@ MDNODE_SDNODE
MDNODE_SDNODE - This is a node that holdes an MDNode*, which is used to reference metadata in the IR.
@ SINT_TO_FP
[SU]INT_TO_FP - These operators convert integers (whose interpreted sign depends on the first letter)...
This class implements an extremely fast bulk output stream that can only output to a stream.
@ FP16_TO_FP
FP16_TO_FP, FP_TO_FP16 - These operators are used to perform promotions and truncation for half-preci...
@ ATOMIC_STORE
OUTCHAIN = ATOMIC_STORE(INCHAIN, ptr, val) This corresponds to "store atomic" instruction.
@ AssertAlign
AssertAlign - These nodes record if a register contains a value that has a known alignment and the tr...
@ AND
Bitwise operators - logical and, logical or, logical xor.
@ SMULO
Same for multiplication.
@ TargetGlobalAddress
TargetGlobalAddress - Like GlobalAddress, but the DAG does no folding or anything else with this node...
@ SPLAT_VECTOR
SPLAT_VECTOR(VAL) - Returns a vector with the scalar value VAL duplicated in all lanes.
@ EntryToken
EntryToken - This is the marker used to indicate the start of a region.
@ FSINCOS
FSINCOS - Compute both fsin and fcos as a single operation.
@ CopyFromReg
CopyFromReg - This node indicates that the input value is a virtual or physical register that is defi...
@ FADD
Simple binary floating point operators.
@ SMIN
[US]{MIN/MAX} - Binary minimum or maximum of signed or unsigned integers.
@ FMINIMUM
FMINIMUM/FMAXIMUM - NaN-propagating minimum/maximum that also treat -0.0 as less than 0....
@ AVGCEILS
AVGCEILS/AVGCEILU - Rounding averaging add - Add two integers using an integer of type i[N+2],...
@ GET_DYNAMIC_AREA_OFFSET
GET_DYNAMIC_AREA_OFFSET - get offset from native SP to the address of the most recent dynamic alloca.
@ SADDO
RESULT, BOOL = [SU]ADDO(LHS, RHS) - Overflow-aware nodes for addition.
@ FMAD
FMAD - Perform a * b + c, while getting the same result as the separately rounded operations.
@ LOCAL_RECOVER
LOCAL_RECOVER - Represents the llvm.localrecover intrinsic.
@ ATOMIC_FENCE
OUTCHAIN = ATOMIC_FENCE(INCHAIN, ordering, scope) This corresponds to the fence instruction.
@ ATOMIC_CMP_SWAP_WITH_SUCCESS
Val, Success, OUTCHAIN = ATOMIC_CMP_SWAP_WITH_SUCCESS(INCHAIN, ptr, cmp, swap) N.b.
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
Module * getParent()
Get the module that this global value is contained inside of...
@ VECREDUCE_ADD
Integer reductions may have a result type larger than the vector element type.
@ LOAD
LOAD and STORE have token chains as their first operand, then the same operands as an LLVM load/store...
void print_details(raw_ostream &OS, const SelectionDAG *G) const
@ SRCVALUE
SRCVALUE - This is a node type that holds a Value* that is used to make reference to a value in the L...
@ TRAP
TRAP - Trapping instruction.
This is an important class for using LLVM in a threaded context.
@ SPONENTRY
SPONENTRY - Represents the llvm.sponentry intrinsic.
iterator_range< typename GraphTraits< GraphType >::nodes_iterator > nodes(const GraphType &G)
@ EXTRACT_VECTOR_ELT
EXTRACT_VECTOR_ELT(VECTOR, IDX) - Returns a single element from VECTOR identified by the (potentially...
@ VECREDUCE_FADD
These reductions have relaxed evaluation order semantics, and have a single vector operand.
@ CLEANUPRET
CLEANUPRET - Represents a return from a cleanup block funclet.
const SDValue & getOperand(unsigned Num) const
static Printable PrintNodeId(const SDNode &Node)
@ ATOMIC_CMP_SWAP
Val, OUTCHAIN = ATOMIC_CMP_SWAP(INCHAIN, ptr, cmp, swap) For double-word atomic operations: ValLo,...
@ SSUBSAT
RESULT = [US]SUBSAT(LHS, RHS) - Perform saturation subtraction on 2 integers with the same bit width ...
@ FCOPYSIGN
FCOPYSIGN(X, Y) - Return the value of X with the sign of Y.
void dump() const
Dump this node, for debugging.
ArrayRef< MachineMemOperand * >::const_iterator mmo_iterator
static void printMemOperand(raw_ostream &OS, const MachineMemOperand &MMO, const MachineFunction *MF, const Module *M, const MachineFrameInfo *MFI, const TargetInstrInfo *TII, LLVMContext &Ctx)
@ MEMBARRIER
MEMBARRIER - Compiler barrier only; generate a no-op.
@ ADJUST_TRAMPOLINE
ADJUST_TRAMPOLINE - This corresponds to the adjust_trampoline intrinsic.
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
@ DEBUGTRAP
DEBUGTRAP - Trap intended to get the attention of a debugger.
void print(raw_ostream &OS, const SelectionDAG *G=nullptr) const
@ EH_DWARF_CFA
EH_DWARF_CFA - This node represents the pointer to the DWARF Canonical Frame Address (CFA),...
@ BasicBlock
Various leaf nodes.
@ SDIVFIXSAT
Same as the corresponding unsaturated fixed point instructions, but the result is clamped between the...
A Module instance is used to store all the information related to an LLVM module.
virtual const char * getTargetNodeName(unsigned Opcode) const
This method returns the name of a target specific DAG node.
bool isMachineOpcode() const
Test if this node has a post-isel opcode, directly corresponding to a MachineInstr opcode.
@ ANNOTATION_LABEL
ANNOTATION_LABEL - Represents a mid basic block label used by annotations.
@ VSCALE
VSCALE(IMM) - Returns the runtime scaling factor used to calculate the number of elements within a sc...
@ HANDLENODE
HANDLENODE node - Used as a handle for various purposes.
@ UBSANTRAP
UBSANTRAP - Trap with an immediate describing the kind of sanitizer failure.
void print_types(raw_ostream &OS, const SelectionDAG *G) const
static const fltSemantics & IEEEdouble() LLVM_READNONE
@ STRICT_SINT_TO_FP
STRICT_[US]INT_TO_FP - Convert a signed or unsigned integer to a floating point value.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
static const char * getIndexedModeName(ISD::MemIndexedMode AM)
@ UNDEF
UNDEF - An undefined node.
@ SMUL_LOHI
SMUL_LOHI/UMUL_LOHI - Multiply two integers of type iN, producing a signed/unsigned value of type i[2...
@ BUILTIN_OP_END
BUILTIN_OP_END - This must be the last enum value in this list.
@ STRICT_FP_EXTEND
X = STRICT_FP_EXTEND(Y) - Extend a smaller FP type into a larger FP type.
@ ATOMIC_SWAP
Val, OUTCHAIN = ATOMIC_SWAP(INCHAIN, ptr, amt) Val, OUTCHAIN = ATOMIC_LOAD_[OpName](INCHAIN,...
@ VECTOR_SPLICE
VECTOR_SPLICE(VEC1, VEC2, IMM) - Returns a subvector of the same type as VEC1/VEC2 from CONCAT_VECTOR...
@ CARRY_FALSE
CARRY_FALSE - This node is used when folding other nodes, like ADDC/SUBC, which indicate the carry re...
@ SSHLSAT
RESULT = [US]SHLSAT(LHS, RHS) - Perform saturation left shift.
@ PCMARKER
PCMARKER - This corresponds to the pcmarker intrinsic.
@ INTRINSIC_WO_CHAIN
RESULT = INTRINSIC_WO_CHAIN(INTRINSICID, arg1, arg2, ...) This node represents a target intrinsic fun...
std::string getOperationName(const SelectionDAG *G=nullptr) const
Return the opcode of this operation for printing.
@ FRAMEADDR
FRAMEADDR, RETURNADDR - These nodes represent llvm.frameaddress and llvm.returnaddress on the DAG.
std::string getEVTString() const
This function returns value type as a string, e.g. "i32".
@ INSERT_SUBVECTOR
INSERT_SUBVECTOR(VECTOR1, VECTOR2, IDX) - Returns a vector with VECTOR2 inserted into VECTOR1.
@ READ_REGISTER
READ_REGISTER, WRITE_REGISTER - This node represents llvm.register on the DAG, which implements the n...
Function & getFunction()
Return the LLVM function that this machine code represents.
@ EXTRACT_SUBVECTOR
EXTRACT_SUBVECTOR(VECTOR, IDX) - Returns a subvector from VECTOR.
@ FP_TO_SINT_SAT
FP_TO_[US]INT_SAT - Convert floating point value in operand 0 to a signed or unsigned scalar integer ...
@ SADDO_CARRY
Carry-using overflow-aware nodes for multiple precision addition and subtraction.
@ BR
Control flow instructions. These all have token chains.
@ INLINEASM_BR
INLINEASM_BR - Branching version of inline asm. Used by asm-goto.
@ BUILD_VECTOR
BUILD_VECTOR(ELT0, ELT1, ELT2, ELT3,...) - Return a fixed-width vector with the specified,...
@ FRAME_TO_ARGS_OFFSET
FRAME_TO_ARGS_OFFSET - This node represents offset from frame pointer to first (possible) on-stack ar...
@ TargetConstant
TargetConstant* - Like Constant*, but the DAG does not do any folding, simplification,...
unsigned getNumValues() const
Return the number of values defined/returned by this operator.
@ EH_RETURN
OUTCHAIN = EH_RETURN(INCHAIN, OFFSET, HANDLER) - This node represents 'eh_return' gcc dwarf builtin,...
static bool hasNoSignedWrap(BinaryOperator &I)
@ VACOPY
VACOPY - VACOPY has 5 operands: an input chain, a destination pointer, a source pointer,...
@ ADD
Simple integer binary arithmetic operators.
@ SSUBO
Same for subtraction.
unsigned getMachineOpcode() const
This may only be called if isMachineOpcode returns true.
@ IS_FPCLASS
Performs a check of floating point class property, defined by IEEE-754.
@ FP_EXTEND
X = FP_EXTEND(Y) - Extend a smaller FP type into a larger FP type.
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted.
@ FGETSIGN
INT = FGETSIGN(FP) - Return the sign bit of the specified floating point value as an integer 0/1 valu...
@ PREFETCH
PREFETCH - This corresponds to a prefetch intrinsic.
@ BF16_TO_FP
BF16_TO_FP, FP_TO_BF16 - These operators are used to perform promotions and truncation for bfloat16.
@ SHL
Shift and rotation operations.
@ READCYCLECOUNTER
READCYCLECOUNTER - This corresponds to the readcyclecounter intrinsic.
Simple wrapper around std::function<void(raw_ostream&)>.
@ ZERO_EXTEND_VECTOR_INREG
ZERO_EXTEND_VECTOR_INREG(Vector) - This operator represents an in-register zero-extension of the low ...
@ ADDROFRETURNADDR
ADDROFRETURNADDR - Represents the llvm.addressofreturnaddress intrinsic.
@ STRICT_FADD
Constrained versions of the binary floating point operators.
@ MULHU
MULHU/MULHS - Multiply high - Multiply two integers of type iN, producing an unsigned/signed value of...
std::string str() const
str - Get the contents as an std::string.
@ INTRINSIC_W_CHAIN
RESULT,OUTCHAIN = INTRINSIC_W_CHAIN(INCHAIN, INTRINSICID, arg1, ...) This node represents a target in...
@ FNEG
Perform various unary floating-point operations inspired by libm.
@ GET_ROUNDING
Returns current rounding mode: -1 Undefined 0 Round to 0 1 Round to nearest, ties to even 2 Round to ...
@ BUILD_PAIR
BUILD_PAIR - This is the opposite of EXTRACT_ELEMENT in some ways.
@ VAARG
VAARG - VAARG has four operands: an input chain, a pointer, a SRCVALUE, and the alignment.
@ SDIVREM
SDIVREM/UDIVREM - Divide two integers and produce both a quotient and remainder result.
static bool hasNoInfs(const TargetOptions &Options, SDValue N)
@ SIGN_EXTEND
Conversion operators.
The same transformation can work with an even modulo with the addition of a and shrink the compare RHS by the same amount Unless the target supports that transformation probably isn t worthwhile The transformation can also easily be made to work with non zero equality for n
SDNodeFlags getFlags() const
@ INSERT_VECTOR_ELT
INSERT_VECTOR_ELT(VECTOR, VAL, IDX) - Returns VECTOR with the element at IDX replaced with VAL.
@ FCANONICALIZE
Returns platform specific canonical encoding of a floating point number.
@ STACKSAVE
STACKSAVE - STACKSAVE has one operand, an input chain.
@ ADDE
Carry-using nodes for multiple precision addition and subtraction.
@ FP_ROUND
X = FP_ROUND(Y, TRUNC) - Rounding 'Y' from a larger floating point type down to the precision of the ...
@ AVGFLOORS
AVGFLOORS/AVGFLOORU - Averaging add - Add two integers using an integer of type i[N+1],...
@ SET_ROUNDING
Set rounding mode.
@ ATOMIC_LOAD
Val, OUTCHAIN = ATOMIC_LOAD(INCHAIN, ptr) This corresponds to "load atomic" instruction.
@ SCALAR_TO_VECTOR
SCALAR_TO_VECTOR(VAL) - This represents the operation of loading a scalar value into element 0 of the...
@ SADDSAT
RESULT = [US]ADDSAT(LHS, RHS) - Perform saturation addition on 2 integers with the same bit width (W)...
@ TokenFactor
TokenFactor - This node takes multiple tokens as input and produces a single token result.
@ EXTRACT_ELEMENT
EXTRACT_ELEMENT - This is used to get the lower or upper (determined by a Constant,...
@ VSELECT
Select with a vector condition (op #0) and two vector operands (ops #1 and #2), returning a vector re...
static cl::opt< bool > VerboseDAGDumping("dag-dump-verbose", cl::Hidden, cl::desc("Display more information when dumping selection " "DAG nodes."))