diff options
author | Quentin Colombet <qcolombet@apple.com> | 2016-06-08 16:24:55 +0000 |
---|---|---|
committer | Quentin Colombet <qcolombet@apple.com> | 2016-06-08 16:24:55 +0000 |
commit | 06ef4e209d0e42f9cb465f795b36977b05a996ac (patch) | |
tree | 818fd326535f16e726934c292f2a316602554004 | |
parent | f88d3b9afbb39217d3a8649c5b2549707dd4a559 (diff) | |
download | bcm5719-llvm-06ef4e209d0e42f9cb465f795b36977b05a996ac.tar.gz bcm5719-llvm-06ef4e209d0e42f9cb465f795b36977b05a996ac.zip |
[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
-rw-r--r-- | llvm/include/llvm/CodeGen/GlobalISel/RegBankSelect.h | 9 | ||||
-rw-r--r-- | llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/RegBankSelect.h b/llvm/include/llvm/CodeGen/GlobalISel/RegBankSelect.h index 29a89dca18f..b393744e67c 100644 --- a/llvm/include/llvm/CodeGen/GlobalISel/RegBankSelect.h +++ b/llvm/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 ... => <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. diff --git a/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp b/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp index 726ef268adb..daf1685b067 100644 --- a/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp +++ b/llvm/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<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. |