[PATCH] D87107: [AMDGPU] Target hook to apply target specific split constraint

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 8 10:28:45 PDT 2020


rampitec added a comment.

In D87107#2259217 <https://reviews.llvm.org/D87107#2259217>, @alex-t wrote:

> The idea is:
>
> For the block that is queried
>
> 1. Look for it's predecessors that can pass control through the S_EXECZ/EXECNZ
> 2. If found one, look for exec restoring code starting the beginning of the block being queried.
> 3. Since exec restoring code always belong to the block prologue, search the prologue and if not found return false.
>
> Considering your comment that exec == 0 does not matter, we'd rather search upwards before the immediate dominator block in encountered to check what we met first - exec modify or exec restore. The problem here is that XOR can be both.

Thanks. More or less you want to disable split in an empty block preceded by c_branch_exec[n]z. I can understand why this would be a problem. In reality such block can be either empty or contain another branch, because it does not make any sense to pass a control to a block with vector instructions and have no active lanes.

But this leaves couple problems:

1. It does not disallow a split in a block prologue before exec is restored. This creates exactly the same problem.
2. It does not disallow a split even in an empty block where EXEC is not zero, but just wrong. The problem is not zero EXEC, the problem is wrong EXEC, zero is just once case of this.

JBTW, even with all of this it is still OK to split an LI of SGPR. I'd say at the very least callback needs to take an LI in question as well.



================
Comment at: llvm/lib/Target/AMDGPU/SIInstrInfo.cpp:6813
+            (Instr->getOpcode() == AMDGPU::S_MOV_B64 &&
+             Instr->getOperand(0).getReg() == AMDGPU::EXEC));
+  };
----------------
It already modifies EXEC, so checking DST here is not needed.


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

https://reviews.llvm.org/D87107



More information about the llvm-commits mailing list