Skip to content

Commit bc9cee1

Browse files
[IPO] Avoid repeated map lookups (NFC) (#132144)
1 parent ac269e6 commit bc9cee1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Transforms/IPO/SampleContextTracker.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,9 @@ ContextTrieNode *ContextTrieNode::getOrCreateChildContext(
189189
if (!AllowCreate)
190190
return nullptr;
191191

192-
AllChildContext[Hash] = ContextTrieNode(this, CalleeName, nullptr, CallSite);
193-
return &AllChildContext[Hash];
192+
ContextTrieNode &ACC = AllChildContext[Hash];
193+
ACC = ContextTrieNode(this, CalleeName, nullptr, CallSite);
194+
return &ACC;
194195
}
195196

196197
// Profiler tracker than manages profiles and its associated context

0 commit comments

Comments
 (0)