[AMDGPU] HIP error: unsupported expression in static initializer: addrspacecast
The following HIP program triggers a compiler error during compilation. The compiler fails to handle an address space cast from shared memory (addrspace(3)) to a generic pointer within a static initialiser context.
Test File: HIPProg.hip
How to reproduce:
clang++ -x hip HIPProg.hip --offload-arch=native
Actual Output:
error: unsupported expression in static initializer:
addrspacecast (ptr addrspace(3) @_ZZ6func_1P2S1E6l_1069 to ptr)
...
7 errors generated when compiling for gfx906.
I am not sure if this is just an ungraceful error or something not allowed in the generation.
tagging @mgcarrasco who is working on it
I can confirm with commit https://github.com/llvm/llvm-project/commit/3e20d3d3964a3a6ac5f882842c7716e2682d622f.
@llvm/issue-subscribers-backend-amdgpu
Author: ElliotBLabs
Test File: HIPProg.hip
How to reproduce:
clang++ -x hip HIPProg.hip --offload-arch=native
Actual Output:
error: unsupported expression in static initializer:
addrspacecast (ptr addrspace(3) @<!-- -->_ZZ6func_1P2S1E6l_1069 to ptr)
...
7 errors generated when compiling for gfx906.
I am not sure if this is just an ungraceful error or something not allowed in the generation.