[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.

llvm-svn: 282130
This commit is contained in:
Quentin Colombet 2016-09-22 02:10:32 +00:00
parent 624f59f4d8
commit b202eb88aa
1 changed files with 1 additions and 3 deletions

View File

@ -513,9 +513,7 @@ RegisterBankInfo::OperandsMapper::OperandsMapper(
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");
}