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

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 22 00:38:53 PDT 2024


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

None

>From 3cc236bd9b7bc1d72f8fba4cc7ab021dd93c311a Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Sun, 22 Sep 2024 00:25:01 -0700
Subject: [PATCH] [ARM] Avoid repeated hash lookups (NFC)

---
 llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp b/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
index e42623cb385637..b042ee69edd26c 100644
--- a/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
+++ b/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
@@ -3289,7 +3289,7 @@ bool ARMPreAllocLoadStoreOpt::DistributeIncrements() {
         continue;
 
       Register Base = MI.getOperand(BaseOp).getReg();
-      if (!Base.isVirtual() || Visited.count(Base))
+      if (!Base.isVirtual())
         continue;
 
       Visited.insert(Base);



More information about the llvm-commits mailing list