Skip to content

Commit 33fee56

Browse files
authored
[HLSL][SPIR-V] Change SPV AS map for groupshared (#143519)
The previous mapping we setting the hlsl_groupshared AS to 0, which translated to either Generic or Function. Changing this to 3, which translated to Workgroup. Related to #142804
1 parent ac7fa40 commit 33fee56

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

clang/lib/Basic/Targets/SPIR.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ static const unsigned SPIRDefIsPrivMap[] = {
4646
0, // ptr32_sptr
4747
0, // ptr32_uptr
4848
0, // ptr64
49-
0, // hlsl_groupshared
49+
3, // hlsl_groupshared
5050
12, // hlsl_constant
5151
10, // hlsl_private
5252
11, // hlsl_device
@@ -82,7 +82,7 @@ static const unsigned SPIRDefIsGenMap[] = {
8282
0, // ptr32_sptr
8383
0, // ptr32_uptr
8484
0, // ptr64
85-
0, // hlsl_groupshared
85+
3, // hlsl_groupshared
8686
0, // hlsl_constant
8787
10, // hlsl_private
8888
11, // hlsl_device

clang/test/CodeGenHLSL/group_shared.hlsl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
// RUN: dxil-pc-shadermodel6.3-library %s \
44
// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s
55

6+
// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \
7+
// RUN: spirv-unknown-vulkan1.3-compute %s \
8+
// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s
9+
610
// Make sure groupshared translated into address space 3.
711
// CHECK:@a = addrspace(3) global [10 x float]
812

0 commit comments

Comments
 (0)