Skip to content

[HLSL] Crash using array parameters #125743

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

Closed
Tracked by #21 ...
llvm-beanz opened this issue Feb 4, 2025 · 3 comments · Fixed by #126561
Closed
Tracked by #21 ...

[HLSL] Crash using array parameters #125743

llvm-beanz opened this issue Feb 4, 2025 · 3 comments · Fixed by #126561
Assignees
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" HLSL HLSL Language Support

Comments

@llvm-beanz
Copy link
Collaborator

Clang currently crashes when compiling the following simplified compute shader:

typedef uint4  uint32_t4;
typedef uint32_t4 uint32_t8[2];

uint32_t Accumulate(uint32_t8 V) {
  uint32_t4 SumVec = V[0] + V[1];
  return SumVec.x + SumVec.y + SumVec.z + SumVec.w;
}

Buffer<uint4> Buf;
RWBuffer<uint> Out;

[numthreads(8,1,1)]
void main(uint GI : SV_GroupIndex) {
  uint32_t8 Val = {Buf[GI], Buf[GI+8]};
  Out[GI] = Accumulate(Val);
}

Godbolt Link

@llvm-beanz llvm-beanz added the HLSL HLSL Language Support label Feb 4, 2025
@llvm-beanz llvm-beanz moved this to Planning in HLSL Support Feb 4, 2025
@spall
Copy link
Contributor

spall commented Feb 7, 2025

Simplified: https://godbolt.org/z/YMszdnP18

@spall spall self-assigned this Feb 7, 2025
spall added a commit that referenced this issue Feb 10, 2025
…rayParameterType (#126561)

Desugar type when converting from a ConstantArrayType to an
ArrayParameterType in getArrayParameterType
Closes #125743
@github-project-automation github-project-automation bot moved this from Planning to Closed in HLSL Support Feb 10, 2025
Icohedron pushed a commit to Icohedron/llvm-project that referenced this issue Feb 11, 2025
…rayParameterType (llvm#126561)

Desugar type when converting from a ConstantArrayType to an
ArrayParameterType in getArrayParameterType
Closes llvm#125743
joaosaffran pushed a commit to joaosaffran/llvm-project that referenced this issue Feb 14, 2025
…rayParameterType (llvm#126561)

Desugar type when converting from a ConstantArrayType to an
ArrayParameterType in getArrayParameterType
Closes llvm#125743
@spall
Copy link
Contributor

spall commented Feb 18, 2025

Also part of fixing this broader issue: #127670

@EugeneZelenko EugeneZelenko added the clang:frontend Language frontend issues, e.g. anything involving "Sema" label Feb 18, 2025
@llvmbot
Copy link
Member

llvmbot commented Feb 18, 2025

@llvm/issue-subscribers-clang-frontend

Author: Chris B (llvm-beanz)

Clang currently crashes when compiling the following simplified compute shader:
typedef uint4  uint32_t4;
typedef uint32_t4 uint32_t8[2];

uint32_t Accumulate(uint32_t8 V) {
  uint32_t4 SumVec = V[0] + V[1];
  return SumVec.x + SumVec.y + SumVec.z + SumVec.w;
}

Buffer&lt;uint4&gt; Buf;
RWBuffer&lt;uint&gt; Out;

[numthreads(8,1,1)]
void main(uint GI : SV_GroupIndex) {
  uint32_t8 Val = {Buf[GI], Buf[GI+8]};
  Out[GI] = Accumulate(Val);
}

Godbolt Link

sivan-shani pushed a commit to sivan-shani/llvm-project that referenced this issue Feb 24, 2025
…rayParameterType (llvm#126561)

Desugar type when converting from a ConstantArrayType to an
ArrayParameterType in getArrayParameterType
Closes llvm#125743
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" HLSL HLSL Language Support
Projects
Archived in project
4 participants