[AMDGPU][GFX11] exp should have at least one target
In contrast with GFX10, GFX11 does not allow en=0, i.e. the following code is not legal:
exp mrt0, off, off, off, off
I prepared an MC patch to check this limitation, but then noticed that codegen has GFX11 tests with en=0, for example, see llvm.amdgcn.exp.ll:
; GCN-LABEL: {{^}}test_export_zeroes_f32:
; GCN: exp mrt0 off, off, off, off{{$}}
; GCN: exp mrt0 off, off, off, off done{{$}}
define amdgpu_kernel void @test_export_zeroes_f32() #0 {
call void @llvm.amdgcn.exp.f32(i32 0, i32 0, float 0.0, float 0.0, float 0.0, float 0.0, i1 false, i1 false)
call void @llvm.amdgcn.exp.f32(i32 0, i32 0, float 0.0, float 0.0, float 0.0, float 0.0, i1 true, i1 false)
ret void
}
@Sisyph, is this a legal GFX11 code?
@llvm/issue-subscribers-backend-amdgpu
exp mrt0, off, off, off, off
Do you really think this should be rejected by the assembler? What does SP3 do?
I think en=0 is valid for some scenarios (16-bit components?). We also use it en=0 for null exports/early termination from pixel shaders.
I think en=0 is valid for some scenarios (16-bit components?).
In GFX11 the hardware has stopped even pretending to care whether you are exporting 16- or 32-bit data. All it cares about is how many vgprs-worth of data you are exporting.
Thanks for clarification. I remember that SPG explicitly disabled en=0 at some point. Probably it was a documentation bug. SP3 seems to accept en=0.