llvm-project/llvm/test/Transforms/StructurizeCFG
Changpeng Fang 5f9154618e StructurizeCFG: Adjust the loop depth for a subregion to order the nodes correctly
Summary:
  StructurizeCFG::orderNodes basically uses a reverse post-order (RPO) traversal of the region list to get the order.
The only problem with it is that sometimes backedges for outer loops will be visited before backedges for inner loops.
To solve this problem, a loop depth based approach has been used to make sure all blocks in this loop has been visited
before moving on to outer loop.

However, we found a problem for a SubRegion which is a loop itself:

--> BB1 --> BB2 --> BB3 -->

In this case, BB2 is a SubRegion (loop), and thus its loopdepth is different than that of BB1 and BB3. This fact will lead
BB2 to be placed in the wrong order.

In this work, we treat the SubRegion as a special case and use its exit block to determine the loop and its depth
to guard the sorting.

Reviewers:
  arsenm, jlebar

Differential Revision:
  https://reviews.llvm.org/D46912

llvm-svn: 333111
2018-05-23 18:34:48 +00:00
..
AMDGPU StructurizeCFG: Adjust the loop depth for a subregion to order the nodes correctly 2018-05-23 18:34:48 +00:00
branch-on-argument.ll [Dominators] Include infinite loops in PostDominatorTree 2017-08-15 18:14:57 +00:00
bug36015.ll Revert r321751, "StructurizeCFG: Fix broken backedge detection" 2018-01-24 18:02:05 +00:00
invert-condition.ll StructurizeCFG: fix inverting conditions 2018-05-15 21:41:55 +00:00
invert-constantexpr.ll [StructurizeCFG] fix test to be independent of FP undef 2018-03-08 17:13:57 +00:00
loop-multiple-exits.ll
nested-loop-order.ll Revert r321751, "StructurizeCFG: Fix broken backedge detection" 2018-01-24 18:02:05 +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
switch.ll