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

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 16 08:22:08 PDT 2021


arsenm added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUMCInstLower.cpp:300
+      if (isVerbose())
+        OutStreamer->emitRawComment(" meta instruction");
+      return;
----------------
sebastian-ne wrote:
> arsenm wrote:
> > sebastian-ne wrote:
> > > arsenm wrote:
> > > > I don't see a reason to emit a comment for these. Kills for example already have a comment for them
> > > The problem is that the AsmPrinter only handles top-level instructions, but not instructions inside bundles.
> > > So, without the code here, printing a bundle containing a KILL will crash because KILL and others are unhandled in `AMDGPUInstPrinter::printInstruction`.
> > We shouldn't be bundling these?
> How do we create the clause then?
> In the tests, we have
> ```
>     $sgpr2 = S_LOAD_DWORD_IMM $sgpr0_sgpr1, 0, 0
>     KILL undef renamable $sgpr4
>     $sgpr3 = S_LOAD_DWORD_IMM $sgpr0_sgpr1, 4, 0
> ```
> and we should be able to emit an `s_clause 0x1` in front of the two memory instructions.
Where did this kill come from? A kill of an undef source is pointless and can be deleted. The point of kill is to artifically extend live ranges anyway, so it can be moved outside of the bundle. Kills are ordinarily deleted after RA anyway


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