[PATCH] D88777: [AMDGPU] Add SI_EARLY_TERMINATE_SCC0 for early terminating shader

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 8 02:08:32 PST 2021


foad added a comment.

Patch looks fine to me. Why is it useful to terminate on scc0 instead of scc1, or is it an arbitrary choice? Could you give a slightly more realistic example of how it would be used? Your tests all have:

  S_CMP_EQ_U32 killed $sgpr0, 0, implicit-def $scc
  SI_EARLY_TERMINATE_SCC0 implicit $scc, implicit $exec

which will terminate early if sgpr0 is //not// 0. Is the idea that this would be used when we're just about to AND sgpr0 into exec?



================
Comment at: llvm/lib/Target/AMDGPU/SIInsertSkips.cpp:494
+    else
+      Instr->eraseFromParent();
+  }
----------------
Could erase here unconditionally, to avoid having an erase in earlyTerm as well.


================
Comment at: llvm/lib/Target/AMDGPU/SIInstructions.td:328
+// Only valid in pixel shaders.
+def SI_EARLY_TERMINATE_SCC0 : SPseudoInstSI <(outs), (ins)> {
+  let Uses = [EXEC,SCC];
----------------
Am I right in thinking that this is not a terminator, so it can appear in the middle of an MBB? Is that normal for this kind of pseudo?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88777



More information about the llvm-commits mailing list