summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/Reassociate.cpp
diff options
context:
space:
mode:
authorDavide Italiano <davide@freebsd.org>2016-10-28 02:47:09 +0000
committerDavide Italiano <davide@freebsd.org>2016-10-28 02:47:09 +0000
commit631cd27f29607272d58d32b3978bde69b814d2c7 (patch)
tree6c26800c30d464e50ef51c7881a2d1eb9c4aab05 /llvm/lib/Transforms/Scalar/Reassociate.cpp
parent02563cd3a6150c829d050ad64217a2a91d397534 (diff)
downloadbcm5719-llvm-631cd27f29607272d58d32b3978bde69b814d2c7.tar.gz
bcm5719-llvm-631cd27f29607272d58d32b3978bde69b814d2c7.zip
[Reassociate] Removing instructions mutates the IR.
Fixes PR 30784. Discussed with Justin, who pointed out that in the new PassManager infrastructure we can have more fine-grained control on which analyses we want to preserve, but this is the best we can do with the current infrastructure. llvm-svn: 285380
Diffstat (limited to 'llvm/lib/Transforms/Scalar/Reassociate.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/Reassociate.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/Reassociate.cpp b/llvm/lib/Transforms/Scalar/Reassociate.cpp
index 1ec7fcea109..ac0d7b8f1dd 100644
--- a/llvm/lib/Transforms/Scalar/Reassociate.cpp
+++ b/llvm/lib/Transforms/Scalar/Reassociate.cpp
@@ -2198,8 +2198,10 @@ PreservedAnalyses ReassociatePass::run(Function &F, FunctionAnalysisManager &) {
// trivially dead instructions have been removed.
while (!ToRedo.empty()) {
Instruction *I = ToRedo.pop_back_val();
- if (isInstructionTriviallyDead(I))
+ if (isInstructionTriviallyDead(I)) {
RecursivelyEraseDeadInsts(I, ToRedo);
+ MadeChange = true;
+ }
}
// Now that we have removed dead instructions, we can reoptimize the
OpenPOWER on IntegriCloud