clspv
clspv copied to clipboard
Invalid SPIR-V for some phi nodes/selects
I noticed this for at least physical storage buffer.
constant int b[5] = {1,2,3,4,5};
__attribute__((noinline))
int foo(constant int* p, int x) {
return p[x];
}
kernel void test(global int* out, constant int* other, int x) {
int gid = get_global_id(0);
out[gid] = foo(x > 5 ? other : p, gid);
}
The geps generated for the selection of pointers has differing types due to the module scope constant vs the kernel argument.