[llvm] [ARM] Avoid repeated hash lookups (NFC) (PR #128994)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 26 20:36:39 PST 2025


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

None

>From ed685bfcf1ebdc57b02472c6eb89400d3e93d89a Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Wed, 26 Feb 2025 07:47:34 -0800
Subject: [PATCH] [ARM] Avoid repeated hash lookups (NFC)

---
 llvm/lib/Target/ARM/ARMISelLowering.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp
index c7ed73d0e95f7..e3dc337bd0843 100644
--- a/llvm/lib/Target/ARM/ARMISelLowering.cpp
+++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp
@@ -2731,8 +2731,9 @@ ARMTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
 
       SDValue ByValSrc;
       bool NeedsStackCopy;
-      if (ByValTemporaries.contains(realArgIdx)) {
-        ByValSrc = ByValTemporaries[realArgIdx];
+      if (auto It = ByValTemporaries.find(realArgIdx);
+          It != ByValTemporaries.end()) {
+        ByValSrc = It->second;
         NeedsStackCopy = true;
       } else {
         ByValSrc = Arg;



More information about the llvm-commits mailing list