[llvm] r261577 - CodeGen: Bring back MachineBasicBlock::iterator::getInstrIterator()...

Duncan P. N. Exon Smith via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 22 13:30:16 PST 2016


Author: dexonsmith
Date: Mon Feb 22 15:30:15 2016
New Revision: 261577

URL: http://llvm.org/viewvc/llvm-project?rev=261577&view=rev
Log:
CodeGen: Bring back MachineBasicBlock::iterator::getInstrIterator()...

This is a little embarrassing.

When I reverted r261504 (getIterator() => getInstrIterator()) in
r261567, I did a `git grep` to see if there were new calls to
`getInstrIterator()` that I needed to migrate.  There were 10-20 hits,
and I blindly did a `sed ...` before calling `ninja check`.

However, these were `MachineInstrBundleIterator::getInstrIterator()`,
which predated r261567.  Perhaps coincidentally, these had an identical
name and return type.

This commit undoes my careless sed and restores
`MachineBasicBlock::iterator::getInstrIterator()`.

Modified:
    llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h
    llvm/trunk/include/llvm/CodeGen/MachineInstrBuilder.h
    llvm/trunk/include/llvm/CodeGen/MachineInstrBundleIterator.h
    llvm/trunk/lib/Target/AMDGPU/R600ControlFlowFinalizer.cpp
    llvm/trunk/lib/Target/AMDGPU/R600Packetizer.cpp
    llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp
    llvm/trunk/lib/Target/ARM/Thumb2ITBlockPass.cpp
    llvm/trunk/lib/Target/Hexagon/HexagonFrameLowering.cpp
    llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.cpp
    llvm/trunk/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp

Modified: llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h?rev=261577&r1=261576&r2=261577&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h Mon Feb 22 15:30:15 2016
@@ -517,7 +517,7 @@ public:
   void insert(iterator I, IT S, IT E) {
     assert((I == end() || I->getParent() == this) &&
            "iterator points outside of basic block");
-    Insts.insert(I.getIterator(), S, E);
+    Insts.insert(I.getInstrIterator(), S, E);
   }
 
   /// Insert MI into the instruction list before I.
@@ -526,7 +526,7 @@ public:
            "iterator points outside of basic block");
     assert(!MI->isBundledWithPred() && !MI->isBundledWithSucc() &&
            "Cannot insert instruction with bundle flags");
-    return Insts.insert(I.getIterator(), MI);
+    return Insts.insert(I.getInstrIterator(), MI);
   }
 
   /// Insert MI into the instruction list after I.
@@ -535,7 +535,7 @@ public:
            "iterator points outside of basic block");
     assert(!MI->isBundledWithPred() && !MI->isBundledWithSucc() &&
            "Cannot insert instruction with bundle flags");
-    return Insts.insertAfter(I.getIterator(), MI);
+    return Insts.insertAfter(I.getInstrIterator(), MI);
   }
 
   /// Remove an instruction from the instruction list and delete it.
@@ -554,7 +554,7 @@ public:
 
   /// Remove a range of instructions from the instruction list and delete them.
   iterator erase(iterator I, iterator E) {
-    return Insts.erase(I.getIterator(), E.getIterator());
+    return Insts.erase(I.getInstrIterator(), E.getInstrIterator());
   }
 
   /// Remove an instruction or bundle from the instruction list and delete it.
@@ -610,8 +610,8 @@ public:
   /// instructions to move.
   void splice(iterator Where, MachineBasicBlock *Other,
               iterator From, iterator To) {
-    Insts.splice(Where.getIterator(), Other->Insts, From.getIterator(),
-                 To.getIterator());
+    Insts.splice(Where.getInstrIterator(), Other->Insts,
+                 From.getInstrIterator(), To.getInstrIterator());
   }
 
   /// This method unlinks 'this' from the containing function, and returns it,
@@ -639,7 +639,7 @@ public:
   /// instructions.  Return UnknownLoc if there is none.
   DebugLoc findDebugLoc(instr_iterator MBBI);
   DebugLoc findDebugLoc(iterator MBBI) {
-    return findDebugLoc(MBBI.getIterator());
+    return findDebugLoc(MBBI.getInstrIterator());
   }
 
   /// Possible outcome of a register liveness query to computeRegisterLiveness()

Modified: llvm/trunk/include/llvm/CodeGen/MachineInstrBuilder.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineInstrBuilder.h?rev=261577&r1=261576&r2=261577&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineInstrBuilder.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineInstrBuilder.h Mon Feb 22 15:30:15 2016
@@ -429,12 +429,12 @@ public:
   /// Create an MIBundleBuilder that inserts instructions into a new bundle in
   /// BB above the bundle or instruction at Pos.
   MIBundleBuilder(MachineBasicBlock &BB, MachineBasicBlock::iterator Pos)
-      : MBB(BB), Begin(Pos.getIterator()), End(Begin) {}
+      : MBB(BB), Begin(Pos.getInstrIterator()), End(Begin) {}
 
   /// Create a bundle from the sequence of instructions between B and E.
   MIBundleBuilder(MachineBasicBlock &BB, MachineBasicBlock::iterator B,
                   MachineBasicBlock::iterator E)
