[PATCH] D32494: [Loop Deletion] Delete loops that are semantically unreachable

Anna Thomas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 25 10:03:02 PDT 2017


anna created this revision.
Herald added a subscriber: mzolotukhin.

This is the first set of changes to merge loop-deletion and loop-simplifyCFG.
Currently, loop deletion only supports deleting loops that have backedges that
are not taken back into the loop (i.e. the values outside the loop are invariant
wrt each loop iteration).
This patch adds logic to delete loops where the loop is proven to be
semantically unreachable.
The basic purpose here is to support and test the loop deletion
logic for the usage in loop-simplifyCFG, where changing constant conditional
branches to unconditional can make loops dead.

The next steps are:

1. moving the loop deletion implementation to LoopUtils
2. Add logic in loop-simplifyCFG which will support changing conditional

constant branches to unconditional branches. If loops become unreachable in this
process, they can be removed using `deleteDeadLoop` function.


https://reviews.llvm.org/D32494

Files:
  lib/Transforms/Scalar/LoopDeletion.cpp
  test/Transforms/LoopDeletion/unreachable-loops.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32494.96586.patch
Type: text/x-patch
Size: 15225 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170425/af42385d/attachment.bin>


More information about the llvm-commits mailing list