From: Quentin Colombet Date: Thu, 22 Sep 2016 02:10:32 +0000 (+0000) Subject: [RegisterBankInfo] Take advantage of the extra argument of SmallVector::resize. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=22bb41e797e148d070feec9f96a9f2db9ce1b58e;p=llvm [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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282130 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp b/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp index c76601da4d0..be4bbeeda98 100644 --- a/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp +++ b/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp @@ -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"); }