Skip to content

Commit 25ebdfc

Browse files
[IR] Avoid repeated hash lookups (NFC) (#128998)
1 parent 42e5592 commit 25ebdfc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/IR/DroppedVariableStats.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@ void DroppedVariableStats::calculateDroppedStatsAndPrint(
4444
unsigned DroppedCount = 0;
4545
DenseSet<VarID> &DebugVariablesBeforeSet = DbgVariables.DebugVariablesBefore;
4646
DenseSet<VarID> &DebugVariablesAfterSet = DbgVariables.DebugVariablesAfter;
47-
if (InlinedAts.back().find(FuncName) == InlinedAts.back().end())
47+
auto It = InlinedAts.back().find(FuncName);
48+
if (It == InlinedAts.back().end())
4849
return;
49-
DenseMap<VarID, DILocation *> &InlinedAtsMap = InlinedAts.back()[FuncName];
50+
DenseMap<VarID, DILocation *> &InlinedAtsMap = It->second;
5051
// Find an Instruction that shares the same scope as the dropped #dbg_value
5152
// or has a scope that is the child of the scope of the #dbg_value, and has
5253
// an inlinedAt equal to the inlinedAt of the #dbg_value or it's inlinedAt

0 commit comments

Comments
 (0)