diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2016-07-01 01:27:19 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2016-07-01 01:27:19 +0000 |
commit | 1df1d1dcfcb146d425793953dc46f56915661164 (patch) | |
tree | 13cf50add7cb2ebac552c5c9ad4d447a45f2452a /llvm/lib | |
parent | 6ad68551c3fbf780f91a3351e0704a7707fc19cf (diff) | |
download | bcm5719-llvm-1df1d1dcfcb146d425793953dc46f56915661164.tar.gz bcm5719-llvm-1df1d1dcfcb146d425793953dc46f56915661164.zip |
CodeGen: Remove implicit iterator conversions in PHIElimination, NFC
llvm-svn: 274317
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/PHIElimination.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/PHIElimination.cpp b/llvm/lib/CodeGen/PHIElimination.cpp index c65a5a7100d..f593fafe774 100644 --- a/llvm/lib/CodeGen/PHIElimination.cpp +++ b/llvm/lib/CodeGen/PHIElimination.cpp @@ -227,7 +227,7 @@ void PHIElimination::LowerPHINode(MachineBasicBlock &MBB, MachineBasicBlock::iterator AfterPHIsIt = std::next(LastPHIIt); // Unlink the PHI node from the basic block, but don't delete the PHI yet. - MachineInstr *MPhi = MBB.remove(MBB.begin()); + MachineInstr *MPhi = MBB.remove(&*MBB.begin()); unsigned NumSrcs = (MPhi->getNumOperands() - 1) / 2; unsigned DestReg = MPhi->getOperand(0).getReg(); @@ -269,7 +269,7 @@ void PHIElimination::LowerPHINode(MachineBasicBlock &MBB, // Update live variable information if there is any. if (LV) { - MachineInstr *PHICopy = std::prev(AfterPHIsIt); + MachineInstr &PHICopy = *std::prev(AfterPHIsIt); if (IncomingReg) { LiveVariables::VarInfo &VI = LV->getVarInfo(IncomingReg); @@ -291,7 +291,7 @@ void PHIElimination::LowerPHINode(MachineBasicBlock &MBB, // killed. Note that because the value is defined in several places (once // each for each incoming block), the "def" block and instruction fields // for the VarInfo is not filled in. - LV->addVirtualRegisterKilled(IncomingReg, PHICopy); + LV->addVirtualRegisterKilled(IncomingReg, &PHICopy); } // Since we are going to be deleting the PHI node, if it is the last use of @@ -301,15 +301,15 @@ void PHIElimination::LowerPHINode(MachineBasicBlock &MBB, // If the result is dead, update LV. if (isDead) { - LV->addVirtualRegisterDead(DestReg, PHICopy); + LV->addVirtualRegisterDead(DestReg, &PHICopy); LV->removeVirtualRegisterDead(DestReg, MPhi); } } // Update LiveIntervals for the new copy or implicit def. if (LIS) { - MachineInstr *NewInstr = std::prev(AfterPHIsIt); - SlotIndex DestCopyIndex = LIS->InsertMachineInstrInMaps(*NewInstr); + SlotIndex DestCopyIndex = + LIS->InsertMachineInstrInMaps(*std::prev(AfterPHIsIt)); SlotIndex MBBStartIndex = LIS->getMBBStartIdx(&MBB); if (IncomingReg) { @@ -452,7 +452,7 @@ void PHIElimination::LowerPHINode(MachineBasicBlock &MBB, assert(KillInst->readsRegister(SrcReg) && "Cannot find kill instruction"); // Finally, mark it killed. - LV->addVirtualRegisterKilled(SrcReg, KillInst); + LV->addVirtualRegisterKilled(SrcReg, &*KillInst); // This vreg no longer lives all of the way through opBlock. unsigned opBlockNum = opBlock.getNumber(); |