mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-19 17:33:29 +00:00
While removing PHI, use basicblock to identify incoming value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55678 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
cb7f483d8c
commit
c72139134c
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user