aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-ifcombine.c
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2015-11-03 00:31:18 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2015-11-03 00:31:18 +0000
commit067339d22029606a24ff31136d5696d56e3e05de (patch)
tree62dc97fa8c6c93ca0eeac3251e4d590a1f3c167f /gcc/tree-ssa-ifcombine.c
parent828ca3d835ac006cbcb2e5b480c6429cc8a75bdd (diff)
downloadgcc-067339d22029606a24ff31136d5696d56e3e05de.zip
gcc-067339d22029606a24ff31136d5696d56e3e05de.tar.gz
gcc-067339d22029606a24ff31136d5696d56e3e05de.tar.bz2
ifcombine: factor out inner block viability test
Bail out early if the inner block has side effects or is otherwise not eligible for ifcombine. for gcc/ChangeLog * tree-ssa-ifcombine.c (tree_ssa_ifcombine_bb_1): Factor out bb_no_side_effects_p tests... (tree_ssa_ifcombine_bb): ... here. From-SVN: r229691
Diffstat (limited to 'gcc/tree-ssa-ifcombine.c')
-rw-r--r--gcc/tree-ssa-ifcombine.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/gcc/tree-ssa-ifcombine.c b/gcc/tree-ssa-ifcombine.c
index c18de7e..2a2e387 100644
--- a/gcc/tree-ssa-ifcombine.c
+++ b/gcc/tree-ssa-ifcombine.c
@@ -576,8 +576,7 @@ tree_ssa_ifcombine_bb_1 (basic_block inner_cond_bb, basic_block outer_cond_bb,
the inner cond_bb having no side-effects. */
if (phi_pred_bb != else_bb
&& recognize_if_then_else (outer_cond_bb, &inner_cond_bb, &else_bb)
- && same_phi_args_p (outer_cond_bb, phi_pred_bb, else_bb)
- && bb_no_side_effects_p (inner_cond_bb))
+ && same_phi_args_p (outer_cond_bb, phi_pred_bb, else_bb))
{
/* We have
<outer_cond_bb>
@@ -595,8 +594,7 @@ tree_ssa_ifcombine_bb_1 (basic_block inner_cond_bb, basic_block outer_cond_bb,
/* And a version where the outer condition is negated. */
if (phi_pred_bb != else_bb
&& recognize_if_then_else (outer_cond_bb, &else_bb, &inner_cond_bb)
- && same_phi_args_p (outer_cond_bb, phi_pred_bb, else_bb)
- && bb_no_side_effects_p (inner_cond_bb))
+ && same_phi_args_p (outer_cond_bb, phi_pred_bb, else_bb))
{
/* We have
<outer_cond_bb>
@@ -617,8 +615,7 @@ tree_ssa_ifcombine_bb_1 (basic_block inner_cond_bb, basic_block outer_cond_bb,
having no side-effects. */
if (phi_pred_bb != then_bb
&& recognize_if_then_else (outer_cond_bb, &then_bb, &inner_cond_bb)
- && same_phi_args_p (outer_cond_bb, phi_pred_bb, then_bb)
- && bb_no_side_effects_p (inner_cond_bb))
+ && same_phi_args_p (outer_cond_bb, phi_pred_bb, then_bb))
{
/* We have
<outer_cond_bb>
@@ -635,8 +632,7 @@ tree_ssa_ifcombine_bb_1 (basic_block inner_cond_bb, basic_block outer_cond_bb,
/* And a version where the outer condition is negated. */
if (phi_pred_bb != then_bb
&& recognize_if_then_else (outer_cond_bb, &inner_cond_bb, &then_bb)
- && same_phi_args_p (outer_cond_bb, phi_pred_bb, then_bb)
- && bb_no_side_effects_p (inner_cond_bb))
+ && same_phi_args_p (outer_cond_bb, phi_pred_bb, then_bb))
{
/* We have
<outer_cond_bb>
@@ -673,7 +669,8 @@ tree_ssa_ifcombine_bb (basic_block inner_cond_bb)
if (a && b)
;
This requires a single predecessor of the inner cond_bb. */
- if (single_pred_p (inner_cond_bb))
+ if (single_pred_p (inner_cond_bb)
+ && bb_no_side_effects_p (inner_cond_bb))
{
basic_block outer_cond_bb = single_pred (inner_cond_bb);