Skip to content

[AMDGPU] Avoid repeated hash lookups (NFC) #132583

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

kazutakahirata
Copy link
Contributor

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Mar 23, 2025

@llvm/pr-subscribers-backend-amdgpu

Author: Kazu Hirata (kazutakahirata)

Changes

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

1 Files Affected:

  • (modified) llvm/lib/Target/AMDGPU/AMDGPUSetWavePriority.cpp (+3-2)
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUSetWavePriority.cpp b/llvm/lib/Target/AMDGPU/AMDGPUSetWavePriority.cpp
index d760cd3115eaa..c6c8211618620 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUSetWavePriority.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUSetWavePriority.cpp
@@ -146,9 +146,10 @@ bool AMDGPUSetWavePriority::runOnMachineFunction(MachineFunction &MF) {
     bool SuccsMayReachVMEMLoad = false;
     unsigned NumFollowingVALUInsts = 0;
     for (const MachineBasicBlock *Succ : MBB->successors()) {
-      SuccsMayReachVMEMLoad |= MBBInfos[Succ].MayReachVMEMLoad;
+      MBBInfo &SuccInfo = MBBInfos[Succ];
+      SuccsMayReachVMEMLoad |= SuccInfo.MayReachVMEMLoad;
       NumFollowingVALUInsts =
-          std::max(NumFollowingVALUInsts, MBBInfos[Succ].NumVALUInstsAtStart);
+          std::max(NumFollowingVALUInsts, SuccInfo.NumVALUInstsAtStart);
     }
     MBBInfo &Info = MBBInfos[MBB];
     if (AtStart)

@kazutakahirata kazutakahirata merged commit b4061a5 into llvm:main Mar 23, 2025
11 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_001_repeated_hash_lookups_llvm_AMDGPU branch March 23, 2025 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants