[PATCH] D43743: StructurizeCFG: Test for branch divergence correctly
Nicolai Hähnle via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Feb 25 07:27:57 PST 2018
nhaehnle created this revision.
nhaehnle added reviewers: arsenm, rampitec, jlebar, alex-t.
Fixes cases like the new test @nonuniform. In that test, %cc itself
is a uniform value; however, when reading it after the end of the loop in
basic block %if, its value is effectively non-uniform, so the branch is
This problem was encountered in
https://bugs.freedesktop.org/show_bug.cgi?id=103743; however, this change
in itself is not sufficient to fix that bug, as there is another issue
in the AMDGPU backend.
As discovered after committing an earlier version of this change, this
exposes a subtle interaction between this pass and DivergenceAnalysis:
since we remove and re-create branch instructions, we can no longer rely
on DivergenceAnalysis for branches in subregions that were already
processed by the pass.
Explicitly remove branch instructions from DivergenceAnalysis to
avoid dangling pointers as a matter of defensive programming, and
change how we detect non-uniform subregions.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 8111 bytes
Desc: not available
More information about the llvm-commits