1 //===-- llvm/CodeGen/SelectionDAG.h - InstSelection DAG ---------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file declares the SelectionDAG class, and transitively defines the
11 // SDNode class and subclasses.
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_CODEGEN_SELECTIONDAG_H
16 #define LLVM_CODEGEN_SELECTIONDAG_H
18 #include "llvm/CodeGen/SelectionDAGNodes.h"
19 #include "llvm/CodeGen/SelectionDAGCSEMap.h"
20 #include "llvm/ADT/ilist"
30 class MachineDebugInfo;
31 class MachineFunction;
33 /// SelectionDAG class - This is used to represent a portion of an LLVM function
34 /// in a low-level Data Dependence DAG representation suitable for instruction
35 /// selection. This DAG is constructed as the first step of instruction
36 /// selection in order to allow implementation of machine specific optimizations
37 /// and code simplifications.
39 /// The representation used by the SelectionDAG is a target-independent
40 /// representation, which has some similarities to the GCC RTL representation,
41 /// but is significantly more simple, powerful, and is a graph form instead of a
49 /// Root - The root of the entire DAG. EntryNode - The starting token.
50 SDOperand Root, EntryNode;
52 /// AllNodes - A linked list of nodes in the current DAG.
53 ilist<SDNode> AllNodes;
55 /// CSEMap - This structure is used to memoize nodes, automatically performing
56 /// CSE with existing nodes with a duplicate is requested.
57 SelectionDAGCSEMap CSEMap;
60 SelectionDAG(TargetLowering &tli, MachineFunction &mf, MachineDebugInfo *di)
61 : TLI(tli), MF(mf), DI(di) {
62 EntryNode = Root = getNode(ISD::EntryToken, MVT::Other);
66 MachineFunction &getMachineFunction() const { return MF; }
67 const TargetMachine &getTarget() const;
68 TargetLowering &getTargetLoweringInfo() const { return TLI; }
69 MachineDebugInfo *getMachineDebugInfo() const { return DI; }
71 /// viewGraph - Pop up a ghostview window with the DAG rendered using 'dot'.
76 typedef ilist<SDNode>::const_iterator allnodes_const_iterator;
77 allnodes_const_iterator allnodes_begin() const { return AllNodes.begin(); }
78 allnodes_const_iterator allnodes_end() const { return AllNodes.end(); }
79 typedef ilist<SDNode>::iterator allnodes_iterator;
80 allnodes_iterator allnodes_begin() { return AllNodes.begin(); }
81 allnodes_iterator allnodes_end() { return AllNodes.end(); }
83 /// getRoot - Return the root tag of the SelectionDAG.
85 const SDOperand &getRoot() const { return Root; }
87 /// getEntryNode - Return the token chain corresponding to the entry of the
89 const SDOperand &getEntryNode() const { return EntryNode; }
91 /// setRoot - Set the current root tag of the SelectionDAG.
93 const SDOperand &setRoot(SDOperand N) { return Root = N; }
95 /// Combine - This iterates over the nodes in the SelectionDAG, folding
96 /// certain types of nodes together, or eliminating superfluous nodes. When
97 /// the AfterLegalize argument is set to 'true', Combine takes care not to
98 /// generate any nodes that will be illegal on the target.
99 void Combine(bool AfterLegalize);
101 /// Legalize - This transforms the SelectionDAG into a SelectionDAG that is
102 /// compatible with the target instruction selector, as indicated by the
103 /// TargetLowering object.
105 /// Note that this is an involved process that may invalidate pointers into
109 /// RemoveDeadNodes - This method deletes all unreachable nodes in the
111 void RemoveDeadNodes();
113 /// getVTList - Return an SDVTList that represents the list of values
115 SDVTList getVTList(MVT::ValueType VT);
116 SDVTList getVTList(MVT::ValueType VT1, MVT::ValueType VT2);
117 SDVTList getVTList(MVT::ValueType VT1, MVT::ValueType VT2,MVT::ValueType VT3);
118 SDVTList getVTList(const MVT::ValueType *VTs, unsigned NumVTs);
120 /// getNodeValueTypes - These are obsolete, use getVTList instead.
121 const MVT::ValueType *getNodeValueTypes(MVT::ValueType VT) {
122 return getVTList(VT).VTs;
124 const MVT::ValueType *getNodeValueTypes(MVT::ValueType VT1,
125 MVT::ValueType VT2) {
126 return getVTList(VT1, VT2).VTs;
128 const MVT::ValueType *getNodeValueTypes(MVT::ValueType VT1,MVT::ValueType VT2,
129 MVT::ValueType VT3) {
130 return getVTList(VT1, VT2, VT3).VTs;
132 const MVT::ValueType *getNodeValueTypes(std::vector<MVT::ValueType> &VTList) {
133 return getVTList(&VTList[0], VTList.size()).VTs;
137 //===----------------------------------------------------------------------===//
138 // Node creation methods.
140 SDOperand getString(const std::string &Val);
141 SDOperand getConstant(uint64_t Val, MVT::ValueType VT, bool isTarget = false);
142 SDOperand getTargetConstant(uint64_t Val, MVT::ValueType VT) {
143 return getConstant(Val, VT, true);
145 SDOperand getConstantFP(double Val, MVT::ValueType VT, bool isTarget = false);
146 SDOperand getTargetConstantFP(double Val, MVT::ValueType VT) {
147 return getConstantFP(Val, VT, true);
149 SDOperand getGlobalAddress(const GlobalValue *GV, MVT::ValueType VT,
150 int offset = 0, bool isTargetGA = false);
151 SDOperand getTargetGlobalAddress(const GlobalValue *GV, MVT::ValueType VT,
153 return getGlobalAddress(GV, VT, offset, true);
155 SDOperand getFrameIndex(int FI, MVT::ValueType VT, bool isTarget = false);
156 SDOperand getTargetFrameIndex(int FI, MVT::ValueType VT) {
157 return getFrameIndex(FI, VT, true);
159 SDOperand getJumpTable(int JTI, MVT::ValueType VT, bool isTarget = false);
160 SDOperand getTargetJumpTable(int JTI, MVT::ValueType VT) {
161 return getJumpTable(JTI, VT, true);
163 SDOperand getConstantPool(Constant *C, MVT::ValueType VT,
164 unsigned Align = 0, int Offs = 0, bool isT=false);
165 SDOperand getTargetConstantPool(Constant *C, MVT::ValueType VT,
166 unsigned Align = 0, int Offset = 0) {
167 return getConstantPool(C, VT, Align, Offset, true);
169 SDOperand getBasicBlock(MachineBasicBlock *MBB);
170 SDOperand getExternalSymbol(const char *Sym, MVT::ValueType VT);
171 SDOperand getTargetExternalSymbol(const char *Sym, MVT::ValueType VT);
172 SDOperand getValueType(MVT::ValueType);
173 SDOperand getRegister(unsigned Reg, MVT::ValueType VT);
175 SDOperand getCopyToReg(SDOperand Chain, unsigned Reg, SDOperand N) {
176 return getNode(ISD::CopyToReg, MVT::Other, Chain,
177 getRegister(Reg, N.getValueType()), N);
180 // This version of the getCopyToReg method takes an extra operand, which
181 // indicates that there is potentially an incoming flag value (if Flag is not
182 // null) and that there should be a flag result.
183 SDOperand getCopyToReg(SDOperand Chain, unsigned Reg, SDOperand N,
185 const MVT::ValueType *VTs = getNodeValueTypes(MVT::Other, MVT::Flag);
186 SDOperand Ops[] = { Chain, getRegister(Reg, N.getValueType()), N, Flag };
187 return getNode(ISD::CopyToReg, VTs, 2, Ops, Flag.Val ? 4 : 3);
190 // Similar to last getCopyToReg() except parameter Reg is a SDOperand
191 SDOperand getCopyToReg(SDOperand Chain, SDOperand Reg, SDOperand N,
193 const MVT::ValueType *VTs = getNodeValueTypes(MVT::Other, MVT::Flag);
194 SDOperand Ops[] = { Chain, Reg, N, Flag };
195 return getNode(ISD::CopyToReg, VTs, 2, Ops, Flag.Val ? 4 : 3);
198 SDOperand getCopyFromReg(SDOperand Chain, unsigned Reg, MVT::ValueType VT) {
199 const MVT::ValueType *VTs = getNodeValueTypes(VT, MVT::Other);
200 SDOperand Ops[] = { Chain, getRegister(Reg, VT) };
201 return getNode(ISD::CopyFromReg, VTs, 2, Ops, 2);
204 // This version of the getCopyFromReg method takes an extra operand, which
205 // indicates that there is potentially an incoming flag value (if Flag is not
206 // null) and that there should be a flag result.
207 SDOperand getCopyFromReg(SDOperand Chain, unsigned Reg, MVT::ValueType VT,
209 const MVT::ValueType *VTs = getNodeValueTypes(VT, MVT::Other, MVT::Flag);
210 SDOperand Ops[] = { Chain, getRegister(Reg, VT), Flag };
211 return getNode(ISD::CopyFromReg, VTs, 3, Ops, Flag.Val ? 3 : 2);
214 SDOperand getCondCode(ISD::CondCode Cond);
216 /// getZeroExtendInReg - Return the expression required to zero extend the Op
217 /// value assuming it was the smaller SrcTy value.
218 SDOperand getZeroExtendInReg(SDOperand Op, MVT::ValueType SrcTy);
220 /// getCALLSEQ_START - Return a new CALLSEQ_START node, which always must have
221 /// a flag result (to ensure it's not CSE'd).
222 SDOperand getCALLSEQ_START(SDOperand Chain, SDOperand Op) {
223 const MVT::ValueType *VTs = getNodeValueTypes(MVT::Other, MVT::Flag);
224 SDOperand Ops[] = { Chain, Op };
225 return getNode(ISD::CALLSEQ_START, VTs, 2, Ops, 2);
228 /// getNode - Gets or creates the specified node.
230 SDOperand getNode(unsigned Opcode, MVT::ValueType VT);
231 SDOperand getNode(unsigned Opcode, MVT::ValueType VT, SDOperand N);
232 SDOperand getNode(unsigned Opcode, MVT::ValueType VT,
233 SDOperand N1, SDOperand N2);
234 SDOperand getNode(unsigned Opcode, MVT::ValueType VT,
235 SDOperand N1, SDOperand N2, SDOperand N3);
236 SDOperand getNode(unsigned Opcode, MVT::ValueType VT,
237 SDOperand N1, SDOperand N2, SDOperand N3, SDOperand N4);
238 SDOperand getNode(unsigned Opcode, MVT::ValueType VT,
239 SDOperand N1, SDOperand N2, SDOperand N3, SDOperand N4,
241 SDOperand getNode(unsigned Opcode, MVT::ValueType VT,
242 const SDOperand *Ops, unsigned NumOps);
243 SDOperand getNode(unsigned Opcode, std::vector<MVT::ValueType> &ResultTys,
244 const SDOperand *Ops, unsigned NumOps);
245 SDOperand getNode(unsigned Opcode, const MVT::ValueType *VTs, unsigned NumVTs,
246 const SDOperand *Ops, unsigned NumOps);
248 /// getSetCC - Helper function to make it easier to build SetCC's if you just
249 /// have an ISD::CondCode instead of an SDOperand.
251 SDOperand getSetCC(MVT::ValueType VT, SDOperand LHS, SDOperand RHS,
252 ISD::CondCode Cond) {
253 return getNode(ISD::SETCC, VT, LHS, RHS, getCondCode(Cond));
256 /// getSelectCC - Helper function to make it easier to build SelectCC's if you
257 /// just have an ISD::CondCode instead of an SDOperand.
259 SDOperand getSelectCC(SDOperand LHS, SDOperand RHS,
260 SDOperand True, SDOperand False, ISD::CondCode Cond) {
261 return getNode(ISD::SELECT_CC, True.getValueType(), LHS, RHS, True, False,
265 /// getVAArg - VAArg produces a result and token chain, and takes a pointer
266 /// and a source value as input.
267 SDOperand getVAArg(MVT::ValueType VT, SDOperand Chain, SDOperand Ptr,
270 /// getLoad - Loads are not normal binary operators: their result type is not
271 /// determined by their operands, and they produce a value AND a token chain.
273 SDOperand getLoad(MVT::ValueType VT, SDOperand Chain, SDOperand Ptr,
275 SDOperand getVecLoad(unsigned Count, MVT::ValueType VT, SDOperand Chain,
276 SDOperand Ptr, SDOperand SV);
277 SDOperand getExtLoad(unsigned Opcode, MVT::ValueType VT, SDOperand Chain,
278 SDOperand Ptr, SDOperand SV, MVT::ValueType EVT);
280 // getSrcValue - construct a node to track a Value* through the backend
281 SDOperand getSrcValue(const Value* I, int offset = 0);
283 /// UpdateNodeOperands - *Mutate* the specified node in-place to have the
284 /// specified operands. If the resultant node already exists in the DAG,
285 /// this does not modify the specified node, instead it returns the node that
286 /// already exists. If the resultant node does not exist in the DAG, the
287 /// input node is returned. As a degenerate case, if you specify the same
288 /// input operands as the node already has, the input node is returned.
289 SDOperand UpdateNodeOperands(SDOperand N, SDOperand Op);
290 SDOperand UpdateNodeOperands(SDOperand N, SDOperand Op1, SDOperand Op2);
291 SDOperand UpdateNodeOperands(SDOperand N, SDOperand Op1, SDOperand Op2,
293 SDOperand UpdateNodeOperands(SDOperand N, SDOperand Op1, SDOperand Op2,
294 SDOperand Op3, SDOperand Op4);
295 SDOperand UpdateNodeOperands(SDOperand N, SDOperand Op1, SDOperand Op2,
296 SDOperand Op3, SDOperand Op4, SDOperand Op5);
297 SDOperand UpdateNodeOperands(SDOperand N, SDOperand *Ops, unsigned NumOps);
299 /// SelectNodeTo - These are used for target selectors to *mutate* the
300 /// specified node to have the specified return type, Target opcode, and
301 /// operands. Note that target opcodes are stored as
302 /// ISD::BUILTIN_OP_END+TargetOpcode in the node opcode field. The 0th value
303 /// of the resultant node is returned.
304 SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT);
305 SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT,
307 SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT,
308 SDOperand Op1, SDOperand Op2);
309 SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT,
310 SDOperand Op1, SDOperand Op2, SDOperand Op3);
311 SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT,
312 SDOperand Op1, SDOperand Op2, SDOperand Op3,
314 SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT,
315 SDOperand Op1, SDOperand Op2, SDOperand Op3,
316 SDOperand Op4, SDOperand Op5);
317 SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT,
318 SDOperand Op1, SDOperand Op2, SDOperand Op3,
319 SDOperand Op4, SDOperand Op5, SDOperand Op6);
320 SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT,
321 SDOperand Op1, SDOperand Op2, SDOperand Op3,
322 SDOperand Op4, SDOperand Op5, SDOperand Op6,
324 SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT,
325 SDOperand Op1, SDOperand Op2, SDOperand Op3,
326 SDOperand Op4, SDOperand Op5, SDOperand Op6,
327 SDOperand Op7, SDOperand Op8);
328 SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1,
329 MVT::ValueType VT2, SDOperand Op1, SDOperand Op2);
330 SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1,
331 MVT::ValueType VT2, SDOperand Op1, SDOperand Op2,
333 SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1,
334 MVT::ValueType VT2, SDOperand Op1, SDOperand Op2,
335 SDOperand Op3, SDOperand Op4);
336 SDOperand SelectNodeTo(SDNode *N, unsigned TargetOpc, MVT::ValueType VT1,
337 MVT::ValueType VT2, SDOperand Op1, SDOperand Op2,
338 SDOperand Op3, SDOperand Op4, SDOperand Op5);
340 /// getTargetNode - These are used for target selectors to create a new node
341 /// with specified return type(s), target opcode, and operands.
343 /// Note that getTargetNode returns the resultant node. If there is already a
344 /// node of the specified opcode and operands, it returns that node instead of
346 SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT);
347 SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT,
349 SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT,
350 SDOperand Op1, SDOperand Op2);
351 SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT,
352 SDOperand Op1, SDOperand Op2, SDOperand Op3);
353 SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT,
354 SDOperand Op1, SDOperand Op2, SDOperand Op3,
356 SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT,
357 SDOperand Op1, SDOperand Op2, SDOperand Op3,
358 SDOperand Op4, SDOperand Op5);
359 SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT,
360 SDOperand Op1, SDOperand Op2, SDOperand Op3,
361 SDOperand Op4, SDOperand Op5, SDOperand Op6);
362 SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT,
363 SDOperand Op1, SDOperand Op2, SDOperand Op3,
364 SDOperand Op4, SDOperand Op5, SDOperand Op6,
366 SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT,
367 SDOperand Op1, SDOperand Op2, SDOperand Op3,
368 SDOperand Op4, SDOperand Op5, SDOperand Op6,
369 SDOperand Op7, SDOperand Op8);
370 SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT,
371 const SDOperand *Ops, unsigned NumOps);
372 SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1,
373 MVT::ValueType VT2, SDOperand Op1);
374 SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1,
375 MVT::ValueType VT2, SDOperand Op1, SDOperand Op2);
376 SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1,
377 MVT::ValueType VT2, SDOperand Op1, SDOperand Op2,
379 SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1,
380 MVT::ValueType VT2, SDOperand Op1, SDOperand Op2,
381 SDOperand Op3, SDOperand Op4);
382 SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1,
383 MVT::ValueType VT2, SDOperand Op1, SDOperand Op2,
384 SDOperand Op3, SDOperand Op4, SDOperand Op5);
385 SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1,
386 MVT::ValueType VT2, SDOperand Op1, SDOperand Op2,
387 SDOperand Op3, SDOperand Op4, SDOperand Op5,
389 SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1,
390 MVT::ValueType VT2, SDOperand Op1, SDOperand Op2,
391 SDOperand Op3, SDOperand Op4, SDOperand Op5,
392 SDOperand Op6, SDOperand Op7);
393 SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1,
394 MVT::ValueType VT2, MVT::ValueType VT3,
395 SDOperand Op1, SDOperand Op2);
396 SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1,
397 MVT::ValueType VT2, MVT::ValueType VT3,
398 SDOperand Op1, SDOperand Op2,
399 SDOperand Op3, SDOperand Op4, SDOperand Op5);
400 SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1,
401 MVT::ValueType VT2, MVT::ValueType VT3,
402 SDOperand Op1, SDOperand Op2,
403 SDOperand Op3, SDOperand Op4, SDOperand Op5,
405 SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1,
406 MVT::ValueType VT2, MVT::ValueType VT3,
407 SDOperand Op1, SDOperand Op2,
408 SDOperand Op3, SDOperand Op4, SDOperand Op5,
409 SDOperand Op6, SDOperand Op7);
410 SDNode *getTargetNode(unsigned Opcode, MVT::ValueType VT1,
412 const SDOperand *Ops, unsigned NumOps);
414 /// ReplaceAllUsesWith - Modify anything using 'From' to use 'To' instead.
415 /// This can cause recursive merging of nodes in the DAG. Use the first
416 /// version if 'From' is known to have a single result, use the second
417 /// if you have two nodes with identical results, use the third otherwise.
419 /// These methods all take an optional vector, which (if not null) is
420 /// populated with any nodes that are deleted from the SelectionDAG, due to
421 /// new equivalences that are discovered.
423 void ReplaceAllUsesWith(SDOperand From, SDOperand Op,
424 std::vector<SDNode*> *Deleted = 0);
425 void ReplaceAllUsesWith(SDNode *From, SDNode *To,
426 std::vector<SDNode*> *Deleted = 0);
427 void ReplaceAllUsesWith(SDNode *From, const SDOperand *To,
428 std::vector<SDNode*> *Deleted = 0);
430 /// ReplaceAllUsesOfValueWith - Replace any uses of From with To, leaving
431 /// uses of other values produced by From.Val alone. The Deleted vector is
432 /// handled the same was as for ReplaceAllUsesWith, but it is required for
434 void ReplaceAllUsesOfValueWith(SDOperand From, SDOperand To,
435 std::vector<SDNode*> &Deleted);
437 /// DeleteNode - Remove the specified node from the system. This node must
438 /// have no referrers.
439 void DeleteNode(SDNode *N);
441 /// AssignNodeIds - Assign a unique node id for each node in the DAG based on
442 /// their allnodes order. It returns the maximum id.
443 unsigned AssignNodeIds();
445 /// AssignTopologicalOrder - Assign a unique node id for each node in the DAG
446 /// based on their topological order. It returns the maximum id and a vector
447 /// of the SDNodes* in assigned order by reference.
448 unsigned AssignTopologicalOrder(std::vector<SDNode*> &TopOrder);
453 void RemoveNodeFromCSEMaps(SDNode *N);
454 SDNode *AddNonLeafNodeToCSEMaps(SDNode *N);
455 SDNode *FindModifiedNodeSlot(SDNode *N, SDOperand Op, void *&InsertPos);
456 SDNode *FindModifiedNodeSlot(SDNode *N, SDOperand Op1, SDOperand Op2,
458 SDNode *FindModifiedNodeSlot(SDNode *N, const SDOperand *Ops, unsigned NumOps,
461 void DeleteNodeNotInCSEMaps(SDNode *N);
463 /// SimplifySetCC - Try to simplify a setcc built with the specified operands
464 /// and cc. If unable to simplify it, return a null SDOperand.
465 SDOperand SimplifySetCC(MVT::ValueType VT, SDOperand N1,
466 SDOperand N2, ISD::CondCode Cond);
468 // List of non-single value types.
469 std::list<std::vector<MVT::ValueType> > VTList;
471 // Maps to auto-CSE operations.
472 std::vector<CondCodeSDNode*> CondCodeNodes;
474 std::vector<SDNode*> ValueTypeNodes;
475 std::map<std::string, SDNode*> ExternalSymbols;
476 std::map<std::string, SDNode*> TargetExternalSymbols;
477 std::map<std::string, StringSDNode*> StringNodes;
480 template <> struct GraphTraits<SelectionDAG*> : public GraphTraits<SDNode*> {
481 typedef SelectionDAG::allnodes_iterator nodes_iterator;
482 static nodes_iterator nodes_begin(SelectionDAG *G) {
483 return G->allnodes_begin();
485 static nodes_iterator nodes_end(SelectionDAG *G) {
486 return G->allnodes_end();
490 } // end namespace llvm