1 //===- llvm/Analysis/LoopInfo.h - Natural Loop Calculator -------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines the LoopInfo class that is used to identify natural loops
11 // and determine the loop depth of various nodes of the CFG. A natural loop
12 // has exactly one entry-point, which is called the header. Note that natural
13 // loops may actually be several loops that share the same header node.
15 // This analysis calculates the nesting structure of loops in a function. For
16 // each natural loop identified, this analysis identifies natural loops
17 // contained entirely within the loop and the basic blocks the make up the loop.
19 // It can calculate on the fly various bits of information, for example:
21 // * whether there is a preheader for the loop
22 // * the number of back edges to the header
23 // * whether or not a particular block branches out of the loop
24 // * the successor blocks of the loop
28 //===----------------------------------------------------------------------===//
30 #ifndef LLVM_ANALYSIS_LOOPINFO_H
31 #define LLVM_ANALYSIS_LOOPINFO_H
33 #include "llvm/ADT/DenseMap.h"
34 #include "llvm/ADT/DenseSet.h"
35 #include "llvm/ADT/DepthFirstIterator.h"
36 #include "llvm/ADT/GraphTraits.h"
37 #include "llvm/ADT/SmallVector.h"
38 #include "llvm/Analysis/Dominators.h"
39 #include "llvm/Pass.h"
40 #include "llvm/Support/CFG.h"
41 #include "llvm/Support/raw_ostream.h"
47 inline void RemoveFromVector(std::vector<T*> &V, T *N) {
48 typename std::vector<T*>::iterator I = std::find(V.begin(), V.end(), N);
49 assert(I != V.end() && "N is not in this list!");
57 template<class N, class M> class LoopInfoBase;
58 template<class N, class M> class LoopBase;
60 //===----------------------------------------------------------------------===//
61 /// LoopBase class - Instances of this class are used to represent loops that
62 /// are detected in the flow graph
64 template<class BlockT, class LoopT>
67 // SubLoops - Loops contained entirely within this one.
68 std::vector<LoopT *> SubLoops;
70 // Blocks - The list of blocks in this loop. First entry is the header node.
71 std::vector<BlockT*> Blocks;
73 LoopBase(const LoopBase<BlockT, LoopT> &) LLVM_DELETED_FUNCTION;
74 const LoopBase<BlockT, LoopT>&
75 operator=(const LoopBase<BlockT, LoopT> &) LLVM_DELETED_FUNCTION;
77 /// Loop ctor - This creates an empty loop.
78 LoopBase() : ParentLoop(0) {}
80 for (size_t i = 0, e = SubLoops.size(); i != e; ++i)
84 /// getLoopDepth - Return the nesting level of this loop. An outer-most
85 /// loop has depth 1, for consistency with loop depth values used for basic
86 /// blocks, where depth 0 is used for blocks not inside any loops.
87 unsigned getLoopDepth() const {
89 for (const LoopT *CurLoop = ParentLoop; CurLoop;
90 CurLoop = CurLoop->ParentLoop)
94 BlockT *getHeader() const { return Blocks.front(); }
95 LoopT *getParentLoop() const { return ParentLoop; }
97 /// setParentLoop is a raw interface for bypassing addChildLoop.
98 void setParentLoop(LoopT *L) { ParentLoop = L; }
100 /// contains - Return true if the specified loop is contained within in
103 bool contains(const LoopT *L) const {
104 if (L == this) return true;
105 if (L == 0) return false;
106 return contains(L->getParentLoop());
109 /// contains - Return true if the specified basic block is in this loop.
111 bool contains(const BlockT *BB) const {
112 return std::find(block_begin(), block_end(), BB) != block_end();
115 /// contains - Return true if the specified instruction is in this loop.
117 template<class InstT>
118 bool contains(const InstT *Inst) const {
119 return contains(Inst->getParent());
122 /// iterator/begin/end - Return the loops contained entirely within this loop.
124 const std::vector<LoopT *> &getSubLoops() const { return SubLoops; }
125 std::vector<LoopT *> &getSubLoopsVector() { return SubLoops; }
126 typedef typename std::vector<LoopT *>::const_iterator iterator;
127 typedef typename std::vector<LoopT *>::const_reverse_iterator
129 iterator begin() const { return SubLoops.begin(); }
130 iterator end() const { return SubLoops.end(); }
131 reverse_iterator rbegin() const { return SubLoops.rbegin(); }
132 reverse_iterator rend() const { return SubLoops.rend(); }
133 bool empty() const { return SubLoops.empty(); }
135 /// getBlocks - Get a list of the basic blocks which make up this loop.
137 const std::vector<BlockT*> &getBlocks() const { return Blocks; }
138 std::vector<BlockT*> &getBlocksVector() { return Blocks; }
139 typedef typename std::vector<BlockT*>::const_iterator block_iterator;
140 block_iterator block_begin() const { return Blocks.begin(); }
141 block_iterator block_end() const { return Blocks.end(); }
143 /// getNumBlocks - Get the number of blocks in this loop in constant time.
144 unsigned getNumBlocks() const {
145 return Blocks.size();
148 /// isLoopExiting - True if terminator in the block can branch to another
149 /// block that is outside of the current loop.
151 bool isLoopExiting(const BlockT *BB) const {
152 typedef GraphTraits<BlockT*> BlockTraits;
153 for (typename BlockTraits::ChildIteratorType SI =
154 BlockTraits::child_begin(const_cast<BlockT*>(BB)),
155 SE = BlockTraits::child_end(const_cast<BlockT*>(BB)); SI != SE; ++SI) {
162 /// getNumBackEdges - Calculate the number of back edges to the loop header
164 unsigned getNumBackEdges() const {
165 unsigned NumBackEdges = 0;
166 BlockT *H = getHeader();
168 typedef GraphTraits<Inverse<BlockT*> > InvBlockTraits;
169 for (typename InvBlockTraits::ChildIteratorType I =
170 InvBlockTraits::child_begin(const_cast<BlockT*>(H)),
171 E = InvBlockTraits::child_end(const_cast<BlockT*>(H)); I != E; ++I)
178 //===--------------------------------------------------------------------===//
179 // APIs for simple analysis of the loop.
181 // Note that all of these methods can fail on general loops (ie, there may not
182 // be a preheader, etc). For best success, the loop simplification and
183 // induction variable canonicalization pass should be used to normalize loops
184 // for easy analysis. These methods assume canonical loops.
186 /// getExitingBlocks - Return all blocks inside the loop that have successors
187 /// outside of the loop. These are the blocks _inside of the current loop_
188 /// which branch out. The returned list is always unique.
190 void getExitingBlocks(SmallVectorImpl<BlockT *> &ExitingBlocks) const;
192 /// getExitingBlock - If getExitingBlocks would return exactly one block,
193 /// return that block. Otherwise return null.
194 BlockT *getExitingBlock() const;
196 /// getExitBlocks - Return all of the successor blocks of this loop. These
197 /// are the blocks _outside of the current loop_ which are branched to.
199 void getExitBlocks(SmallVectorImpl<BlockT*> &ExitBlocks) const;
201 /// getExitBlock - If getExitBlocks would return exactly one block,
202 /// return that block. Otherwise return null.
203 BlockT *getExitBlock() const;
206 typedef std::pair<const BlockT*, const BlockT*> Edge;
208 /// getExitEdges - Return all pairs of (_inside_block_,_outside_block_).
209 void getExitEdges(SmallVectorImpl<Edge> &ExitEdges) const;
211 /// getLoopPreheader - If there is a preheader for this loop, return it. A
212 /// loop has a preheader if there is only one edge to the header of the loop
213 /// from outside of the loop. If this is the case, the block branching to the
214 /// header of the loop is the preheader node.
216 /// This method returns null if there is no preheader for the loop.
218 BlockT *getLoopPreheader() const;
220 /// getLoopPredecessor - If the given loop's header has exactly one unique
221 /// predecessor outside the loop, return it. Otherwise return null.
222 /// This is less strict that the loop "preheader" concept, which requires
223 /// the predecessor to have exactly one successor.
225 BlockT *getLoopPredecessor() const;
227 /// getLoopLatch - If there is a single latch block for this loop, return it.
228 /// A latch block is a block that contains a branch back to the header.
229 BlockT *getLoopLatch() const;
231 //===--------------------------------------------------------------------===//
232 // APIs for updating loop information after changing the CFG
235 /// addBasicBlockToLoop - This method is used by other analyses to update loop
236 /// information. NewBB is set to be a new member of the current loop.
237 /// Because of this, it is added as a member of all parent loops, and is added
238 /// to the specified LoopInfo object as being in the current basic block. It
239 /// is not valid to replace the loop header with this method.
241 void addBasicBlockToLoop(BlockT *NewBB, LoopInfoBase<BlockT, LoopT> &LI);
243 /// replaceChildLoopWith - This is used when splitting loops up. It replaces
244 /// the OldChild entry in our children list with NewChild, and updates the
245 /// parent pointer of OldChild to be null and the NewChild to be this loop.
246 /// This updates the loop depth of the new child.
247 void replaceChildLoopWith(LoopT *OldChild, LoopT *NewChild);
249 /// addChildLoop - Add the specified loop to be a child of this loop. This
250 /// updates the loop depth of the new child.
252 void addChildLoop(LoopT *NewChild) {
253 assert(NewChild->ParentLoop == 0 && "NewChild already has a parent!");
254 NewChild->ParentLoop = static_cast<LoopT *>(this);
255 SubLoops.push_back(NewChild);
258 /// removeChildLoop - This removes the specified child from being a subloop of
259 /// this loop. The loop is not deleted, as it will presumably be inserted
260 /// into another loop.
261 LoopT *removeChildLoop(iterator I) {
262 assert(I != SubLoops.end() && "Cannot remove end iterator!");
264 assert(Child->ParentLoop == this && "Child is not a child of this loop!");
265 SubLoops.erase(SubLoops.begin()+(I-begin()));
266 Child->ParentLoop = 0;
270 /// addBlockEntry - This adds a basic block directly to the basic block list.
271 /// This should only be used by transformations that create new loops. Other
272 /// transformations should use addBasicBlockToLoop.
273 void addBlockEntry(BlockT *BB) {
274 Blocks.push_back(BB);
277 /// moveToHeader - This method is used to move BB (which must be part of this
278 /// loop) to be the loop header of the loop (the block that dominates all
280 void moveToHeader(BlockT *BB) {
281 if (Blocks[0] == BB) return;
282 for (unsigned i = 0; ; ++i) {
283 assert(i != Blocks.size() && "Loop does not contain BB!");
284 if (Blocks[i] == BB) {
285 Blocks[i] = Blocks[0];
292 /// removeBlockFromLoop - This removes the specified basic block from the
293 /// current loop, updating the Blocks as appropriate. This does not update
294 /// the mapping in the LoopInfo class.
295 void removeBlockFromLoop(BlockT *BB) {
296 RemoveFromVector(Blocks, BB);
299 /// verifyLoop - Verify loop structure
300 void verifyLoop() const;
302 /// verifyLoop - Verify loop structure of this loop and all nested loops.
303 void verifyLoopNest(DenseSet<const LoopT*> *Loops) const;
305 void print(raw_ostream &OS, unsigned Depth = 0) const;
308 friend class LoopInfoBase<BlockT, LoopT>;
309 explicit LoopBase(BlockT *BB) : ParentLoop(0) {
310 Blocks.push_back(BB);
314 template<class BlockT, class LoopT>
315 raw_ostream& operator<<(raw_ostream &OS, const LoopBase<BlockT, LoopT> &Loop) {
320 // Implementation in LoopInfoImpl.h
322 __extension__ extern template class LoopBase<BasicBlock, Loop>;
325 class Loop : public LoopBase<BasicBlock, Loop> {
329 /// isLoopInvariant - Return true if the specified value is loop invariant
331 bool isLoopInvariant(Value *V) const;
333 /// hasLoopInvariantOperands - Return true if all the operands of the
334 /// specified instruction are loop invariant.
335 bool hasLoopInvariantOperands(Instruction *I) const;
337 /// makeLoopInvariant - If the given value is an instruction inside of the
338 /// loop and it can be hoisted, do so to make it trivially loop-invariant.
339 /// Return true if the value after any hoisting is loop invariant. This
340 /// function can be used as a slightly more aggressive replacement for
343 /// If InsertPt is specified, it is the point to hoist instructions to.
344 /// If null, the terminator of the loop preheader is used.
346 bool makeLoopInvariant(Value *V, bool &Changed,
347 Instruction *InsertPt = 0) const;
349 /// makeLoopInvariant - If the given instruction is inside of the
350 /// loop and it can be hoisted, do so to make it trivially loop-invariant.
351 /// Return true if the instruction after any hoisting is loop invariant. This
352 /// function can be used as a slightly more aggressive replacement for
355 /// If InsertPt is specified, it is the point to hoist instructions to.
356 /// If null, the terminator of the loop preheader is used.
358 bool makeLoopInvariant(Instruction *I, bool &Changed,
359 Instruction *InsertPt = 0) const;
361 /// getCanonicalInductionVariable - Check to see if the loop has a canonical
362 /// induction variable: an integer recurrence that starts at 0 and increments
363 /// by one each time through the loop. If so, return the phi node that
364 /// corresponds to it.
366 /// The IndVarSimplify pass transforms loops to have a canonical induction
369 PHINode *getCanonicalInductionVariable() const;
371 /// isLCSSAForm - Return true if the Loop is in LCSSA form
372 bool isLCSSAForm(DominatorTree &DT) const;
374 /// isLoopSimplifyForm - Return true if the Loop is in the form that
375 /// the LoopSimplify form transforms loops to, which is sometimes called
377 bool isLoopSimplifyForm() const;
379 /// isSafeToClone - Return true if the loop body is safe to clone in practice.
380 bool isSafeToClone() const;
382 /// hasDedicatedExits - Return true if no exit block for the loop
383 /// has a predecessor that is outside the loop.
384 bool hasDedicatedExits() const;
386 /// getUniqueExitBlocks - Return all unique successor blocks of this loop.
387 /// These are the blocks _outside of the current loop_ which are branched to.
388 /// This assumes that loop exits are in canonical form.
390 void getUniqueExitBlocks(SmallVectorImpl<BasicBlock *> &ExitBlocks) const;
392 /// getUniqueExitBlock - If getUniqueExitBlocks would return exactly one
393 /// block, return that block. Otherwise return null.
394 BasicBlock *getUniqueExitBlock() const;
399 friend class LoopInfoBase<BasicBlock, Loop>;
400 explicit Loop(BasicBlock *BB) : LoopBase<BasicBlock, Loop>(BB) {}
403 //===----------------------------------------------------------------------===//
404 /// LoopInfo - This class builds and contains all of the top level loop
405 /// structures in the specified function.
408 template<class BlockT, class LoopT>
410 // BBMap - Mapping of basic blocks to the inner most loop they occur in
411 DenseMap<BlockT *, LoopT *> BBMap;
412 std::vector<LoopT *> TopLevelLoops;
413 friend class LoopBase<BlockT, LoopT>;
414 friend class LoopInfo;
416 void operator=(const LoopInfoBase &) LLVM_DELETED_FUNCTION;
417 LoopInfoBase(const LoopInfo &) LLVM_DELETED_FUNCTION;
420 ~LoopInfoBase() { releaseMemory(); }
422 void releaseMemory() {
423 for (typename std::vector<LoopT *>::iterator I =
424 TopLevelLoops.begin(), E = TopLevelLoops.end(); I != E; ++I)
425 delete *I; // Delete all of the loops...
427 BBMap.clear(); // Reset internal state of analysis
428 TopLevelLoops.clear();
431 /// iterator/begin/end - The interface to the top-level loops in the current
434 typedef typename std::vector<LoopT *>::const_iterator iterator;
435 typedef typename std::vector<LoopT *>::const_reverse_iterator
437 iterator begin() const { return TopLevelLoops.begin(); }
438 iterator end() const { return TopLevelLoops.end(); }
439 reverse_iterator rbegin() const { return TopLevelLoops.rbegin(); }
440 reverse_iterator rend() const { return TopLevelLoops.rend(); }
441 bool empty() const { return TopLevelLoops.empty(); }
443 /// getLoopFor - Return the inner most loop that BB lives in. If a basic
444 /// block is in no loop (for example the entry node), null is returned.
446 LoopT *getLoopFor(const BlockT *BB) const {
447 return BBMap.lookup(const_cast<BlockT*>(BB));
450 /// operator[] - same as getLoopFor...
452 const LoopT *operator[](const BlockT *BB) const {
453 return getLoopFor(BB);
456 /// getLoopDepth - Return the loop nesting level of the specified block. A
457 /// depth of 0 means the block is not inside any loop.
459 unsigned getLoopDepth(const BlockT *BB) const {
460 const LoopT *L = getLoopFor(BB);
461 return L ? L->getLoopDepth() : 0;
464 // isLoopHeader - True if the block is a loop header node
465 bool isLoopHeader(BlockT *BB) const {
466 const LoopT *L = getLoopFor(BB);
467 return L && L->getHeader() == BB;
470 /// removeLoop - This removes the specified top-level loop from this loop info
471 /// object. The loop is not deleted, as it will presumably be inserted into
473 LoopT *removeLoop(iterator I) {
474 assert(I != end() && "Cannot remove end iterator!");
476 assert(L->getParentLoop() == 0 && "Not a top-level loop!");
477 TopLevelLoops.erase(TopLevelLoops.begin() + (I-begin()));
481 /// changeLoopFor - Change the top-level loop that contains BB to the
482 /// specified loop. This should be used by transformations that restructure
483 /// the loop hierarchy tree.
484 void changeLoopFor(BlockT *BB, LoopT *L) {
492 /// changeTopLevelLoop - Replace the specified loop in the top-level loops
493 /// list with the indicated loop.
494 void changeTopLevelLoop(LoopT *OldLoop,
496 typename std::vector<LoopT *>::iterator I =
497 std::find(TopLevelLoops.begin(), TopLevelLoops.end(), OldLoop);
498 assert(I != TopLevelLoops.end() && "Old loop not at top level!");
500 assert(NewLoop->ParentLoop == 0 && OldLoop->ParentLoop == 0 &&
501 "Loops already embedded into a subloop!");
504 /// addTopLevelLoop - This adds the specified loop to the collection of
506 void addTopLevelLoop(LoopT *New) {
507 assert(New->getParentLoop() == 0 && "Loop already in subloop!");
508 TopLevelLoops.push_back(New);
511 /// removeBlock - This method completely removes BB from all data structures,
512 /// including all of the Loop objects it is nested in and our mapping from
513 /// BasicBlocks to loops.
514 void removeBlock(BlockT *BB) {
515 typename DenseMap<BlockT *, LoopT *>::iterator I = BBMap.find(BB);
516 if (I != BBMap.end()) {
517 for (LoopT *L = I->second; L; L = L->getParentLoop())
518 L->removeBlockFromLoop(BB);
526 static bool isNotAlreadyContainedIn(const LoopT *SubLoop,
527 const LoopT *ParentLoop) {
528 if (SubLoop == 0) return true;
529 if (SubLoop == ParentLoop) return false;
530 return isNotAlreadyContainedIn(SubLoop->getParentLoop(), ParentLoop);
533 /// Create the loop forest using a stable algorithm.
534 void Analyze(DominatorTreeBase<BlockT> &DomTree);
538 void print(raw_ostream &OS) const;
541 // Implementation in LoopInfoImpl.h
543 __extension__ extern template class LoopInfoBase<BasicBlock, Loop>;
546 class LoopInfo : public FunctionPass {
547 LoopInfoBase<BasicBlock, Loop> LI;
548 friend class LoopBase<BasicBlock, Loop>;
550 void operator=(const LoopInfo &) LLVM_DELETED_FUNCTION;
551 LoopInfo(const LoopInfo &) LLVM_DELETED_FUNCTION;
553 static char ID; // Pass identification, replacement for typeid
555 LoopInfo() : FunctionPass(ID) {
556 initializeLoopInfoPass(*PassRegistry::getPassRegistry());
559 LoopInfoBase<BasicBlock, Loop>& getBase() { return LI; }
561 /// iterator/begin/end - The interface to the top-level loops in the current
564 typedef LoopInfoBase<BasicBlock, Loop>::iterator iterator;
565 typedef LoopInfoBase<BasicBlock, Loop>::reverse_iterator reverse_iterator;
566 inline iterator begin() const { return LI.begin(); }
567 inline iterator end() const { return LI.end(); }
568 inline reverse_iterator rbegin() const { return LI.rbegin(); }
569 inline reverse_iterator rend() const { return LI.rend(); }
570 bool empty() const { return LI.empty(); }
572 /// getLoopFor - Return the inner most loop that BB lives in. If a basic
573 /// block is in no loop (for example the entry node), null is returned.
575 inline Loop *getLoopFor(const BasicBlock *BB) const {
576 return LI.getLoopFor(BB);
579 /// operator[] - same as getLoopFor...
581 inline const Loop *operator[](const BasicBlock *BB) const {
582 return LI.getLoopFor(BB);
585 /// getLoopDepth - Return the loop nesting level of the specified block. A
586 /// depth of 0 means the block is not inside any loop.
588 inline unsigned getLoopDepth(const BasicBlock *BB) const {
589 return LI.getLoopDepth(BB);
592 // isLoopHeader - True if the block is a loop header node
593 inline bool isLoopHeader(BasicBlock *BB) const {
594 return LI.isLoopHeader(BB);
597 /// runOnFunction - Calculate the natural loop information.
599 virtual bool runOnFunction(Function &F);
601 virtual void verifyAnalysis() const;
603 virtual void releaseMemory() { LI.releaseMemory(); }
605 virtual void print(raw_ostream &O, const Module* M = 0) const;
607 virtual void getAnalysisUsage(AnalysisUsage &AU) const;
609 /// removeLoop - This removes the specified top-level loop from this loop info
610 /// object. The loop is not deleted, as it will presumably be inserted into
612 inline Loop *removeLoop(iterator I) { return LI.removeLoop(I); }
614 /// changeLoopFor - Change the top-level loop that contains BB to the
615 /// specified loop. This should be used by transformations that restructure
616 /// the loop hierarchy tree.
617 inline void changeLoopFor(BasicBlock *BB, Loop *L) {
618 LI.changeLoopFor(BB, L);
621 /// changeTopLevelLoop - Replace the specified loop in the top-level loops
622 /// list with the indicated loop.
623 inline void changeTopLevelLoop(Loop *OldLoop, Loop *NewLoop) {
624 LI.changeTopLevelLoop(OldLoop, NewLoop);
627 /// addTopLevelLoop - This adds the specified loop to the collection of
629 inline void addTopLevelLoop(Loop *New) {
630 LI.addTopLevelLoop(New);
633 /// removeBlock - This method completely removes BB from all data structures,
634 /// including all of the Loop objects it is nested in and our mapping from
635 /// BasicBlocks to loops.
636 void removeBlock(BasicBlock *BB) {
640 /// updateUnloop - Update LoopInfo after removing the last backedge from a
641 /// loop--now the "unloop". This updates the loop forest and parent loops for
642 /// each block so that Unloop is no longer referenced, but the caller must
643 /// actually delete the Unloop object.
644 void updateUnloop(Loop *Unloop);
646 /// replacementPreservesLCSSAForm - Returns true if replacing From with To
647 /// everywhere is guaranteed to preserve LCSSA form.
648 bool replacementPreservesLCSSAForm(Instruction *From, Value *To) {
649 // Preserving LCSSA form is only problematic if the replacing value is an
651 Instruction *I = dyn_cast<Instruction>(To);
653 // If both instructions are defined in the same basic block then replacement
654 // cannot break LCSSA form.
655 if (I->getParent() == From->getParent())
657 // If the instruction is not defined in a loop then it can safely replace
659 Loop *ToLoop = getLoopFor(I->getParent());
660 if (!ToLoop) return true;
661 // If the replacing instruction is defined in the same loop as the original
662 // instruction, or in a loop that contains it as an inner loop, then using
663 // it as a replacement will not break LCSSA form.
664 return ToLoop->contains(getLoopFor(From->getParent()));
669 // Allow clients to walk the list of nested loops...
670 template <> struct GraphTraits<const Loop*> {
671 typedef const Loop NodeType;
672 typedef LoopInfo::iterator ChildIteratorType;
674 static NodeType *getEntryNode(const Loop *L) { return L; }
675 static inline ChildIteratorType child_begin(NodeType *N) {
678 static inline ChildIteratorType child_end(NodeType *N) {
683 template <> struct GraphTraits<Loop*> {
684 typedef Loop NodeType;
685 typedef LoopInfo::iterator ChildIteratorType;
687 static NodeType *getEntryNode(Loop *L) { return L; }
688 static inline ChildIteratorType child_begin(NodeType *N) {
691 static inline ChildIteratorType child_end(NodeType *N) {
696 } // End llvm namespace