diff options
| author | Nick Lewycky <nicholas@mxc.ca> | 2007-06-06 03:51:56 +0000 |
|---|---|---|
| committer | Nick Lewycky <nicholas@mxc.ca> | 2007-06-06 03:51:56 +0000 |
| commit | 91ed6efc247c20b29df2f87ee29efba8d2b0ca3b (patch) | |
| tree | 075e7b35e102616ff6b09d701e73eb9ecbee184d /llvm/lib | |
| parent | e4ec918be024f173368d6e4697939ddbaf48b32b (diff) | |
| download | bcm5719-llvm-91ed6efc247c20b29df2f87ee29efba8d2b0ca3b.tar.gz bcm5719-llvm-91ed6efc247c20b29df2f87ee29efba8d2b0ca3b.zip | |
Inform ScalarEvolutions that we're deleting Values.
This is the obviously correct part of the fix for PR1487.
llvm-svn: 37457
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/IndVarSimplify.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp index 20eb3a85215..8042d62581b 100644 --- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -181,6 +181,7 @@ void IndVarSimplify::EliminatePointerRecurrence(PHINode *PN, GetElementPtrInst *NGEPI = new GetElementPtrInst( NCE, Constant::getNullValue(Type::Int32Ty), NewAdd, GEPI->getName(), GEPI); + SE->deleteInstructionFromRecords(GEPI); GEPI->replaceAllUsesWith(NGEPI); GEPI->eraseFromParent(); GEPI = NGEPI; @@ -398,6 +399,7 @@ void IndVarSimplify::RewriteLoopExitValues(Loop *L) { // the PHI entirely. This is safe, because the NewVal won't be variant // in the loop, so we don't need an LCSSA phi node anymore. if (NumPreds == 1) { + SE->deleteInstructionFromRecords(PN); PN->replaceAllUsesWith(ExitVal); PN->eraseFromParent(); break; |

