[llvm] r272163 - [RegBankSelect] Use const_iterator instead of iterator for repairReg.

Quentin Colombet via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 8 09:24:56 PDT 2016


Author: qcolombet
Date: Wed Jun  8 11:24:55 2016
New Revision: 272163

URL: http://llvm.org/viewvc/llvm-project?rev=272163&view=rev
Log:
[RegBankSelect] Use const_iterator instead of iterator for repairReg.

The repairing code has no reason to change the source or destination of
the registers.

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=272163&r1=272162&r2=272163&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/GlobalISel/RegBankSelect.h (original)
+++ llvm/trunk/include/llvm/CodeGen/GlobalISel/RegBankSelect.h Wed Jun  8 11:24:55 2016
@@ -520,10 +520,11 @@ private:
   ///
   /// \note The caller is supposed to do the rewriting of op if need be.
   /// I.e., Reg = op ... => <NewRegs> = NewOp ...
-  void repairReg(
-      MachineOperand &MO, const RegisterBankInfo::ValueMapping &ValMapping,
-      RegBankSelect::RepairingPlacement &RepairPt,
-      const iterator_range<SmallVectorImpl<unsigned>::iterator> &NewVRegs);
+  void repairReg(MachineOperand &MO,
+                 const RegisterBankInfo::ValueMapping &ValMapping,
+                 RegBankSelect::RepairingPlacement &RepairPt,
+                 const iterator_range<SmallVectorImpl<unsigned>::const_iterator>
+                     &NewVRegs);
 
   /// Return the cost of the instruction needed to map \p MO to \p ValMapping.
   /// The cost is free of basic block frequencies.

Modified: llvm/trunk/lib/CodeGen/GlobalISel/RegBankSelect.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GlobalISel/RegBankSelect.cpp?rev=272163&r1=272162&r2=272163&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/GlobalISel/RegBankSelect.cpp (original)
+++ llvm/trunk/lib/CodeGen/GlobalISel/RegBankSelect.cpp Wed Jun  8 11:24:55 2016
@@ -106,7 +106,7 @@ bool RegBankSelect::assignmentMatch(
 void RegBankSelect::repairReg(
     MachineOperand &MO, const RegisterBankInfo::ValueMapping &ValMapping,
     RegBankSelect::RepairingPlacement &RepairPt,
-    const iterator_range<SmallVectorImpl<unsigned>::iterator> &NewVRegs) {
+    const iterator_range<SmallVectorImpl<unsigned>::const_iterator> &NewVRegs) {
   assert(ValMapping.BreakDown.size() == 1 && "Not yet implemented");
   // Assume we are repairing a use and thus, the original reg will be
   // the source of the repairing.




More information about the llvm-commits mailing list