diff options
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUtils.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LoopUtils.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopUtils.cpp b/llvm/lib/Transforms/Utils/LoopUtils.cpp index 9a4289e..7004727 100644 --- a/llvm/lib/Transforms/Utils/LoopUtils.cpp +++ b/llvm/lib/Transforms/Utils/LoopUtils.cpp @@ -445,21 +445,22 @@ TransformationMode llvm::hasLICMVersioningTransformation(const Loop *L) { } /// Does a BFS from a given node to all of its children inside a given loop. -/// The returned vector of nodes includes the starting point. -SmallVector<DomTreeNode *, 16> -llvm::collectChildrenInLoop(DomTreeNode *N, const Loop *CurLoop) { - SmallVector<DomTreeNode *, 16> Worklist; +/// The returned vector of basic blocks includes the starting point. +SmallVector<BasicBlock *, 16> llvm::collectChildrenInLoop(DominatorTree *DT, + DomTreeNode *N, + const Loop *CurLoop) { + SmallVector<BasicBlock *, 16> Worklist; auto AddRegionToWorklist = [&](DomTreeNode *DTN) { // Only include subregions in the top level loop. BasicBlock *BB = DTN->getBlock(); if (CurLoop->contains(BB)) - Worklist.push_back(DTN); + Worklist.push_back(DTN->getBlock()); }; AddRegionToWorklist(N); for (size_t I = 0; I < Worklist.size(); I++) { - for (DomTreeNode *Child : Worklist[I]->children()) + for (DomTreeNode *Child : DT->getNode(Worklist[I])->children()) AddRegionToWorklist(Child); } |