[llvm] [AMDGPU] Avoid repeated hash lookups (NFC) (PR #130235)

via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 6 20:47:55 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-amdgpu

Author: Kazu Hirata (kazutakahirata)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/130235.diff


1 Files Affected:

- (modified) llvm/lib/Target/AMDGPU/AMDGPUInsertDelayAlu.cpp (+2-2) 


``````````diff
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;

``````````

</details>


https://github.com/llvm/llvm-project/pull/130235


More information about the llvm-commits mailing list