Add DAG scheduling mutation to cluster export instructions.
This avoids unnecessary waitcnts being added when computation
ends up interspersed with exports.
Details
- Reviewers
foad arsenm rampitec nhaehnle - Commits
- rGe3ffe7269b69: [AMDGPU] Cluster shader exports
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Looks good.
As a follow-on, would this be a good place to try to ensure that position exports go before parameter exports?
llvm/lib/Target/AMDGPU/AMDGPUExportClustering.cpp | ||
---|---|---|
32–33 | You don't need these parentheses. | |
40 | This is trivia, but isn't it simpler to start counting at 1 than to finish at (End - 1) ? | |
46 | I don't quite understand the comment. If nothing depends on an export then surely isExport() on the next line will never be true? | |
59–79 | Do you understand the chain formation logic, or is it copied from the standard MemOpClusterMutation? (Or both?!) | |
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.exp.ll | ||
552–558 | Can you pre-commit this? Did it actually have a waitcnt before this fix? |
llvm/lib/Target/AMDGPU/AMDGPUExportClustering.cpp | ||
---|---|---|
59–79 | A bit of both, code adapted from MemOpClusterMutation and I have reasonable confidence I understand what it is doing. | |
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.exp.ll | ||
552–558 | Sorry for the effort, but can you educate me on the concept of pre-committing the test. It will fail without the rest of the code in this patch as a waitcnt is inserted at present. |
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.exp.ll | ||
---|---|---|
552–558 | I mean, commit @test_export_clustering but with check lines that show the current codegen. (This is easier if you auto-generate the check lines. I hadn't noticed that you wrote these ones by hand.) Then, when you rebase the current patch, it will show us exactly what effect it had on the codegen for this function. It's not essential but it is helpful to reviewers. |
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.exp.ll | ||
---|---|---|
552–558 | Nice! |
You don't need these parentheses.