[llvm] r282130 - [RegisterBankInfo] Take advantage of the extra argument of SmallVector::resize.
Quentin Colombet via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 21 19:10:32 PDT 2016
Author: qcolombet
Date: Wed Sep 21 21:10:32 2016
New Revision: 282130
URL: http://llvm.org/viewvc/llvm-project?rev=282130&view=rev
Log:
[RegisterBankInfo] Take advantage of the extra argument of SmallVector::resize.
When initializing an instance of OperandsMapper, instead of using
SmallVector::resize followed by std::fill, use the function that
directly does that in SmallVector.
Modified:
llvm/trunk/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp
Modified: llvm/trunk/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp?rev=282130&r1=282129&r2=282130&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp (original)
+++ llvm/trunk/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp Wed Sep 21 21:10:32 2016
@@ -513,9 +513,7 @@ RegisterBankInfo::OperandsMapper::Operan
MachineRegisterInfo &MRI)
: MRI(MRI), MI(MI), InstrMapping(InstrMapping) {
unsigned NumOpds = MI.getNumOperands();
- OpToNewVRegIdx.resize(NumOpds);
- std::fill(OpToNewVRegIdx.begin(), OpToNewVRegIdx.end(),
- OperandsMapper::DontKnowIdx);
+ OpToNewVRegIdx.resize(NumOpds, OperandsMapper::DontKnowIdx);
assert(InstrMapping.verify(MI) && "Invalid mapping for MI");
}
More information about the llvm-commits
mailing list