[llvm] [SPIRV] Emit intrinsics for globals only in function that references them (PR #178143)

Marcos Maronas via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 28 03:12:38 PST 2026


Juan Manuel Martinez =?utf-8?q?Caamaño?=,
Juan Manuel Martinez =?utf-8?q?Caamaño?Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/178143 at github.com>


================
@@ -62,6 +62,83 @@ namespace llvm::SPIRV {
 } // namespace llvm::SPIRV
 
 namespace {
+// This class keeps track of which functions reference which global variables.
+class GlobalVariableReferences {
+  template <typename T1, typename T2>
+  using OneToManyMapTy = DenseMap<T1, SmallPtrSet<T2, 4>>;
----------------
maarquitos14 wrote:

Are we choosing 4 for any reason or is just an arbitrary small number? 

https://github.com/llvm/llvm-project/pull/178143


More information about the llvm-commits mailing list