Issue 144608
Summary [DirectX] DXIL Data Scalarization is not scalarizing GEP for an array of vectors
Labels new issue
Assignees
Reporter Icohedron
    The following shader compiles without error under clang, but fails validation
https://godbolt.org/z/Tnq16cMxh

```hlsl
uint foo(uint2 v[2], uint i) { return v[i]; }
RWStructuredBuffer<uint> output;
[numthreads(1, 1, 1)] 
void CSMain(uint3 Tid : SV_DispatchThreadID) {
  uint2 v[2] = {Tid.xy, Tid.yx};
  output[Tid.z] = foo(v, Tid.z);
}
```

Validation error:
```
Invalid record
Validation failed.
```

The validation error is likely due to this GEP in the resulting DXIL
```llvm
%13 = getelementptr inbounds nuw [2 x <2 x i32>], ptr %12, i32 0, i32 %7, !dbg !106
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to