[clang][SPIR-V] Addrspace of opencl_global should always be 1 (#136753)
This fixes a CUDA SPIR-V regression introduced in https://github.com/llvm/llvm-project/pull/134399. --------- Signed-off-by: Sarnie, Nick <nick.sarnie@intel.com>
This commit is contained in:
parent
ed866d994c
commit
52a96491e1
@ -58,8 +58,9 @@ static const unsigned SPIRDefIsPrivMap[] = {
|
||||
// Used by both the SPIR and SPIR-V targets.
|
||||
static const unsigned SPIRDefIsGenMap[] = {
|
||||
4, // Default
|
||||
// OpenCL address space values for this map are dummy and they can't be used
|
||||
0, // opencl_global
|
||||
// Some OpenCL address space values for this map are dummy and they can't be
|
||||
// used
|
||||
1, // opencl_global
|
||||
0, // opencl_local
|
||||
0, // opencl_constant
|
||||
0, // opencl_private
|
||||
|
||||
11
clang/test/CodeGenCUDASPIRV/printf.cu
Normal file
11
clang/test/CodeGenCUDASPIRV/printf.cu
Normal file
@ -0,0 +1,11 @@
|
||||
// RUN: %clang_cc1 -fcuda-is-device -triple spirv32 -o - -emit-llvm -x cuda %s | FileCheck --check-prefix=CHECK-SPIRV32 %s
|
||||
// RUN: %clang_cc1 -fcuda-is-device -triple spirv64 -o - -emit-llvm -x cuda %s | FileCheck --check-prefix=CHECK-SPIRV64 %s
|
||||
|
||||
// CHECK-SPIRV32: @.str = private unnamed_addr addrspace(4) constant [13 x i8] c"Hello World\0A\00", align 1
|
||||
// CHECK-SPIRV64: @.str = private unnamed_addr addrspace(1) constant [13 x i8] c"Hello World\0A\00", align 1
|
||||
|
||||
extern "C" __attribute__((device)) int printf(const char* format, ...);
|
||||
|
||||
__attribute__((global)) void printf_kernel() {
|
||||
printf("Hello World\n");
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user