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

Arseniy Obolenskiy via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 15 00:30:19 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() {}
----------------
aobolensk wrote:

Added test case for the 2nd scenario in clang/test/CIR/Lowering/address-space.cir

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


More information about the cfe-commits mailing list