[llvm] [AMDGPU] Avoid repeated hash lookups (NFC) (PR #110788)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 1 21:24:09 PDT 2024
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/110788
None
>From 0ee56205fe1faffae88152a815cbf2f91c10e4ed Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Tue, 1 Oct 2024 07:53:39 -0700
Subject: [PATCH] [AMDGPU] Avoid repeated hash lookups (NFC)
---
llvm/lib/Target/AMDGPU/AMDGPUIGroupLP.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUIGroupLP.cpp b/llvm/lib/Target/AMDGPU/AMDGPUIGroupLP.cpp
index 4e913d1b32e1f1..aaad2a56de2cd0 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUIGroupLP.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUIGroupLP.cpp
@@ -2123,13 +2123,13 @@ bool MFMASmallGemmSingleWaveOpt::applyIGLPStrategy(
continue;
}
- if (!VMEMLookup.contains(MI)) {
+ auto [It, Inserted] = VMEMLookup.try_emplace(MI, *I);
+ if (Inserted) {
MissedAny = true;
- VMEMLookup[MI] = *I;
continue;
}
- Cand = VMEMLookup[MI];
+ Cand = It->second;
if (llvm::is_contained(Counted, Cand)) {
MissedAny = true;
break;
More information about the llvm-commits
mailing list