Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions llvm/lib/Transforms/IPO/FunctionAttrs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,8 @@ static FunctionSummary *calculatePrevailingSummary(
function_ref<bool(GlobalValue::GUID, const GlobalValueSummary *)>
IsPrevailing) {

if (auto It = CachedPrevailingSummary.find(VI);
It != CachedPrevailingSummary.end())
auto [It, Inserted] = CachedPrevailingSummary.try_emplace(VI);
if (!Inserted)
return It->second;

/// At this point, prevailing symbols have been resolved. The following leads
Expand Down Expand Up @@ -363,7 +363,6 @@ static FunctionSummary *calculatePrevailingSummary(
/// future this can be revisited.
/// 5. Otherwise, go conservative.

CachedPrevailingSummary[VI] = nullptr;
FunctionSummary *Local = nullptr;
FunctionSummary *Prevailing = nullptr;

Expand Down Expand Up @@ -764,12 +763,12 @@ ArgumentUsesSummary collectArgumentUsesPerBlock(Argument &A, Function &F) {
auto UpdateUseInfo = [&Result](Instruction *I, ArgumentAccessInfo Info) {
auto *BB = I->getParent();
auto &BBInfo = Result.UsesPerBlock[BB];
bool AlreadyVisitedInst = BBInfo.Insts.contains(I);
auto &IInfo = BBInfo.Insts[I];
auto [It, Inserted] = BBInfo.Insts.try_emplace(I);
auto &IInfo = It->second;

// Instructions that have more than one use of the argument are considered
// as clobbers.
if (AlreadyVisitedInst) {
if (!Inserted) {
IInfo = {ArgumentAccessInfo::AccessType::Unknown, {}};
BBInfo.HasUnknownAccess = true;
return false;
Expand Down