[PATCH] D119696: [AMDGPU] Improve v_cmpx usage on GFX10.3.

Carl Ritson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 15 00:11:37 PDT 2022


critson requested changes to this revision.
critson added a comment.
This revision now requires changes to proceed.

Need to fix missing TRI for modifiesRegister calls.
Also please add a test of the form:

  $sgpr0 = S_BFE_U32 killed renamable $sgpr3, 524296, implicit-def dead $scc
  $vcc = V_CMP_GT_U32_e64 killed $sgpr0, killed $vgpr0, implicit $exec
  $sgpr0_sgpr1 = COPY $exec, implicit-def $exec
  $sgpr0_sgpr1 = S_AND_B64 killed renamable $sgpr0_sgpr1, killed renamable $vcc, implicit-def dead $scc
  $exec = S_MOV_B64_term killed renamable $sgpr0_sgpr

Where V_CMP source is subregister of saved EXEC mask, which can happen in wave64.



================
Comment at: llvm/lib/Target/AMDGPU/SIOptimizeExecMasking.cpp:379
+  if (Src0->isReg() && TRI->isSGPRReg(MRI, Src0->getReg()) &&
+      SaveExec.modifiesRegister(Src0->getReg()))
+    return nullptr;
----------------
sebastian-ne wrote:
> Does this also need the TRI?
modifiesRegister must be passed TRI otherwise subregisters will not be checked.


================
Comment at: llvm/lib/Target/AMDGPU/SIOptimizeExecMasking.cpp:384
+  if (Src1->isReg() && TRI->isSGPRReg(MRI, Src1->getReg()) &&
+      SaveExec.modifiesRegister(Src1->getReg()))
+    return nullptr;
----------------
Here too.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119696



More information about the llvm-commits mailing list