Skip to content

[llvm-profgen] Avoid repeated hash lookups (NFC) #130466

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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
6 changes: 3 additions & 3 deletions llvm/tools/llvm-profgen/MissingFrameInferrer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,14 @@ uint64_t MissingFrameInferrer::computeUniqueTailCallPath(
if (CurSearchingDepth == MaximumSearchDepth)
return 0;


if (!FuncToTailCallMap.count(From))
auto It = FuncToTailCallMap.find(From);
if (It == FuncToTailCallMap.end())
return 0;

CurSearchingDepth++;
Visiting.insert(From);
uint64_t NumPaths = 0;
for (auto TailCall : FuncToTailCallMap[From]) {
for (auto TailCall : It->second) {
NumPaths += computeUniqueTailCallPath(TailCall, To, Path);
// Stop analyzing the remaining if we are already seeing more than one
// reachable paths.
Expand Down
Loading