Skip to content

Commit 812daae

Browse files
sarnexIanWood1
authored andcommitted
[clang][SPIR-V] Fix OpenCL addrspace mapping when using non-zero default AS (llvm#137187)
Based on feedback from llvm#136753, remove the dummy values for OpenCL and make them match the zero default AS map. Signed-off-by: Sarnie, Nick <[email protected]>
1 parent 0c149dd commit 812daae

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

clang/lib/Basic/Targets/SPIR.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,13 @@ static const unsigned SPIRDefIsPrivMap[] = {
5858
// Used by both the SPIR and SPIR-V targets.
5959
static const unsigned SPIRDefIsGenMap[] = {
6060
4, // Default
61-
// Some OpenCL address space values for this map are dummy and they can't be
62-
// used
6361
1, // opencl_global
64-
0, // opencl_local
65-
0, // opencl_constant
62+
3, // opencl_local
63+
2, // opencl_constant
6664
0, // opencl_private
67-
0, // opencl_generic
68-
0, // opencl_global_device
69-
0, // opencl_global_host
65+
4, // opencl_generic
66+
5, // opencl_global_device
67+
6, // opencl_global_host
7068
// cuda_* address space mapping is intended for HIPSPV (HIP to SPIR-V
7169
// translation). This mapping is enabled when the language mode is HIP.
7270
1, // cuda_device

0 commit comments

Comments
 (0)