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) {
728
728
729
729
PredicateInfoBuilder::ValueInfo &
730
730
PredicateInfoBuilder::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.
734
734
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 ];
739
735
}
740
- return ValueInfos[OIN ->second ];
736
+ return ValueInfos[Res. first ->second ];
741
737
}
742
738
743
739
const PredicateInfoBuilder::ValueInfo &
You can’t perform that action at this time.
0 commit comments