HomePhabricator

[SimplifyCFG] Re-apply Relax restriction for folding unconditional branches

Authored by skatkov on Feb 7 2018, 11:16 PM.

Description

[SimplifyCFG] Re-apply Relax restriction for folding unconditional branches

The commit 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.

The test profile/Linux/counter_promo_nest.c in compiler-rt project
is updated to meet this change.

Reviewers: efriedma, mcrosier, pacxx, hsung, davidxl
Reviewed By: pacxx
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D42691

llvm-svn: 324572

Details

Committed
skatkovFeb 7 2018, 11:16 PM
Reviewer
pacxx
Differential Revision
D42691: [SimplifyCFG] Relax restriction for folding unconditional branches
Parents
rGd535c4d9d244: Update test counter_promo_nest.c to meet llvm change
Branches
Unknown
Tags
Unknown