Invalid OpPtrAccessChain into a Function Storage pointer
Open
- Dominant language
- LLVM
- Stars
- 729
- Forks
- 110
- Avg merge
- 17h 51m
- Merged PRs (30d)
- 23
Description
The following:
```cpp
struct InstanceTest
{
uint data1_;
uint data2_;
uint data3_;
};
__kernel void test(__global InstanceTest* dst)
{
const size_t index = get_global_id(0);
InstanceTest instances[2];
if (index < 2) {
dst[index] = instances[index];
}
}
```
Generates a OpPtrAccessChain into a function storage pointer:
```llvm
%35 = OpPtrAccessChain %_ptr_Function_uint %33 %uint_3
```
https://gcc.godbolt.org/z/oz5MGoWd5
I don't think this is valid.
See also https://github.com/google/clspv/issues/135
Contributor guide
Assessment
This issue has not been assessed yet.