[PATCH] D98888: [AMDGPU] SIOptimizeExecMaskingPreRA should check constant bus constraint when folds EXEC copy

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 19 15:22:19 PDT 2021


rampitec accepted this revision.
rampitec added a comment.
This revision now requires review to proceed.

LGTM



================
Comment at: llvm/lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp:424
+        if (SingleExecUser->getParent() == I->getParent() &&
+            !SingleExecUser->getOperand(Idx).isImplicit() &&
+            TII->isOperandLegal(*SingleExecUser, Idx, &I->getOperand(1))) {
----------------
alex-t wrote:
> rampitec wrote:
> > It is OK for exec operand to be implicit, but you do not need to check for legality in this case.
> The EXEC register may be an implicit operand but the "Idx" is the index of the Sreg64 register that holds the EXEC copy. 
Yep, you are right.


================
Comment at: llvm/test/CodeGen/AMDGPU/opt_exec_copy_fold.mir:16
+    %2:vreg_64 = COPY $exec
+    %3:sreg_64 = V_CMP_EQ_U64_e64 %1, %2, implicit $exec
+    $scc = COPY %3
----------------
arsenm wrote:
> Is exec + implicit exec + other SGPR really a constant bus violation?
I think SGPR + EXEC is a violation, implicit exec is just an internal glue. There is difference if you read exec as exec or as data operand.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98888



More information about the llvm-commits mailing list