[PATCH] D42691: [SimplifyCFG] Relax restriction for folding unconditional branches

Serguei Katkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 30 07:14:42 PST 2018


skatkov created this revision.
skatkov added reviewers: efriedma, mcrosier, pacxx, hsung, davidxl.

The commit https://reviews.llvm.org/rL308422 introduces a restriction for folding unconditional
branches. Specifically if empty block with unconditional branch leads to
header of the loop then elimination of this basic block is prohibited.
However it seems this condition is redundantly strict.
If elimination of this basic block does not introduce more back edges
then we can eliminate this block.

The patch implements this relax of restriction.


https://reviews.llvm.org/D42691

Files:
  lib/Transforms/Utils/SimplifyCFG.cpp
  test/Transforms/LoopUnroll/peel-loop.ll
  test/Transforms/LoopUnswitch/2015-06-17-Metadata.ll
  test/Transforms/LoopUnswitch/infinite-loop.ll
  test/Transforms/SimplifyCFG/UncondBranchToHeader.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42691.131967.patch
Type: text/x-patch
Size: 4608 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180130/837ef442/attachment.bin>


More information about the llvm-commits mailing list