Skip to content

Conversation

@kazutakahirata
Copy link
Contributor

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Jan 20, 2025

@llvm/pr-subscribers-llvm-transforms

Author: Kazu Hirata (kazutakahirata)

Changes

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

1 Files Affected:

  • (modified) llvm/lib/Transforms/HipStdPar/HipStdPar.cpp (+3-2)
diff --git a/llvm/lib/Transforms/HipStdPar/HipStdPar.cpp b/llvm/lib/Transforms/HipStdPar/HipStdPar.cpp
index 92042ddab38dc7..895c8c9d48681e 100644
--- a/llvm/lib/Transforms/HipStdPar/HipStdPar.cpp
+++ b/llvm/lib/Transforms/HipStdPar/HipStdPar.cpp
@@ -279,10 +279,11 @@ HipStdParAllocationInterpositionPass::run(Module &M, ModuleAnalysisManager&) {
   for (auto &&F : M) {
     if (!F.hasName())
       continue;
-    if (!AllocReplacements.contains(F.getName()))
+    auto It = AllocReplacements.find(F.getName());
+    if (It == AllocReplacements.end())
       continue;
 
-    if (auto R = M.getFunction(AllocReplacements[F.getName()])) {
+    if (auto R = M.getFunction(It->second)) {
       F.replaceAllUsesWith(R);
     } else {
       std::string W;

@kazutakahirata kazutakahirata merged commit f355a44 into llvm:main Jan 20, 2025
10 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_001_repeated_hash_lookups_llvm_HipStdPar branch January 20, 2025 18: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