Issue 171175
Summary [SPIRV] Add legalization for single element vectors
Labels backend:SPIR-V
Assignees s-perron
Reporter s-perron
    SPIR-V does not allow vectors with just a single element. If the llvm-ir has such vectors, they need to be scalarized.

Some HLSL examples that generate small vectors are:

https://godbolt.org/z/1nx3ndGY3

```
struct T {
 int a;
};

[[vk::binding(10)]] const T t;

RWStructuredBuffer<int1x1> a;

[numthreads(1,1,1)]
void main() {
    a[0] = a[1] * t.a;
}
```

and https://godbolt.org/z/WThhWoo97

```
struct T {
 int a;
};

[[vk::binding(10)]] const T t;

RWStructuredBuffer<int1> a;

[numthreads(1,1,1)]
void main() {
    a[0] = a[1] * t.a;
}
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to