Disable null export (for kills) when a frontend defines a pixel
shader as not exporting using amdgpu-color-export and
amdgpu-depth-export function attrbutes.
This allows the generation of export free pixel shaders.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
LGTM.
llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp | ||
---|---|---|
1353 | Do these newly invented attributes need to be documented somewhere? |
llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp | ||
---|---|---|
1353 | I cannot find anywhere the existing ones like InitialPSInputAddr are documented? |
llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp | ||
---|---|---|
1353 | OK then I guess you're off the hook :-/ |
llvm/lib/Target/AMDGPU/SILateBranchLowering.cpp | ||
---|---|---|
76 | Do you think we need to define a subtarget feature like AllowNoExportPS and check it here? The hardware behavior is different before and after gfx10, if we do not check this hardware difference, then this attributes will be gpu-generation-dependent (frontend should not set this attribute before gfx10). I am not sure whether this sounds a issue to others? |
llvm/lib/Target/AMDGPU/SILateBranchLowering.cpp | ||
---|---|---|
76 | It depends, it seems we are going in the direction that it is up to frontends to ensure correct behaviour of exports. Rather than adding a subtarget feature we could just add an architecture check here. |
llvm/lib/Target/AMDGPU/SILateBranchLowering.cpp | ||
---|---|---|
76 | Frontends are responsible for correctly inserting exp/exp_done to meet hardware requirement for most cases, there is only one exception AFAIK, the kill case which is what we are dealing with here. Architecture check sounds quite good to me. That would make the attribute just match the high level shader behavior. |
llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp | ||
---|---|---|
1355 | Should stick to lowercase - separated naming convention with amdgpu- prefix |
LGTM.
llvm/lib/Target/AMDGPU/SILateBranchLowering.cpp | ||
---|---|---|
75 | Maybe add a brief comment explaining what changed in the hardware in GFX10? |
llvm/lib/Target/AMDGPU/SILateBranchLowering.cpp | ||
---|---|---|
84 | Typo "once" :) |
Maybe add a brief comment explaining what changed in the hardware in GFX10?