Open DigOrDog opened 3 months ago
@llvm/issue-subscribers-backend-amdgpu
Author: None (DigOrDog)
The default amdgcn subtarget does not support flat addressing and isn't meaningful to codegen. You need to always supply a -mcpu
The default amdgcn subtarget does not support flat addressing and isn't meaningful to codegen. You need to always supply a -mcpu
Thank you for your explanation. I referred to this document and tried the options -mtriple=amdgcn -mcpu=gfx700 and -mtriple=amdgcn -mcpu=gfx940, but neither worked. I believe my understanding of flat addressing is flawed. Could you please inform me which mcpu supports it?
The default amdgcn subtarget does not support flat addressing and isn't meaningful to codegen. You need to always supply a -mcpu
Thank you for your explanation. I referred to this document and tried the options -mtriple=amdgcn -mcpu=gfx700 and -mtriple=amdgcn -mcpu=gfx940, but neither worked. I believe my understanding of flat addressing is flawed. Could you please inform me which mcpu supports it?
gfx700 and gfx940 both support flat addressing. It's only gfx6* that do not. Your IR has a secondary problem after the initial selection failure on the flat store. The alloca is using the wrong address space. We do not support using alloca with the default address space, it needs to use addrspace(5). Here is the corrected IR . Alternatively, you could directly access the pointer as addrspace(5) instead of using the addrspacecast to the flat pointer.
Description
Interestingly, compiling IR with llc 18 results in a crash, but versions prior to llc 17 do not.
Minimal Reproduction
https://llvm.godbolt.org/z/TqPhzqzYY
Code
Stack