[llvm] Late temporal divergence lowering for SDAG (PR #67033)

via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 25 07:39:10 PDT 2023


https://github.com/ruiling commented:

I doubt how much help MachineUniformityAnalysis could help here, can it correctly differentiate uniform/divergent booleans stored in SGPR at this late stage? Do you have some tests to show this?

Do you know any other sources of such temporal divergence besides MachineSink?

For the issue shown in the test, I think there might be a little bit more complex case like:
```
bb.loop:
  ...
  %0 = S_ADD ...
  %1 = V_ADD %0, ...
  ...
  SI_LOOP ...
  S_BRANCH %bb.exit
```
Now that we allow `%1` to be sunk, then `%0` which is a scalar instruction may also be sunk out of the loop. So I think inserting a simple sgpr to vgpr copy does not work for such kind of case. If you follow the way shown in the change, you might need to convert the instruction into vector instruction. But I guess there might be constraint that you cannot always do that, which I am not sure about possible issues here.

https://github.com/llvm/llvm-project/pull/67033


More information about the llvm-commits mailing list