1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00

While removing PHI, use basicblock to identify incoming value.

llvm-svn: 55678
This commit is contained in:
Devang Patel 2008-09-03 00:02:42 +00:00
parent 5659d2508e
commit df5dce4aa8

View File

@ -1909,6 +1909,7 @@ BinaryOperator *getNewPHIIncrement(BinaryOperator *Incr, PHINode *PHI,
void LoopStrengthReduce::OptimizeIVType(Loop *L) {
BasicBlock *LPH = L->getLoopPreheader();
BasicBlock *LatchBB = L->getLoopLatch();
SmallVector<PHINode *, 4> PHIs;
for (BasicBlock::iterator BI = L->getHeader()->begin(),
BE = L->getHeader()->end(); BI != BE; ++BI) {
@ -2000,8 +2001,8 @@ void LoopStrengthReduce::OptimizeIVType(Loop *L) {
// Remove old PHI and increment instruction.
SE->deleteValueFromRecords(PHI);
PHI->removeIncomingValue(Entry);
PHI->removeIncomingValue(Latch);
PHI->removeIncomingValue(LatchBB);
PHI->removeIncomingValue(LPH);
SE->deleteValueFromRecords(Incr);
Incr->eraseFromParent();
}