aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/LoopUtils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUtils.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/LoopUtils.cpp13
1 files changed, 1 insertions, 12 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopUtils.cpp b/llvm/lib/Transforms/Utils/LoopUtils.cpp
index 2340e8c..68ef0fe4 100644
--- a/llvm/lib/Transforms/Utils/LoopUtils.cpp
+++ b/llvm/lib/Transforms/Utils/LoopUtils.cpp
@@ -673,18 +673,7 @@ void llvm::deleteDeadLoop(Loop *L, DominatorTree *DT = nullptr,
LI->removeBlock(BB);
// The last step is to update LoopInfo now that we've eliminated this loop.
- // Note: LoopInfo::erase remove the given loop and relink its subloops with
- // its parent. While removeLoop/removeChildLoop remove the given loop but
- // not relink its subloops, which is what we want.
- if (Loop *ParentLoop = L->getParentLoop()) {
- Loop::iterator I = find(ParentLoop->begin(), ParentLoop->end(), L);
- assert(I != ParentLoop->end() && "Couldn't find loop");
- ParentLoop->removeChildLoop(I);
- } else {
- Loop::iterator I = find(LI->begin(), LI->end(), L);
- assert(I != LI->end() && "Couldn't find loop");
- LI->removeLoop(I);
- }
+ LI->erase(L);
}
}