[clang] [CIR][SPIR-V] Use the program address space for function global views (PR #232173)

Steffen Larsen via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 15 00:01:57 PDT 2026


================
@@ -29,6 +29,10 @@
 __constant__ int tab[2] = {1, 2};
 __device__ int dev = 3;
 
+// Functions live in the program address space 4.
+// LLVM-DAG: @llvm.used = {{.*}}ptr addrspace(4) @_Z7used_fnv
+__attribute__((used)) __device__ void used_fn() {}
----------------
steffenlarsen wrote:

This adds one test case, but the changes changes two paths. Will this visit both paths during lowering or can we add more tests to ensure coverage?

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


More information about the cfe-commits mailing list