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

Alexander via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 7 07:14:33 PDT 2020


alex-t added a comment.

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 to check what we encounter first - exec modify or exec restore. The problem here is that XOR can be both.



================
Comment at: llvm/lib/Target/AMDGPU/SIInstrInfo.cpp:6817
+    MachineBasicBlock::iterator I = Pred->getFirstTerminator();
+    if (I != Pred->end() && I->modifiesRegister(AMDGPU::EXEC, TRI)) {
+      while (++I != Pred->end()) {
----------------
rampitec wrote:
> alex-t wrote:
> > rampitec wrote:
> > > S_OR shall not be a terminator, it is used in the prologue.
> > This is not about searching S_OR at all. This code checks if one of the predecessors has exec modified at block exit and a branch with exeec == 0 to current block or which we are querying now.
> It does at line 6811?
At line 6811 is the lambda that looks for the exec restoring instructions. It is used  at line 6834 looking for exec restore from the beginning of current block. As for the XOR - yes it also should be counted here.


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

https://reviews.llvm.org/D87107



More information about the llvm-commits mailing list