aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Scalar/LoopDeletion.cpp
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2015-12-16 18:40:20 +0000
committerJustin Bogner <mail@justinbogner.com>2015-12-16 18:40:20 +0000
commit883a3ea67f5f64f08fefe62f9430ea7e3b665fa1 (patch)
treef7e949d42bdaceddf268f113fac5cf0f5d63c2da /llvm/lib/Transforms/Scalar/LoopDeletion.cpp
parente05ff151866610c53a8730a51a5cabef3cc09138 (diff)
downloadllvm-883a3ea67f5f64f08fefe62f9430ea7e3b665fa1.zip
llvm-883a3ea67f5f64f08fefe62f9430ea7e3b665fa1.tar.gz
llvm-883a3ea67f5f64f08fefe62f9430ea7e3b665fa1.tar.bz2
LPM: Make callers of LPM.deleteLoopFromQueue update LoopInfo directly. NFC
As of r255720, the loop pass manager will DTRT when passes update the loop info for removed loops, so they no longer need to reach into LPPassManager APIs to do this kind of transformation. This change very nearly removes the need for the LPPassManager to even be passed into loop passes - the only remaining pass that uses the LPM argument is LoopUnswitch. llvm-svn: 255797
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopDeletion.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopDeletion.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopDeletion.cpp b/llvm/lib/Transforms/Scalar/LoopDeletion.cpp
index 4971ab8..bc00ff3 100644
--- a/llvm/lib/Transforms/Scalar/LoopDeletion.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopDeletion.cpp
@@ -36,7 +36,7 @@ namespace {
}
// Possibly eliminate loop L if it is dead.
- bool runOnLoop(Loop *L, LPPassManager &LPM) override;
+ bool runOnLoop(Loop *L, LPPassManager &) override;
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.addRequired<DominatorTreeWrapperPass>();
@@ -132,7 +132,7 @@ bool LoopDeletion::isLoopDead(Loop *L,
/// so could change the halting/non-halting nature of a program.
/// NOTE: This entire process relies pretty heavily on LoopSimplify and LCSSA
/// in order to make various safety checks work.
-bool LoopDeletion::runOnLoop(Loop *L, LPPassManager &LPM) {
+bool LoopDeletion::runOnLoop(Loop *L, LPPassManager &) {
if (skipOptnoneFunction(L))
return false;
@@ -244,9 +244,8 @@ bool LoopDeletion::runOnLoop(Loop *L, LPPassManager &LPM) {
for (BasicBlock *BB : blocks)
loopInfo.removeBlock(BB);
- // The last step is to inform the loop pass manager that we've
- // eliminated this loop.
- LPM.deleteLoopFromQueue(L);
+ // The last step is to update LoopInfo now that we've eliminated this loop.
+ loopInfo.updateUnloop(L);
Changed = true;
++NumDeleted;