[PATCH] D79481: [AMDGPU] Cluster shader exports

Carl Ritson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 7 02:48:07 PDT 2020


critson marked 6 inline comments as done.
critson added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUExportClustering.cpp:58-78
+  // Build chains of exports
+  for (SUnit &SU : DAG->SUnits) {
+    if (!isExport(SU))
+      continue;
+
+    unsigned ChainID = ExportChains.size();
+    for (const SDep &Pred : SU.Preds) {
----------------
foad wrote:
> Do you understand the chain formation logic, or is it copied from the standard MemOpClusterMutation? (Or both?!)
A bit of both, code adapted from MemOpClusterMutation and I have reasonable confidence I understand what it is doing.


================
Comment at: llvm/test/CodeGen/AMDGPU/llvm.amdgcn.exp.ll:552-558
+define amdgpu_kernel void @test_export_clustering(float %x, float %y) #0 {
+  %z0 = fadd float %x, %y
+  call void @llvm.amdgcn.exp.f32(i32 32, i32 15, float %x, float %y, float %z0, float 0.0, i1 false, i1 false)
+  %z1 = fsub float %y, %x
+  call void @llvm.amdgcn.exp.f32(i32 33, i32 15, float %x, float %y, float %z1, float 1.0, i1 true, i1 false)
+  ret void
+}
----------------
foad wrote:
> Can you pre-commit this? Did it actually have a waitcnt before this fix?
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.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79481/new/

https://reviews.llvm.org/D79481





More information about the llvm-commits mailing list