[llvm] 6cb2f6d - [AMDGPU] Avoid repeated hash lookups (NFC) (#130235)

via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 6 23:58:19 PST 2025


Author: Kazu Hirata
Date: 2025-03-06T23:58:16-08:00
New Revision: 6cb2f6de9b3cf0e72b7d45c9fc149457b3462ca3

URL: https://github.com/llvm/llvm-project/commit/6cb2f6de9b3cf0e72b7d45c9fc149457b3462ca3
DIFF: https://github.com/llvm/llvm-project/commit/6cb2f6de9b3cf0e72b7d45c9fc149457b3462ca3.diff

LOG: [AMDGPU] Avoid repeated hash lookups (NFC) (#130235)

Added: 
    

Modified: 
    llvm/lib/Target/AMDGPU/AMDGPUInsertDelayAlu.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AMDGPU/AMDGPUInsertDelayAlu.cpp b/llvm/lib/Target/AMDGPU/AMDGPUInsertDelayAlu.cpp
index b3e371cdff8fd..b25619b4c5422 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUInsertDelayAlu.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUInsertDelayAlu.cpp
@@ -400,8 +400,8 @@ class AMDGPUInsertDelayAlu {
     if (Emit) {
       assert(State == BlockState[&MBB] &&
              "Basic block state should not have changed on final pass!");
-    } else if (State != BlockState[&MBB]) {
-      BlockState[&MBB] = std::move(State);
+    } else if (DelayState &BS = BlockState[&MBB]; State != BS) {
+      BS = std::move(State);
       Changed = true;
     }
     return Changed;


        


More information about the llvm-commits mailing list