29 #include "llvm/Config/llvm-config.h" 56 cl::desc(
"Display more information when dumping selection " 63 return "<<Unknown DAG Node>>";
74 if (Name)
return Name;
115 if (cast<ConstantSDNode>(
this)->isOpaque())
116 return "OpaqueConstant";
145 unsigned IID = cast<ConstantSDNode>(
getOperand(OpNo))->getZExtValue();
146 if (IID < Intrinsic::num_intrinsics)
149 return "Unknown intrinsic";
151 return TII->getName(IID);
157 if (cast<ConstantSDNode>(
this)->isOpaque())
158 return "OpaqueTargetConstant";
159 return "TargetConstant";
406 switch (cast<CondCodeSDNode>(
this)->
get()) {
469 OS << (
const void*)&Node;
483 MMO.
print(OS, MST, SSNs, Ctx, MFI, TII);
496 nullptr,
nullptr, Ctx);
500 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) 538 if (
getFlags().hasAllowReciprocal())
544 if (
getFlags().hasApproximateFuncs())
547 if (
getFlags().hasAllowReassociation())
550 if (
getFlags().hasVectorReduction())
551 OS <<
" vector-reduction";
556 if (
const MachineSDNode *MN = dyn_cast<MachineSDNode>(
this)) {
557 if (!MN->memoperands_empty()) {
561 e = MN->memoperands_end(); i !=
e; ++i) {
563 if (std::next(i) !=
e)
569 dyn_cast<ShuffleVectorSDNode>(
this)) {
571 for (
unsigned i = 0,
e = ValueList[0].getVectorNumElements(); i !=
e; ++i) {
572 int Idx = SVN->getMaskElt(i);
580 }
else if (
const ConstantSDNode *CSDN = dyn_cast<ConstantSDNode>(
this)) {
581 OS <<
'<' << CSDN->getAPIntValue() <<
'>';
582 }
else if (
const ConstantFPSDNode *CSDN = dyn_cast<ConstantFPSDNode>(
this)) {
584 OS <<
'<' << CSDN->getValueAPF().convertToFloat() <<
'>';
586 OS <<
'<' << CSDN->getValueAPF().convertToDouble() <<
'>';
589 CSDN->getValueAPF().bitcastToAPInt().print(OS,
false);
593 dyn_cast<GlobalAddressSDNode>(
this)) {
594 int64_t offset = GADN->getOffset();
596 GADN->getGlobal()->printAsOperand(OS);
599 OS << " + " << offset; 602 if (unsigned int TF = GADN->getTargetFlags()) 603 OS << " [TF=" << TF << ']
'; 604 } else if (const FrameIndexSDNode *FIDN = dyn_cast<FrameIndexSDNode>(this)) { 605 OS << "<" << FIDN->getIndex() << ">"; 606 } else if (const JumpTableSDNode *JTDN = dyn_cast<JumpTableSDNode>(this)) { 607 OS << "<" << JTDN->getIndex() << ">"; 608 if (unsigned int TF = JTDN->getTargetFlags()) 609 OS << " [TF=" << TF << ']
'; 610 } else if (const ConstantPoolSDNode *CP = dyn_cast<ConstantPoolSDNode>(this)){ 611 int offset = CP->getOffset(); 612 if (CP->isMachineConstantPoolEntry()) 613 OS << "<" << *CP->getMachineCPVal() << ">"; 615 OS << "<" << *CP->getConstVal() << ">"; 617 OS << " + " << offset; 620 if (unsigned int TF = CP->getTargetFlags()) 621 OS << " [TF=" << TF << ']
'; 622 } else if (const TargetIndexSDNode *TI = dyn_cast<TargetIndexSDNode>(this)) { 623 OS << "<" << TI->getIndex() << '+
' << TI->getOffset() << ">"; 624 if (unsigned TF = TI->getTargetFlags()) 625 OS << " [TF=" << TF << ']
'; 626 } else if (const BasicBlockSDNode *BBDN = dyn_cast<BasicBlockSDNode>(this)) { 628 const Value *LBB = (const Value*)BBDN->getBasicBlock()->getBasicBlock(); 630 OS << LBB->getName() << " "; 631 OS << (const void*)BBDN->getBasicBlock() << ">"; 632 } else if (const RegisterSDNode *R = dyn_cast<RegisterSDNode>(this)) { 633 OS << ' ' << printReg(R->getReg(), 634 G ? G->getSubtarget().getRegisterInfo() : nullptr); 635 } else if (const ExternalSymbolSDNode *ES = 636 dyn_cast<ExternalSymbolSDNode>(this)) { 637 OS << "'" << ES->getSymbol() << "'"; 638 if (unsigned int TF = ES->getTargetFlags()) 639 OS << " [TF=" << TF << ']
'; 640 } else if (const SrcValueSDNode *M = dyn_cast<SrcValueSDNode>(this)) { 642 OS << "<" << M->getValue() << ">"; 645 } else if (const MDNodeSDNode *MD = dyn_cast<MDNodeSDNode>(this)) { 647 OS << "<" << MD->getMD() << ">"; 650 } else if (const VTSDNode *N = dyn_cast<VTSDNode>(this)) { 651 OS << ":" << N->getVT().getEVTString(); 653 else if (const LoadSDNode *LD = dyn_cast<LoadSDNode>(this)) { 656 printMemOperand(OS, *LD->getMemOperand(), G); 659 switch (LD->getExtensionType()) { 660 default: doExt = false; break; 661 case ISD::EXTLOAD: OS << ", anyext"; break; 662 case ISD::SEXTLOAD: OS << ", sext"; break; 663 case ISD::ZEXTLOAD: OS << ", zext"; break; 666 OS << " from " << LD->getMemoryVT().getEVTString(); 668 const char *AM = getIndexedModeName(LD->getAddressingMode()); 673 } else if (const StoreSDNode *ST = dyn_cast<StoreSDNode>(this)) { 675 printMemOperand(OS, *ST->getMemOperand(), G); 677 if (ST->isTruncatingStore()) 678 OS << ", trunc to " << ST->getMemoryVT().getEVTString(); 680 const char *AM = getIndexedModeName(ST->getAddressingMode()); 685 } else if (const MaskedLoadSDNode *MLd = dyn_cast<MaskedLoadSDNode>(this)) { 688 printMemOperand(OS, *MLd->getMemOperand(), G); 691 switch (MLd->getExtensionType()) { 692 default: doExt = false; break; 693 case ISD::EXTLOAD: OS << ", anyext"; break; 694 case ISD::SEXTLOAD: OS << ", sext"; break; 695 case ISD::ZEXTLOAD: OS << ", zext"; break; 698 OS << " from " << MLd->getMemoryVT().getEVTString(); 700 const char *AM = getIndexedModeName(MLd->getAddressingMode()); 704 if (MLd->isExpandingLoad()) 708 } else if (const MaskedStoreSDNode *MSt = dyn_cast<MaskedStoreSDNode>(this)) { 710 printMemOperand(OS, *MSt->getMemOperand(), G); 712 if (MSt->isTruncatingStore()) 713 OS << ", trunc to " << MSt->getMemoryVT().getEVTString(); 715 const char *AM = getIndexedModeName(MSt->getAddressingMode()); 719 if (MSt->isCompressingStore()) 720 OS << ", compressing"; 723 } else if (const MemSDNode* M = dyn_cast<MemSDNode>(this)) { 725 printMemOperand(OS, *M->getMemOperand(), G); 727 } else if (const BlockAddressSDNode *BA = 728 dyn_cast<BlockAddressSDNode>(this)) { 729 int64_t offset = BA->getOffset(); 731 BA->getBlockAddress()->getFunction()->printAsOperand(OS, false); 733 BA->getBlockAddress()->getBasicBlock()->printAsOperand(OS, false); 736 OS << " + " << offset; 739 if (unsigned int TF = BA->getTargetFlags()) 740 OS << " [TF=" << TF << ']
'; 741 } else if (const AddrSpaceCastSDNode *ASC = 742 dyn_cast<AddrSpaceCastSDNode>(this)) { 744 << ASC->getSrcAddressSpace() 746 << ASC->getDestAddressSpace() 748 } else if (const LifetimeSDNode *LN = dyn_cast<LifetimeSDNode>(this)) { 750 OS << "<" << LN->getOffset() << " to " << LN->getOffset() + LN->getSize() << ">"; 753 if (VerboseDAGDumping) { 754 if (unsigned Order = getIROrder()) 755 OS << " [ORD=" << Order << ']
'; 757 if (getNodeId() != -1) 758 OS << " [ID=" << getNodeId() << ']
'; 759 if (!(isa<ConstantSDNode>(this) || (isa<ConstantFPSDNode>(this)))) 760 OS << " # D:" << isDivergent(); 762 if (G && !G->GetDbgValues(this).empty()) { 763 OS << " [NoOfDbgValues=" << G->GetDbgValues(this).size() << ']
'; 764 for (SDDbgValue *Dbg : G->GetDbgValues(this)) 765 if (!Dbg->isInvalidated()) 767 } else if (getHasDebugValue()) 768 OS << " [NoOfDbgValues>0]"; 772 LLVM_DUMP_METHOD void SDDbgValue::print(raw_ostream &OS) const { 773 OS << " DbgVal(Order=" << getOrder() << ')
'; 774 if (isInvalidated()) OS << "(Invalidated)"; 775 if (isEmitted()) OS << "(Emitted)"; 779 OS << "(SDNODE=" << PrintNodeId(*getSDNode()) << ':
' << getResNo() << ')
'; 787 OS << "(FRAMEIX=" << getFrameIx() << ')
'; 790 OS << "(VREG=" << getVReg() << ')
'; 793 if (isIndirect()) OS << "(Indirect)"; 794 OS << ":\"" << Var->getName() << '"'; 796 if (Expr->getNumElements()) 801 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) 802 LLVM_DUMP_METHOD void SDDbgValue::dump() const { 812 static bool shouldPrintInline(const SDNode &Node, const SelectionDAG *G) {
813 // Avoid lots of cluttering when inline printing nodes with associated
814 // DbgValues in verbose mode.
815 if (VerboseDAGDumping && G && !G->GetDbgValues(&Node).empty())
817 if (Node.getOpcode() == ISD::EntryToken)
819 return Node.getNumOperands() == 0;
822 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
823 static void DumpNodes(const SDNode *N, unsigned indent, const SelectionDAG *G) {
824 for (const SDValue &Op : N->op_values()) {
825 if (shouldPrintInline(*Op.getNode(), G))
827 if (Op.getNode()->hasOneUse())
828 DumpNodes(Op.getNode(), indent+2, G);
831 dbgs().indent(indent);
835 LLVM_DUMP_METHOD void SelectionDAG::dump() const {
838 for (allnodes_const_iterator I = allnodes_begin(), E = allnodes_end(); 840 const SDNode *N = &*I; 841 if (!N->hasOneUse() && N != getRoot().getNode() && 842 (!shouldPrintInline(*N, this) || N->use_empty())) 843 DumpNodes(N, 2, this); 846 if (getRoot().getNode()) DumpNodes(getRoot().getNode(), 2, this); 849 if (VerboseDAGDumping) { 850 if (DbgBegin() != DbgEnd()) 851 dbgs() << "SDDbgValues:\n
"; 852 for (auto *Dbg : make_range(DbgBegin(), DbgEnd())) 854 if (ByvalParmDbgBegin() != ByvalParmDbgEnd()) 855 dbgs() << "Byval SDDbgValues:\n
"; 856 for (auto *Dbg : make_range(ByvalParmDbgBegin(), ByvalParmDbgEnd())) 863 void SDNode::printr(raw_ostream &OS, const SelectionDAG *G) const { 864 OS << PrintNodeId(*this) << ":
"; 866 OS << " =
" << getOperationName(G); 867 print_details(OS, G); 870 static bool printOperand(raw_ostream &OS, const SelectionDAG *G, 871 const SDValue Value) { 872 if (!Value.getNode()) { 875 } else if (shouldPrintInline(*Value.getNode(), G)) { 876 OS << Value->getOperationName(G) << ':'; 877 Value->print_types(OS, G); 878 Value->print_details(OS, G); 881 OS << PrintNodeId(*Value.getNode()); 882 if (unsigned RN = Value.getResNo()) 888 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) 889 using VisitedSDNodeSet = SmallPtrSet<const SDNode *, 32>; 891 static void DumpNodesr(raw_ostream &OS, const SDNode *N, unsigned indent, 892 const SelectionDAG *G, VisitedSDNodeSet &once) { 893 if (!once.insert(N).second) // If we've been here before, return now. 896 // Dump the current SDNode, but don't end the line yet. 900 // Having printed this SDNode, walk the children: 901 for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) { 905 const SDValue Op = N->getOperand(i); 906 bool printedInline = printOperand(OS, G, Op); 908 once.insert(Op.getNode()); 913 // Dump children that have grandchildren on their own line(s). 914 for (const SDValue &Op : N->op_values()) 915 DumpNodesr(OS, Op.getNode(), indent+2, G, once); 918 LLVM_DUMP_METHOD void SDNode::dumpr() const { 919 VisitedSDNodeSet once; 920 DumpNodesr(dbgs(), this, 0, nullptr, once); 923 LLVM_DUMP_METHOD void SDNode::dumpr(const SelectionDAG *G) const { 924 VisitedSDNodeSet once; 925 DumpNodesr(dbgs(), this, 0, G, once); 929 static void printrWithDepthHelper(raw_ostream &OS, const SDNode *N, 930 const SelectionDAG *G, unsigned depth, 942 for (const SDValue &Op : N->op_values()) { 943 // Don't follow chain operands. 944 if (Op.getValueType() == MVT::Other) 947 printrWithDepthHelper(OS, Op.getNode(), G, depth-1, indent+2); 951 void SDNode::printrWithDepth(raw_ostream &OS, const SelectionDAG *G, 952 unsigned depth) const { 953 printrWithDepthHelper(OS, this, G, depth, 0); 956 void SDNode::printrFull(raw_ostream &OS, const SelectionDAG *G) const { 957 // Don't print impossibly deep things. 958 printrWithDepth(OS, G, 10); 961 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) 963 void SDNode::dumprWithDepth(const SelectionDAG *G, unsigned depth) const { 964 printrWithDepth(dbgs(), G, depth); 967 LLVM_DUMP_METHOD void SDNode::dumprFull(const SelectionDAG *G) const { 968 // Don't print impossibly deep things. 969 dumprWithDepth(G, 10); 973 void SDNode::print(raw_ostream &OS, const SelectionDAG *G) const { 975 for (unsigned i = 0, e = getNumOperands(); i != e; ++i) { 976 if (i) OS << ",
"; else OS << " "; 977 printOperand(OS, G, getOperand(i)); 979 if (DebugLoc DL = getDebugLoc()) { ANNOTATION_LABEL - Represents a mid basic block label used by annotations.
ADJUST_TRAMPOLINE - This corresponds to the adjust_trampoline intrinsic.
BITCAST - This operator converts between integer, vector and FP values, as if the value was stored to...
X = FP_ROUND(Y, TRUNC) - Rounding 'Y' from a larger floating point type down to the precision of the ...
BUILTIN_OP_END - This must be the last enum value in this list.
FMINNUM/FMAXNUM - Perform floating-point minimum or maximum on two values.
Constrained versions of libm-equivalent floating point intrinsics.
std::string getOperationName(const SelectionDAG *G=nullptr) const
Return the opcode of this operation for printing.
EXTRACT_ELEMENT - This is used to get the lower or upper (determined by a Constant, which is required to be operand #1) half of the integer or float value specified as operand #0.
unsigned getOpcode() const
Return the SelectionDAG opcode value for this node.
DELETED_NODE - This is an illegal value that is used to catch errors.
MDNODE_SDNODE - This is a node that holdes an MDNode*, which is used to reference metadata in the IR...
EXTRACT_SUBVECTOR(VECTOR, IDX) - Returns a subvector from VECTOR (an vector value) starting with the ...
BR_CC - Conditional branch.
This class represents lattice values for constants.
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds...
FMINIMUM/FMAXIMUM - NaN-propagating minimum/maximum that also treat -0.0 as less than 0...
VECTOR_SHUFFLE(VEC1, VEC2) - Returns a vector, of the same type as VEC1/VEC2.
A Module instance is used to store all the information related to an LLVM module. ...
amdgpu Simplify well known AMD library false FunctionCallee Value const Twine & Name
Same as the corresponding unsaturated fixed point instructions, but the result is clamped between the...
ZERO_EXTEND_VECTOR_INREG(Vector) - This operator represents an in-register zero-extension of the low ...
Carry-setting nodes for multiple precision addition and subtraction.
EVT getValueType(unsigned ResNo) const
Return the type of a specified result.
STACKRESTORE has two operands, an input chain and a pointer to restore to it returns an output chain...
void print_details(raw_ostream &OS, const SelectionDAG *G) const
RESULT, BOOL = [SU]ADDO(LHS, RHS) - Overflow-aware nodes for addition.
TargetGlobalAddress - Like GlobalAddress, but the DAG does no folding or anything else with this node...
SPLAT_VECTOR(VAL) - Returns a vector with the scalar value VAL duplicated in all lanes.
Val, Success, OUTCHAIN = ATOMIC_CMP_SWAP_WITH_SUCCESS(INCHAIN, ptr, cmp, swap) N.b.
virtual const char * getTargetNodeName(unsigned Opcode) const
This method returns the name of a target specific DAG node.
Constrained versions of the binary floating point operators.
SIGN_EXTEND_VECTOR_INREG(Vector) - This operator represents an in-register sign-extension of the low ...
Manage lifetime of a slot tracker for printing IR.
[US]{MIN/MAX} - Binary minimum or maximum or signed or unsigned integers.
const SDNodeFlags getFlags() const
INSERT_SUBVECTOR(VECTOR1, VECTOR2, IDX) - Returns a vector with VECTOR2 inserted into VECTOR1 at the ...
uint16_t PersistentId
Unique and persistent id per SDNode in the DAG.
EntryToken - This is the marker used to indicate the start of a region.
OUTCHAIN = ATOMIC_FENCE(INCHAIN, ordering, scope) This corresponds to the fence instruction.
Select with condition operator - This selects between a true value and a false value (ops #2 and #3) ...
INT = FGETSIGN(FP) - Return the sign bit of the specified floating point value as an integer 0/1 valu...
This SDNode is used to implement the code generator support for the llvm IR shufflevector instruction...
RESULT,OUTCHAIN = INTRINSIC_W_CHAIN(INCHAIN, INTRINSICID, arg1, ...) This node represents a target in...
OUTCHAIN = EH_SJLJ_LONGJMP(INCHAIN, buffer) This corresponds to the eh.sjlj.longjmp intrinsic...
SDIVREM/UDIVREM - Divide two integers and produce both a quotient and remainder result.
SHL_PARTS/SRA_PARTS/SRL_PARTS - These operators are used for expanded integer shift operations...
CLEANUPRET - Represents a return from a cleanup block funclet.
static Printable PrintNodeId(const SDNode &Node)
A description of a memory reference used in the backend.
PCMARKER - This corresponds to the pcmarker intrinsic.
StringRef getName(ID id)
Return the LLVM name for an intrinsic, such as "llvm.ppc.altivec.lvx".
This file declares the MachineConstantPool class which is an abstract constant pool to keep track of ...
const HexagonInstrInfo * TII
Shift and rotation operations.
ABS - Determine the unsigned absolute value of a signed integer value of the same bitwidth...
BUILD_PAIR - This is the opposite of EXTRACT_ELEMENT in some ways.
RESULT = [US]MULFIX(LHS, RHS, SCALE) - Perform fixed point multiplication on 2 integers with the same...
CopyToReg - This node has three operands: a chain, a register number to set to this value...
FLT_ROUNDS_ - Returns current rounding mode: -1 Undefined 0 Round to 0 1 Round to nearest 2 Round to ...
CALLSEQ_START/CALLSEQ_END - These operators mark the beginning and end of a call sequence, and carry arbitrary information that target might want to know.
EH_DWARF_CFA - This node represents the pointer to the DWARF Canonical Frame Address (CFA)...
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted...
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.
FRAMEADDR, RETURNADDR - These nodes represent llvm.frameaddress and llvm.returnaddress on the DAG...
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
This file implements a class to represent arbitrary precision integral constant values and operations...
INLINEASM - Represents an inline asm block.
STACKSAVE - STACKSAVE has one operand, an input chain.
FRAME_TO_ARGS_OFFSET - This node represents offset from frame pointer to first (possible) on-stack ar...
STRICT_FSETCC/STRICT_FSETCCS - Constrained versions of SETCC, used for floating-point operands only...
MachineFunction & getMachineFunction() const
[SU]INT_TO_FP - These operators convert integers (whose interpreted sign depends on the first letter)...
OUTCHAIN = EH_SJLJ_SETUP_DISPATCH(INCHAIN) The target initializes the dispatch table here...
const TargetMachine & getTarget() const
Select with a vector condition (op #0) and two vector operands (ops #1 and #2), returning a vector re...
Simple integer binary arithmetic operators.
STRICT_[US]INT_TO_FP - Convert a signed or unsigned integer to a floating point value.
X = STRICT_FP_EXTEND(Y) - Extend a smaller FP type into a larger FP type.
virtual const TargetInstrInfo * getInstrInfo() const
static const fltSemantics & IEEEdouble() LLVM_READNONE
TargetConstant* - Like Constant*, but the DAG does not do any folding, simplification, or lowering of the constant.
static const char * getIndexedModeName(ISD::MemIndexedMode AM)
READCYCLECOUNTER - This corresponds to the readcyclecounter intrinsic.
ANY_EXTEND_VECTOR_INREG(Vector) - This operator represents an in-register any-extension of the low la...
static bool hasNoSignedWrap(BinaryOperator &I)
RESULT = INTRINSIC_WO_CHAIN(INTRINSICID, arg1, arg2, ...) This node represents a target intrinsic fun...
UNDEF - An undefined node.
FP_TO_[US]INT - Convert a floating point value to a signed or unsigned integer.
BUILD_VECTOR(ELT0, ELT1, ELT2, ELT3,...) - Return a vector with the specified, possibly variable...
TargetInstrInfo - Interface to description of machine instruction set.
This corresponds to the llvm.lifetime.
unsigned getNumValues() const
Return the number of values defined/returned by this operator.
OUTCHAIN = INTRINSIC_VOID(INCHAIN, INTRINSICID, arg1, arg2, ...) This node represents a target intrin...
These reductions are non-strict, and have a single vector operand.
Control flow instructions. These all have token chains.
READ_REGISTER, WRITE_REGISTER - This node represents llvm.register on the DAG, which implements the n...
GC_TRANSITION_START/GC_TRANSITION_END - These operators mark the beginning and end of GC transition s...
LOCAL_RECOVER - Represents the llvm.localrecover intrinsic.
static cl::opt< bool > VerboseDAGDumping("dag-dump-verbose", cl::Hidden, cl::desc("Display more information when dumping selection " "DAG nodes."))
This is an important class for using LLVM in a threaded context.
Simple binary floating point operators.
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
VAEND, VASTART - VAEND and VASTART have three operands: an input chain, pointer, and a SRCVALUE...
const SDValue & getOperand(unsigned Num) const
INSERT_VECTOR_ELT(VECTOR, VAL, IDX) - Returns VECTOR with the element at IDX replaced with VAL...
This file contains the declarations for the subclasses of Constant, which represent the different fla...
Carry-using nodes for multiple precision addition and subtraction.
This file declares a class to represent arbitrary precision floating point values and provide a varie...
INIT_TRAMPOLINE - This corresponds to the init_trampoline intrinsic.
TRAP - Trapping instruction.
TargetIndex - Like a constant pool entry, but with completely target-dependent semantics.
std::string getEVTString() const
This function returns value type as a string, e.g. "i32".
AssertSext, AssertZext - These nodes record if a register contains a value that has already been zero...
DEBUGTRAP - Trap intended to get the attention of a debugger.
VAARG - VAARG has four operands: an input chain, a pointer, a SRCVALUE, and the alignment.
Bit counting operators with an undefined result for zero inputs.
Val, OUTCHAIN = ATOMIC_CMP_SWAP(INCHAIN, ptr, cmp, swap) For double-word atomic operations: ValLo...
static bool hasNoUnsignedWrap(BinaryOperator &I)
X = FP_EXTEND(Y) - Extend a smaller FP type into a larger FP type.
void incorporateFunction(const Function &F)
Incorporate the given function.
bool isMachineOpcode() const
Test if this node has a post-isel opcode, directly corresponding to a MachineInstr opcode...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
HANDLENODE node - Used as a handle for various purposes.
EH_LABEL - Represents a label in mid basic block used to track locations needed for debug and excepti...
TargetIntrinsicInfo - Interface to description of machine instruction set.
RESULT = [US]ADDSAT(LHS, RHS) - Perform saturation addition on 2 integers with the same bit width (W)...
TokenFactor - This node takes multiple tokens as input and produces a single token result...
void dump() const
Dump this node, for debugging.
static const fltSemantics & IEEEsingle() LLVM_READNONE
static void printMemOperand(raw_ostream &OS, const MachineMemOperand &MMO, const MachineFunction *MF, const Module *M, const MachineFrameInfo *MFI, const TargetInstrInfo *TII, LLVMContext &Ctx)
const TargetLowering & getTargetLoweringInfo() const
Returns platform specific canonical encoding of a floating point number.
void print(raw_ostream &OS, ModuleSlotTracker &MST, SmallVectorImpl< StringRef > &SSNs, const LLVMContext &Context, const MachineFrameInfo *MFI, const TargetInstrInfo *TII) const
Support for operator<<.
EXTRACT_VECTOR_ELT(VECTOR, IDX) - Returns a single element from VECTOR identified by the (potentially...
Like SetCC, ops #0 and #1 are the LHS and RHS operands to compare, but op #2 is a boolean indicating ...
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.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
BRCOND - Conditional branch.
FMINNUM_IEEE/FMAXNUM_IEEE - Perform floating-point minimum or maximum on two values, following the IEEE-754 2008 definition.
An SDNode that represents everything that will be needed to construct a MachineInstr.
Byte Swap and Counting operators.
FP16_TO_FP, FP_TO_FP16 - These operators are used to perform promotions and truncation for half-preci...
Represents one node in the SelectionDAG.
std::string utostr(uint64_t X, bool isNeg=false)
const Function & getFunction() const
Return the LLVM function that this machine code represents.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
Select(COND, TRUEVAL, FALSEVAL).
ZERO_EXTEND - Used for integer types, zeroing the new bits.
ANY_EXTEND - Used for integer types. The high bits are undefined.
FCOPYSIGN(X, Y) - Return the value of X with the sign of Y.
CATCHRET - Represents a return from a catch block funclet.
GET_DYNAMIC_AREA_OFFSET - get offset from native SP to the address of the most recent dynamic alloca...
BR_JT - Jumptable branch.
VACOPY - VACOPY has 5 operands: an input chain, a destination pointer, a source pointer, a SRCVALUE for the destination, and a SRCVALUE for the source.
Bitwise operators - logical and, logical or, logical xor.
iterator_range< typename GraphTraits< GraphType >::nodes_iterator > nodes(const GraphType &G)
SMUL_LOHI/UMUL_LOHI - Multiply two integers of type iN, producing a signed/unsigned value of type i[2...
SIGN_EXTEND_INREG - This operator atomically performs a SHL/SRA pair to sign extend a small value in ...
LOAD and STORE have token chains as their first operand, then the same operands as an LLVM load/store...
virtual const TargetIntrinsicInfo * getIntrinsicInfo() const
If intrinsic information is available, return it. If not, return null.
const TargetSubtargetInfo & getSubtarget() const
RESULT = [US]SUBSAT(LHS, RHS) - Perform saturation subtraction on 2 integers with the same bit width ...
X = STRICT_FP_ROUND(Y, TRUNC) - Rounding 'Y' from a larger floating point type down to the precision ...
FSINCOS - Compute both fsin and fcos as a single operation.
void print_types(raw_ostream &OS, const SelectionDAG *G) const
RESULT, OUTCHAIN = EH_SJLJ_SETJMP(INCHAIN, buffer) This corresponds to the eh.sjlj.setjmp intrinsic.
CopyFromReg - This node indicates that the input value is a virtual or physical register that is defi...
OUTCHAIN = EH_RETURN(INCHAIN, OFFSET, HANDLER) - This node represents 'eh_return' gcc dwarf builtin...
CONCAT_VECTORS(VECTOR0, VECTOR1, ...) - Given a number of values of vector type with the same length ...
INLINEASM_BR - Terminator version of inline asm. Used by asm-goto.
void print(raw_ostream &OS, const SelectionDAG *G=nullptr) const
Module * getParent()
Get the module that this global value is contained inside of...
FMA - Perform a * b + c with no intermediate rounding step.
Integer reductions may have a result type larger than the vector element type.
FMIN/FMAX nodes can have flags, for NaN/NoNaN variants.
unsigned getMachineOpcode() const
This may only be called if isMachineOpcode returns true.
PREFETCH - This corresponds to a prefetch intrinsic.
This class implements an extremely fast bulk output stream that can only output to a stream...
FMAD - Perform a * b + c, while getting the same result as the separately rounded operations...
SetCC operator - This evaluates to a true value iff the condition is true.
MERGE_VALUES - This node takes multiple discrete operands and returns them all as its individual resu...
Simple wrapper around std::function<void(raw_ostream&)>.
OUTCHAIN = ATOMIC_STORE(INCHAIN, ptr, val) This corresponds to "store atomic" instruction.
TRUNCATE - Completely drop the high bits.
RESULT = [US]DIVFIX(LHS, RHS, SCALE) - Perform fixed point division on 2 integers with the same width...
Perform various unary floating-point operations inspired by libm.
Val, OUTCHAIN = ATOMIC_LOAD(INCHAIN, ptr) This corresponds to "load atomic" instruction.
STRICT_FP_TO_[US]INT - Convert a floating point value to a signed or unsigned integer.
LLVMContext * getContext() const
SCALAR_TO_VECTOR(VAL) - This represents the operation of loading a scalar value into element 0 of the...
Carry-using nodes for multiple precision addition and subtraction.
CARRY_FALSE - This node is used when folding other nodes, like ADDC/SUBC, which indicate the carry re...
This file describes how to lower LLVM code to machine code.
MemIndexedMode
MemIndexedMode enum - This enum defines the load / store indexed addressing modes.
MULHU/MULHS - Multiply high - Multiply two integers of type iN, producing an unsigned/signed value of...
SRCVALUE - This is a node type that holds a Value* that is used to make reference to a value in the L...
DYNAMIC_STACKALLOC - Allocate some number of bytes on the stack aligned to a specified boundary...