llvm-project/llvm/test/Transforms/LoopDeletion
Philip Reames ef51eed37b [LoopDeletion] Handle inner loops w/untaken backedges
This builds on the restricted after initial revert form of D93906, and adds back support for breaking backedges of inner loops. It turns out the original invalidation logic wasn't quite right, specifically around the handling of LCSSA.

When breaking the backedge of an inner loop, we can cause blocks which were in the outer loop only because they were also included in a sub-loop to be removed from both loops. This results in the exit block set for our original parent loop changing, and thus a need for new LCSSA phi nodes.

This case happens when the inner loop has an exit block which is also an exit block of the parent, and there's a block in the child which reaches an exit to said block without also reaching an exit to the parent loop.

(I'm describing this in terms of the immediate parent, but the problem is general for any transitive parent in the nest.)

The approach implemented here involves a potentially expensive LCSSA rebuild.  Perf testing during review didn't show anything concerning, but we may end up needing to revert this if anyone encounters a practical compile time issue.

Differential Revision: https://reviews.llvm.org/D94378
2021-01-22 16:31:29 -08:00
..
2007-07-23-InfiniteLoop.ll
2008-05-06-Phi.ll [SimplifyCFG] Teach simplifyUnreachable() to preserve DomTree 2020-12-18 00:37:22 +03:00
2011-06-21-phioperands.ll
2017-07-11-incremental-dt.ll Revert "[LoopDeletion] Allows deletion of possibly infinite side-effect free loops" 2020-11-07 00:32:12 -05:00
assume.ll [LoopDelete][Assume] Allow deleting loops with assumes 2020-09-26 12:32:44 +02:00
basic-remark.ll Revert "[LoopDeletion] Allows deletion of possibly infinite side-effect free loops" 2020-11-07 00:32:12 -05:00
crashbc.ll
dcetest.ll [SimplifyCFG] TryToSimplifyUncondBranchFromEmptyBlock() already knows how to preserve DomTree 2020-12-17 01:03:49 +03:00
diundef.ll Revert "[LoopDeletion] Allows deletion of possibly infinite side-effect free loops" 2020-11-07 00:32:12 -05:00
invalidation.ll Revert "[LoopDeletion] Allows deletion of possibly infinite side-effect free loops" 2020-11-07 00:32:12 -05:00
multiple-exit-conditions.ll Revert "[LoopDeletion] Allows deletion of possibly infinite side-effect free loops" 2020-11-07 00:32:12 -05:00
multiple-exits.ll Revert "[LoopDeletion] Allows deletion of possibly infinite side-effect free loops" 2020-11-07 00:32:12 -05:00
mustprogress.ll [LoopDeletion] Allows deletion of possibly infinite side-effect free loops 2021-01-05 09:56:16 -05:00
no-exit-blocks.ll [LoopDeletion] Allows deletion of possibly infinite side-effect free loops 2021-01-05 09:56:16 -05:00
noop-loops-with-subloops.ll [LoopDeletion] Also consider loops with subloops for deletion. 2021-01-06 14:49:00 +00:00
simplify-then-delete.ll [SimplifyCFG] Teach SimplifyCondBranchToTwoReturns() to preserve DomTree, part 1 2020-12-20 00:18:35 +03:00
unreachable-loops.ll [LoopDeletion] Also consider loops with subloops for deletion. 2021-01-06 14:49:00 +00:00
update-scev.ll [LoopDeletion] Break backedge of outermost loops when known not taken 2021-01-10 16:02:33 -08:00
use-in-unreachable.ll Revert "[LoopDeletion] Allows deletion of possibly infinite side-effect free loops" 2020-11-07 00:32:12 -05:00
zero-btc.ll [LoopDeletion] Handle inner loops w/untaken backedges 2021-01-22 16:31:29 -08:00