Skip to content

Commit 6228379

Browse files
[llvm-profgen] Avoid repeated hash lookups (NFC) (#126467)
1 parent 2f88672 commit 6228379

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/tools/llvm-profgen/MissingFrameInferrer.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,12 @@ uint64_t MissingFrameInferrer::computeUniqueTailCallPath(
206206

207207
uint64_t MissingFrameInferrer::computeUniqueTailCallPath(
208208
uint64_t From, BinaryFunction *To, SmallVectorImpl<uint64_t> &Path) {
209-
if (!TailCallEdgesF.count(From))
209+
auto It = TailCallEdgesF.find(From);
210+
if (It == TailCallEdgesF.end())
210211
return 0;
211212
Path.push_back(From);
212213
uint64_t NumPaths = 0;
213-
for (auto Target : TailCallEdgesF[From]) {
214+
for (auto Target : It->second) {
214215
NumPaths += computeUniqueTailCallPath(Target, To, Path);
215216
// Stop analyzing the remaining if we are already seeing more than one
216217
// reachable paths.

0 commit comments

Comments
 (0)