[llvm] [Hexagon] Avoid repeated hash lookups (NFC) (PR #127578)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 17 22:56:29 PST 2025


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

None

>From 5ec043e39225087c8e198359111deac5f4a9ba84 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Mon, 17 Feb 2025 02:08:18 -0800
Subject: [PATCH] [Hexagon] Avoid repeated hash lookups (NFC)

---
 llvm/lib/Target/Hexagon/HexagonVectorCombine.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/llvm/lib/Target/Hexagon/HexagonVectorCombine.cpp b/llvm/lib/Target/Hexagon/HexagonVectorCombine.cpp
index 4e4467c76aff5..0760d712f9afd 100644
--- a/llvm/lib/Target/Hexagon/HexagonVectorCombine.cpp
+++ b/llvm/lib/Target/Hexagon/HexagonVectorCombine.cpp
@@ -1174,8 +1174,8 @@ auto AlignVectors::realignLoadGroup(IRBuilderBase &Builder,
   for (const ByteSpan::Block &B : VSpan) {
     ByteSpan ASection = ASpan.section(B.Pos, B.Seg.Size);
     for (const ByteSpan::Block &S : ASection) {
-      EarliestUser[S.Seg.Val] = std::min(
-          EarliestUser[S.Seg.Val], earliestUser(B.Seg.Val->uses()), isEarlier);
+      auto &EU = EarliestUser[S.Seg.Val];
+      EU = std::min(EU, earliestUser(B.Seg.Val->uses()), isEarlier);
     }
   }
 



More information about the llvm-commits mailing list