Skip to content

Commit 9dd8c14

Browse files
[IR] Avoid repeated map lookups (NFC) (llvm#128396)
1 parent b0d1c51 commit 9dd8c14

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

llvm/include/llvm/IR/ModuleSummaryIndexYAML.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,7 @@ template <> struct CustomMappingTraits<GlobalValueSummaryMapTy> {
229229
static_cast<GlobalValueSummary::ImportKind>(GVSum.ImportType));
230230
if (GVSum.Aliasee) {
231231
auto ASum = std::make_unique<AliasSummary>(GVFlags);
232-
if (!V.count(*GVSum.Aliasee))
233-
V.emplace(*GVSum.Aliasee, /*IsAnalysis=*/false);
232+
V.try_emplace(*GVSum.Aliasee, /*IsAnalysis=*/false);
234233
ValueInfo AliaseeVI(/*IsAnalysis=*/false, &*V.find(*GVSum.Aliasee));
235234
// Note: Aliasee cannot be filled until all summaries are loaded.
236235
// This is done in fixAliaseeLinks() which is called in

0 commit comments

Comments
 (0)