mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-23 03:59:12 +00:00
Inform ScalarEvolutions that we're deleting Values.
This is the obviously correct part of the fix for PR1487. llvm-svn: 37457
This commit is contained in:
parent
4c42a30bad
commit
65199a504b
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user