[PATCH] D106042: [AMDGPU] Ignore KILLs when forming clauses

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 15 06:30:40 PDT 2021


foad accepted this revision.
foad added a comment.
This revision is now accepted and ready to land.

I think this looks fine, thanks.

A possible alternative approach would be to put something like this at the start of emitClause:

  while (getHardClauseType(CI.Last) == HARDCLAUSE_INTERNAL)
    --CI.Last;



================
Comment at: llvm/lib/Target/AMDGPU/SIInsertHardClauses.cpp:61
   HARDCLAUSE_INTERNAL,
+  // Pseudo instructions that do not result in any ISA like KILL.
+  HARDCLAUSE_IGNORE,
----------------
Nit: maybe call them "meta instructions" here, for consistency with isMetaInstruction, and because "pseudo instruction" means something differrent in the AMDGPU backend.


================
Comment at: llvm/lib/Target/AMDGPU/SIInsertHardClauses.cpp:119
     // The length of the clause including any internal instructions in the
-    // middle or after the end of the clause.
+    // middle (but not in the end) of the clause.
     unsigned Length = 0;
----------------
"**at** the end"


================
Comment at: llvm/lib/Target/AMDGPU/SIInsertHardClauses.cpp:191
+          if (Type != HARDCLAUSE_IGNORE) {
+            if (Type != HARDCLAUSE_INTERNAL) {
+              ++CI.Length;
----------------
Nit: do the == case first, otherwise the "else" case reads like a double negative.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106042



More information about the llvm-commits mailing list