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

via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 25 08:08:36 PDT 2023


petar-avramovic wrote:

> can it correctly differentiate uniform/divergent booleans stored in SGPR at this late stage? 

No (maybe it could for global-isel but with a few patches). But that does not matter for temporal divergence detection. Divergent loops are detected via intrinsic-terminator-pseudo-branches (for example SI_IF), and candidates for 'temporal divergent uses' can be collected during uniformity info analysis calculation

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

Most of the phis with one incoming inserted in LCSSA(the ir pass) to the function

> For the issue shown in the test, I think there might be a little bit more complex case like:

If all of those can be sunk out of the loop, that would be done in some early ir pass. S_ADD is used by some phi (easiest is to think about it as "loop counter" - the "++i") and cannot be sunk out of the loop

Working on a smaller test, will update soon


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


More information about the llvm-commits mailing list