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

via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 17 22:45:40 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/127573.diff


1 Files Affected:

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


``````````diff
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUWaitSGPRHazards.cpp b/llvm/lib/Target/AMDGPU/AMDGPUWaitSGPRHazards.cpp
index e70d6aab306fe..9e2261b663dc9 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUWaitSGPRHazards.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUWaitSGPRHazards.cpp
@@ -384,13 +384,14 @@ class AMDGPUWaitSGPRHazards {
       }
     }
 
-    bool Changed = State != BlockState[&MBB].Out;
+    auto &BS = BlockState[&MBB];
+    bool Changed = State != BS.Out;
     if (Emit) {
       assert(!Changed && "Hazard state should not change on emit pass");
       return Emitted;
     }
     if (Changed)
-      BlockState[&MBB].Out = State;
+      BS.Out = State;
     return Changed;
   }
 

``````````

</details>


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


More information about the llvm-commits mailing list