Skip to content

Commit 99d2b3b

Browse files
[llvm-profgen] Avoid repeated hash lookups (NFC) (#130466)
1 parent 573df34 commit 99d2b3b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/tools/llvm-profgen/MissingFrameInferrer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,14 +165,14 @@ uint64_t MissingFrameInferrer::computeUniqueTailCallPath(
165165
if (CurSearchingDepth == MaximumSearchDepth)
166166
return 0;
167167

168-
169-
if (!FuncToTailCallMap.count(From))
168+
auto It = FuncToTailCallMap.find(From);
169+
if (It == FuncToTailCallMap.end())
170170
return 0;
171171

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

0 commit comments

Comments
 (0)