[llvm] r274315 - CodeGen: Use MachineInstr& in PostRASchedulerList, NFC
Duncan P. N. Exon Smith via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 30 18:18:54 PDT 2016
Author: dexonsmith
Date: Thu Jun 30 20:18:53 2016
New Revision: 274315
URL: http://llvm.org/viewvc/llvm-project?rev=274315&view=rev
Log:
CodeGen: Use MachineInstr& in PostRASchedulerList, NFC
Remove another unnecessary iterator to pointer conversion.
Modified:
llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp
Modified: llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp?rev=274315&r1=274314&r2=274315&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp (original)
+++ llvm/trunk/lib/CodeGen/PostRASchedulerList.cpp Thu Jun 30 20:18:53 2016
@@ -335,24 +335,24 @@ bool PostRAScheduler::runOnMachineFuncti
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) &&
More information about the llvm-commits
mailing list