Sfoglia il codice sorgente

CodeGen: Use MachineInstr& in PostRASchedulerList, NFC

Remove another unnecessary iterator to pointer conversion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274315 91177308-0d34-0410-b5e6-96231b3b80d8
Duncan P. N. Exon Smith 9 anni fa
parent
commit
e16c630f4a
1 ha cambiato i file con 6 aggiunte e 6 eliminazioni
  1. 6 6
      lib/CodeGen/PostRASchedulerList.cpp

+ 6 - 6
lib/CodeGen/PostRASchedulerList.cpp

@@ -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) &&