Currently, loop deletion only supports deleting loops that have backedges that
are not-taken into the loop header (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. This is the first set of changes to
merge loop-deletion and loop-simplifyCFG [1].
The next steps are:
- moving the loop deletion implementation to LoopUtils
- 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.