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

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


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

None

>From 9ae9396e512df685a1b8c253db2fce0ef3b9a94b Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Wed, 6 Nov 2024 08:52:06 -0800
Subject: [PATCH] [IPO] Simplify code with DenseMap::operator[] (NFC)

---
 llvm/lib/Transforms/IPO/Internalize.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;



More information about the llvm-commits mailing list