[PATCH] D101546: [AMDGPU] Fix v_swap_b32 formation on physical registers

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 29 10:11:26 PDT 2021


foad added a comment.

In D101546#2726051 <https://reviews.llvm.org/D101546#2726051>, @arsenm wrote:

> We don't need to rely on kill flags (and in fact should not, since they are semi-deprecated). We should be using liveness scans starting from the bottom of the block which do not need kill flags

I'm not relying on the kill flag being present for correctness, I'm just taking advantage of it if it does happen to be there (and assuming that it is correct if it is present). If kill flags are not present then I guess you'd need to run MachineDCE again afterwards to clean up.



================
Comment at: llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp:580-583
+    if (T.isVirtual() ? MRI.use_nodbg_empty(T)
+                      : (MovY->getOperand(1).isKill() && !PrevUsedT)) {
+      // For physical registers: the use of T in MovY is killed, and we didn't
+      // see any other uses of T before MovY.
----------------
Does this part make sense? I am really not too sure what kind of liveness information we can rely on here for virtual and/or physical registers.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101546



More information about the llvm-commits mailing list