[llvm] [AMDGPU] Eliminate likely-spurious execz checks (PR #117567)
Fabian Ritter via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 25 08:05:23 PST 2024
ritter-x2a wrote:
> I still don't really understand...
>
> Are you trying to identify branches whose condition is divergent according to UA, but is likely to be uniform in practice?
>
> How can branch weights tell you whether the branch is likely uniform or not? I guess if it's likely uniform-and-true or uniform-and-false then they can tell you that.
>
> For what kind of branches do you want to influence the exec-skipping logic? Can you give an example?
There is an example in the added llvm/test/CodeGen/AMDGPU/conditional-mem-no-cbranch-execz.ll test (see also SWDEV-483228 for more discussion). When every wavefront diverges when executing a conditional, the execz branches to skip then/else cases are unnecessary and harm performance. The goal here is to remove the execz branches when that is likely the case (since the performance gains are probably not worth the effort of implementing a full, sound "must-not-be-uniform analysis" for this.)
https://github.com/llvm/llvm-project/pull/117567
More information about the llvm-commits
mailing list