Skip to content

Commit

Permalink
[ExecutionEngine] Avoid repeated hash lookups (NFC) (llvm#110621)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazutakahirata authored and Sterling-Augustine committed Oct 3, 2024
1 parent c92ec3d commit 0e4ebfa
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions llvm/lib/ExecutionEngine/Orc/Debugging/VTuneSupportPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ static VTuneMethodBatch getMethodBatch(LinkGraph &G, bool EmitDebugInfo) {

auto GetStringIdx = [Deduplicator = StringMap<uint32_t>(),
&Batch](StringRef S) mutable {
auto I = Deduplicator.find(S);
if (I != Deduplicator.end())
return I->second;

Batch.Strings.push_back(S.str());
return Deduplicator[S] = Batch.Strings.size();
auto [I, Inserted] = Deduplicator.try_emplace(S);
if (Inserted) {
Batch.Strings.push_back(S.str());
I->second = Batch.Strings.size();
}
return I->second;
};
for (auto Sym : G.defined_symbols()) {
if (!Sym->isCallable())
Expand Down

0 comments on commit 0e4ebfa

Please sign in to comment.