Skip to content

Conversation

@kazutakahirata
Copy link
Contributor

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Feb 22, 2025

@llvm/pr-subscribers-backend-spir-v

Author: Kazu Hirata (kazutakahirata)

Changes

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

1 Files Affected:

  • (modified) llvm/lib/Target/SPIRV/SPIRVDuplicatesTracker.h (+5-4)
diff --git a/llvm/lib/Target/SPIRV/SPIRVDuplicatesTracker.h b/llvm/lib/Target/SPIRV/SPIRVDuplicatesTracker.h
index e574892712298..441e32c1eb695 100644
--- a/llvm/lib/Target/SPIRV/SPIRVDuplicatesTracker.h
+++ b/llvm/lib/Target/SPIRV/SPIRVDuplicatesTracker.h
@@ -154,22 +154,23 @@ template <typename KeyTy> class SPIRVDuplicatesTrackerBase {
     if (find(V, MF).isValid())
       return;
 
-    Storage[V][MF] = R;
+    auto &S = Storage[V];
+    S[MF] = R;
     if (std::is_same<Function,
                      typename std::remove_const<
                          typename std::remove_pointer<KeyTy>::type>::type>() ||
         std::is_same<Argument,
                      typename std::remove_const<
                          typename std::remove_pointer<KeyTy>::type>::type>())
-      Storage[V].setIsFunc(true);
+      S.setIsFunc(true);
     if (std::is_same<GlobalVariable,
                      typename std::remove_const<
                          typename std::remove_pointer<KeyTy>::type>::type>())
-      Storage[V].setIsGV(true);
+      S.setIsGV(true);
     if (std::is_same<Constant,
                      typename std::remove_const<
                          typename std::remove_pointer<KeyTy>::type>::type>())
-      Storage[V].setIsConst(true);
+      S.setIsConst(true);
   }
 
   Register find(KeyTy V, const MachineFunction *MF) const {

@kazutakahirata kazutakahirata merged commit 3747ba4 into llvm:main Feb 22, 2025
14 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_001_repeated_hash_lookups_llvm_SPIRV branch February 22, 2025 10: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