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

Juan Manuel Martinez CaamaƱo via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 28 06:59:40 PST 2026


================
@@ -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>>;
----------------
jmmartinez wrote:

Just an arbitrary small number.

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


More information about the llvm-commits mailing list