llvm-mirror/test/Transforms/StructurizeCFG
Matt Arsenault 6c170b33ed StructurizeCFG: Fix broken backedge detection
The work order was changed in r228186 from SCC order
to RPO with an arbitrary sorting function. The sorting
function attempted to move inner loop nodes earlier. This
was was apparently relying on an assumption that every block
in a given loop / the same loop depth would be seen before
visiting another loop. In the broken testcase, a block
outside of the loop was encountered before moving onto
another block in the same loop. The testcase would then
structurize such that one blocks unconditional successor
could never be reached.

Revert to plain RPO for the analysis phase. This fixes
detecting edges as backedges that aren't really.

The processing phase does use another visited set, and
I'm unclear on whether the order there is as important.
An arbitrary order doesn't work, and triggers some infinite
loops. The reversed RPO list seems to work and is closer
to the order that was used before, minus the arbitary
custom sorting.

A few of the changed tests now produce smaller code,
and a few are slightly worse looking.

llvm-svn: 321751
2018-01-03 18:45:37 +00:00
..
AMDGPU StructurizeCFG: Fix broken backedge detection 2018-01-03 18:45:37 +00:00
branch-on-argument.ll [Dominators] Include infinite loops in PostDominatorTree 2017-08-15 18:14:57 +00:00
invert-constantexpr.ll StructurizeCFG: Fix inverting constantexpr conditions 2016-07-15 22:13:16 +00:00
loop-multiple-exits.ll
nested-loop-order.ll StructurizeCFG: Fix broken backedge detection 2018-01-03 18:45:37 +00:00
no-branch-to-entry.ll [Dominators] Include infinite loops in PostDominatorTree 2017-08-15 18:14:57 +00:00
one-loop-multiple-backedges.ll Revert "StructurizeCFG: Directly invert cmp instructions" 2017-04-24 20:25:01 +00:00
post-order-traversal-bug.ll Revert "StructurizeCFG: Directly invert cmp instructions" 2017-04-24 20:25:01 +00:00
rebuild-ssa-infinite-loop.ll AMDGPU: Remove llvm.SI.vs.load.input 2017-04-03 21:45:13 +00:00
switch.ll