Remove warnings about shadowed and unused variables.
[oota-llvm.git] / include / llvm / CodeGen / SelectionDAGNodes.h
1 //===-- llvm/CodeGen/SelectionDAGNodes.h - SelectionDAG Nodes ---*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
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.
14 //
15 // Clients should include the SelectionDAG.h file instead of this file directly.
16 //
17 //===----------------------------------------------------------------------===//
18
19 #ifndef LLVM_CODEGEN_SELECTIONDAGNODES_H
20 #define LLVM_CODEGEN_SELECTIONDAGNODES_H
21
22 #include "llvm/Value.h"
23 #include "llvm/ADT/FoldingSet.h"
24 #include "llvm/ADT/GraphTraits.h"
25 #include "llvm/ADT/iterator.h"
26 #include "llvm/ADT/APFloat.h"
27 #include "llvm/ADT/APInt.h"
28 #include "llvm/CodeGen/ValueTypes.h"
29 #include "llvm/CodeGen/MachineMemOperand.h"
30 #include "llvm/Support/DataTypes.h"
31 #include <cassert>
32
33 namespace llvm {
34
35 class SelectionDAG;
36 class GlobalValue;
37 class MachineBasicBlock;
38 class MachineConstantPoolValue;
39 class SDNode;
40 template <typename T> struct DenseMapInfo;
41 template <typename T> struct simplify_type;
42 template <typename T> struct ilist_traits;
43 template<typename NodeTy, typename Traits> class iplist;
44 template<typename NodeTy> class ilist_iterator;
45
46 /// SDVTList - This represents a list of ValueType's that has been intern'd by
47 /// a SelectionDAG.  Instances of this simple value class are returned by
48 /// SelectionDAG::getVTList(...).
49 ///
50 struct SDVTList {
51   const MVT *VTs;
52   unsigned short NumVTs;
53 };
54
55 /// ISD namespace - This namespace contains an enum which represents all of the
56 /// SelectionDAG node types and value types.
57 ///
58 namespace ISD {
59
60   //===--------------------------------------------------------------------===//
61   /// ISD::NodeType enum - This enum defines all of the operators valid in a
62   /// SelectionDAG.
63   ///
64   enum NodeType {
65     // DELETED_NODE - This is an illegal flag value that is used to catch
66     // errors.  This opcode is not a legal opcode for any node.
67     DELETED_NODE,
68     
69     // EntryToken - This is the marker used to indicate the start of the region.
70     EntryToken,
71
72     // Token factor - This node takes multiple tokens as input and produces a
73     // single token result.  This is used to represent the fact that the operand
74     // operators are independent of each other.
75     TokenFactor,
76     
77     // AssertSext, AssertZext - These nodes record if a register contains a 
78     // value that has already been zero or sign extended from a narrower type.  
79     // These nodes take two operands.  The first is the node that has already 
80     // been extended, and the second is a value type node indicating the width
81     // of the extension
82     AssertSext, AssertZext,
83
84     // Various leaf nodes.
85     STRING, BasicBlock, VALUETYPE, ARG_FLAGS, CONDCODE, Register,
86     Constant, ConstantFP,
87     GlobalAddress, GlobalTLSAddress, FrameIndex,
88     JumpTable, ConstantPool, ExternalSymbol,
89
90     // The address of the GOT
91     GLOBAL_OFFSET_TABLE,
92     
93     // FRAMEADDR, RETURNADDR - These nodes represent llvm.frameaddress and
94     // llvm.returnaddress on the DAG.  These nodes take one operand, the index
95     // of the frame or return address to return.  An index of zero corresponds
96     // to the current function's frame or return address, an index of one to the
97     // parent's frame or return address, and so on.
98     FRAMEADDR, RETURNADDR,
99
100     // FRAME_TO_ARGS_OFFSET - This node represents offset from frame pointer to
101     // first (possible) on-stack argument. This is needed for correct stack
102     // adjustment during unwind.
103     FRAME_TO_ARGS_OFFSET,
104     
105     // RESULT, OUTCHAIN = EXCEPTIONADDR(INCHAIN) - This node represents the
106     // address of the exception block on entry to an landing pad block.
107     EXCEPTIONADDR,
108     
109     // RESULT, OUTCHAIN = EHSELECTION(INCHAIN, EXCEPTION) - This node represents
110     // the selection index of the exception thrown.
111     EHSELECTION,
112
113     // OUTCHAIN = EH_RETURN(INCHAIN, OFFSET, HANDLER) - This node represents
114     // 'eh_return' gcc dwarf builtin, which is used to return from
115     // exception. The general meaning is: adjust stack by OFFSET and pass
116     // execution to HANDLER. Many platform-related details also :)
117     EH_RETURN,
118
119     // TargetConstant* - Like Constant*, but the DAG does not do any folding or
120     // simplification of the constant.
121     TargetConstant,
122     TargetConstantFP,
123     
124     // TargetGlobalAddress - Like GlobalAddress, but the DAG does no folding or
125     // anything else with this node, and this is valid in the target-specific
126     // dag, turning into a GlobalAddress operand.
127     TargetGlobalAddress,
128     TargetGlobalTLSAddress,
129     TargetFrameIndex,
130     TargetJumpTable,
131     TargetConstantPool,
132     TargetExternalSymbol,
133     
134     /// RESULT = INTRINSIC_WO_CHAIN(INTRINSICID, arg1, arg2, ...)
135     /// This node represents a target intrinsic function with no side effects.
136     /// The first operand is the ID number of the intrinsic from the
137     /// llvm::Intrinsic namespace.  The operands to the intrinsic follow.  The
138     /// node has returns the result of the intrinsic.
139     INTRINSIC_WO_CHAIN,
140     
141     /// RESULT,OUTCHAIN = INTRINSIC_W_CHAIN(INCHAIN, INTRINSICID, arg1, ...)
142     /// This node represents a target intrinsic function with side effects that
143     /// returns a result.  The first operand is a chain pointer.  The second is
144     /// the ID number of the intrinsic from the llvm::Intrinsic namespace.  The
145     /// operands to the intrinsic follow.  The node has two results, the result
146     /// of the intrinsic and an output chain.
147     INTRINSIC_W_CHAIN,
148
149     /// OUTCHAIN = INTRINSIC_VOID(INCHAIN, INTRINSICID, arg1, arg2, ...)
150     /// This node represents a target intrinsic function with side effects that
151     /// does not return a result.  The first operand is a chain pointer.  The
152     /// second is the ID number of the intrinsic from the llvm::Intrinsic
153     /// namespace.  The operands to the intrinsic follow.
154     INTRINSIC_VOID,
155     
156     // CopyToReg - This node has three operands: a chain, a register number to
157     // set to this value, and a value.  
158     CopyToReg,
159
160     // CopyFromReg - This node indicates that the input value is a virtual or
161     // physical register that is defined outside of the scope of this
162     // SelectionDAG.  The register is available from the RegisterSDNode object.
163     CopyFromReg,
164
165     // UNDEF - An undefined node
166     UNDEF,
167     
168     /// FORMAL_ARGUMENTS(CHAIN, CC#, ISVARARG, FLAG0, ..., FLAGn) - This node
169     /// represents the formal arguments for a function.  CC# is a Constant value
170     /// indicating the calling convention of the function, and ISVARARG is a
171     /// flag that indicates whether the function is varargs or not. This node
172     /// has one result value for each incoming argument, plus one for the output
173     /// chain. It must be custom legalized. See description of CALL node for
174     /// FLAG argument contents explanation.
175     /// 
176     FORMAL_ARGUMENTS,
177     
178     /// RV1, RV2...RVn, CHAIN = CALL(CHAIN, CC#, ISVARARG, ISTAILCALL, CALLEE,
179     ///                              ARG0, FLAG0, ARG1, FLAG1, ... ARGn, FLAGn)
180     /// This node represents a fully general function call, before the legalizer
181     /// runs.  This has one result value for each argument / flag pair, plus
182     /// a chain result. It must be custom legalized. Flag argument indicates
183     /// misc. argument attributes. Currently:
184     /// Bit 0 - signness
185     /// Bit 1 - 'inreg' attribute
186     /// Bit 2 - 'sret' attribute
187     /// Bit 4 - 'byval' attribute
188     /// Bit 5 - 'nest' attribute
189     /// Bit 6-9 - alignment of byval structures
190     /// Bit 10-26 - size of byval structures
191     /// Bits 31:27 - argument ABI alignment in the first argument piece and
192     /// alignment '1' in other argument pieces.
193     CALL,
194
195     // EXTRACT_ELEMENT - This is used to get the lower or upper (determined by
196     // a Constant, which is required to be operand #1) half of the integer or
197     // float value specified as operand #0.  This is only for use before
198     // legalization, for values that will be broken into multiple registers.
199     EXTRACT_ELEMENT,
200
201     // BUILD_PAIR - This is the opposite of EXTRACT_ELEMENT in some ways.  Given
202     // two values of the same integer value type, this produces a value twice as
203     // big.  Like EXTRACT_ELEMENT, this can only be used before legalization.
204     BUILD_PAIR,
205
206     // MERGE_VALUES - This node takes multiple discrete operands and returns
207     // them all as its individual results.  This nodes has exactly the same
208     // number of inputs and outputs, and is only valid before legalization.
209     // This node is useful for some pieces of the code generator that want to
210     // think about a single node with multiple results, not multiple nodes.
211     MERGE_VALUES,
212
213     // Simple integer binary arithmetic operators.
214     ADD, SUB, MUL, SDIV, UDIV, SREM, UREM,
215
216     // SMUL_LOHI/UMUL_LOHI - Multiply two integers of type iN, producing
217     // a signed/unsigned value of type i[2*N], and return the full value as
218     // two results, each of type iN.
219     SMUL_LOHI, UMUL_LOHI,
220
221     // SDIVREM/UDIVREM - Divide two integers and produce both a quotient and
222     // remainder result.
223     SDIVREM, UDIVREM,
224     
225     // CARRY_FALSE - This node is used when folding other nodes,
226     // like ADDC/SUBC, which indicate the carry result is always false.
227     CARRY_FALSE,
228     
229     // Carry-setting nodes for multiple precision addition and subtraction.
230     // These nodes take two operands of the same value type, and produce two
231     // results.  The first result is the normal add or sub result, the second
232     // result is the carry flag result.
233     ADDC, SUBC,
234     
235     // Carry-using nodes for multiple precision addition and subtraction.  These
236     // nodes take three operands: The first two are the normal lhs and rhs to
237     // the add or sub, and the third is the input carry flag.  These nodes
238     // produce two results; the normal result of the add or sub, and the output
239     // carry flag.  These nodes both read and write a carry flag to allow them
240     // to them to be chained together for add and sub of arbitrarily large
241     // values.
242     ADDE, SUBE,
243     
244     // Simple binary floating point operators.
245     FADD, FSUB, FMUL, FDIV, FREM,
246
247     // FCOPYSIGN(X, Y) - Return the value of X with the sign of Y.  NOTE: This
248     // DAG node does not require that X and Y have the same type, just that they
249     // are both floating point.  X and the result must have the same type.
250     // FCOPYSIGN(f32, f64) is allowed.
251     FCOPYSIGN,
252
253     // INT = FGETSIGN(FP) - Return the sign bit of the specified floating point
254     // value as an integer 0/1 value.
255     FGETSIGN,
256     
257     /// BUILD_VECTOR(ELT0, ELT1, ELT2, ELT3,...) - Return a vector
258     /// with the specified, possibly variable, elements.  The number of elements
259     /// is required to be a power of two.
260     BUILD_VECTOR,
261     
262     /// INSERT_VECTOR_ELT(VECTOR, VAL, IDX) - Returns VECTOR with the element
263     /// at IDX replaced with VAL.  If the type of VAL is larger than the vector
264     /// element type then VAL is truncated before replacement.
265     INSERT_VECTOR_ELT,
266
267     /// EXTRACT_VECTOR_ELT(VECTOR, IDX) - Returns a single element from VECTOR
268     /// identified by the (potentially variable) element number IDX.
269     EXTRACT_VECTOR_ELT,
270     
271     /// CONCAT_VECTORS(VECTOR0, VECTOR1, ...) - Given a number of values of
272     /// vector type with the same length and element type, this produces a
273     /// concatenated vector result value, with length equal to the sum of the
274     /// lengths of the input vectors.
275     CONCAT_VECTORS,
276     
277     /// EXTRACT_SUBVECTOR(VECTOR, IDX) - Returns a subvector from VECTOR (an
278     /// vector value) starting with the (potentially variable) element number
279     /// IDX, which must be a multiple of the result vector length.
280     EXTRACT_SUBVECTOR,
281
282     /// VECTOR_SHUFFLE(VEC1, VEC2, SHUFFLEVEC) - Returns a vector, of the same
283     /// type as VEC1/VEC2.  SHUFFLEVEC is a BUILD_VECTOR of constant int values
284     /// (maybe of an illegal datatype) or undef that indicate which value each
285     /// result element will get.  The elements of VEC1/VEC2 are enumerated in
286     /// order.  This is quite similar to the Altivec 'vperm' instruction, except
287     /// that the indices must be constants and are in terms of the element size
288     /// of VEC1/VEC2, not in terms of bytes.
289     VECTOR_SHUFFLE,
290
291     /// SCALAR_TO_VECTOR(VAL) - This represents the operation of loading a
292     /// scalar value into element 0 of the resultant vector type.  The top
293     /// elements 1 to N-1 of the N-element vector are undefined.
294     SCALAR_TO_VECTOR,
295     
296     // EXTRACT_SUBREG - This node is used to extract a sub-register value. 
297     // This node takes a superreg and a constant sub-register index as operands.
298     // Note sub-register indices must be increasing. That is, if the
299     // sub-register index of a 8-bit sub-register is N, then the index for a
300     // 16-bit sub-register must be at least N+1.
301     EXTRACT_SUBREG,
302     
303     // INSERT_SUBREG - This node is used to insert a sub-register value. 
304     // This node takes a superreg, a subreg value, and a constant sub-register
305     // index as operands.
306     INSERT_SUBREG,
307     
308     // MULHU/MULHS - Multiply high - Multiply two integers of type iN, producing
309     // an unsigned/signed value of type i[2*N], then return the top part.
310     MULHU, MULHS,
311
312     // Bitwise operators - logical and, logical or, logical xor, shift left,
313     // shift right algebraic (shift in sign bits), shift right logical (shift in
314     // zeroes), rotate left, rotate right, and byteswap.
315     AND, OR, XOR, SHL, SRA, SRL, ROTL, ROTR, BSWAP,
316
317     // Counting operators
318     CTTZ, CTLZ, CTPOP,
319
320     // Select(COND, TRUEVAL, FALSEVAL)
321     SELECT, 
322     
323     // Select with condition operator - This selects between a true value and 
324     // a false value (ops #2 and #3) based on the boolean result of comparing
325     // the lhs and rhs (ops #0 and #1) of a conditional expression with the 
326     // condition code in op #4, a CondCodeSDNode.
327     SELECT_CC,
328
329     // SetCC operator - This evaluates to a boolean (i1) true value if the
330     // condition is true.  The operands to this are the left and right operands
331     // to compare (ops #0, and #1) and the condition code to compare them with
332     // (op #2) as a CondCodeSDNode.
333     SETCC,
334
335     // Vector SetCC operator - This evaluates to a vector of integer elements
336     // with the high bit in each element set to true if the comparison is true
337     // and false if the comparison is false.  All other bits in each element 
338     // are undefined.  The operands to this are the left and right operands
339     // to compare (ops #0, and #1) and the condition code to compare them with
340     // (op #2) as a CondCodeSDNode.
341     VSETCC,
342
343     // SHL_PARTS/SRA_PARTS/SRL_PARTS - These operators are used for expanded
344     // integer shift operations, just like ADD/SUB_PARTS.  The operation
345     // ordering is:
346     //       [Lo,Hi] = op [LoLHS,HiLHS], Amt
347     SHL_PARTS, SRA_PARTS, SRL_PARTS,
348
349     // Conversion operators.  These are all single input single output
350     // operations.  For all of these, the result type must be strictly
351     // wider or narrower (depending on the operation) than the source
352     // type.
353
354     // SIGN_EXTEND - Used for integer types, replicating the sign bit
355     // into new bits.
356     SIGN_EXTEND,
357
358     // ZERO_EXTEND - Used for integer types, zeroing the new bits.
359     ZERO_EXTEND,
360
361     // ANY_EXTEND - Used for integer types.  The high bits are undefined.
362     ANY_EXTEND,
363     
364     // TRUNCATE - Completely drop the high bits.
365     TRUNCATE,
366
367     // [SU]INT_TO_FP - These operators convert integers (whose interpreted sign
368     // depends on the first letter) to floating point.
369     SINT_TO_FP,
370     UINT_TO_FP,
371
372     // SIGN_EXTEND_INREG - This operator atomically performs a SHL/SRA pair to
373     // sign extend a small value in a large integer register (e.g. sign
374     // extending the low 8 bits of a 32-bit register to fill the top 24 bits
375     // with the 7th bit).  The size of the smaller type is indicated by the 1th
376     // operand, a ValueType node.
377     SIGN_EXTEND_INREG,
378
379     /// FP_TO_[US]INT - Convert a floating point value to a signed or unsigned
380     /// integer.
381     FP_TO_SINT,
382     FP_TO_UINT,
383
384     /// X = FP_ROUND(Y, TRUNC) - Rounding 'Y' from a larger floating point type
385     /// down to the precision of the destination VT.  TRUNC is a flag, which is
386     /// always an integer that is zero or one.  If TRUNC is 0, this is a
387     /// normal rounding, if it is 1, this FP_ROUND is known to not change the
388     /// value of Y.
389     ///
390     /// The TRUNC = 1 case is used in cases where we know that the value will
391     /// not be modified by the node, because Y is not using any of the extra
392     /// precision of source type.  This allows certain transformations like
393     /// FP_EXTEND(FP_ROUND(X,1)) -> X which are not safe for 
394     /// FP_EXTEND(FP_ROUND(X,0)) because the extra bits aren't removed.
395     FP_ROUND,
396     
397     // FLT_ROUNDS_ - Returns current rounding mode:
398     // -1 Undefined
399     //  0 Round to 0
400     //  1 Round to nearest
401     //  2 Round to +inf
402     //  3 Round to -inf
403     FLT_ROUNDS_,
404
405     /// X = FP_ROUND_INREG(Y, VT) - This operator takes an FP register, and
406     /// rounds it to a floating point value.  It then promotes it and returns it
407     /// in a register of the same size.  This operation effectively just
408     /// discards excess precision.  The type to round down to is specified by
409     /// the VT operand, a VTSDNode.
410     FP_ROUND_INREG,
411
412     /// X = FP_EXTEND(Y) - Extend a smaller FP type into a larger FP type.
413     FP_EXTEND,
414
415     // BIT_CONVERT - Theis operator converts between integer and FP values, as
416     // if one was stored to memory as integer and the other was loaded from the
417     // same address (or equivalently for vector format conversions, etc).  The 
418     // source and result are required to have the same bit size (e.g. 
419     // f32 <-> i32).  This can also be used for int-to-int or fp-to-fp 
420     // conversions, but that is a noop, deleted by getNode().
421     BIT_CONVERT,
422     
423     // FNEG, FABS, FSQRT, FSIN, FCOS, FPOWI, FPOW - Perform unary floating point
424     // negation, absolute value, square root, sine and cosine, powi, and pow
425     // operations.
426     FNEG, FABS, FSQRT, FSIN, FCOS, FPOWI, FPOW,
427     
428     // LOAD and STORE have token chains as their first operand, then the same
429     // operands as an LLVM load/store instruction, then an offset node that
430     // is added / subtracted from the base pointer to form the address (for
431     // indexed memory ops).
432     LOAD, STORE,
433
434     // DYNAMIC_STACKALLOC - Allocate some number of bytes on the stack aligned
435     // to a specified boundary.  This node always has two return values: a new
436     // stack pointer value and a chain. The first operand is the token chain,
437     // the second is the number of bytes to allocate, and the third is the
438     // alignment boundary.  The size is guaranteed to be a multiple of the stack
439     // alignment, and the alignment is guaranteed to be bigger than the stack
440     // alignment (if required) or 0 to get standard stack alignment.
441     DYNAMIC_STACKALLOC,
442
443     // Control flow instructions.  These all have token chains.
444
445     // BR - Unconditional branch.  The first operand is the chain
446     // operand, the second is the MBB to branch to.
447     BR,
448
449     // BRIND - Indirect branch.  The first operand is the chain, the second
450     // is the value to branch to, which must be of the same type as the target's
451     // pointer type.
452     BRIND,
453
454     // BR_JT - Jumptable branch. The first operand is the chain, the second
455     // is the jumptable index, the last one is the jumptable entry index.
456     BR_JT,
457     
458     // BRCOND - Conditional branch.  The first operand is the chain,
459     // the second is the condition, the third is the block to branch
460     // to if the condition is true.
461     BRCOND,
462
463     // BR_CC - Conditional branch.  The behavior is like that of SELECT_CC, in
464     // that the condition is represented as condition code, and two nodes to
465     // compare, rather than as a combined SetCC node.  The operands in order are
466     // chain, cc, lhs, rhs, block to branch to if condition is true.
467     BR_CC,
468     
469     // RET - Return from function.  The first operand is the chain,
470     // and any subsequent operands are pairs of return value and return value
471     // signness for the function.  This operation can have variable number of
472     // operands.
473     RET,
474
475     // INLINEASM - Represents an inline asm block.  This node always has two
476     // return values: a chain and a flag result.  The inputs are as follows:
477     //   Operand #0   : Input chain.
478     //   Operand #1   : a ExternalSymbolSDNode with a pointer to the asm string.
479     //   Operand #2n+2: A RegisterNode.
480     //   Operand #2n+3: A TargetConstant, indicating if the reg is a use/def
481     //   Operand #last: Optional, an incoming flag.
482     INLINEASM,
483     
484     // LABEL - Represents a label in mid basic block used to track
485     // locations needed for debug and exception handling tables.  This node
486     // returns a chain.
487     //   Operand #0 : input chain.
488     //   Operand #1 : module unique number use to identify the label.
489     //   Operand #2 : 0 indicates a debug label (e.g. stoppoint), 1 indicates
490     //                a EH label, 2 indicates unknown label type.
491     LABEL,
492
493     // DECLARE - Represents a llvm.dbg.declare intrinsic. It's used to track
494     // local variable declarations for debugging information. First operand is
495     // a chain, while the next two operands are first two arguments (address
496     // and variable) of a llvm.dbg.declare instruction.
497     DECLARE,
498     
499     // STACKSAVE - STACKSAVE has one operand, an input chain.  It produces a
500     // value, the same type as the pointer type for the system, and an output
501     // chain.
502     STACKSAVE,
503     
504     // STACKRESTORE has two operands, an input chain and a pointer to restore to
505     // it returns an output chain.
506     STACKRESTORE,
507     
508     // CALLSEQ_START/CALLSEQ_END - These operators mark the beginning and end of
509     // a call sequence, and carry arbitrary information that target might want
510     // to know.  The first operand is a chain, the rest are specified by the
511     // target and not touched by the DAG optimizers.
512     // CALLSEQ_START..CALLSEQ_END pairs may not be nested.
513     CALLSEQ_START,  // Beginning of a call sequence
514     CALLSEQ_END,    // End of a call sequence
515     
516     // VAARG - VAARG has three operands: an input chain, a pointer, and a 
517     // SRCVALUE.  It returns a pair of values: the vaarg value and a new chain.
518     VAARG,
519     
520     // VACOPY - VACOPY has five operands: an input chain, a destination pointer,
521     // a source pointer, a SRCVALUE for the destination, and a SRCVALUE for the
522     // source.
523     VACOPY,
524     
525     // VAEND, VASTART - VAEND and VASTART have three operands: an input chain, a
526     // pointer, and a SRCVALUE.
527     VAEND, VASTART,
528
529     // SRCVALUE - This is a node type that holds a Value* that is used to
530     // make reference to a value in the LLVM IR.
531     SRCVALUE,
532
533     // MEMOPERAND - This is a node that contains a MachineMemOperand which
534     // records information about a memory reference. This is used to make
535     // AliasAnalysis queries from the backend.
536     MEMOPERAND,
537
538     // PCMARKER - This corresponds to the pcmarker intrinsic.
539     PCMARKER,
540
541     // READCYCLECOUNTER - This corresponds to the readcyclecounter intrinsic.
542     // The only operand is a chain and a value and a chain are produced.  The
543     // value is the contents of the architecture specific cycle counter like 
544     // register (or other high accuracy low latency clock source)
545     READCYCLECOUNTER,
546
547     // HANDLENODE node - Used as a handle for various purposes.
548     HANDLENODE,
549
550     // LOCATION - This node is used to represent a source location for debug
551     // info.  It takes token chain as input, then a line number, then a column
552     // number, then a filename, then a working dir.  It produces a token chain
553     // as output.
554     LOCATION,
555     
556     // DEBUG_LOC - This node is used to represent source line information
557     // embedded in the code.  It takes a token chain as input, then a line
558     // number, then a column then a file id (provided by MachineModuleInfo.) It
559     // produces a token chain as output.
560     DEBUG_LOC,
561
562     // TRAMPOLINE - This corresponds to the init_trampoline intrinsic.
563     // It takes as input a token chain, the pointer to the trampoline,
564     // the pointer to the nested function, the pointer to pass for the
565     // 'nest' parameter, a SRCVALUE for the trampoline and another for
566     // the nested function (allowing targets to access the original
567     // Function*).  It produces the result of the intrinsic and a token
568     // chain as output.
569     TRAMPOLINE,
570
571     // TRAP - Trapping instruction
572     TRAP,
573
574     // PREFETCH - This corresponds to a prefetch intrinsic. It takes chains are
575     // their first operand. The other operands are the address to prefetch,
576     // read / write specifier, and locality specifier.
577     PREFETCH,
578
579     // OUTCHAIN = MEMBARRIER(INCHAIN, load-load, load-store, store-load, 
580     //                       store-store, device)
581     // This corresponds to the memory.barrier intrinsic.
582     // it takes an input chain, 4 operands to specify the type of barrier, an
583     // operand specifying if the barrier applies to device and uncached memory
584     // and produces an output chain.
585     MEMBARRIER,
586
587     // Val, OUTCHAIN = ATOMIC_CMP_SWAP(INCHAIN, ptr, cmp, swap)
588     // this corresponds to the atomic.lcs intrinsic.
589     // cmp is compared to *ptr, and if equal, swap is stored in *ptr.
590     // the return is always the original value in *ptr
591     ATOMIC_CMP_SWAP,
592
593     // Val, OUTCHAIN = ATOMIC_LOAD_ADD(INCHAIN, ptr, amt)
594     // this corresponds to the atomic.las intrinsic.
595     // *ptr + amt is stored to *ptr atomically.
596     // the return is always the original value in *ptr
597     ATOMIC_LOAD_ADD,
598
599     // Val, OUTCHAIN = ATOMIC_SWAP(INCHAIN, ptr, amt)
600     // this corresponds to the atomic.swap intrinsic.
601     // amt is stored to *ptr atomically.
602     // the return is always the original value in *ptr
603     ATOMIC_SWAP,
604
605     // Val, OUTCHAIN = ATOMIC_LOAD_SUB(INCHAIN, ptr, amt)
606     // this corresponds to the atomic.lss intrinsic.
607     // *ptr - amt is stored to *ptr atomically.
608     // the return is always the original value in *ptr
609     ATOMIC_LOAD_SUB,
610     
611     // Val, OUTCHAIN = ATOMIC_L[OpName]S(INCHAIN, ptr, amt)
612     // this corresponds to the atomic.[OpName] intrinsic.
613     // op(*ptr, amt) is stored to *ptr atomically.
614     // the return is always the original value in *ptr
615     ATOMIC_LOAD_AND,
616     ATOMIC_LOAD_OR,
617     ATOMIC_LOAD_XOR,
618     ATOMIC_LOAD_NAND,
619     ATOMIC_LOAD_MIN,
620     ATOMIC_LOAD_MAX,
621     ATOMIC_LOAD_UMIN,
622     ATOMIC_LOAD_UMAX,
623     
624     // BUILTIN_OP_END - This must be the last enum value in this list.
625     BUILTIN_OP_END
626   };
627
628   /// Node predicates
629
630   /// isBuildVectorAllOnes - Return true if the specified node is a
631   /// BUILD_VECTOR where all of the elements are ~0 or undef.
632   bool isBuildVectorAllOnes(const SDNode *N);
633
634   /// isBuildVectorAllZeros - Return true if the specified node is a
635   /// BUILD_VECTOR where all of the elements are 0 or undef.
636   bool isBuildVectorAllZeros(const SDNode *N);
637
638   /// isScalarToVector - Return true if the specified node is a
639   /// ISD::SCALAR_TO_VECTOR node or a BUILD_VECTOR node where only the low
640   /// element is not an undef.
641   bool isScalarToVector(const SDNode *N);
642
643   /// isDebugLabel - Return true if the specified node represents a debug
644   /// label (i.e. ISD::LABEL or TargetInstrInfo::LABEL node and third operand
645   /// is 0).
646   bool isDebugLabel(const SDNode *N);
647   
648   //===--------------------------------------------------------------------===//
649   /// MemIndexedMode enum - This enum defines the load / store indexed 
650   /// addressing modes.
651   ///
652   /// UNINDEXED    "Normal" load / store. The effective address is already
653   ///              computed and is available in the base pointer. The offset
654   ///              operand is always undefined. In addition to producing a
655   ///              chain, an unindexed load produces one value (result of the
656   ///              load); an unindexed store does not produce a value.
657   ///
658   /// PRE_INC      Similar to the unindexed mode where the effective address is
659   /// PRE_DEC      the value of the base pointer add / subtract the offset.
660   ///              It considers the computation as being folded into the load /
661   ///              store operation (i.e. the load / store does the address
662   ///              computation as well as performing the memory transaction).
663   ///              The base operand is always undefined. In addition to
664   ///              producing a chain, pre-indexed load produces two values
665   ///              (result of the load and the result of the address
666   ///              computation); a pre-indexed store produces one value (result
667   ///              of the address computation).
668   ///
669   /// POST_INC     The effective address is the value of the base pointer. The
670   /// POST_DEC     value of the offset operand is then added to / subtracted
671   ///              from the base after memory transaction. In addition to
672   ///              producing a chain, post-indexed load produces two values
673   ///              (the result of the load and the result of the base +/- offset
674   ///              computation); a post-indexed store produces one value (the
675   ///              the result of the base +/- offset computation).
676   ///
677   enum MemIndexedMode {
678     UNINDEXED = 0,
679     PRE_INC,
680     PRE_DEC,
681     POST_INC,
682     POST_DEC,
683     LAST_INDEXED_MODE
684   };
685
686   //===--------------------------------------------------------------------===//
687   /// LoadExtType enum - This enum defines the three variants of LOADEXT
688   /// (load with extension).
689   ///
690   /// SEXTLOAD loads the integer operand and sign extends it to a larger
691   ///          integer result type.
692   /// ZEXTLOAD loads the integer operand and zero extends it to a larger
693   ///          integer result type.
694   /// EXTLOAD  is used for three things: floating point extending loads, 
695   ///          integer extending loads [the top bits are undefined], and vector
696   ///          extending loads [load into low elt].
697   ///
698   enum LoadExtType {
699     NON_EXTLOAD = 0,
700     EXTLOAD,
701     SEXTLOAD,
702     ZEXTLOAD,
703     LAST_LOADX_TYPE
704   };
705
706   //===--------------------------------------------------------------------===//
707   /// ISD::CondCode enum - These are ordered carefully to make the bitfields
708   /// below work out, when considering SETFALSE (something that never exists
709   /// dynamically) as 0.  "U" -> Unsigned (for integer operands) or Unordered
710   /// (for floating point), "L" -> Less than, "G" -> Greater than, "E" -> Equal
711   /// to.  If the "N" column is 1, the result of the comparison is undefined if
712   /// the input is a NAN.
713   ///
714   /// All of these (except for the 'always folded ops') should be handled for
715   /// floating point.  For integer, only the SETEQ,SETNE,SETLT,SETLE,SETGT,
716   /// SETGE,SETULT,SETULE,SETUGT, and SETUGE opcodes are used.
717   ///
718   /// Note that these are laid out in a specific order to allow bit-twiddling
719   /// to transform conditions.
720   enum CondCode {
721     // Opcode          N U L G E       Intuitive operation
722     SETFALSE,      //    0 0 0 0       Always false (always folded)
723     SETOEQ,        //    0 0 0 1       True if ordered and equal
724     SETOGT,        //    0 0 1 0       True if ordered and greater than
725     SETOGE,        //    0 0 1 1       True if ordered and greater than or equal
726     SETOLT,        //    0 1 0 0       True if ordered and less than
727     SETOLE,        //    0 1 0 1       True if ordered and less than or equal
728     SETONE,        //    0 1 1 0       True if ordered and operands are unequal
729     SETO,          //    0 1 1 1       True if ordered (no nans)
730     SETUO,         //    1 0 0 0       True if unordered: isnan(X) | isnan(Y)
731     SETUEQ,        //    1 0 0 1       True if unordered or equal
732     SETUGT,        //    1 0 1 0       True if unordered or greater than
733     SETUGE,        //    1 0 1 1       True if unordered, greater than, or equal
734     SETULT,        //    1 1 0 0       True if unordered or less than
735     SETULE,        //    1 1 0 1       True if unordered, less than, or equal
736     SETUNE,        //    1 1 1 0       True if unordered or not equal
737     SETTRUE,       //    1 1 1 1       Always true (always folded)
738     // Don't care operations: undefined if the input is a nan.
739     SETFALSE2,     //  1 X 0 0 0       Always false (always folded)
740     SETEQ,         //  1 X 0 0 1       True if equal
741     SETGT,         //  1 X 0 1 0       True if greater than
742     SETGE,         //  1 X 0 1 1       True if greater than or equal
743     SETLT,         //  1 X 1 0 0       True if less than
744     SETLE,         //  1 X 1 0 1       True if less than or equal
745     SETNE,         //  1 X 1 1 0       True if not equal
746     SETTRUE2,      //  1 X 1 1 1       Always true (always folded)
747
748     SETCC_INVALID       // Marker value.
749   };
750
751   /// isSignedIntSetCC - Return true if this is a setcc instruction that
752   /// performs a signed comparison when used with integer operands.
753   inline bool isSignedIntSetCC(CondCode Code) {
754     return Code == SETGT || Code == SETGE || Code == SETLT || Code == SETLE;
755   }
756
757   /// isUnsignedIntSetCC - Return true if this is a setcc instruction that
758   /// performs an unsigned comparison when used with integer operands.
759   inline bool isUnsignedIntSetCC(CondCode Code) {
760     return Code == SETUGT || Code == SETUGE || Code == SETULT || Code == SETULE;
761   }
762
763   /// isTrueWhenEqual - Return true if the specified condition returns true if
764   /// the two operands to the condition are equal.  Note that if one of the two
765   /// operands is a NaN, this value is meaningless.
766   inline bool isTrueWhenEqual(CondCode Cond) {
767     return ((int)Cond & 1) != 0;
768   }
769
770   /// getUnorderedFlavor - This function returns 0 if the condition is always
771   /// false if an operand is a NaN, 1 if the condition is always true if the
772   /// operand is a NaN, and 2 if the condition is undefined if the operand is a
773   /// NaN.
774   inline unsigned getUnorderedFlavor(CondCode Cond) {
775     return ((int)Cond >> 3) & 3;
776   }
777
778   /// getSetCCInverse - Return the operation corresponding to !(X op Y), where
779   /// 'op' is a valid SetCC operation.
780   CondCode getSetCCInverse(CondCode Operation, bool isInteger);
781
782   /// getSetCCSwappedOperands - Return the operation corresponding to (Y op X)
783   /// when given the operation for (X op Y).
784   CondCode getSetCCSwappedOperands(CondCode Operation);
785
786   /// getSetCCOrOperation - Return the result of a logical OR between different
787   /// comparisons of identical values: ((X op1 Y) | (X op2 Y)).  This
788   /// function returns SETCC_INVALID if it is not possible to represent the
789   /// resultant comparison.
790   CondCode getSetCCOrOperation(CondCode Op1, CondCode Op2, bool isInteger);
791
792   /// getSetCCAndOperation - Return the result of a logical AND between
793   /// different comparisons of identical values: ((X op1 Y) & (X op2 Y)).  This
794   /// function returns SETCC_INVALID if it is not possible to represent the
795   /// resultant comparison.
796   CondCode getSetCCAndOperation(CondCode Op1, CondCode Op2, bool isInteger);
797 }  // end llvm::ISD namespace
798
799
800 //===----------------------------------------------------------------------===//
801 /// SDOperand - Unlike LLVM values, Selection DAG nodes may return multiple
802 /// values as the result of a computation.  Many nodes return multiple values,
803 /// from loads (which define a token and a return value) to ADDC (which returns
804 /// a result and a carry value), to calls (which may return an arbitrary number
805 /// of values).
806 ///
807 /// As such, each use of a SelectionDAG computation must indicate the node that
808 /// computes it as well as which return value to use from that node.  This pair
809 /// of information is represented with the SDOperand value type.
810 ///
811 class SDOperand {
812 public:
813   SDNode *Val;        // The node defining the value we are using.
814   unsigned ResNo;     // Which return value of the node we are using.
815
816   SDOperand() : Val(0), ResNo(0) {}
817   SDOperand(SDNode *val, unsigned resno) : Val(val), ResNo(resno) {}
818
819   bool operator==(const SDOperand &O) const {
820     return Val == O.Val && ResNo == O.ResNo;
821   }
822   bool operator!=(const SDOperand &O) const {
823     return !operator==(O);
824   }
825   bool operator<(const SDOperand &O) const {
826     return Val < O.Val || (Val == O.Val && ResNo < O.ResNo);
827   }
828
829   SDOperand getValue(unsigned R) const {
830     return SDOperand(Val, R);
831   }
832
833   // isOperandOf - Return true if this node is an operand of N.
834   bool isOperandOf(SDNode *N) const;
835
836   /// getValueType - Return the ValueType of the referenced return value.
837   ///
838   inline MVT getValueType() const;
839
840   /// getValueSizeInBits - Returns the size of the value in bits.
841   ///
842   unsigned getValueSizeInBits() const {
843     return getValueType().getSizeInBits();
844   }
845
846   // Forwarding methods - These forward to the corresponding methods in SDNode.
847   inline unsigned getOpcode() const;
848   inline unsigned getNumOperands() const;
849   inline const SDOperand &getOperand(unsigned i) const;
850   inline uint64_t getConstantOperandVal(unsigned i) const;
851   inline bool isTargetOpcode() const;
852   inline unsigned getTargetOpcode() const;
853
854   
855   /// reachesChainWithoutSideEffects - Return true if this operand (which must
856   /// be a chain) reaches the specified operand without crossing any 
857   /// side-effecting instructions.  In practice, this looks through token
858   /// factors and non-volatile loads.  In order to remain efficient, this only
859   /// looks a couple of nodes in, it does not do an exhaustive search.
860   bool reachesChainWithoutSideEffects(SDOperand Dest, 
861                                       unsigned Depth = 2) const;
862   
863   /// hasOneUse - Return true if there is exactly one operation using this
864   /// result value of the defining operator.
865   inline bool hasOneUse() const;
866
867   /// use_empty - Return true if there are no operations using this
868   /// result value of the defining operator.
869   inline bool use_empty() const;
870 };
871
872
873 template<> struct DenseMapInfo<SDOperand> {
874   static inline SDOperand getEmptyKey() { 
875     return SDOperand((SDNode*)-1, -1U); 
876   }
877   static inline SDOperand getTombstoneKey() { 
878     return SDOperand((SDNode*)-1, 0);
879   }
880   static unsigned getHashValue(const SDOperand &Val) {
881     return ((unsigned)((uintptr_t)Val.Val >> 4) ^
882             (unsigned)((uintptr_t)Val.Val >> 9)) + Val.ResNo;
883   }
884   static bool isEqual(const SDOperand &LHS, const SDOperand &RHS) {
885     return LHS == RHS;
886   }
887   static bool isPod() { return true; }
888 };
889
890 /// simplify_type specializations - Allow casting operators to work directly on
891 /// SDOperands as if they were SDNode*'s.
892 template<> struct simplify_type<SDOperand> {
893   typedef SDNode* SimpleType;
894   static SimpleType getSimplifiedValue(const SDOperand &Val) {
895     return static_cast<SimpleType>(Val.Val);
896   }
897 };
898 template<> struct simplify_type<const SDOperand> {
899   typedef SDNode* SimpleType;
900   static SimpleType getSimplifiedValue(const SDOperand &Val) {
901     return static_cast<SimpleType>(Val.Val);
902   }
903 };
904
905 /// SDUse - Represents a use of the SDNode referred by
906 /// the SDOperand.
907 class SDUse {
908   SDOperand Operand;
909   /// User - Parent node of this operand.
910   SDNode    *User;
911   /// Prev, next - Pointers to the uses list of the SDNode referred by 
912   /// this operand.
913   SDUse **Prev, *Next;
914 public:
915   friend class SDNode;
916   SDUse(): Operand(), User(NULL), Prev(NULL), Next(NULL) {}
917
918   SDUse(SDNode *val, unsigned resno) : 
919     Operand(val,resno), User(NULL), Prev(NULL), Next(NULL) {}
920
921   SDUse& operator= (const SDOperand& Op) {
922       Operand = Op;
923       Next = NULL;
924       Prev = NULL;
925       return *this;
926   }
927
928   SDUse& operator= (const SDUse& Op) {
929       Operand = Op;
930       Next = NULL;
931       Prev = NULL;
932       return *this;
933   }
934
935   SDUse * getNext() { return Next; }
936
937   SDNode *getUser() { return User; }
938
939   void setUser(SDNode *p) { User = p; }
940
941   operator SDOperand() const { return Operand; }
942
943   const SDOperand& getSDOperand() const { return Operand; }
944
945   SDNode* &getVal () { return Operand.Val; }
946
947   bool operator==(const SDOperand &O) const {
948     return Operand == O;
949   }
950
951   bool operator!=(const SDOperand &O) const {
952     return !(Operand == O);
953   }
954
955   bool operator<(const SDOperand &O) const {
956     return Operand < O;
957   }
958
959 protected:
960   void addToList(SDUse **List) {
961     Next = *List;
962     if (Next) Next->Prev = &Next;
963     Prev = List;
964     *List = this;
965   }
966
967   void removeFromList() {
968     *Prev = Next;
969     if (Next) Next->Prev = Prev;
970   }
971 };
972
973
974 /// simplify_type specializations - Allow casting operators to work directly on
975 /// SDOperands as if they were SDNode*'s.
976 template<> struct simplify_type<SDUse> {
977   typedef SDNode* SimpleType;
978   static SimpleType getSimplifiedValue(const SDUse &Val) {
979     return static_cast<SimpleType>(Val.getSDOperand().Val);
980   }
981 };
982 template<> struct simplify_type<const SDUse> {
983   typedef SDNode* SimpleType;
984   static SimpleType getSimplifiedValue(const SDUse &Val) {
985     return static_cast<SimpleType>(Val.getSDOperand().Val);
986   }
987 };
988
989
990 /// SDOperandPtr - A helper SDOperand pointer class, that can handle
991 /// arrays of SDUse and arrays of SDOperand objects. This is required
992 /// in many places inside the SelectionDAG.
993 /// 
994 class SDOperandPtr {
995   const SDOperand *ptr; // The pointer to the SDOperand object
996   int object_size;      // The size of the object containg the SDOperand
997 public:
998   SDOperandPtr() : ptr(0), object_size(0) {}
999
1000   SDOperandPtr(SDUse * use_ptr) { 
1001     ptr = &use_ptr->getSDOperand(); 
1002     object_size = (int)sizeof(SDUse); 
1003   }
1004
1005   SDOperandPtr(const SDOperand * op_ptr) { 
1006     ptr = op_ptr; 
1007     object_size = (int)sizeof(SDOperand); 
1008   }
1009
1010   const SDOperand operator *() { return *ptr; }
1011   const SDOperand *operator ->() { return ptr; }
1012   SDOperandPtr operator ++ () { 
1013     ptr = (SDOperand*)((char *)ptr + object_size); 
1014     return *this; 
1015   }
1016
1017   SDOperandPtr operator ++ (int) { 
1018     SDOperandPtr tmp = *this;
1019     ptr = (SDOperand*)((char *)ptr + object_size); 
1020     return tmp; 
1021   }
1022
1023   SDOperand operator[] (int idx) const {
1024     return *(SDOperand*)((char*) ptr + object_size * idx);
1025   } 
1026 };
1027
1028 /// SDNode - Represents one node in the SelectionDAG.
1029 ///
1030 class SDNode : public FoldingSetNode {
1031 private:
1032   /// NodeType - The operation that this node performs.
1033   ///
1034   unsigned short NodeType;
1035   
1036   /// OperandsNeedDelete - This is true if OperandList was new[]'d.  If true,
1037   /// then they will be delete[]'d when the node is destroyed.
1038   bool OperandsNeedDelete : 1;
1039
1040   /// NodeId - Unique id per SDNode in the DAG.
1041   int NodeId;
1042
1043   /// OperandList - The values that are used by this operation.
1044   ///
1045   SDUse *OperandList;
1046   
1047   /// ValueList - The types of the values this node defines.  SDNode's may
1048   /// define multiple values simultaneously.
1049   const MVT *ValueList;
1050
1051   /// NumOperands/NumValues - The number of entries in the Operand/Value list.
1052   unsigned short NumOperands, NumValues;
1053   
1054   /// UsesSize - The size of the uses list.
1055   unsigned UsesSize;
1056
1057   /// Uses - List of uses for this SDNode.
1058   SDUse *Uses;
1059
1060   /// Prev/Next pointers - These pointers form the linked list of of the
1061   /// AllNodes list in the current DAG.
1062   SDNode *Prev, *Next;
1063   friend struct ilist_traits<SDNode>;
1064
1065   /// addUse - add SDUse to the list of uses.
1066   void addUse(SDUse &U) { U.addToList(&Uses); }
1067
1068   // Out-of-line virtual method to give class a home.
1069   virtual void ANCHOR();
1070 public:
1071   virtual ~SDNode() {
1072     assert(NumOperands == 0 && "Operand list not cleared before deletion");
1073     NodeType = ISD::DELETED_NODE;
1074   }
1075   
1076   //===--------------------------------------------------------------------===//
1077   //  Accessors
1078   //
1079   unsigned getOpcode()  const { return NodeType; }
1080   bool isTargetOpcode() const { return NodeType >= ISD::BUILTIN_OP_END; }
1081   unsigned getTargetOpcode() const {
1082     assert(isTargetOpcode() && "Not a target opcode!");
1083     return NodeType - ISD::BUILTIN_OP_END;
1084   }
1085
1086   size_t use_size() const { return UsesSize; }
1087   bool use_empty() const { return Uses == NULL; }
1088   bool hasOneUse() const { return use_size() == 1; }
1089
1090   /// getNodeId - Return the unique node id.
1091   ///
1092   int getNodeId() const { return NodeId; }
1093
1094   /// setNodeId - Set unique node id.
1095   void setNodeId(int Id) { NodeId = Id; }
1096
1097   /// use_iterator - This class provides iterator support for SDUse
1098   /// operands that use a specific SDNode. 
1099   class use_iterator
1100     : public forward_iterator<SDUse, ptrdiff_t> {
1101     SDUse *Op;
1102     explicit use_iterator(SDUse *op) : Op(op) {
1103     }
1104     friend class SDNode;
1105   public:
1106     typedef forward_iterator<SDUse, ptrdiff_t>::reference reference;
1107     typedef forward_iterator<SDUse, ptrdiff_t>::pointer pointer;
1108
1109     use_iterator(const use_iterator &I) : Op(I.Op) {}
1110     use_iterator() : Op(0) {}
1111
1112     bool operator==(const use_iterator &x) const {
1113       return Op == x.Op;
1114     }
1115     bool operator!=(const use_iterator &x) const {
1116       return !operator==(x);
1117     }
1118  
1119     /// atEnd - return true if this iterator is at the end of uses list.
1120     bool atEnd() const { return Op == 0; }
1121
1122     // Iterator traversal: forward iteration only.
1123     use_iterator &operator++() {          // Preincrement
1124       assert(Op && "Cannot increment end iterator!");
1125       Op = Op->getNext();
1126       return *this;
1127     }
1128
1129     use_iterator operator++(int) {        // Postincrement
1130       use_iterator tmp = *this; ++*this; return tmp;
1131     }
1132
1133
1134     /// getOperandNum - Retrive a number of a current operand.
1135     unsigned getOperandNum() const {
1136       assert(Op && "Cannot dereference end iterator!");
1137       return (unsigned)(Op - Op->getUser()->OperandList);
1138     }
1139
1140     /// Retrieve a reference to the current operand.
1141     SDUse &operator*() const {
1142       assert(Op && "Cannot dereference end iterator!");
1143       return *Op;
1144     }
1145
1146     /// Retrieve a pointer to the current operand.
1147     SDUse *operator->() const {
1148       assert(Op && "Cannot dereference end iterator!");
1149       return Op;
1150     }
1151   };
1152
1153   /// use_begin/use_end - Provide iteration support to walk over all uses
1154   /// of an SDNode.
1155
1156   use_iterator use_begin(SDNode *node) const {
1157     return use_iterator(node->Uses);
1158   }
1159
1160   use_iterator use_begin() const {
1161     return use_iterator(Uses);
1162   }
1163
1164   static use_iterator use_end() { return use_iterator(0); }
1165
1166
1167   /// hasNUsesOfValue - Return true if there are exactly NUSES uses of the
1168   /// indicated value.  This method ignores uses of other values defined by this
1169   /// operation.
1170   bool hasNUsesOfValue(unsigned NUses, unsigned Value) const;
1171
1172   /// hasAnyUseOfValue - Return true if there are any use of the indicated
1173   /// value. This method ignores uses of other values defined by this operation.
1174   bool hasAnyUseOfValue(unsigned Value) const;
1175
1176   /// isOnlyUseOf - Return true if this node is the only use of N.
1177   ///
1178   bool isOnlyUseOf(SDNode *N) const;
1179
1180   /// isOperandOf - Return true if this node is an operand of N.
1181   ///
1182   bool isOperandOf(SDNode *N) const;
1183
1184   /// isPredecessorOf - Return true if this node is a predecessor of N. This
1185   /// node is either an operand of N or it can be reached by recursively
1186   /// traversing up the operands.
1187   /// NOTE: this is an expensive method. Use it carefully.
1188   bool isPredecessorOf(SDNode *N) const;
1189
1190   /// getNumOperands - Return the number of values used by this operation.
1191   ///
1192   unsigned getNumOperands() const { return NumOperands; }
1193
1194   /// getConstantOperandVal - Helper method returns the integer value of a 
1195   /// ConstantSDNode operand.
1196   uint64_t getConstantOperandVal(unsigned Num) const;
1197
1198   const SDOperand &getOperand(unsigned Num) const {
1199     assert(Num < NumOperands && "Invalid child # of SDNode!");
1200     return OperandList[Num].getSDOperand();
1201   }
1202
1203   typedef SDUse* op_iterator;
1204   op_iterator op_begin() const { return OperandList; }
1205   op_iterator op_end() const { return OperandList+NumOperands; }
1206
1207
1208   SDVTList getVTList() const {
1209     SDVTList X = { ValueList, NumValues };
1210     return X;
1211   };
1212   
1213   /// getNumValues - Return the number of values defined/returned by this
1214   /// operator.
1215   ///
1216   unsigned getNumValues() const { return NumValues; }
1217
1218   /// getValueType - Return the type of a specified result.
1219   ///
1220   MVT getValueType(unsigned ResNo) const {
1221     assert(ResNo < NumValues && "Illegal result number!");
1222     return ValueList[ResNo];
1223   }
1224
1225   /// getValueSizeInBits - Returns MVT::getSizeInBits(getValueType(ResNo)).
1226   ///
1227   unsigned getValueSizeInBits(unsigned ResNo) const {
1228     return getValueType(ResNo).getSizeInBits();
1229   }
1230
1231   typedef const MVT* value_iterator;
1232   value_iterator value_begin() const { return ValueList; }
1233   value_iterator value_end() const { return ValueList+NumValues; }
1234
1235   /// getOperationName - Return the opcode of this operation for printing.
1236   ///
1237   std::string getOperationName(const SelectionDAG *G = 0) const;
1238   static const char* getIndexedModeName(ISD::MemIndexedMode AM);
1239   void dump() const;
1240   void dump(const SelectionDAG *G) const;
1241
1242   static bool classof(const SDNode *) { return true; }
1243
1244   /// Profile - Gather unique data for the node.
1245   ///
1246   void Profile(FoldingSetNodeID &ID);
1247
1248 protected:
1249   friend class SelectionDAG;
1250   
1251   /// getValueTypeList - Return a pointer to the specified value type.
1252   ///
1253   static const MVT *getValueTypeList(MVT VT);
1254   static SDVTList getSDVTList(MVT VT) {
1255     SDVTList Ret = { getValueTypeList(VT), 1 };
1256     return Ret;
1257   }
1258
1259   SDNode(unsigned Opc, SDVTList VTs, const SDOperand *Ops, unsigned NumOps)
1260     : NodeType(Opc), NodeId(-1), UsesSize(0), Uses(NULL) {
1261     OperandsNeedDelete = true;
1262     NumOperands = NumOps;
1263     OperandList = NumOps ? new SDUse[NumOperands] : 0;
1264     
1265     for (unsigned i = 0; i != NumOps; ++i) {
1266       OperandList[i] = Ops[i];
1267       OperandList[i].setUser(this);
1268       Ops[i].Val->addUse(OperandList[i]);
1269       ++Ops[i].Val->UsesSize;
1270     }
1271     
1272     ValueList = VTs.VTs;
1273     NumValues = VTs.NumVTs;
1274     Prev = 0; Next = 0;
1275   }
1276
1277   SDNode(unsigned Opc, SDVTList VTs, SDOperandPtr Ops, unsigned NumOps)
1278     : NodeType(Opc), NodeId(-1), UsesSize(0), Uses(NULL) {
1279     OperandsNeedDelete = true;
1280     NumOperands = NumOps;
1281     OperandList = NumOps ? new SDUse[NumOperands] : 0;
1282     
1283     for (unsigned i = 0; i != NumOps; ++i) {
1284       OperandList[i] = Ops[i];
1285       OperandList[i].setUser(this);
1286       Ops[i].Val->addUse(OperandList[i]);
1287       ++Ops[i].Val->UsesSize;
1288     }
1289     
1290     ValueList = VTs.VTs;
1291     NumValues = VTs.NumVTs;
1292     Prev = 0; Next = 0;
1293   }
1294
1295   SDNode(unsigned Opc, SDVTList VTs)
1296     : NodeType(Opc), NodeId(-1), UsesSize(0), Uses(NULL) {
1297     OperandsNeedDelete = false;  // Operands set with InitOperands.
1298     NumOperands = 0;
1299     OperandList = 0;
1300     ValueList = VTs.VTs;
1301     NumValues = VTs.NumVTs;
1302     Prev = 0; Next = 0;
1303   }
1304   
1305   /// InitOperands - Initialize the operands list of this node with the
1306   /// specified values, which are part of the node (thus they don't need to be
1307   /// copied in or allocated).
1308   void InitOperands(SDUse *Ops, unsigned NumOps) {
1309     assert(OperandList == 0 && "Operands already set!");
1310     NumOperands = NumOps;
1311     OperandList = Ops;
1312     UsesSize = 0;
1313     Uses = NULL;
1314     
1315     for (unsigned i = 0; i != NumOps; ++i) {
1316       OperandList[i].setUser(this);
1317       Ops[i].getVal()->addUse(OperandList[i]);
1318       ++Ops[i].getVal()->UsesSize;
1319     }
1320   }
1321   
1322   /// MorphNodeTo - This frees the operands of the current node, resets the
1323   /// opcode, types, and operands to the specified value.  This should only be
1324   /// used by the SelectionDAG class.
1325   void MorphNodeTo(unsigned Opc, SDVTList L,
1326                    SDOperandPtr Ops, unsigned NumOps);
1327   
1328   void addUser(unsigned i, SDNode *User) {
1329     assert(User->OperandList[i].getUser() && "Node without parent");
1330     addUse(User->OperandList[i]);
1331     ++UsesSize;
1332   }
1333
1334   void removeUser(unsigned i, SDNode *User) {
1335     assert(User->OperandList[i].getUser() && "Node without parent");
1336     SDUse &Op = User->OperandList[i];
1337     Op.removeFromList();
1338     --UsesSize;
1339   }
1340 };
1341
1342
1343 // Define inline functions from the SDOperand class.
1344
1345 inline unsigned SDOperand::getOpcode() const {
1346   return Val->getOpcode();
1347 }
1348 inline MVT SDOperand::getValueType() const {
1349   return Val->getValueType(ResNo);
1350 }
1351 inline unsigned SDOperand::getNumOperands() const {
1352   return Val->getNumOperands();
1353 }
1354 inline const SDOperand &SDOperand::getOperand(unsigned i) const {
1355   return Val->getOperand(i);
1356 }
1357 inline uint64_t SDOperand::getConstantOperandVal(unsigned i) const {
1358   return Val->getConstantOperandVal(i);
1359 }
1360 inline bool SDOperand::isTargetOpcode() const {
1361   return Val->isTargetOpcode();
1362 }
1363 inline unsigned SDOperand::getTargetOpcode() const {
1364   return Val->getTargetOpcode();
1365 }
1366 inline bool SDOperand::hasOneUse() const {
1367   return Val->hasNUsesOfValue(1, ResNo);
1368 }
1369 inline bool SDOperand::use_empty() const {
1370   return !Val->hasAnyUseOfValue(ResNo);
1371 }
1372
1373 /// UnarySDNode - This class is used for single-operand SDNodes.  This is solely
1374 /// to allow co-allocation of node operands with the node itself.
1375 class UnarySDNode : public SDNode {
1376   virtual void ANCHOR();  // Out-of-line virtual method to give class a home.
1377   SDUse Op;
1378 public:
1379   UnarySDNode(unsigned Opc, SDVTList VTs, SDOperand X)
1380     : SDNode(Opc, VTs) {
1381     Op = X;
1382     InitOperands(&Op, 1);
1383   }
1384 };
1385
1386 /// BinarySDNode - This class is used for two-operand SDNodes.  This is solely
1387 /// to allow co-allocation of node operands with the node itself.
1388 class BinarySDNode : public SDNode {
1389   virtual void ANCHOR();  // Out-of-line virtual method to give class a home.
1390   SDUse Ops[2];
1391 public:
1392   BinarySDNode(unsigned Opc, SDVTList VTs, SDOperand X, SDOperand Y)
1393     : SDNode(Opc, VTs) {
1394     Ops[0] = X;
1395     Ops[1] = Y;
1396     InitOperands(Ops, 2);
1397   }
1398 };
1399
1400 /// TernarySDNode - This class is used for three-operand SDNodes. This is solely
1401 /// to allow co-allocation of node operands with the node itself.
1402 class TernarySDNode : public SDNode {
1403   virtual void ANCHOR();  // Out-of-line virtual method to give class a home.
1404   SDUse Ops[3];
1405 public:
1406   TernarySDNode(unsigned Opc, SDVTList VTs, SDOperand X, SDOperand Y,
1407                 SDOperand Z)
1408     : SDNode(Opc, VTs) {
1409     Ops[0] = X;
1410     Ops[1] = Y;
1411     Ops[2] = Z;
1412     InitOperands(Ops, 3);
1413   }
1414 };
1415
1416
1417 /// HandleSDNode - This class is used to form a handle around another node that
1418 /// is persistant and is updated across invocations of replaceAllUsesWith on its
1419 /// operand.  This node should be directly created by end-users and not added to
1420 /// the AllNodes list.
1421 class HandleSDNode : public SDNode {
1422   virtual void ANCHOR();  // Out-of-line virtual method to give class a home.
1423   SDUse Op;
1424 public:
1425   // FIXME: Remove the "noinline" attribute once <rdar://problem/5852746> is
1426   // fixed.
1427 #ifdef __GNUC__
1428   explicit __attribute__((__noinline__)) HandleSDNode(SDOperand X)
1429 #else
1430   explicit HandleSDNode(SDOperand X)
1431 #endif
1432     : SDNode(ISD::HANDLENODE, getSDVTList(MVT::Other)) {
1433     Op = X;
1434     InitOperands(&Op, 1);
1435   }
1436   ~HandleSDNode();  
1437   SDUse getValue() const { return Op; }
1438 };
1439
1440 /// Abstact virtual class for operations for memory operations
1441 class MemSDNode : public SDNode {
1442   virtual void ANCHOR();  // Out-of-line virtual method to give class a home.
1443
1444 private:
1445   //! SrcValue - Memory location for alias analysis.
1446   const Value *SrcValue;
1447
1448   //! Alignment - Alignment of memory location in bytes.
1449   unsigned Alignment;
1450
1451 public:
1452   MemSDNode(unsigned Opc, SDVTList VTs, const Value *srcValue,
1453             unsigned alignment)
1454     : SDNode(Opc, VTs), SrcValue(srcValue), Alignment(alignment) {}
1455   
1456   virtual ~MemSDNode() {}
1457
1458   /// Returns alignment and volatility of the memory access
1459   unsigned getAlignment() const { return Alignment; }
1460   virtual bool isVolatile() const = 0;
1461   
1462   /// Returns the SrcValue and offset that describes the location of the access
1463   const Value *getSrcValue() const { return SrcValue; }
1464   virtual int getSrcValueOffset() const = 0;
1465   
1466   /// getMemOperand - Return a MachineMemOperand object describing the memory
1467   /// reference performed by operation.
1468   virtual MachineMemOperand getMemOperand() const = 0;
1469
1470   // Methods to support isa and dyn_cast
1471   static bool classof(const MemSDNode *) { return true; }
1472   static bool classof(const SDNode *N) {
1473     return N->getOpcode() == ISD::LOAD  ||
1474            N->getOpcode() == ISD::STORE ||
1475            N->getOpcode() == ISD::ATOMIC_CMP_SWAP  ||
1476            N->getOpcode() == ISD::ATOMIC_LOAD_ADD  ||
1477            N->getOpcode() == ISD::ATOMIC_SWAP      ||
1478            N->getOpcode() == ISD::ATOMIC_LOAD_SUB  ||
1479            N->getOpcode() == ISD::ATOMIC_LOAD_AND  ||
1480            N->getOpcode() == ISD::ATOMIC_LOAD_OR   ||
1481            N->getOpcode() == ISD::ATOMIC_LOAD_XOR  ||
1482            N->getOpcode() == ISD::ATOMIC_LOAD_NAND ||
1483            N->getOpcode() == ISD::ATOMIC_LOAD_MIN  ||
1484            N->getOpcode() == ISD::ATOMIC_LOAD_MAX  ||
1485            N->getOpcode() == ISD::ATOMIC_LOAD_UMIN ||
1486            N->getOpcode() == ISD::ATOMIC_LOAD_UMAX;
1487   }  
1488 };
1489
1490 /// Atomic operations node
1491 class AtomicSDNode : public MemSDNode {
1492   virtual void ANCHOR();  // Out-of-line virtual method to give class a home.
1493   SDUse Ops[4];
1494   
1495  public:
1496   // Opc:   opcode for atomic
1497   // VTL:    value type list
1498   // Chain:  memory chain for operaand
1499   // Ptr:    address to update as a SDOperand
1500   // Cmp:    compare value
1501   // Swp:    swap value
1502   // SrcVal: address to update as a Value (used for MemOperand)
1503   // Align:  alignment of memory
1504   AtomicSDNode(unsigned Opc, SDVTList VTL, SDOperand Chain, SDOperand Ptr, 
1505                SDOperand Cmp, SDOperand Swp, const Value* SrcVal,
1506                unsigned Align=0)
1507     : MemSDNode(Opc, VTL, SrcVal, Align) {
1508     Ops[0] = Chain;
1509     Ops[1] = Ptr;
1510     Ops[2] = Swp;
1511     Ops[3] = Cmp;
1512     InitOperands(Ops, 4);
1513   }
1514   AtomicSDNode(unsigned Opc, SDVTList VTL, SDOperand Chain, SDOperand Ptr, 
1515                SDOperand Val, const Value* SrcVal, unsigned Align=0)
1516     : MemSDNode(Opc, VTL, SrcVal, Align) {
1517     Ops[0] = Chain;
1518     Ops[1] = Ptr;
1519     Ops[2] = Val;
1520     InitOperands(Ops, 3);
1521   }
1522   
1523   const SDOperand &getChain() const { return getOperand(0); }
1524   const SDOperand &getBasePtr() const { return getOperand(1); }
1525   const SDOperand &getVal() const { return getOperand(2); }
1526
1527   bool isCompareAndSwap() const { return getOpcode() == ISD::ATOMIC_CMP_SWAP; }
1528
1529   // Implementation for MemSDNode
1530   virtual int getSrcValueOffset() const { return 0; }
1531   virtual bool isVolatile() const { return true; }   
1532   
1533   /// getMemOperand - Return a MachineMemOperand object describing the memory
1534   /// reference performed by this atomic load/store.
1535   virtual MachineMemOperand getMemOperand() const;
1536   
1537   // Methods to support isa and dyn_cast
1538   static bool classof(const AtomicSDNode *) { return true; }
1539   static bool classof(const SDNode *N) {
1540     return N->getOpcode() == ISD::ATOMIC_CMP_SWAP  ||
1541            N->getOpcode() == ISD::ATOMIC_LOAD_ADD  ||
1542            N->getOpcode() == ISD::ATOMIC_SWAP      ||
1543            N->getOpcode() == ISD::ATOMIC_LOAD_SUB  ||
1544            N->getOpcode() == ISD::ATOMIC_LOAD_AND  ||
1545            N->getOpcode() == ISD::ATOMIC_LOAD_OR   ||
1546            N->getOpcode() == ISD::ATOMIC_LOAD_XOR  ||
1547            N->getOpcode() == ISD::ATOMIC_LOAD_NAND ||
1548            N->getOpcode() == ISD::ATOMIC_LOAD_MIN  ||
1549            N->getOpcode() == ISD::ATOMIC_LOAD_MAX  ||
1550            N->getOpcode() == ISD::ATOMIC_LOAD_UMIN ||
1551            N->getOpcode() == ISD::ATOMIC_LOAD_UMAX;
1552   }
1553 };
1554
1555 class StringSDNode : public SDNode {
1556   std::string Value;
1557   virtual void ANCHOR();  // Out-of-line virtual method to give class a home.
1558 protected:
1559   friend class SelectionDAG;
1560   explicit StringSDNode(const std::string &val)
1561     : SDNode(ISD::STRING, getSDVTList(MVT::Other)), Value(val) {
1562   }
1563 public:
1564   const std::string &getValue() const { return Value; }
1565   static bool classof(const StringSDNode *) { return true; }
1566   static bool classof(const SDNode *N) {
1567     return N->getOpcode() == ISD::STRING;
1568   }
1569 };  
1570
1571 class ConstantSDNode : public SDNode {
1572   APInt Value;
1573   virtual void ANCHOR();  // Out-of-line virtual method to give class a home.
1574 protected:
1575   friend class SelectionDAG;
1576   ConstantSDNode(bool isTarget, const APInt &val, MVT VT)
1577     : SDNode(isTarget ? ISD::TargetConstant : ISD::Constant, getSDVTList(VT)),
1578       Value(val) {
1579   }
1580 public:
1581
1582   const APInt &getAPIntValue() const { return Value; }
1583   uint64_t getValue() const { return Value.getZExtValue(); }
1584
1585   int64_t getSignExtended() const {
1586     unsigned Bits = getValueType(0).getSizeInBits();
1587     return ((int64_t)Value.getZExtValue() << (64-Bits)) >> (64-Bits);
1588   }
1589
1590   bool isNullValue() const { return Value == 0; }
1591   bool isAllOnesValue() const {
1592     return Value == getValueType(0).getIntegerVTBitMask();
1593   }
1594
1595   static bool classof(const ConstantSDNode *) { return true; }
1596   static bool classof(const SDNode *N) {
1597     return N->getOpcode() == ISD::Constant ||
1598            N->getOpcode() == ISD::TargetConstant;
1599   }
1600 };
1601
1602 class ConstantFPSDNode : public SDNode {
1603   APFloat Value;
1604   virtual void ANCHOR();  // Out-of-line virtual method to give class a home.
1605 protected:
1606   friend class SelectionDAG;
1607   ConstantFPSDNode(bool isTarget, const APFloat& val, MVT VT)
1608     : SDNode(isTarget ? ISD::TargetConstantFP : ISD::ConstantFP,
1609              getSDVTList(VT)), Value(val) {
1610   }
1611 public:
1612
1613   const APFloat& getValueAPF() const { return Value; }
1614
1615   /// isExactlyValue - We don't rely on operator== working on double values, as
1616   /// it returns true for things that are clearly not equal, like -0.0 and 0.0.
1617   /// As such, this method can be used to do an exact bit-for-bit comparison of
1618   /// two floating point values.
1619
1620   /// We leave the version with the double argument here because it's just so
1621   /// convenient to write "2.0" and the like.  Without this function we'd 
1622   /// have to duplicate its logic everywhere it's called.
1623   bool isExactlyValue(double V) const {
1624     // convert is not supported on this type
1625     if (&Value.getSemantics() == &APFloat::PPCDoubleDouble)
1626       return false;
1627     APFloat Tmp(V);
1628     Tmp.convert(Value.getSemantics(), APFloat::rmNearestTiesToEven);
1629     return isExactlyValue(Tmp);
1630   }
1631   bool isExactlyValue(const APFloat& V) const;
1632
1633   bool isValueValidForType(MVT VT, const APFloat& Val);
1634
1635   static bool classof(const ConstantFPSDNode *) { return true; }
1636   static bool classof(const SDNode *N) {
1637     return N->getOpcode() == ISD::ConstantFP || 
1638            N->getOpcode() == ISD::TargetConstantFP;
1639   }
1640 };
1641
1642 class GlobalAddressSDNode : public SDNode {
1643   GlobalValue *TheGlobal;
1644   int Offset;
1645   virtual void ANCHOR();  // Out-of-line virtual method to give class a home.
1646 protected:
1647   friend class SelectionDAG;
1648   GlobalAddressSDNode(bool isTarget, const GlobalValue *GA, MVT VT, int o = 0);
1649 public:
1650
1651   GlobalValue *getGlobal() const { return TheGlobal; }
1652   int getOffset() const { return Offset; }
1653
1654   static bool classof(const GlobalAddressSDNode *) { return true; }
1655   static bool classof(const SDNode *N) {
1656     return N->getOpcode() == ISD::GlobalAddress ||
1657            N->getOpcode() == ISD::TargetGlobalAddress ||
1658            N->getOpcode() == ISD::GlobalTLSAddress ||
1659            N->getOpcode() == ISD::TargetGlobalTLSAddress;
1660   }
1661 };
1662
1663 class FrameIndexSDNode : public SDNode {
1664   int FI;
1665   virtual void ANCHOR();  // Out-of-line virtual method to give class a home.
1666 protected:
1667   friend class SelectionDAG;
1668   FrameIndexSDNode(int fi, MVT VT, bool isTarg)
1669     : SDNode(isTarg ? ISD::TargetFrameIndex : ISD::FrameIndex, getSDVTList(VT)),
1670       FI(fi) {
1671   }
1672 public:
1673
1674   int getIndex() const { return FI; }
1675
1676   static bool classof(const FrameIndexSDNode *) { return true; }
1677   static bool classof(const SDNode *N) {
1678     return N->getOpcode() == ISD::FrameIndex ||
1679            N->getOpcode() == ISD::TargetFrameIndex;
1680   }
1681 };
1682
1683 class JumpTableSDNode : public SDNode {
1684   int JTI;
1685   virtual void ANCHOR();  // Out-of-line virtual method to give class a home.
1686 protected:
1687   friend class SelectionDAG;
1688   JumpTableSDNode(int jti, MVT VT, bool isTarg)
1689     : SDNode(isTarg ? ISD::TargetJumpTable : ISD::JumpTable, getSDVTList(VT)),
1690       JTI(jti) {
1691   }
1692 public:
1693     
1694   int getIndex() const { return JTI; }
1695   
1696   static bool classof(const JumpTableSDNode *) { return true; }
1697   static bool classof(const SDNode *N) {
1698     return N->getOpcode() == ISD::JumpTable ||
1699            N->getOpcode() == ISD::TargetJumpTable;
1700   }
1701 };
1702
1703 class ConstantPoolSDNode : public SDNode {
1704   union {
1705     Constant *ConstVal;
1706     MachineConstantPoolValue *MachineCPVal;
1707   } Val;
1708   int Offset;  // It's a MachineConstantPoolValue if top bit is set.
1709   unsigned Alignment;
1710   virtual void ANCHOR();  // Out-of-line virtual method to give class a home.
1711 protected:
1712   friend class SelectionDAG;
1713   ConstantPoolSDNode(bool isTarget, Constant *c, MVT VT, int o=0)
1714     : SDNode(isTarget ? ISD::TargetConstantPool : ISD::ConstantPool,
1715              getSDVTList(VT)), Offset(o), Alignment(0) {
1716     assert((int)Offset >= 0 && "Offset is too large");
1717     Val.ConstVal = c;
1718   }
1719   ConstantPoolSDNode(bool isTarget, Constant *c, MVT VT, int o, unsigned Align)
1720     : SDNode(isTarget ? ISD::TargetConstantPool : ISD::ConstantPool, 
1721              getSDVTList(VT)), Offset(o), Alignment(Align) {
1722     assert((int)Offset >= 0 && "Offset is too large");
1723     Val.ConstVal = c;
1724   }
1725   ConstantPoolSDNode(bool isTarget, MachineConstantPoolValue *v,
1726                      MVT VT, int o=0)
1727     : SDNode(isTarget ? ISD::TargetConstantPool : ISD::ConstantPool, 
1728              getSDVTList(VT)), Offset(o), Alignment(0) {
1729     assert((int)Offset >= 0 && "Offset is too large");
1730     Val.MachineCPVal = v;
1731     Offset |= 1 << (sizeof(unsigned)*8-1);
1732   }
1733   ConstantPoolSDNode(bool isTarget, MachineConstantPoolValue *v,
1734                      MVT VT, int o, unsigned Align)
1735     : SDNode(isTarget ? ISD::TargetConstantPool : ISD::ConstantPool,
1736              getSDVTList(VT)), Offset(o), Alignment(Align) {
1737     assert((int)Offset >= 0 && "Offset is too large");
1738     Val.MachineCPVal = v;
1739     Offset |= 1 << (sizeof(unsigned)*8-1);
1740   }
1741 public:
1742
1743   bool isMachineConstantPoolEntry() const {
1744     return (int)Offset < 0;
1745   }
1746
1747   Constant *getConstVal() const {
1748     assert(!isMachineConstantPoolEntry() && "Wrong constantpool type");
1749     return Val.ConstVal;
1750   }
1751
1752   MachineConstantPoolValue *getMachineCPVal() const {
1753     assert(isMachineConstantPoolEntry() && "Wrong constantpool type");
1754     return Val.MachineCPVal;
1755   }
1756
1757   int getOffset() const {
1758     return Offset & ~(1 << (sizeof(unsigned)*8-1));
1759   }
1760   
1761   // Return the alignment of this constant pool object, which is either 0 (for
1762   // default alignment) or log2 of the desired value.
1763   unsigned getAlignment() const { return Alignment; }
1764
1765   const Type *getType() const;
1766
1767   static bool classof(const ConstantPoolSDNode *) { return true; }
1768   static bool classof(const SDNode *N) {
1769     return N->getOpcode() == ISD::ConstantPool ||
1770            N->getOpcode() == ISD::TargetConstantPool;
1771   }
1772 };
1773
1774 class BasicBlockSDNode : public SDNode {
1775   MachineBasicBlock *MBB;
1776   virtual void ANCHOR();  // Out-of-line virtual method to give class a home.
1777 protected:
1778   friend class SelectionDAG;
1779   explicit BasicBlockSDNode(MachineBasicBlock *mbb)
1780     : SDNode(ISD::BasicBlock, getSDVTList(MVT::Other)), MBB(mbb) {
1781   }
1782 public:
1783
1784   MachineBasicBlock *getBasicBlock() const { return MBB; }
1785
1786   static bool classof(const BasicBlockSDNode *) { return true; }
1787   static bool classof(const SDNode *N) {
1788     return N->getOpcode() == ISD::BasicBlock;
1789   }
1790 };
1791
1792 /// SrcValueSDNode - An SDNode that holds an arbitrary LLVM IR Value. This is
1793 /// used when the SelectionDAG needs to make a simple reference to something
1794 /// in the LLVM IR representation.
1795 ///
1796 /// Note that this is not used for carrying alias information; that is done
1797 /// with MemOperandSDNode, which includes a Value which is required to be a
1798 /// pointer, and several other fields specific to memory references.
1799 ///
1800 class SrcValueSDNode : public SDNode {
1801   const Value *V;
1802   virtual void ANCHOR();  // Out-of-line virtual method to give class a home.
1803 protected:
1804   friend class SelectionDAG;
1805   /// Create a SrcValue for a general value.
1806   explicit SrcValueSDNode(const Value *v)
1807     : SDNode(ISD::SRCVALUE, getSDVTList(MVT::Other)), V(v) {}
1808
1809 public:
1810   /// getValue - return the contained Value.
1811   const Value *getValue() const { return V; }
1812
1813   static bool classof(const SrcValueSDNode *) { return true; }
1814   static bool classof(const SDNode *N) {
1815     return N->getOpcode() == ISD::SRCVALUE;
1816   }
1817 };
1818
1819
1820 /// MemOperandSDNode - An SDNode that holds a MachineMemOperand. This is
1821 /// used to represent a reference to memory after ISD::LOAD
1822 /// and ISD::STORE have been lowered.
1823 ///
1824 class MemOperandSDNode : public SDNode {
1825   virtual void ANCHOR();  // Out-of-line virtual method to give class a home.
1826 protected:
1827   friend class SelectionDAG;
1828   /// Create a MachineMemOperand node
1829   explicit MemOperandSDNode(const MachineMemOperand &mo)
1830     : SDNode(ISD::MEMOPERAND, getSDVTList(MVT::Other)), MO(mo) {}
1831
1832 public:
1833   /// MO - The contained MachineMemOperand.
1834   const MachineMemOperand MO;
1835
1836   static bool classof(const MemOperandSDNode *) { return true; }
1837   static bool classof(const SDNode *N) {
1838     return N->getOpcode() == ISD::MEMOPERAND;
1839   }
1840 };
1841
1842
1843 class RegisterSDNode : public SDNode {
1844   unsigned Reg;
1845   virtual void ANCHOR();  // Out-of-line virtual method to give class a home.
1846 protected:
1847   friend class SelectionDAG;
1848   RegisterSDNode(unsigned reg, MVT VT)
1849     : SDNode(ISD::Register, getSDVTList(VT)), Reg(reg) {
1850   }
1851 public:
1852
1853   unsigned getReg() const { return Reg; }
1854
1855   static bool classof(const RegisterSDNode *) { return true; }
1856   static bool classof(const SDNode *N) {
1857     return N->getOpcode() == ISD::Register;
1858   }
1859 };
1860
1861 class ExternalSymbolSDNode : public SDNode {
1862   const char *Symbol;
1863   virtual void ANCHOR();  // Out-of-line virtual method to give class a home.
1864 protected:
1865   friend class SelectionDAG;
1866   ExternalSymbolSDNode(bool isTarget, const char *Sym, MVT VT)
1867     : SDNode(isTarget ? ISD::TargetExternalSymbol : ISD::ExternalSymbol,
1868              getSDVTList(VT)), Symbol(Sym) {
1869   }
1870 public:
1871
1872   const char *getSymbol() const { return Symbol; }
1873
1874   static bool classof(const ExternalSymbolSDNode *) { return true; }
1875   static bool classof(const SDNode *N) {
1876     return N->getOpcode() == ISD::ExternalSymbol ||
1877            N->getOpcode() == ISD::TargetExternalSymbol;
1878   }
1879 };
1880
1881 class CondCodeSDNode : public SDNode {
1882   ISD::CondCode Condition;
1883   virtual void ANCHOR();  // Out-of-line virtual method to give class a home.
1884 protected:
1885   friend class SelectionDAG;
1886   explicit CondCodeSDNode(ISD::CondCode Cond)
1887     : SDNode(ISD::CONDCODE, getSDVTList(MVT::Other)), Condition(Cond) {
1888   }
1889 public:
1890
1891   ISD::CondCode get() const { return Condition; }
1892
1893   static bool classof(const CondCodeSDNode *) { return true; }
1894   static bool classof(const SDNode *N) {
1895     return N->getOpcode() == ISD::CONDCODE;
1896   }
1897 };
1898
1899 namespace ISD {
1900   struct ArgFlagsTy {
1901   private:
1902     static const uint64_t NoFlagSet      = 0ULL;
1903     static const uint64_t ZExt           = 1ULL<<0;  ///< Zero extended
1904     static const uint64_t ZExtOffs       = 0;
1905     static const uint64_t SExt           = 1ULL<<1;  ///< Sign extended
1906     static const uint64_t SExtOffs       = 1;
1907     static const uint64_t InReg          = 1ULL<<2;  ///< Passed in register
1908     static const uint64_t InRegOffs      = 2;
1909     static const uint64_t SRet           = 1ULL<<3;  ///< Hidden struct-ret ptr
1910     static const uint64_t SRetOffs       = 3;
1911     static const uint64_t ByVal          = 1ULL<<4;  ///< Struct passed by value
1912     static const uint64_t ByValOffs      = 4;
1913     static const uint64_t Nest           = 1ULL<<5;  ///< Nested fn static chain
1914     static const uint64_t NestOffs       = 5;
1915     static const uint64_t ByValAlign     = 0xFULL << 6; //< Struct alignment
1916     static const uint64_t ByValAlignOffs = 6;
1917     static const uint64_t Split          = 1ULL << 10;
1918     static const uint64_t SplitOffs      = 10;
1919     static const uint64_t OrigAlign      = 0x1FULL<<27;
1920     static const uint64_t OrigAlignOffs  = 27;
1921     static const uint64_t ByValSize      = 0xffffffffULL << 32; //< Struct size
1922     static const uint64_t ByValSizeOffs  = 32;
1923
1924     static const uint64_t One            = 1ULL; //< 1 of this type, for shifts
1925
1926     uint64_t Flags;
1927   public:
1928     ArgFlagsTy() : Flags(0) { }
1929
1930     bool isZExt()   const { return Flags & ZExt; }
1931     void setZExt()  { Flags |= One << ZExtOffs; }
1932
1933     bool isSExt()   const { return Flags & SExt; }
1934     void setSExt()  { Flags |= One << SExtOffs; }
1935
1936     bool isInReg()  const { return Flags & InReg; }
1937     void setInReg() { Flags |= One << InRegOffs; }
1938
1939     bool isSRet()   const { return Flags & SRet; }
1940     void setSRet()  { Flags |= One << SRetOffs; }
1941
1942     bool isByVal()  const { return Flags & ByVal; }
1943     void setByVal() { Flags |= One << ByValOffs; }
1944
1945     bool isNest()   const { return Flags & Nest; }
1946     void setNest()  { Flags |= One << NestOffs; }
1947
1948     unsigned getByValAlign() const {
1949       return (unsigned) 
1950         ((One << ((Flags & ByValAlign) >> ByValAlignOffs)) / 2);
1951     }
1952     void setByValAlign(unsigned A) {
1953       Flags = (Flags & ~ByValAlign) |
1954         (uint64_t(Log2_32(A) + 1) << ByValAlignOffs);
1955     }
1956             
1957     bool isSplit()   const { return Flags & Split; }
1958     void setSplit()  { Flags |= One << SplitOffs; }
1959
1960     unsigned getOrigAlign() const {
1961       return (unsigned)
1962         ((One << ((Flags & OrigAlign) >> OrigAlignOffs)) / 2);
1963     }
1964     void setOrigAlign(unsigned A) {
1965       Flags = (Flags & ~OrigAlign) |
1966         (uint64_t(Log2_32(A) + 1) << OrigAlignOffs);
1967     }
1968
1969     unsigned getByValSize() const {
1970       return (unsigned)((Flags & ByValSize) >> ByValSizeOffs);
1971     }
1972     void setByValSize(unsigned S) {
1973       Flags = (Flags & ~ByValSize) | (uint64_t(S) << ByValSizeOffs);
1974     }
1975
1976     /// getArgFlagsString - Returns the flags as a string, eg: "zext align:4".
1977     std::string getArgFlagsString();
1978
1979     /// getRawBits - Represent the flags as a bunch of bits.
1980     uint64_t getRawBits() const { return Flags; }
1981   };
1982 }
1983
1984 /// ARG_FLAGSSDNode - Leaf node holding parameter flags.
1985 class ARG_FLAGSSDNode : public SDNode {
1986   ISD::ArgFlagsTy TheFlags;
1987   virtual void ANCHOR();  // Out-of-line virtual method to give class a home.
1988 protected:
1989   friend class SelectionDAG;
1990   explicit ARG_FLAGSSDNode(ISD::ArgFlagsTy Flags)
1991     : SDNode(ISD::ARG_FLAGS, getSDVTList(MVT::Other)), TheFlags(Flags) {
1992   }
1993 public:
1994   ISD::ArgFlagsTy getArgFlags() const { return TheFlags; }
1995
1996   static bool classof(const ARG_FLAGSSDNode *) { return true; }
1997   static bool classof(const SDNode *N) {
1998     return N->getOpcode() == ISD::ARG_FLAGS;
1999   }
2000 };
2001
2002 /// VTSDNode - This class is used to represent MVT's, which are used
2003 /// to parameterize some operations.
2004 class VTSDNode : public SDNode {
2005   MVT ValueType;
2006   virtual void ANCHOR();  // Out-of-line virtual method to give class a home.
2007 protected:
2008   friend class SelectionDAG;
2009   explicit VTSDNode(MVT VT)
2010     : SDNode(ISD::VALUETYPE, getSDVTList(MVT::Other)), ValueType(VT) {
2011   }
2012 public:
2013
2014   MVT getVT() const { return ValueType; }
2015
2016   static bool classof(const VTSDNode *) { return true; }
2017   static bool classof(const SDNode *N) {
2018     return N->getOpcode() == ISD::VALUETYPE;
2019   }
2020 };
2021
2022 /// LSBaseSDNode - Base class for LoadSDNode and StoreSDNode
2023 ///
2024 class LSBaseSDNode : public MemSDNode {
2025 private:
2026   // AddrMode - unindexed, pre-indexed, post-indexed.
2027   ISD::MemIndexedMode AddrMode;
2028
2029   // MemoryVT - VT of in-memory value.
2030   MVT MemoryVT;
2031
2032   //! SVOffset - Memory location offset. Note that base is defined in MemSDNode
2033   int SVOffset;
2034
2035   //! IsVolatile - True if the load/store is volatile.
2036   bool IsVolatile;
2037
2038 protected:
2039   //! Operand array for load and store
2040   /*!
2041     \note Moving this array to the base class captures more
2042     common functionality shared between LoadSDNode and
2043     StoreSDNode
2044    */
2045   SDUse Ops[4];
2046 public:
2047   LSBaseSDNode(ISD::NodeType NodeTy, SDOperand *Operands, unsigned numOperands,
2048                SDVTList VTs, ISD::MemIndexedMode AM, MVT VT,
2049                const Value *SV, int SVO, unsigned Align, bool Vol)
2050     : MemSDNode(NodeTy, VTs, SV, Align), AddrMode(AM), MemoryVT(VT),
2051       SVOffset(SVO), IsVolatile(Vol) {
2052     for (unsigned i = 0; i != numOperands; ++i)
2053       Ops[i] = Operands[i];
2054     InitOperands(Ops, numOperands);
2055     assert(Align != 0 && "Loads and stores should have non-zero aligment");
2056     assert((getOffset().getOpcode() == ISD::UNDEF || isIndexed()) &&
2057            "Only indexed loads and stores have a non-undef offset operand");
2058   }
2059
2060   const SDOperand &getChain() const { return getOperand(0); }
2061   const SDOperand &getBasePtr() const {
2062     return getOperand(getOpcode() == ISD::LOAD ? 1 : 2);
2063   }
2064   const SDOperand &getOffset() const {
2065     return getOperand(getOpcode() == ISD::LOAD ? 2 : 3);
2066   }
2067
2068   MVT getMemoryVT() const { return MemoryVT; }
2069     
2070   ISD::MemIndexedMode getAddressingMode() const { return AddrMode; }
2071
2072   /// isIndexed - Return true if this is a pre/post inc/dec load/store.
2073   bool isIndexed() const { return AddrMode != ISD::UNINDEXED; }
2074
2075   /// isUnindexed - Return true if this is NOT a pre/post inc/dec load/store.
2076   bool isUnindexed() const { return AddrMode == ISD::UNINDEXED; }
2077
2078   // Implementation for MemSDNode
2079   virtual int getSrcValueOffset() const { return SVOffset; }
2080   virtual bool isVolatile() const { return IsVolatile; }  
2081   
2082   /// getMemOperand - Return a MachineMemOperand object describing the memory
2083   /// reference performed by this load or store.
2084   virtual MachineMemOperand getMemOperand() const;
2085
2086   static bool classof(const LSBaseSDNode *) { return true; }
2087   static bool classof(const SDNode *N) {
2088     return N->getOpcode() == ISD::LOAD ||
2089            N->getOpcode() == ISD::STORE;
2090   }
2091 };
2092
2093 /// LoadSDNode - This class is used to represent ISD::LOAD nodes.
2094 ///
2095 class LoadSDNode : public LSBaseSDNode {
2096   virtual void ANCHOR();  // Out-of-line virtual method to give class a home.
2097   
2098   // ExtType - non-ext, anyext, sext, zext.
2099   ISD::LoadExtType ExtType;
2100
2101 protected:
2102   friend class SelectionDAG;
2103   LoadSDNode(SDOperand *ChainPtrOff, SDVTList VTs,
2104              ISD::MemIndexedMode AM, ISD::LoadExtType ETy, MVT LVT,
2105              const Value *SV, int O=0, unsigned Align=0, bool Vol=false)
2106     : LSBaseSDNode(ISD::LOAD, ChainPtrOff, 3,
2107                    VTs, AM, LVT, SV, O, Align, Vol),
2108       ExtType(ETy) {}
2109 public:
2110
2111   ISD::LoadExtType getExtensionType() const { return ExtType; }
2112   const SDOperand &getBasePtr() const { return getOperand(1); }
2113   const SDOperand &getOffset() const { return getOperand(2); }
2114   
2115   static bool classof(const LoadSDNode *) { return true; }
2116   static bool classof(const SDNode *N) {
2117     return N->getOpcode() == ISD::LOAD;
2118   }
2119 };
2120
2121 /// StoreSDNode - This class is used to represent ISD::STORE nodes.
2122 ///
2123 class StoreSDNode : public LSBaseSDNode {
2124   virtual void ANCHOR();  // Out-of-line virtual method to give class a home.
2125     
2126   // IsTruncStore - True if the op does a truncation before store.
2127   bool IsTruncStore;
2128 protected:
2129   friend class SelectionDAG;
2130   StoreSDNode(SDOperand *ChainValuePtrOff, SDVTList VTs,
2131               ISD::MemIndexedMode AM, bool isTrunc, MVT SVT,
2132               const Value *SV, int O=0, unsigned Align=0, bool Vol=false)
2133     : LSBaseSDNode(ISD::STORE, ChainValuePtrOff, 4,
2134                    VTs, AM, SVT, SV, O, Align, Vol),
2135       IsTruncStore(isTrunc) {}
2136 public:
2137
2138   bool isTruncatingStore() const { return IsTruncStore; }
2139   const SDOperand &getValue() const { return getOperand(1); }
2140   const SDOperand &getBasePtr() const { return getOperand(2); }
2141   const SDOperand &getOffset() const { return getOperand(3); }
2142   
2143   static bool classof(const StoreSDNode *) { return true; }
2144   static bool classof(const SDNode *N) {
2145     return N->getOpcode() == ISD::STORE;
2146   }
2147 };
2148
2149
2150 class SDNodeIterator : public forward_iterator<SDNode, ptrdiff_t> {
2151   SDNode *Node;
2152   unsigned Operand;
2153
2154   SDNodeIterator(SDNode *N, unsigned Op) : Node(N), Operand(Op) {}
2155 public:
2156   bool operator==(const SDNodeIterator& x) const {
2157     return Operand == x.Operand;
2158   }
2159   bool operator!=(const SDNodeIterator& x) const { return !operator==(x); }
2160
2161   const SDNodeIterator &operator=(const SDNodeIterator &I) {
2162     assert(I.Node == Node && "Cannot assign iterators to two different nodes!");
2163     Operand = I.Operand;
2164     return *this;
2165   }
2166
2167   pointer operator*() const {
2168     return Node->getOperand(Operand).Val;
2169   }
2170   pointer operator->() const { return operator*(); }
2171
2172   SDNodeIterator& operator++() {                // Preincrement
2173     ++Operand;
2174     return *this;
2175   }
2176   SDNodeIterator operator++(int) { // Postincrement
2177     SDNodeIterator tmp = *this; ++*this; return tmp;
2178   }
2179
2180   static SDNodeIterator begin(SDNode *N) { return SDNodeIterator(N, 0); }
2181   static SDNodeIterator end  (SDNode *N) {
2182     return SDNodeIterator(N, N->getNumOperands());
2183   }
2184
2185   unsigned getOperand() const { return Operand; }
2186   const SDNode *getNode() const { return Node; }
2187 };
2188
2189 template <> struct GraphTraits<SDNode*> {
2190   typedef SDNode NodeType;
2191   typedef SDNodeIterator ChildIteratorType;
2192   static inline NodeType *getEntryNode(SDNode *N) { return N; }
2193   static inline ChildIteratorType child_begin(NodeType *N) {
2194     return SDNodeIterator::begin(N);
2195   }
2196   static inline ChildIteratorType child_end(NodeType *N) {
2197     return SDNodeIterator::end(N);
2198   }
2199 };
2200
2201 template<>
2202 struct ilist_traits<SDNode> {
2203   static SDNode *getPrev(const SDNode *N) { return N->Prev; }
2204   static SDNode *getNext(const SDNode *N) { return N->Next; }
2205   
2206   static void setPrev(SDNode *N, SDNode *Prev) { N->Prev = Prev; }
2207   static void setNext(SDNode *N, SDNode *Next) { N->Next = Next; }
2208   
2209   static SDNode *createSentinel() {
2210     return new SDNode(ISD::EntryToken, SDNode::getSDVTList(MVT::Other));
2211   }
2212   static void destroySentinel(SDNode *N) { delete N; }
2213   //static SDNode *createNode(const SDNode &V) { return new SDNode(V); }
2214   
2215   
2216   void addNodeToList(SDNode *) {}
2217   void removeNodeFromList(SDNode *) {}
2218   void transferNodesFromList(iplist<SDNode, ilist_traits> &,
2219                              const ilist_iterator<SDNode> &,
2220                              const ilist_iterator<SDNode> &) {}
2221 };
2222
2223 namespace ISD {
2224   /// isNormalLoad - Returns true if the specified node is a non-extending
2225   /// and unindexed load.
2226   inline bool isNormalLoad(const SDNode *N) {
2227     const LoadSDNode *Ld = dyn_cast<LoadSDNode>(N);
2228     return Ld && Ld->getExtensionType() == ISD::NON_EXTLOAD &&
2229       Ld->getAddressingMode() == ISD::UNINDEXED;
2230   }
2231
2232   /// isNON_EXTLoad - Returns true if the specified node is a non-extending
2233   /// load.
2234   inline bool isNON_EXTLoad(const SDNode *N) {
2235     return isa<LoadSDNode>(N) &&
2236       cast<LoadSDNode>(N)->getExtensionType() == ISD::NON_EXTLOAD;
2237   }
2238
2239   /// isEXTLoad - Returns true if the specified node is a EXTLOAD.
2240   ///
2241   inline bool isEXTLoad(const SDNode *N) {
2242     return isa<LoadSDNode>(N) &&
2243       cast<LoadSDNode>(N)->getExtensionType() == ISD::EXTLOAD;
2244   }
2245
2246   /// isSEXTLoad - Returns true if the specified node is a SEXTLOAD.
2247   ///
2248   inline bool isSEXTLoad(const SDNode *N) {
2249     return isa<LoadSDNode>(N) &&
2250       cast<LoadSDNode>(N)->getExtensionType() == ISD::SEXTLOAD;
2251   }
2252
2253   /// isZEXTLoad - Returns true if the specified node is a ZEXTLOAD.
2254   ///
2255   inline bool isZEXTLoad(const SDNode *N) {
2256     return isa<LoadSDNode>(N) &&
2257       cast<LoadSDNode>(N)->getExtensionType() == ISD::ZEXTLOAD;
2258   }
2259
2260   /// isUNINDEXEDLoad - Returns true if the specified node is an unindexed load.
2261   ///
2262   inline bool isUNINDEXEDLoad(const SDNode *N) {
2263     return isa<LoadSDNode>(N) &&
2264       cast<LoadSDNode>(N)->getAddressingMode() == ISD::UNINDEXED;
2265   }
2266
2267   /// isNormalStore - Returns true if the specified node is a non-truncating
2268   /// and unindexed store.
2269   inline bool isNormalStore(const SDNode *N) {
2270     const StoreSDNode *St = dyn_cast<StoreSDNode>(N);
2271     return St && !St->isTruncatingStore() &&
2272       St->getAddressingMode() == ISD::UNINDEXED;
2273   }
2274
2275   /// isNON_TRUNCStore - Returns true if the specified node is a non-truncating
2276   /// store.
2277   inline bool isNON_TRUNCStore(const SDNode *N) {
2278     return isa<StoreSDNode>(N) && !cast<StoreSDNode>(N)->isTruncatingStore();
2279   }
2280
2281   /// isTRUNCStore - Returns true if the specified node is a truncating
2282   /// store.
2283   inline bool isTRUNCStore(const SDNode *N) {
2284     return isa<StoreSDNode>(N) && cast<StoreSDNode>(N)->isTruncatingStore();
2285   }
2286
2287   /// isUNINDEXEDStore - Returns true if the specified node is an
2288   /// unindexed store.
2289   inline bool isUNINDEXEDStore(const SDNode *N) {
2290     return isa<StoreSDNode>(N) &&
2291       cast<StoreSDNode>(N)->getAddressingMode() == ISD::UNINDEXED;
2292   }
2293 }
2294
2295
2296 } // end llvm namespace
2297
2298 #endif