[PATCH] D32353: [LoopSimplify] Simplify constant conditional branches to unconditional branches

Anna Thomas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 21 08:14:00 PDT 2017


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

This is an enhancement to add support to loop-simplify to change constant
conditional branches (eg: `br i1 true, label https://reviews.llvm.org/L1, label L2) to unconditional 
branches (br label https://reviews.llvm.org/L1).
This will remove blocks from the
loop in the process. We avoid cases where a loop is completely removed.

Added test cases shows various use cases for the transformation. The benefit
would be for these branches that are created after loop-unswitching, can be
cleaned up using loop-simplifycfg.


https://reviews.llvm.org/D32353

Files:
  lib/Analysis/LoopInfo.cpp
  lib/Transforms/Scalar/LoopSimplifyCFG.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32353.96145.patch
Type: text/x-patch
Size: 6758 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170421/3e72f784/attachment.bin>


More information about the llvm-commits mailing list