summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorTorok Edwin <edwintorok@gmail.com>2009-05-24 14:23:16 +0000
committerTorok Edwin <edwintorok@gmail.com>2009-05-24 14:23:16 +0000
commitd184bc209c2663b74b63d5f2c4d774823e285c4d (patch)
tree10250e335f48f1f8cb2b5782dfb0d4ee8b662bff /llvm/lib/Transforms
parentfe87034cefd09c87ce90b00ac23bf28b0e714465 (diff)
downloadbcm5719-llvm-d184bc209c2663b74b63d5f2c4d774823e285c4d.tar.gz
bcm5719-llvm-d184bc209c2663b74b63d5f2c4d774823e285c4d.zip
The rewriter may hold references to instructions that are deleted because they are trivially dead.
Fix by clearing the rewriter cache before deleting the trivially dead instructions. Also make InsertedExpressions use an AssertingVH to catch these bugs easier. llvm-svn: 72364
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/IndVarSimplify.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
index 89742c55d64..670499062ec 100644
--- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
@@ -298,6 +298,7 @@ void IndVarSimplify::RewriteLoopExitValues(Loop *L,
// in the loop, so we don't need an LCSSA phi node anymore.
if (NumPreds == 1) {
PN->replaceAllUsesWith(ExitVal);
+ Rewriter.clear();
RecursivelyDeleteTriviallyDeadInstructions(PN);
break;
}
@@ -418,6 +419,7 @@ bool IndVarSimplify::runOnLoop(Loop *L, LPPassManager &LPM) {
// Reorder instructions to avoid use-before-def conditions.
FixUsesBeforeDefs(L, Rewriter);
+ Rewriter.clear();
// For completeness, inform IVUsers of the IV use in the newly-created
// loop exit test instruction.
if (NewICmp)
OpenPOWER on IntegriCloud