-      : MBB(BB), Begin(B.getIterator()), End(E.getIterator()) {
+      : MBB(BB), Begin(B.getInstrIterator()), End(E.getInstrIterator()) {
     assert(B != E && "No instructions to bundle");
     ++B;
     while (B != E) {

Modified: llvm/trunk/include/llvm/CodeGen/MachineInstrBundleIterator.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineInstrBundleIterator.h?rev=261577&r1=261576&r2=261577&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineInstrBundleIterator.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineInstrBundleIterator.h Mon Feb 22 15:30:15 2016
@@ -44,7 +44,7 @@ public:
   // Template allows conversion from const to nonconst.
   template <class OtherTy>
   MachineInstrBundleIterator(const MachineInstrBundleIterator<OtherTy> &I)
-      : MII(I.getIterator()) {}
+      : MII(I.getInstrIterator()) {}
   MachineInstrBundleIterator() : MII(nullptr) {}
 
   Ty &operator*() const { return *MII; }
@@ -84,7 +84,7 @@ public:
     return Temp;
   }
 
-  instr_iterator getIterator() const { return MII; }
+  instr_iterator getInstrIterator() const { return MII; }
 };
 
 } // end namespace llvm

Modified: llvm/trunk/lib/Target/AMDGPU/R600ControlFlowFinalizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/R600ControlFlowFinalizer.cpp?rev=261577&r1=261576&r2=261577&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/R600ControlFlowFinalizer.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/R600ControlFlowFinalizer.cpp Mon Feb 22 15:30:15 2016
@@ -397,7 +397,7 @@ private:
       std::vector<int64_t> Literals;
       if (I->isBundle()) {
         MachineInstr *DeleteMI = I;
-        MachineBasicBlock::instr_iterator BI = I.getIterator();
+        MachineBasicBlock::instr_iterator BI = I.getInstrIterator();
         while (++BI != E && BI->isBundledWithPred()) {
           BI->unbundleFromPred();
           for (unsigned i = 0, e = BI->getNumOperands(); i != e; ++i) {

Modified: llvm/trunk/lib/Target/AMDGPU/R600Packetizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/R600Packetizer.cpp?rev=261577&r1=261576&r2=261577&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/R600Packetizer.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/R600Packetizer.cpp Mon Feb 22 15:30:15 2016
@@ -75,7 +75,7 @@ private:
     I--;
     if (!TII->isALUInstr(I->getOpcode()) && !I->isBundle())
       return Result;
-    MachineBasicBlock::instr_iterator BI = I.getIterator();
+    MachineBasicBlock::instr_iterator BI = I.getInstrIterator();
     if (I->isBundle())
       BI++;
     int LastDstChan = -1;

Modified: llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp?rev=261577&r1=261576&r2=261577&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMBaseInstrInfo.cpp Mon Feb 22 15:30:15 2016
@@ -3410,7 +3410,7 @@ static const MachineInstr *getBundledDef
   Dist = 0;
 
   MachineBasicBlock::const_iterator I = MI; ++I;
-  MachineBasicBlock::const_instr_iterator II = std::prev(I.getIterator());
+  MachineBasicBlock::const_instr_iterator II = std::prev(I.getInstrIterator());
   assert(II->isInsideBundle() && "Empty bundle?");
 
   int Idx = -1;

Modified: llvm/trunk/lib/Target/ARM/Thumb2ITBlockPass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Thumb2ITBlockPass.cpp?rev=261577&r1=261576&r2=261577&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/Thumb2ITBlockPass.cpp (original)
+++ llvm/trunk/lib/Target/ARM/Thumb2ITBlockPass.cpp Mon Feb 22 15:30:15 2016
@@ -256,7 +256,8 @@ bool Thumb2ITBlockPass::InsertITInstruct
     LastITMI->findRegisterUseOperand(ARM::ITSTATE)->setIsKill();
 
     // Finalize the bundle.
-    finalizeBundle(MBB, InsertPos.getIterator(), ++LastITMI->getIterator());
+    finalizeBundle(MBB, InsertPos.getInstrIterator(),
+                   ++LastITMI->getIterator());
 
     Modified = true;
     ++NumITs;

Modified: llvm/trunk/lib/Target/Hexagon/HexagonFrameLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonFrameLowering.cpp?rev=261577&r1=261576&r2=261577&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/HexagonFrameLowering.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/HexagonFrameLowering.cpp Mon Feb 22 15:30:15 2016
@@ -582,7 +582,7 @@ namespace {
     if (!It->isBundle())
       return It->getOpcode() == Hexagon::S2_allocframe;
     auto End = It->getParent()->instr_end();
-    MachineBasicBlock::const_instr_iterator I = It.getIterator();
+    MachineBasicBlock::const_instr_iterator I = It.getInstrIterator();
     while (++I != End && I->isBundled())
       if (I->getOpcode() == Hexagon::S2_allocframe)
         return true;

Modified: llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.cpp?rev=261577&r1=261576&r2=261577&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/HexagonInstrInfo.cpp Mon Feb 22 15:30:15 2016
@@ -4071,7 +4071,7 @@ unsigned HexagonInstrInfo::nonDbgBBSize(
 unsigned HexagonInstrInfo::nonDbgBundleSize(
       MachineBasicBlock::const_iterator BundleHead) const {
   assert(BundleHead->isBundle() && "Not a bundle header");
-  auto MII = BundleHead.getIterator();
+  auto MII = BundleHead.getInstrIterator();
   // Skip the bundle header.
   return nonDbgMICount(++MII, getBundleEnd(BundleHead));
 }

Modified: llvm/trunk/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp?rev=261577&r1=261576&r2=261577&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp Mon Feb 22 15:30:15 2016
@@ -126,9 +126,9 @@ static MachineBasicBlock::iterator moveI
       MachineBasicBlock::iterator BundleIt, bool Before) {
   MachineBasicBlock::instr_iterator InsertPt;
   if (Before)
-    InsertPt = BundleIt.getIterator();
+    InsertPt = BundleIt.getInstrIterator();
   else
-    InsertPt = std::next(BundleIt).getIterator();
+    InsertPt = std::next(BundleIt).getInstrIterator();
 
   MachineBasicBlock &B = *MI->getParent();
   // The instruction should at least be bundled with the preceding instruction




More information about the llvm-commits mailing list