clspv icon indicating copy to clipboard operation
clspv copied to clipboard

Invalid SPIR-V for some phi nodes/selects

Open alan-baker opened this issue 2 years ago • 0 comments

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.

alan-baker avatar Feb 21 '23 17:02 alan-baker