[llvm] r270247 - [RegBankSelect] Get rid of a now dead method: setSafeInsertPoint.

Quentin Colombet via llvm-commits llvm-commits at lists.llvm.org
Fri May 20 11:17:32 PDT 2016


Author: qcolombet
Date: Fri May 20 13:17:16 2016
New Revision: 270247

URL: http://llvm.org/viewvc/llvm-project?rev=270247&view=rev
Log:
[RegBankSelect] Get rid of a now dead method: setSafeInsertPoint.

This is now encapsulated in the RepairingPlacement class.

Modified:
    llvm/trunk/include/llvm/CodeGen/GlobalISel/RegBankSelect.h
    llvm/trunk/lib/CodeGen/GlobalISel/RegBankSelect.cpp

Modified: llvm/trunk/include/llvm/CodeGen/GlobalISel/RegBankSelect.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/GlobalISel/RegBankSelect.h?rev=270247&r1=270246&r2=270247&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/GlobalISel/RegBankSelect.h (original)
+++ llvm/trunk/include/llvm/CodeGen/GlobalISel/RegBankSelect.h Fri May 20 13:17:16 2016
@@ -525,11 +525,6 @@ private:
       RegBankSelect::RepairingPlacement &RepairPt,
       const iterator_range<SmallVectorImpl<unsigned>::iterator> &NewVRegs);
 
-  /// Set the insertion point of the MIRBuilder to a safe point
-  /// to insert instructions before (\p Before == true) or after
-  /// \p InsertPt.
-  void setSafeInsertionPoint(MachineInstr &InsertPt, bool Before);
-
   /// Compute the cost of mapping \p MI with \p InstrMapping and
   /// compute the repairing placement for such mapping in \p
   /// RepairPts.

Modified: llvm/trunk/lib/CodeGen/GlobalISel/RegBankSelect.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GlobalISel/RegBankSelect.cpp?rev=270247&r1=270246&r2=270247&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/GlobalISel/RegBankSelect.cpp (original)
+++ llvm/trunk/lib/CodeGen/GlobalISel/RegBankSelect.cpp Fri May 20 13:17:16 2016
@@ -136,40 +136,6 @@ void RegBankSelect::repairReg(
   // Legalize NewInstrs if need be.
 }
 
-void RegBankSelect::setSafeInsertionPoint(MachineInstr &InsertPt, bool Before) {
-  // Check that we are not looking to insert before a phi.
-  // Indeed, we would need more information on what to do.
-  // By default that should be all the predecessors, but this is
-  // probably not what we want in general.
-  assert((!Before || !InsertPt.isPHI()) &&
-         "Insertion before phis not implemented");
-  // The same kind of observation hold for terminators if we try to
-  // insert after them.
-  assert((Before || !InsertPt.isTerminator()) &&
-         "Insertion after terminatos not implemented");
-  if (InsertPt.isPHI()) {
-    assert(!Before && "Not supported!!");
-    MachineBasicBlock *MBB = InsertPt.getParent();
-    assert(MBB && "Insertion point is not in a basic block");
-    MachineBasicBlock::iterator FirstNonPHIPt = MBB->getFirstNonPHI();
-    if (FirstNonPHIPt == MBB->end()) {
-      // If there is not any non-phi instruction, insert at the end of MBB.
-      MIRBuilder.setMBB(*MBB, /*Beginning*/ false);
-      return;
-    }
-    // The insertion point before the first non-phi instruction.
-    MIRBuilder.setInstr(*FirstNonPHIPt, /*Before*/ true);
-    return;
-  }
-  if (InsertPt.isTerminator()) {
-    MachineBasicBlock *MBB = InsertPt.getParent();
-    assert(MBB && "Insertion point is not in a basic block");
-    MIRBuilder.setInstr(*MBB->getFirstTerminator(), /*Before*/ true);
-    return;
-  }
-  MIRBuilder.setInstr(InsertPt, /*Before*/ Before);
-}
-
 void RegBankSelect::tryAvoidingSplit(
     RegBankSelect::RepairingPlacement &RepairPt, const MachineOperand &MO,
     const RegisterBankInfo::ValueMapping &ValMapping) const {




More information about the llvm-commits mailing list