CodeGen: Use MachineInstr& in PostRASchedulerList, NFC

Remove another unnecessary iterator to pointer conversion.

llvm-svn: 274315
This commit is contained in:
Duncan P. N. Exon Smith 2016-07-01 01:18:53 +00:00
parent 5d8006d24d
commit 762c5ca3ee
1 changed files with 6 additions and 6 deletions

View File

@ -335,24 +335,24 @@ bool PostRAScheduler::runOnMachineFunction(MachineFunction &Fn) {
MachineBasicBlock::iterator Current = MBB.end();
unsigned Count = MBB.size(), CurrentCount = Count;
for (MachineBasicBlock::iterator I = Current; I != MBB.begin();) {
MachineInstr *MI = std::prev(I);
MachineInstr &MI = *std::prev(I);
--Count;
// Calls are not scheduling boundaries before register allocation, but
// post-ra we don't gain anything by scheduling across calls since we
// don't need to worry about register pressure.
if (MI->isCall() || TII->isSchedulingBoundary(*MI, &MBB, Fn)) {
if (MI.isCall() || TII->isSchedulingBoundary(MI, &MBB, Fn)) {
Scheduler.enterRegion(&MBB, I, Current, CurrentCount - Count);
Scheduler.setEndIndex(CurrentCount);
Scheduler.schedule();
Scheduler.exitRegion();
Scheduler.EmitSchedule();
Current = MI;
Current = &MI;
CurrentCount = Count;
Scheduler.Observe(*MI, CurrentCount);
Scheduler.Observe(MI, CurrentCount);
}
I = MI;
if (MI->isBundle())
Count -= MI->getBundleSize();
if (MI.isBundle())
Count -= MI.getBundleSize();
}
assert(Count == 0 && "Instruction count mismatch!");
assert((MBB.begin() == Current || CurrentCount != 0) &&