[DA] conservatively mark the join of every divergent branch
authorSameer Sahasrabuddhe <sameer.sahasrabuddhe@amd.com>
Thu, 18 Jun 2020 12:09:20 +0000 (17:39 +0530)
committerSameer Sahasrabuddhe <sameer.sahasrabuddhe@amd.com>
Thu, 18 Jun 2020 12:09:20 +0000 (17:39 +0530)
commit7aad220795b50bee591cf34dfdbb030ca4d5bdc0
tree25cc373cc3faeee2b969b152eef06e785b6eb80d
parentd8c612b7eabcc7ec399fad533d5beefa4ae08ac9
[DA] conservatively mark the join of every divergent branch

For a loop, a join block is a block that is reachable along multiple
disjoint paths from the exiting block of a loop. If the exit condition
of the loop is divergent, then such join blocks must also be marked
divergent. This currently fails in some cases because not all join
blocks are identified correctly.

The workaround is to conservatively mark every join block of any
branch (not necessarily the exiting block of a loop) as divergent.

https://bugs.llvm.org/show_bug.cgi?id=46372

Reviewed By: simoll

Differential Revision: https://reviews.llvm.org/D81806
llvm/lib/Analysis/DivergenceAnalysis.cpp
llvm/test/Analysis/DivergenceAnalysis/AMDGPU/join-at-loop-exit.ll [new file with mode: 0644]
llvm/test/Analysis/DivergenceAnalysis/AMDGPU/trivial-join-at-loop-exit.ll [new file with mode: 0644]