From 8f581607b20ec6afea7d4607ebd29ab3814750e3 Mon Sep 17 00:00:00 2001 From: Quentin Colombet Date: Wed, 8 Jun 2016 16:24:55 +0000 Subject: [PATCH] [RegBankSelect] Use const_iterator instead of iterator for repairReg. The repairing code has no reason to change the source or destination of the registers. llvm-svn: 272163 --- include/llvm/CodeGen/GlobalISel/RegBankSelect.h | 9 +++++---- lib/CodeGen/GlobalISel/RegBankSelect.cpp | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/llvm/CodeGen/GlobalISel/RegBankSelect.h b/include/llvm/CodeGen/GlobalISel/RegBankSelect.h index 29a89dca18f..b393744e67c 100644 --- a/include/llvm/CodeGen/GlobalISel/RegBankSelect.h +++ b/include/llvm/CodeGen/GlobalISel/RegBankSelect.h @@ -520,10 +520,11 @@ private: /// /// \note The caller is supposed to do the rewriting of op if need be. /// I.e., Reg = op ... => = NewOp ... - void repairReg( - MachineOperand &MO, const RegisterBankInfo::ValueMapping &ValMapping, - RegBankSelect::RepairingPlacement &RepairPt, - const iterator_range::iterator> &NewVRegs); + void repairReg(MachineOperand &MO, + const RegisterBankInfo::ValueMapping &ValMapping, + RegBankSelect::RepairingPlacement &RepairPt, + const iterator_range::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. diff --git a/lib/CodeGen/GlobalISel/RegBankSelect.cpp b/lib/CodeGen/GlobalISel/RegBankSelect.cpp index 726ef268adb..daf1685b067 100644 --- a/lib/CodeGen/GlobalISel/RegBankSelect.cpp +++ b/lib/CodeGen/GlobalISel/RegBankSelect.cpp @@ -106,7 +106,7 @@ bool RegBankSelect::assignmentMatch( void RegBankSelect::repairReg( MachineOperand &MO, const RegisterBankInfo::ValueMapping &ValMapping, RegBankSelect::RepairingPlacement &RepairPt, - const iterator_range::iterator> &NewVRegs) { + const iterator_range::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.