summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2011-04-02 22:45:17 +0000
committerEli Friedman <eli.friedman@gmail.com>2011-04-02 22:45:17 +0000
commit17bf4922c9c6d9e12c1e13c09e16a6058fd24b7f (patch)
treecc633ffcf063402fdd68912f385819c3c6a08160 /llvm/lib/Transforms/Utils
parent8baa2c7ad937a4a5bea7f368cc83b4dbce5295a3 (diff)
downloadbcm5719-llvm-17bf4922c9c6d9e12c1e13c09e16a6058fd24b7f.tar.gz
bcm5719-llvm-17bf4922c9c6d9e12c1e13c09e16a6058fd24b7f.zip
PR9446: RecursivelyDeleteTriviallyDeadInstructions can delete the instruction
after the given instruction; make sure to handle that case correctly. (It's difficult to trigger; the included testcase involves a dead block, but I don't think that's a requirement.) While I'm here, get rid of the unnecessary warning about SimplifyInstructionsInBlock, since it should work correctly as far as I know. llvm-svn: 128782
Diffstat (limited to 'llvm/lib/Transforms/Utils')
-rw-r--r--llvm/lib/Transforms/Utils/Local.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index 47ef1c91749..26ae295d5dc 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -332,8 +332,11 @@ bool llvm::SimplifyInstructionsInBlock(BasicBlock *BB, const TargetData *TD) {
BI = BB->begin();
continue;
}
-
+
+ WeakVH BIHandle(BI);
MadeChange |= RecursivelyDeleteTriviallyDeadInstructions(Inst);
+ if (BIHandle != BI)
+ BI = BB->begin();
}
return MadeChange;
}
OpenPOWER on IntegriCloud