1 //===-- llvm/CodeGen/SelectionDAGNodes.h - SelectionDAG Nodes ---*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file declares the SDNode class and derived classes, which are used to
11 // represent the nodes and operations present in a SelectionDAG. These nodes
12 // and operations are machine code level operations, with some similarities to
13 // the GCC RTL representation.
15 // Clients should include the SelectionDAG.h file instead of this file directly.
17 //===----------------------------------------------------------------------===//
19 #ifndef LLVM_CODEGEN_SELECTIONDAGNODES_H
20 #define LLVM_CODEGEN_SELECTIONDAGNODES_H
22 #include "llvm/CodeGen/ValueTypes.h"
23 #include "llvm/Value.h"
24 #include "llvm/ADT/GraphTraits.h"
25 #include "llvm/ADT/iterator"
26 #include "llvm/Support/DataTypes.h"
34 class MachineBasicBlock;
36 template <typename T> struct simplify_type;
37 template <typename T> struct ilist_traits;
38 template<typename NodeTy, typename Traits> class iplist;
39 template<typename NodeTy> class ilist_iterator;
41 /// ISD namespace - This namespace contains an enum which represents all of the
42 /// SelectionDAG node types and value types.
45 //===--------------------------------------------------------------------===//
46 /// ISD::NodeType enum - This enum defines all of the operators valid in a
50 // EntryToken - This is the marker used to indicate the start of the region.
53 // Token factor - This node takes multiple tokens as input and produces a
54 // single token result. This is used to represent the fact that the operand
55 // operators are independent of each other.
58 // AssertSext, AssertZext - These nodes record if a register contains a
59 // value that has already been zero or sign extended from a narrower type.
60 // These nodes take two operands. The first is the node that has already
61 // been extended, and the second is a value type node indicating the width
63 AssertSext, AssertZext,
65 // Various leaf nodes.
66 STRING, BasicBlock, VALUETYPE, CONDCODE, Register,
68 GlobalAddress, FrameIndex, ConstantPool, ExternalSymbol,
70 // TargetConstant* - Like Constant*, but the DAG does not do any folding or
71 // simplification of the constant.
75 // TargetGlobalAddress - Like GlobalAddress, but the DAG does no folding or
76 // anything else with this node, and this is valid in the target-specific
77 // dag, turning into a GlobalAddress operand.
83 /// RESULT = INTRINSIC_WO_CHAIN(INTRINSICID, arg1, arg2, ...)
84 /// This node represents a target intrinsic function with no side effects.
85 /// The first operand is the ID number of the intrinsic from the
86 /// llvm::Intrinsic namespace. The operands to the intrinsic follow. The
87 /// node has returns the result of the intrinsic.
90 /// RESULT,OUTCHAIN = INTRINSIC_W_CHAIN(INCHAIN, INTRINSICID, arg1, ...)
91 /// This node represents a target intrinsic function with side effects that
92 /// returns a result. The first operand is a chain pointer. The second is
93 /// the ID number of the intrinsic from the llvm::Intrinsic namespace. The
94 /// operands to the intrinsic follow. The node has two results, the result
95 /// of the intrinsic and an output chain.
98 /// OUTCHAIN = INTRINSIC_VOID(INCHAIN, INTRINSICID, arg1, arg2, ...)
99 /// This node represents a target intrinsic function with side effects that
100 /// does not return a result. The first operand is a chain pointer. The
101 /// second is the ID number of the intrinsic from the llvm::Intrinsic
102 /// namespace. The operands to the intrinsic follow.
105 // CopyToReg - This node has three operands: a chain, a register number to
106 // set to this value, and a value.
109 // CopyFromReg - This node indicates that the input value is a virtual or
110 // physical register that is defined outside of the scope of this
111 // SelectionDAG. The register is available from the RegSDNode object.
114 // UNDEF - An undefined node
117 /// FORMAL_ARGUMENTS(CC#, ISVARARG) - This node represents the formal
118 /// arguments for a function. CC# is a Constant value indicating the
119 /// calling convention of the function, and ISVARARG is a flag that
120 /// indicates whether the function is varargs or not. This node has one
121 /// result value for each incoming argument, and is typically custom
125 // EXTRACT_ELEMENT - This is used to get the first or second (determined by
126 // a Constant, which is required to be operand #1), element of the aggregate
127 // value specified as operand #0. This is only for use before legalization,
128 // for values that will be broken into multiple registers.
131 // BUILD_PAIR - This is the opposite of EXTRACT_ELEMENT in some ways. Given
132 // two values of the same integer value type, this produces a value twice as
133 // big. Like EXTRACT_ELEMENT, this can only be used before legalization.
136 // MERGE_VALUES - This node takes multiple discrete operands and returns
137 // them all as its individual results. This nodes has exactly the same
138 // number of inputs and outputs, and is only valid before legalization.
139 // This node is useful for some pieces of the code generator that want to
140 // think about a single node with multiple results, not multiple nodes.
143 // Simple integer binary arithmetic operators.
144 ADD, SUB, MUL, SDIV, UDIV, SREM, UREM,
146 // Carry-setting nodes for multiple precision addition and subtraction.
147 // These nodes take two operands of the same value type, and produce two
148 // results. The first result is the normal add or sub result, the second
149 // result is the carry flag result.
152 // Carry-using nodes for multiple precision addition and subtraction. These
153 // nodes take three operands: The first two are the normal lhs and rhs to
154 // the add or sub, and the third is the input carry flag. These nodes
155 // produce two results; the normal result of the add or sub, and the output
156 // carry flag. These nodes both read and write a carry flag to allow them
157 // to them to be chained together for add and sub of arbitrarily large
161 // Simple binary floating point operators.
162 FADD, FSUB, FMUL, FDIV, FREM,
164 // FCOPYSIGN(X, Y) - Return the value of X with the sign of Y. NOTE: This
165 // DAG node does not require that X and Y have the same type, just that they
166 // are both floating point. X and the result must have the same type.
167 // FCOPYSIGN(f32, f64) is allowed.
170 /// VBUILD_VECTOR(ELT1, ELT2, ELT3, ELT4,..., COUNT,TYPE) - Return a vector
171 /// with the specified, possibly variable, elements. The number of elements
172 /// is required to be a power of two.
175 /// BUILD_VECTOR(ELT1, ELT2, ELT3, ELT4,...) - Return a vector
176 /// with the specified, possibly variable, elements. The number of elements
177 /// is required to be a power of two.
180 /// VINSERT_VECTOR_ELT(VECTOR, VAL, IDX, COUNT,TYPE) - Given a vector
181 /// VECTOR, an element ELEMENT, and a (potentially variable) index IDX,
182 /// return an vector with the specified element of VECTOR replaced with VAL.
183 /// COUNT and TYPE specify the type of vector, as is standard for V* nodes.
186 /// INSERT_VECTOR_ELT(VECTOR, VAL, IDX) - Returns VECTOR (a legal packed
187 /// type) with the element at IDX replaced with VAL.
190 /// VEXTRACT_VECTOR_ELT(VECTOR, IDX) - Returns a single element from VECTOR
191 /// (an MVT::Vector value) identified by the (potentially variable) element
195 /// EXTRACT_VECTOR_ELT(VECTOR, IDX) - Returns a single element from VECTOR
196 /// (a legal packed type vector) identified by the (potentially variable)
197 /// element number IDX.
200 /// VVECTOR_SHUFFLE(VEC1, VEC2, SHUFFLEVEC, COUNT,TYPE) - Returns a vector,
201 /// of the same type as VEC1/VEC2. SHUFFLEVEC is a VBUILD_VECTOR of
202 /// constant int values that indicate which value each result element will
203 /// get. The elements of VEC1/VEC2 are enumerated in order. This is quite
204 /// similar to the Altivec 'vperm' instruction, except that the indices must
205 /// be constants and are in terms of the element size of VEC1/VEC2, not in
209 /// VECTOR_SHUFFLE(VEC1, VEC2, SHUFFLEVEC) - Returns a vector, of the same
210 /// type as VEC1/VEC2. SHUFFLEVEC is a BUILD_VECTOR of constant int values
211 /// (regardless of whether its datatype is legal or not) that indicate
212 /// which value each result element will get. The elements of VEC1/VEC2 are
213 /// enumerated in order. This is quite similar to the Altivec 'vperm'
214 /// instruction, except that the indices must be constants and are in terms
215 /// of the element size of VEC1/VEC2, not in terms of bytes.
218 /// X = VBIT_CONVERT(Y) and X = VBIT_CONVERT(Y, COUNT,TYPE) - This node
219 /// represents a conversion from or to an ISD::Vector type.
221 /// This is lowered to a BIT_CONVERT of the appropriate input/output types.
222 /// The input and output are required to have the same size and at least one
223 /// is required to be a vector (if neither is a vector, just use
226 /// If the result is a vector, this takes three operands (like any other
227 /// vector producer) which indicate the size and type of the vector result.
228 /// Otherwise it takes one input.
231 /// BINOP(LHS, RHS, COUNT,TYPE)
232 /// Simple abstract vector operators. Unlike the integer and floating point
233 /// binary operators, these nodes also take two additional operands:
234 /// a constant element count, and a value type node indicating the type of
235 /// the elements. The order is count, type, op0, op1. All vector opcodes,
236 /// including VLOAD and VConstant must currently have count and type as
237 /// their last two operands.
238 VADD, VSUB, VMUL, VSDIV, VUDIV,
241 /// VSELECT(COND,LHS,RHS, COUNT,TYPE) - Select for MVT::Vector values.
242 /// COND is a boolean value. This node return LHS if COND is true, RHS if
246 /// SCALAR_TO_VECTOR(VAL) - This represents the operation of loading a
247 /// scalar value into the low element of the resultant vector type. The top
248 /// elements of the vector are undefined.
251 // MULHU/MULHS - Multiply high - Multiply two integers of type iN, producing
252 // an unsigned/signed value of type i[2*n], then return the top part.
255 // Bitwise operators - logical and, logical or, logical xor, shift left,
256 // shift right algebraic (shift in sign bits), shift right logical (shift in
257 // zeroes), rotate left, rotate right, and byteswap.
258 AND, OR, XOR, SHL, SRA, SRL, ROTL, ROTR, BSWAP,
260 // Counting operators
263 // Select(COND, TRUEVAL, FALSEVAL)
266 // Select with condition operator - This selects between a true value and
267 // a false value (ops #2 and #3) based on the boolean result of comparing
268 // the lhs and rhs (ops #0 and #1) of a conditional expression with the
269 // condition code in op #4, a CondCodeSDNode.
272 // SetCC operator - This evaluates to a boolean (i1) true value if the
273 // condition is true. The operands to this are the left and right operands
274 // to compare (ops #0, and #1) and the condition code to compare them with
275 // (op #2) as a CondCodeSDNode.
278 // SHL_PARTS/SRA_PARTS/SRL_PARTS - These operators are used for expanded
279 // integer shift operations, just like ADD/SUB_PARTS. The operation
281 // [Lo,Hi] = op [LoLHS,HiLHS], Amt
282 SHL_PARTS, SRA_PARTS, SRL_PARTS,
284 // Conversion operators. These are all single input single output
285 // operations. For all of these, the result type must be strictly
286 // wider or narrower (depending on the operation) than the source
289 // SIGN_EXTEND - Used for integer types, replicating the sign bit
293 // ZERO_EXTEND - Used for integer types, zeroing the new bits.
296 // ANY_EXTEND - Used for integer types. The high bits are undefined.
299 // TRUNCATE - Completely drop the high bits.
302 // [SU]INT_TO_FP - These operators convert integers (whose interpreted sign
303 // depends on the first letter) to floating point.
307 // SIGN_EXTEND_INREG - This operator atomically performs a SHL/SRA pair to
308 // sign extend a small value in a large integer register (e.g. sign
309 // extending the low 8 bits of a 32-bit register to fill the top 24 bits
310 // with the 7th bit). The size of the smaller type is indicated by the 1th
311 // operand, a ValueType node.
314 // FP_TO_[US]INT - Convert a floating point value to a signed or unsigned
319 // FP_ROUND - Perform a rounding operation from the current
320 // precision down to the specified precision (currently always 64->32).
323 // FP_ROUND_INREG - This operator takes a floating point register, and
324 // rounds it to a floating point value. It then promotes it and returns it
325 // in a register of the same size. This operation effectively just discards
326 // excess precision. The type to round down to is specified by the 1th
327 // operation, a VTSDNode (currently always 64->32->64).
330 // FP_EXTEND - Extend a smaller FP type into a larger FP type.
333 // BIT_CONVERT - Theis operator converts between integer and FP values, as
334 // if one was stored to memory as integer and the other was loaded from the
335 // same address (or equivalently for vector format conversions, etc). The
336 // source and result are required to have the same bit size (e.g.
337 // f32 <-> i32). This can also be used for int-to-int or fp-to-fp
338 // conversions, but that is a noop, deleted by getNode().
341 // FNEG, FABS, FSQRT, FSIN, FCOS - Perform unary floating point negation,
342 // absolute value, square root, sine and cosine operations.
343 FNEG, FABS, FSQRT, FSIN, FCOS,
345 // Other operators. LOAD and STORE have token chains as their first
346 // operand, then the same operands as an LLVM load/store instruction, then a
347 // SRCVALUE node that provides alias analysis information.
350 // Abstract vector version of LOAD. VLOAD has a constant element count as
351 // the first operand, followed by a value type node indicating the type of
352 // the elements, a token chain, a pointer operand, and a SRCVALUE node.
355 // EXTLOAD, SEXTLOAD, ZEXTLOAD - These three operators all load a value from
356 // memory and extend them to a larger value (e.g. load a byte into a word
357 // register). All three of these have four operands, a token chain, a
358 // pointer to load from, a SRCVALUE for alias analysis, and a VALUETYPE node
359 // indicating the type to load.
361 // SEXTLOAD loads the integer operand and sign extends it to a larger
362 // integer result type.
363 // ZEXTLOAD loads the integer operand and zero extends it to a larger
364 // integer result type.
365 // EXTLOAD is used for three things: floating point extending loads,
366 // integer extending loads [the top bits are undefined], and vector
367 // extending loads [load into low elt].
368 EXTLOAD, SEXTLOAD, ZEXTLOAD,
370 // TRUNCSTORE - This operators truncates (for integer) or rounds (for FP) a
371 // value and stores it to memory in one operation. This can be used for
372 // either integer or floating point operands. The first four operands of
373 // this are the same as a standard store. The fifth is the ValueType to
374 // store it as (which will be smaller than the source value).
377 // DYNAMIC_STACKALLOC - Allocate some number of bytes on the stack aligned
378 // to a specified boundary. The first operand is the token chain, the
379 // second is the number of bytes to allocate, and the third is the alignment
380 // boundary. The size is guaranteed to be a multiple of the stack
381 // alignment, and the alignment is guaranteed to be bigger than the stack
382 // alignment (if required) or 0 to get standard stack alignment.
385 // Control flow instructions. These all have token chains.
387 // BR - Unconditional branch. The first operand is the chain
388 // operand, the second is the MBB to branch to.
391 // BRCOND - Conditional branch. The first operand is the chain,
392 // the second is the condition, the third is the block to branch
393 // to if the condition is true.
396 // BR_CC - Conditional branch. The behavior is like that of SELECT_CC, in
397 // that the condition is represented as condition code, and two nodes to
398 // compare, rather than as a combined SetCC node. The operands in order are
399 // chain, cc, lhs, rhs, block to branch to if condition is true.
402 // RET - Return from function. The first operand is the chain,
403 // and any subsequent operands are the return values for the
404 // function. This operation can have variable number of operands.
407 // INLINEASM - Represents an inline asm block. This node always has two
408 // return values: a chain and a flag result. The inputs are as follows:
409 // Operand #0 : Input chain.
410 // Operand #1 : a ExternalSymbolSDNode with a pointer to the asm string.
411 // Operand #2n+2: A RegisterNode.
412 // Operand #2n+3: A TargetConstant, indicating if the reg is a use/def
413 // Operand #last: Optional, an incoming flag.
416 // STACKSAVE - STACKSAVE has one operand, an input chain. It produces a
417 // value, the same type as the pointer type for the system, and an output
421 // STACKRESTORE has two operands, an input chain and a pointer to restore to
422 // it returns an output chain.
425 // MEMSET/MEMCPY/MEMMOVE - The first operand is the chain, and the rest
426 // correspond to the operands of the LLVM intrinsic functions. The only
427 // result is a token chain. The alignment argument is guaranteed to be a
433 // CALLSEQ_START/CALLSEQ_END - These operators mark the beginning and end of
434 // a call sequence, and carry arbitrary information that target might want
435 // to know. The first operand is a chain, the rest are specified by the
436 // target and not touched by the DAG optimizers.
437 CALLSEQ_START, // Beginning of a call sequence
438 CALLSEQ_END, // End of a call sequence
440 // VAARG - VAARG has three operands: an input chain, a pointer, and a
441 // SRCVALUE. It returns a pair of values: the vaarg value and a new chain.
444 // VACOPY - VACOPY has five operands: an input chain, a destination pointer,
445 // a source pointer, a SRCVALUE for the destination, and a SRCVALUE for the
449 // VAEND, VASTART - VAEND and VASTART have three operands: an input chain, a
450 // pointer, and a SRCVALUE.
453 // SRCVALUE - This corresponds to a Value*, and is used to associate memory
454 // locations with their value. This allows one use alias analysis
455 // information in the backend.
458 // PCMARKER - This corresponds to the pcmarker intrinsic.
461 // READCYCLECOUNTER - This corresponds to the readcyclecounter intrinsic.
462 // The only operand is a chain and a value and a chain are produced. The
463 // value is the contents of the architecture specific cycle counter like
464 // register (or other high accuracy low latency clock source)
467 // HANDLENODE node - Used as a handle for various purposes.
470 // LOCATION - This node is used to represent a source location for debug
471 // info. It takes token chain as input, then a line number, then a column
472 // number, then a filename, then a working dir. It produces a token chain
476 // DEBUG_LOC - This node is used to represent source line information
477 // embedded in the code. It takes a token chain as input, then a line
478 // number, then a column then a file id (provided by MachineDebugInfo.) It
479 // produces a token chain as output.
482 // DEBUG_LABEL - This node is used to mark a location in the code where a
483 // label should be generated for use by the debug information. It takes a
484 // token chain as input and then a unique id (provided by MachineDebugInfo.)
485 // It produces a token chain as output.
488 // BUILTIN_OP_END - This must be the last enum value in this list.
494 /// isBuildVectorAllOnes - Return true if the specified node is a
495 /// BUILD_VECTOR where all of the elements are ~0 or undef.
496 bool isBuildVectorAllOnes(const SDNode *N);
498 /// isBuildVectorAllZeros - Return true if the specified node is a
499 /// BUILD_VECTOR where all of the elements are 0 or undef.
500 bool isBuildVectorAllZeros(const SDNode *N);
502 //===--------------------------------------------------------------------===//
503 /// ISD::CondCode enum - These are ordered carefully to make the bitfields
504 /// below work out, when considering SETFALSE (something that never exists
505 /// dynamically) as 0. "U" -> Unsigned (for integer operands) or Unordered
506 /// (for floating point), "L" -> Less than, "G" -> Greater than, "E" -> Equal
507 /// to. If the "N" column is 1, the result of the comparison is undefined if
508 /// the input is a NAN.
510 /// All of these (except for the 'always folded ops') should be handled for
511 /// floating point. For integer, only the SETEQ,SETNE,SETLT,SETLE,SETGT,
512 /// SETGE,SETULT,SETULE,SETUGT, and SETUGE opcodes are used.
514 /// Note that these are laid out in a specific order to allow bit-twiddling
515 /// to transform conditions.
517 // Opcode N U L G E Intuitive operation
518 SETFALSE, // 0 0 0 0 Always false (always folded)
519 SETOEQ, // 0 0 0 1 True if ordered and equal
520 SETOGT, // 0 0 1 0 True if ordered and greater than
521 SETOGE, // 0 0 1 1 True if ordered and greater than or equal
522 SETOLT, // 0 1 0 0 True if ordered and less than
523 SETOLE, // 0 1 0 1 True if ordered and less than or equal
524 SETONE, // 0 1 1 0 True if ordered and operands are unequal
525 SETO, // 0 1 1 1 True if ordered (no nans)
526 SETUO, // 1 0 0 0 True if unordered: isnan(X) | isnan(Y)
527 SETUEQ, // 1 0 0 1 True if unordered or equal
528 SETUGT, // 1 0 1 0 True if unordered or greater than
529 SETUGE, // 1 0 1 1 True if unordered, greater than, or equal
530 SETULT, // 1 1 0 0 True if unordered or less than
531 SETULE, // 1 1 0 1 True if unordered, less than, or equal
532 SETUNE, // 1 1 1 0 True if unordered or not equal
533 SETTRUE, // 1 1 1 1 Always true (always folded)
534 // Don't care operations: undefined if the input is a nan.
535 SETFALSE2, // 1 X 0 0 0 Always false (always folded)
536 SETEQ, // 1 X 0 0 1 True if equal
537 SETGT, // 1 X 0 1 0 True if greater than
538 SETGE, // 1 X 0 1 1 True if greater than or equal
539 SETLT, // 1 X 1 0 0 True if less than
540 SETLE, // 1 X 1 0 1 True if less than or equal
541 SETNE, // 1 X 1 1 0 True if not equal
542 SETTRUE2, // 1 X 1 1 1 Always true (always folded)
544 SETCC_INVALID // Marker value.
547 /// isSignedIntSetCC - Return true if this is a setcc instruction that
548 /// performs a signed comparison when used with integer operands.
549 inline bool isSignedIntSetCC(CondCode Code) {
550 return Code == SETGT || Code == SETGE || Code == SETLT || Code == SETLE;
553 /// isUnsignedIntSetCC - Return true if this is a setcc instruction that
554 /// performs an unsigned comparison when used with integer operands.
555 inline bool isUnsignedIntSetCC(CondCode Code) {
556 return Code == SETUGT || Code == SETUGE || Code == SETULT || Code == SETULE;
559 /// isTrueWhenEqual - Return true if the specified condition returns true if
560 /// the two operands to the condition are equal. Note that if one of the two
561 /// operands is a NaN, this value is meaningless.
562 inline bool isTrueWhenEqual(CondCode Cond) {
563 return ((int)Cond & 1) != 0;
566 /// getUnorderedFlavor - This function returns 0 if the condition is always
567 /// false if an operand is a NaN, 1 if the condition is always true if the
568 /// operand is a NaN, and 2 if the condition is undefined if the operand is a
570 inline unsigned getUnorderedFlavor(CondCode Cond) {
571 return ((int)Cond >> 3) & 3;
574 /// getSetCCInverse - Return the operation corresponding to !(X op Y), where
575 /// 'op' is a valid SetCC operation.
576 CondCode getSetCCInverse(CondCode Operation, bool isInteger);
578 /// getSetCCSwappedOperands - Return the operation corresponding to (Y op X)
579 /// when given the operation for (X op Y).
580 CondCode getSetCCSwappedOperands(CondCode Operation);
582 /// getSetCCOrOperation - Return the result of a logical OR between different
583 /// comparisons of identical values: ((X op1 Y) | (X op2 Y)). This
584 /// function returns SETCC_INVALID if it is not possible to represent the
585 /// resultant comparison.
586 CondCode getSetCCOrOperation(CondCode Op1, CondCode Op2, bool isInteger);
588 /// getSetCCAndOperation - Return the result of a logical AND between
589 /// different comparisons of identical values: ((X op1 Y) & (X op2 Y)). This
590 /// function returns SETCC_INVALID if it is not possible to represent the
591 /// resultant comparison.
592 CondCode getSetCCAndOperation(CondCode Op1, CondCode Op2, bool isInteger);
593 } // end llvm::ISD namespace
596 //===----------------------------------------------------------------------===//
597 /// SDOperand - Unlike LLVM values, Selection DAG nodes may return multiple
598 /// values as the result of a computation. Many nodes return multiple values,
599 /// from loads (which define a token and a return value) to ADDC (which returns
600 /// a result and a carry value), to calls (which may return an arbitrary number
603 /// As such, each use of a SelectionDAG computation must indicate the node that
604 /// computes it as well as which return value to use from that node. This pair
605 /// of information is represented with the SDOperand value type.
609 SDNode *Val; // The node defining the value we are using.
610 unsigned ResNo; // Which return value of the node we are using.
612 SDOperand() : Val(0), ResNo(0) {}
613 SDOperand(SDNode *val, unsigned resno) : Val(val), ResNo(resno) {}
615 bool operator==(const SDOperand &O) const {
616 return Val == O.Val && ResNo == O.ResNo;
618 bool operator!=(const SDOperand &O) const {
619 return !operator==(O);
621 bool operator<(const SDOperand &O) const {
622 return Val < O.Val || (Val == O.Val && ResNo < O.ResNo);
625 SDOperand getValue(unsigned R) const {
626 return SDOperand(Val, R);
629 // isOperand - Return true if this node is an operand of N.
630 bool isOperand(SDNode *N) const;
632 /// getValueType - Return the ValueType of the referenced return value.
634 inline MVT::ValueType getValueType() const;
636 // Forwarding methods - These forward to the corresponding methods in SDNode.
637 inline unsigned getOpcode() const;
638 inline unsigned getNodeDepth() const;
639 inline unsigned getNumOperands() const;
640 inline const SDOperand &getOperand(unsigned i) const;
641 inline bool isTargetOpcode() const;
642 inline unsigned getTargetOpcode() const;
644 /// hasOneUse - Return true if there is exactly one operation using this
645 /// result value of the defining operator.
646 inline bool hasOneUse() const;
650 /// simplify_type specializations - Allow casting operators to work directly on
651 /// SDOperands as if they were SDNode*'s.
652 template<> struct simplify_type<SDOperand> {
653 typedef SDNode* SimpleType;
654 static SimpleType getSimplifiedValue(const SDOperand &Val) {
655 return static_cast<SimpleType>(Val.Val);
658 template<> struct simplify_type<const SDOperand> {
659 typedef SDNode* SimpleType;
660 static SimpleType getSimplifiedValue(const SDOperand &Val) {
661 return static_cast<SimpleType>(Val.Val);
666 /// SDNode - Represents one node in the SelectionDAG.
669 /// NodeType - The operation that this node performs.
671 unsigned short NodeType;
673 /// NodeDepth - Node depth is defined as MAX(Node depth of children)+1. This
674 /// means that leaves have a depth of 1, things that use only leaves have a
676 unsigned short NodeDepth;
678 /// OperandList - The values that are used by this operation.
680 SDOperand *OperandList;
682 /// ValueList - The types of the values this node defines. SDNode's may
683 /// define multiple values simultaneously.
684 MVT::ValueType *ValueList;
686 /// NumOperands/NumValues - The number of entries in the Operand/Value list.
687 unsigned short NumOperands, NumValues;
689 /// Prev/Next pointers - These pointers form the linked list of of the
690 /// AllNodes list in the current DAG.
692 friend struct ilist_traits<SDNode>;
694 /// Uses - These are all of the SDNode's that use a value produced by this
696 std::vector<SDNode*> Uses;
699 assert(NumOperands == 0 && "Operand list not cleared before deletion");
702 //===--------------------------------------------------------------------===//
705 unsigned getOpcode() const { return NodeType; }
706 bool isTargetOpcode() const { return NodeType >= ISD::BUILTIN_OP_END; }
707 unsigned getTargetOpcode() const {
708 assert(isTargetOpcode() && "Not a target opcode!");
709 return NodeType - ISD::BUILTIN_OP_END;
712 size_t use_size() const { return Uses.size(); }
713 bool use_empty() const { return Uses.empty(); }
714 bool hasOneUse() const { return Uses.size() == 1; }
716 /// getNodeDepth - Return the distance from this node to the leaves in the
717 /// graph. The leaves have a depth of 1.
718 unsigned getNodeDepth() const { return NodeDepth; }
720 typedef std::vector<SDNode*>::const_iterator use_iterator;
721 use_iterator use_begin() const { return Uses.begin(); }
722 use_iterator use_end() const { return Uses.end(); }
724 /// hasNUsesOfValue - Return true if there are exactly NUSES uses of the
725 /// indicated value. This method ignores uses of other values defined by this
727 bool hasNUsesOfValue(unsigned NUses, unsigned Value) const;
729 // isOnlyUse - Return true if this node is the only use of N.
730 bool isOnlyUse(SDNode *N) const;
732 // isOperand - Return true if this node is an operand of N.
733 bool isOperand(SDNode *N) const;
735 /// getNumOperands - Return the number of values used by this operation.
737 unsigned getNumOperands() const { return NumOperands; }
739 const SDOperand &getOperand(unsigned Num) const {
740 assert(Num < NumOperands && "Invalid child # of SDNode!");
741 return OperandList[Num];
743 typedef const SDOperand* op_iterator;
744 op_iterator op_begin() const { return OperandList; }
745 op_iterator op_end() const { return OperandList+NumOperands; }
748 /// getNumValues - Return the number of values defined/returned by this
751 unsigned getNumValues() const { return NumValues; }
753 /// getValueType - Return the type of a specified result.
755 MVT::ValueType getValueType(unsigned ResNo) const {
756 assert(ResNo < NumValues && "Illegal result number!");
757 return ValueList[ResNo];
760 typedef const MVT::ValueType* value_iterator;
761 value_iterator value_begin() const { return ValueList; }
762 value_iterator value_end() const { return ValueList+NumValues; }
764 /// getOperationName - Return the opcode of this operation for printing.
766 const char* getOperationName(const SelectionDAG *G = 0) const;
768 void dump(const SelectionDAG *G) const;
770 static bool classof(const SDNode *) { return true; }
773 friend class SelectionDAG;
775 /// getValueTypeList - Return a pointer to the specified value type.
777 static MVT::ValueType *getValueTypeList(MVT::ValueType VT);
779 SDNode(unsigned NT, MVT::ValueType VT) : NodeType(NT), NodeDepth(1) {
780 OperandList = 0; NumOperands = 0;
781 ValueList = getValueTypeList(VT);
785 SDNode(unsigned NT, SDOperand Op)
786 : NodeType(NT), NodeDepth(Op.Val->getNodeDepth()+1) {
787 OperandList = new SDOperand[1];
790 Op.Val->Uses.push_back(this);
795 SDNode(unsigned NT, SDOperand N1, SDOperand N2)
797 if (N1.Val->getNodeDepth() > N2.Val->getNodeDepth())
798 NodeDepth = N1.Val->getNodeDepth()+1;
800 NodeDepth = N2.Val->getNodeDepth()+1;
801 OperandList = new SDOperand[2];
805 N1.Val->Uses.push_back(this); N2.Val->Uses.push_back(this);
810 SDNode(unsigned NT, SDOperand N1, SDOperand N2, SDOperand N3)
812 unsigned ND = N1.Val->getNodeDepth();
813 if (ND < N2.Val->getNodeDepth())
814 ND = N2.Val->getNodeDepth();
815 if (ND < N3.Val->getNodeDepth())
816 ND = N3.Val->getNodeDepth();
819 OperandList = new SDOperand[3];
825 N1.Val->Uses.push_back(this); N2.Val->Uses.push_back(this);
826 N3.Val->Uses.push_back(this);
831 SDNode(unsigned NT, SDOperand N1, SDOperand N2, SDOperand N3, SDOperand N4)
833 unsigned ND = N1.Val->getNodeDepth();
834 if (ND < N2.Val->getNodeDepth())
835 ND = N2.Val->getNodeDepth();
836 if (ND < N3.Val->getNodeDepth())
837 ND = N3.Val->getNodeDepth();
838 if (ND < N4.Val->getNodeDepth())
839 ND = N4.Val->getNodeDepth();
842 OperandList = new SDOperand[4];
849 N1.Val->Uses.push_back(this); N2.Val->Uses.push_back(this);
850 N3.Val->Uses.push_back(this); N4.Val->Uses.push_back(this);
855 SDNode(unsigned Opc, const std::vector<SDOperand> &Nodes) : NodeType(Opc) {
856 NumOperands = Nodes.size();
857 OperandList = new SDOperand[NumOperands];
860 for (unsigned i = 0, e = Nodes.size(); i != e; ++i) {
861 OperandList[i] = Nodes[i];
862 SDNode *N = OperandList[i].Val;
863 N->Uses.push_back(this);
864 if (ND < N->getNodeDepth()) ND = N->getNodeDepth();
872 /// MorphNodeTo - This clears the return value and operands list, and sets the
873 /// opcode of the node to the specified value. This should only be used by
874 /// the SelectionDAG class.
875 void MorphNodeTo(unsigned Opc) {
880 // Clear the operands list, updating used nodes to remove this from their
882 for (op_iterator I = op_begin(), E = op_end(); I != E; ++I)
883 I->Val->removeUser(this);
884 delete [] OperandList;
889 void setValueTypes(MVT::ValueType VT) {
890 assert(NumValues == 0 && "Should not have values yet!");
891 ValueList = getValueTypeList(VT);
894 void setValueTypes(MVT::ValueType *List, unsigned NumVal) {
895 assert(NumValues == 0 && "Should not have values yet!");
900 void setOperands(SDOperand Op0) {
901 assert(NumOperands == 0 && "Should not have operands yet!");
902 OperandList = new SDOperand[1];
903 OperandList[0] = Op0;
905 Op0.Val->Uses.push_back(this);
907 void setOperands(SDOperand Op0, SDOperand Op1) {
908 assert(NumOperands == 0 && "Should not have operands yet!");
909 OperandList = new SDOperand[2];
910 OperandList[0] = Op0;
911 OperandList[1] = Op1;
913 Op0.Val->Uses.push_back(this); Op1.Val->Uses.push_back(this);
915 void setOperands(SDOperand Op0, SDOperand Op1, SDOperand Op2) {
916 assert(NumOperands == 0 && "Should not have operands yet!");
917 OperandList = new SDOperand[3];
918 OperandList[0] = Op0;
919 OperandList[1] = Op1;
920 OperandList[2] = Op2;
922 Op0.Val->Uses.push_back(this); Op1.Val->Uses.push_back(this);
923 Op2.Val->Uses.push_back(this);
925 void setOperands(SDOperand Op0, SDOperand Op1, SDOperand Op2, SDOperand Op3) {
926 assert(NumOperands == 0 && "Should not have operands yet!");
927 OperandList = new SDOperand[4];
928 OperandList[0] = Op0;
929 OperandList[1] = Op1;
930 OperandList[2] = Op2;
931 OperandList[3] = Op3;
933 Op0.Val->Uses.push_back(this); Op1.Val->Uses.push_back(this);
934 Op2.Val->Uses.push_back(this); Op3.Val->Uses.push_back(this);
936 void setOperands(SDOperand Op0, SDOperand Op1, SDOperand Op2, SDOperand Op3,
938 assert(NumOperands == 0 && "Should not have operands yet!");
939 OperandList = new SDOperand[5];
940 OperandList[0] = Op0;
941 OperandList[1] = Op1;
942 OperandList[2] = Op2;
943 OperandList[3] = Op3;
944 OperandList[4] = Op4;
946 Op0.Val->Uses.push_back(this); Op1.Val->Uses.push_back(this);
947 Op2.Val->Uses.push_back(this); Op3.Val->Uses.push_back(this);
948 Op4.Val->Uses.push_back(this);
950 void setOperands(SDOperand Op0, SDOperand Op1, SDOperand Op2, SDOperand Op3,
951 SDOperand Op4, SDOperand Op5) {
952 assert(NumOperands == 0 && "Should not have operands yet!");
953 OperandList = new SDOperand[6];
954 OperandList[0] = Op0;
955 OperandList[1] = Op1;
956 OperandList[2] = Op2;
957 OperandList[3] = Op3;
958 OperandList[4] = Op4;
959 OperandList[5] = Op5;
961 Op0.Val->Uses.push_back(this); Op1.Val->Uses.push_back(this);
962 Op2.Val->Uses.push_back(this); Op3.Val->Uses.push_back(this);
963 Op4.Val->Uses.push_back(this); Op5.Val->Uses.push_back(this);
965 void setOperands(SDOperand Op0, SDOperand Op1, SDOperand Op2, SDOperand Op3,
966 SDOperand Op4, SDOperand Op5, SDOperand Op6) {
967 assert(NumOperands == 0 && "Should not have operands yet!");
968 OperandList = new SDOperand[7];
969 OperandList[0] = Op0;
970 OperandList[1] = Op1;
971 OperandList[2] = Op2;
972 OperandList[3] = Op3;
973 OperandList[4] = Op4;
974 OperandList[5] = Op5;
975 OperandList[6] = Op6;
977 Op0.Val->Uses.push_back(this); Op1.Val->Uses.push_back(this);
978 Op2.Val->Uses.push_back(this); Op3.Val->Uses.push_back(this);
979 Op4.Val->Uses.push_back(this); Op5.Val->Uses.push_back(this);
980 Op6.Val->Uses.push_back(this);
982 void setOperands(SDOperand Op0, SDOperand Op1, SDOperand Op2, SDOperand Op3,
983 SDOperand Op4, SDOperand Op5, SDOperand Op6, SDOperand Op7) {
984 assert(NumOperands == 0 && "Should not have operands yet!");
985 OperandList = new SDOperand[8];
986 OperandList[0] = Op0;
987 OperandList[1] = Op1;
988 OperandList[2] = Op2;
989 OperandList[3] = Op3;
990 OperandList[4] = Op4;
991 OperandList[5] = Op5;
992 OperandList[6] = Op6;
993 OperandList[7] = Op7;
995 Op0.Val->Uses.push_back(this); Op1.Val->Uses.push_back(this);
996 Op2.Val->Uses.push_back(this); Op3.Val->Uses.push_back(this);
997 Op4.Val->Uses.push_back(this); Op5.Val->Uses.push_back(this);
998 Op6.Val->Uses.push_back(this); Op7.Val->Uses.push_back(this);
1001 void addUser(SDNode *User) {
1002 Uses.push_back(User);
1004 void removeUser(SDNode *User) {
1005 // Remove this user from the operand's use list.
1006 for (unsigned i = Uses.size(); ; --i) {
1007 assert(i != 0 && "Didn't find user!");
1008 if (Uses[i-1] == User) {
1009 Uses[i-1] = Uses.back();
1018 // Define inline functions from the SDOperand class.
1020 inline unsigned SDOperand::getOpcode() const {
1021 return Val->getOpcode();
1023 inline unsigned SDOperand::getNodeDepth() const {
1024 return Val->getNodeDepth();
1026 inline MVT::ValueType SDOperand::getValueType() const {
1027 return Val->getValueType(ResNo);
1029 inline unsigned SDOperand::getNumOperands() const {
1030 return Val->getNumOperands();
1032 inline const SDOperand &SDOperand::getOperand(unsigned i) const {
1033 return Val->getOperand(i);
1035 inline bool SDOperand::isTargetOpcode() const {
1036 return Val->isTargetOpcode();
1038 inline unsigned SDOperand::getTargetOpcode() const {
1039 return Val->getTargetOpcode();
1041 inline bool SDOperand::hasOneUse() const {
1042 return Val->hasNUsesOfValue(1, ResNo);
1045 /// HandleSDNode - This class is used to form a handle around another node that
1046 /// is persistant and is updated across invocations of replaceAllUsesWith on its
1047 /// operand. This node should be directly created by end-users and not added to
1048 /// the AllNodes list.
1049 class HandleSDNode : public SDNode {
1051 HandleSDNode(SDOperand X) : SDNode(ISD::HANDLENODE, X) {}
1053 MorphNodeTo(ISD::HANDLENODE); // Drops operand uses.
1056 SDOperand getValue() const { return getOperand(0); }
1059 class StringSDNode : public SDNode {
1062 friend class SelectionDAG;
1063 StringSDNode(const std::string &val)
1064 : SDNode(ISD::STRING, MVT::Other), Value(val) {
1067 const std::string &getValue() const { return Value; }
1068 static bool classof(const StringSDNode *) { return true; }
1069 static bool classof(const SDNode *N) {
1070 return N->getOpcode() == ISD::STRING;
1074 class ConstantSDNode : public SDNode {
1077 friend class SelectionDAG;
1078 ConstantSDNode(bool isTarget, uint64_t val, MVT::ValueType VT)
1079 : SDNode(isTarget ? ISD::TargetConstant : ISD::Constant, VT), Value(val) {
1083 uint64_t getValue() const { return Value; }
1085 int64_t getSignExtended() const {
1086 unsigned Bits = MVT::getSizeInBits(getValueType(0));
1087 return ((int64_t)Value << (64-Bits)) >> (64-Bits);
1090 bool isNullValue() const { return Value == 0; }
1091 bool isAllOnesValue() const {
1092 return Value == MVT::getIntVTBitMask(getValueType(0));
1095 static bool classof(const ConstantSDNode *) { return true; }
1096 static bool classof(const SDNode *N) {
1097 return N->getOpcode() == ISD::Constant ||
1098 N->getOpcode() == ISD::TargetConstant;
1102 class ConstantFPSDNode : public SDNode {
1105 friend class SelectionDAG;
1106 ConstantFPSDNode(bool isTarget, double val, MVT::ValueType VT)
1107 : SDNode(isTarget ? ISD::TargetConstantFP : ISD::ConstantFP, VT),
1112 double getValue() const { return Value; }
1114 /// isExactlyValue - We don't rely on operator== working on double values, as
1115 /// it returns true for things that are clearly not equal, like -0.0 and 0.0.
1116 /// As such, this method can be used to do an exact bit-for-bit comparison of
1117 /// two floating point values.
1118 bool isExactlyValue(double V) const;
1120 static bool classof(const ConstantFPSDNode *) { return true; }
1121 static bool classof(const SDNode *N) {
1122 return N->getOpcode() == ISD::ConstantFP ||
1123 N->getOpcode() == ISD::TargetConstantFP;
1127 class GlobalAddressSDNode : public SDNode {
1128 GlobalValue *TheGlobal;
1131 friend class SelectionDAG;
1132 GlobalAddressSDNode(bool isTarget, const GlobalValue *GA, MVT::ValueType VT,
1134 : SDNode(isTarget ? ISD::TargetGlobalAddress : ISD::GlobalAddress, VT),
1136 TheGlobal = const_cast<GlobalValue*>(GA);
1140 GlobalValue *getGlobal() const { return TheGlobal; }
1141 int getOffset() const { return Offset; }
1143 static bool classof(const GlobalAddressSDNode *) { return true; }
1144 static bool classof(const SDNode *N) {
1145 return N->getOpcode() == ISD::GlobalAddress ||
1146 N->getOpcode() == ISD::TargetGlobalAddress;
1151 class FrameIndexSDNode : public SDNode {
1154 friend class SelectionDAG;
1155 FrameIndexSDNode(int fi, MVT::ValueType VT, bool isTarg)
1156 : SDNode(isTarg ? ISD::TargetFrameIndex : ISD::FrameIndex, VT), FI(fi) {}
1159 int getIndex() const { return FI; }
1161 static bool classof(const FrameIndexSDNode *) { return true; }
1162 static bool classof(const SDNode *N) {
1163 return N->getOpcode() == ISD::FrameIndex ||
1164 N->getOpcode() == ISD::TargetFrameIndex;
1168 class ConstantPoolSDNode : public SDNode {
1173 friend class SelectionDAG;
1174 ConstantPoolSDNode(bool isTarget, Constant *c, MVT::ValueType VT,
1176 : SDNode(isTarget ? ISD::TargetConstantPool : ISD::ConstantPool, VT),
1177 C(c), Offset(o), Alignment(0) {}
1178 ConstantPoolSDNode(bool isTarget, Constant *c, MVT::ValueType VT, int o,
1180 : SDNode(isTarget ? ISD::TargetConstantPool : ISD::ConstantPool, VT),
1181 C(c), Offset(o), Alignment(Align) {}
1184 Constant *get() const { return C; }
1185 int getOffset() const { return Offset; }
1187 // Return the alignment of this constant pool object, which is either 0 (for
1188 // default alignment) or log2 of the desired value.
1189 unsigned getAlignment() const { return Alignment; }
1191 static bool classof(const ConstantPoolSDNode *) { return true; }
1192 static bool classof(const SDNode *N) {
1193 return N->getOpcode() == ISD::ConstantPool ||
1194 N->getOpcode() == ISD::TargetConstantPool;
1198 class BasicBlockSDNode : public SDNode {
1199 MachineBasicBlock *MBB;
1201 friend class SelectionDAG;
1202 BasicBlockSDNode(MachineBasicBlock *mbb)
1203 : SDNode(ISD::BasicBlock, MVT::Other), MBB(mbb) {}
1206 MachineBasicBlock *getBasicBlock() const { return MBB; }
1208 static bool classof(const BasicBlockSDNode *) { return true; }
1209 static bool classof(const SDNode *N) {
1210 return N->getOpcode() == ISD::BasicBlock;
1214 class SrcValueSDNode : public SDNode {
1218 friend class SelectionDAG;
1219 SrcValueSDNode(const Value* v, int o)
1220 : SDNode(ISD::SRCVALUE, MVT::Other), V(v), offset(o) {}
1223 const Value *getValue() const { return V; }
1224 int getOffset() const { return offset; }
1226 static bool classof(const SrcValueSDNode *) { return true; }
1227 static bool classof(const SDNode *N) {
1228 return N->getOpcode() == ISD::SRCVALUE;
1233 class RegisterSDNode : public SDNode {
1236 friend class SelectionDAG;
1237 RegisterSDNode(unsigned reg, MVT::ValueType VT)
1238 : SDNode(ISD::Register, VT), Reg(reg) {}
1241 unsigned getReg() const { return Reg; }
1243 static bool classof(const RegisterSDNode *) { return true; }
1244 static bool classof(const SDNode *N) {
1245 return N->getOpcode() == ISD::Register;
1249 class ExternalSymbolSDNode : public SDNode {
1252 friend class SelectionDAG;
1253 ExternalSymbolSDNode(bool isTarget, const char *Sym, MVT::ValueType VT)
1254 : SDNode(isTarget ? ISD::TargetExternalSymbol : ISD::ExternalSymbol, VT),
1259 const char *getSymbol() const { return Symbol; }
1261 static bool classof(const ExternalSymbolSDNode *) { return true; }
1262 static bool classof(const SDNode *N) {
1263 return N->getOpcode() == ISD::ExternalSymbol ||
1264 N->getOpcode() == ISD::TargetExternalSymbol;
1268 class CondCodeSDNode : public SDNode {
1269 ISD::CondCode Condition;
1271 friend class SelectionDAG;
1272 CondCodeSDNode(ISD::CondCode Cond)
1273 : SDNode(ISD::CONDCODE, MVT::Other), Condition(Cond) {
1277 ISD::CondCode get() const { return Condition; }
1279 static bool classof(const CondCodeSDNode *) { return true; }
1280 static bool classof(const SDNode *N) {
1281 return N->getOpcode() == ISD::CONDCODE;
1285 /// VTSDNode - This class is used to represent MVT::ValueType's, which are used
1286 /// to parameterize some operations.
1287 class VTSDNode : public SDNode {
1288 MVT::ValueType ValueType;
1290 friend class SelectionDAG;
1291 VTSDNode(MVT::ValueType VT)
1292 : SDNode(ISD::VALUETYPE, MVT::Other), ValueType(VT) {}
1295 MVT::ValueType getVT() const { return ValueType; }
1297 static bool classof(const VTSDNode *) { return true; }
1298 static bool classof(const SDNode *N) {
1299 return N->getOpcode() == ISD::VALUETYPE;
1304 class SDNodeIterator : public forward_iterator<SDNode, ptrdiff_t> {
1308 SDNodeIterator(SDNode *N, unsigned Op) : Node(N), Operand(Op) {}
1310 bool operator==(const SDNodeIterator& x) const {
1311 return Operand == x.Operand;
1313 bool operator!=(const SDNodeIterator& x) const { return !operator==(x); }
1315 const SDNodeIterator &operator=(const SDNodeIterator &I) {
1316 assert(I.Node == Node && "Cannot assign iterators to two different nodes!");
1317 Operand = I.Operand;
1321 pointer operator*() const {
1322 return Node->getOperand(Operand).Val;
1324 pointer operator->() const { return operator*(); }
1326 SDNodeIterator& operator++() { // Preincrement
1330 SDNodeIterator operator++(int) { // Postincrement
1331 SDNodeIterator tmp = *this; ++*this; return tmp;
1334 static SDNodeIterator begin(SDNode *N) { return SDNodeIterator(N, 0); }
1335 static SDNodeIterator end (SDNode *N) {
1336 return SDNodeIterator(N, N->getNumOperands());
1339 unsigned getOperand() const { return Operand; }
1340 const SDNode *getNode() const { return Node; }
1343 template <> struct GraphTraits<SDNode*> {
1344 typedef SDNode NodeType;
1345 typedef SDNodeIterator ChildIteratorType;
1346 static inline NodeType *getEntryNode(SDNode *N) { return N; }
1347 static inline ChildIteratorType child_begin(NodeType *N) {
1348 return SDNodeIterator::begin(N);
1350 static inline ChildIteratorType child_end(NodeType *N) {
1351 return SDNodeIterator::end(N);
1356 struct ilist_traits<SDNode> {
1357 static SDNode *getPrev(const SDNode *N) { return N->Prev; }
1358 static SDNode *getNext(const SDNode *N) { return N->Next; }
1360 static void setPrev(SDNode *N, SDNode *Prev) { N->Prev = Prev; }
1361 static void setNext(SDNode *N, SDNode *Next) { N->Next = Next; }
1363 static SDNode *createSentinel() {
1364 return new SDNode(ISD::EntryToken, MVT::Other);
1366 static void destroySentinel(SDNode *N) { delete N; }
1367 //static SDNode *createNode(const SDNode &V) { return new SDNode(V); }
1370 void addNodeToList(SDNode *NTy) {}
1371 void removeNodeFromList(SDNode *NTy) {}
1372 void transferNodesFromList(iplist<SDNode, ilist_traits> &L2,
1373 const ilist_iterator<SDNode> &X,
1374 const ilist_iterator<SDNode> &Y) {}
1377 } // end llvm namespace