Skip to content

[IPO] Simplify code with DenseMap::operator[] (NFC) #115261

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

kazutakahirata
Copy link
Contributor

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Nov 7, 2024

@llvm/pr-subscribers-llvm-transforms

Author: Kazu Hirata (kazutakahirata)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/115261.diff

1 Files Affected:

  • (modified) llvm/lib/Transforms/IPO/Internalize.cpp (+1-1)
diff --git a/llvm/lib/Transforms/IPO/Internalize.cpp b/llvm/lib/Transforms/IPO/Internalize.cpp
index 0b8fde6489f8e7..4cdd1fa6110627 100644
--- a/llvm/lib/Transforms/IPO/Internalize.cpp
+++ b/llvm/lib/Transforms/IPO/Internalize.cpp
@@ -176,7 +176,7 @@ void InternalizePass::checkComdat(
   if (!C)
     return;
 
-  ComdatInfo &Info = ComdatMap.try_emplace(C).first->second;
+  ComdatInfo &Info = ComdatMap[C];
   ++Info.Size;
   if (shouldPreserveGV(GV))
     Info.External = true;

Copy link
Contributor

@nikic nikic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG

@kazutakahirata kazutakahirata merged commit 937e506 into llvm:main Nov 7, 2024
10 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_001_operator_sq_br_IPO branch November 7, 2024 18:55
Groverkss pushed a commit to iree-org/llvm-project that referenced this pull request Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants