summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils
diff options
context:
space:
mode:
authorWhitney Tsang <whitneyt@ca.ibm.com>2019-12-17 03:50:03 +0000
committerWhitney Tsang <whitneyt@ca.ibm.com>2019-12-17 03:51:41 +0000
commitec4749e3b8d0366b11eb01d513608a823871f58e (patch)
tree90fb43ca227b5fbc214d04d9042bf481553b4d10 /llvm/lib/Transforms/Utils
parent0bc3336ac168f52b6a6e3297a9cc3eb579f047f4 (diff)
downloadbcm5719-llvm-ec4749e3b8d0366b11eb01d513608a823871f58e.tar.gz
bcm5719-llvm-ec4749e3b8d0366b11eb01d513608a823871f58e.zip
Revert "[LoopUtils] Updated deleteDeadLoop() to handle loop nest."
This reverts commit cd09fee3d63296dd2df0bbb1fae363ca9f311d44. This reverts commit c066ff11d84a7797503ad5a44c4129136926dc85.
Diffstat (limited to 'llvm/lib/Transforms/Utils')
-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 2340e8c72e1..68ef0fe4071 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);
}
}
OpenPOWER on IntegriCloud