File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
llvm/lib/Transforms/Utils Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -728,16 +728,12 @@ void PredicateInfoBuilder::renameUses(SmallVectorImpl<Value *> &OpsToRename) {
728728
729729PredicateInfoBuilder::ValueInfo &
730730PredicateInfoBuilder::getOrCreateValueInfo (Value *Operand) {
731- auto OIN = ValueInfoNums.find (Operand);
732- if (OIN == ValueInfoNums. end () ) {
733- // This will grow it
731+ auto Res = ValueInfoNums.try_emplace (Operand, ValueInfos. size () );
732+ if (Res. second ) {
733+ // Allocate space for new ValueInfo.
734734 ValueInfos.resize (ValueInfos.size () + 1 );
735- // This will use the new size and give us a 0 based number of the info
736- auto InsertResult = ValueInfoNums.insert ({Operand, ValueInfos.size () - 1 });
737- assert (InsertResult.second && " Value info number already existed?" );
738- return ValueInfos[InsertResult.first ->second ];
739735 }
740- return ValueInfos[OIN ->second ];
736+ return ValueInfos[Res. first ->second ];
741737}
742738
743739const PredicateInfoBuilder::ValueInfo &
You can’t perform that action at this time.
0 commit comments