@@ -319,8 +319,8 @@ static FunctionSummary *calculatePrevailingSummary(
319
319
function_ref<bool (GlobalValue::GUID, const GlobalValueSummary *)>
320
320
IsPrevailing) {
321
321
322
- if ( auto It = CachedPrevailingSummary.find (VI);
323
- It != CachedPrevailingSummary. end () )
322
+ auto [It, Inserted] = CachedPrevailingSummary.try_emplace (VI);
323
+ if (!Inserted )
324
324
return It->second ;
325
325
326
326
// / At this point, prevailing symbols have been resolved. The following leads
@@ -363,7 +363,6 @@ static FunctionSummary *calculatePrevailingSummary(
363
363
// / future this can be revisited.
364
364
// / 5. Otherwise, go conservative.
365
365
366
- CachedPrevailingSummary[VI] = nullptr ;
367
366
FunctionSummary *Local = nullptr ;
368
367
FunctionSummary *Prevailing = nullptr ;
369
368
@@ -764,12 +763,12 @@ ArgumentUsesSummary collectArgumentUsesPerBlock(Argument &A, Function &F) {
764
763
auto UpdateUseInfo = [&Result](Instruction *I, ArgumentAccessInfo Info) {
765
764
auto *BB = I->getParent ();
766
765
auto &BBInfo = Result.UsesPerBlock [BB];
767
- bool AlreadyVisitedInst = BBInfo.Insts .contains (I);
768
- auto &IInfo = BBInfo. Insts [I] ;
766
+ auto [It, Inserted] = BBInfo.Insts .try_emplace (I);
767
+ auto &IInfo = It-> second ;
769
768
770
769
// Instructions that have more than one use of the argument are considered
771
770
// as clobbers.
772
- if (AlreadyVisitedInst ) {
771
+ if (!Inserted ) {
773
772
IInfo = {ArgumentAccessInfo::AccessType::Unknown, {}};
774
773
BBInfo.HasUnknownAccess = true ;
775
774
return false ;
0 commit comments