Skip to content

Conversation

@kazutakahirata
Copy link
Contributor

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Feb 20, 2025

@llvm/pr-subscribers-coroutines

@llvm/pr-subscribers-llvm-transforms

Author: Kazu Hirata (kazutakahirata)

Changes

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

1 Files Affected:

  • (modified) llvm/lib/Transforms/Coroutines/MaterializationUtils.cpp (+3-2)
diff --git a/llvm/lib/Transforms/Coroutines/MaterializationUtils.cpp b/llvm/lib/Transforms/Coroutines/MaterializationUtils.cpp
index 5021425152f6c..6aaabca95c4c3 100644
--- a/llvm/lib/Transforms/Coroutines/MaterializationUtils.cpp
+++ b/llvm/lib/Transforms/Coroutines/MaterializationUtils.cpp
@@ -293,7 +293,8 @@ void coro::doRematerializations(
     for (Instruction *U : E.second) {
       // Don't process a user twice (this can happen if the instruction uses
       // more than one rematerializable def)
-      if (AllRemats.count(U))
+      auto [It, Inserted] = AllRemats.try_emplace(U);
+      if (!Inserted)
         continue;
 
       // Constructor creates the whole RematGraph for the given Use
@@ -306,7 +307,7 @@ void coro::doRematerializations(
                       ++I) { (*I)->Node->dump(); } dbgs()
                  << "\n";);
 
-      AllRemats[U] = std::move(RematUPtr);
+      It->second = std::move(RematUPtr);
     }
   }
 

@kazutakahirata kazutakahirata merged commit 2130b9c into llvm:main Feb 20, 2025
11 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_001_repeated_hash_lookups_llvm_Coroutines branch February 20, 2025 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants