Skip to content

[HLSL][SPIR-V] Change SPV AS map for groupshared #143519

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions clang/lib/Basic/Targets/SPIR.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static const unsigned SPIRDefIsPrivMap[] = {
0, // ptr32_sptr
0, // ptr32_uptr
0, // ptr64
0, // hlsl_groupshared
3, // hlsl_groupshared
12, // hlsl_constant
10, // hlsl_private
11, // hlsl_device
Expand Down Expand Up @@ -82,7 +82,7 @@ static const unsigned SPIRDefIsGenMap[] = {
0, // ptr32_sptr
0, // ptr32_uptr
0, // ptr64
0, // hlsl_groupshared
3, // hlsl_groupshared
0, // hlsl_constant
10, // hlsl_private
11, // hlsl_device
Expand Down
4 changes: 4 additions & 0 deletions clang/test/CodeGenHLSL/group_shared.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
// RUN: dxil-pc-shadermodel6.3-library %s \
// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s

// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \
// RUN: spirv-unknown-vulkan1.3-compute %s \
// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s

// Make sure groupshared translated into address space 3.
// CHECK:@a = addrspace(3) global [10 x float]

Expand Down