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

via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 6 20:22:39 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-transforms

Author: Kazu Hirata (kazutakahirata)

<details>
<summary>Changes</summary>



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


1 Files Affected:

- (modified) llvm/lib/Transforms/IPO/Internalize.cpp (+1-1) 


``````````diff
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;

``````````

</details>


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


More information about the llvm-commits mailing list