aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-if-conv.c
diff options
context:
space:
mode:
authorBin Cheng <bin.cheng@arm.com>2016-04-26 11:10:47 +0000
committerBin Cheng <amker@gcc.gnu.org>2016-04-26 11:10:47 +0000
commit00f615afef5bed8d1ef1f9c11033b3995641fab2 (patch)
tree6d0fe4cc8903ea7d313d2752f327a6164552e69d /gcc/tree-if-conv.c
parent901f29c8c9a5775af65f883701ed10a19084d818 (diff)
downloadgcc-00f615afef5bed8d1ef1f9c11033b3995641fab2.zip
gcc-00f615afef5bed8d1ef1f9c11033b3995641fab2.tar.gz
gcc-00f615afef5bed8d1ef1f9c11033b3995641fab2.tar.bz2
re PR tree-optimization/70771 (ICE on valid code at -O3 on x86_64-linux-gnu in operator[], at vec.h:714)
PR tree-optimization/70771 PR tree-optimization/70775 * tree-if-conv.c (if_convertible_phi_p): Remove check on special virtual PHI nodes. Delete parameter. (if_convertible_loop_p_1): Delete argument to above function. (predicate_all_scalar_phis): Delete code handling single-argument PHIs. (tree_if_conversion): Mark and update virtual SSA. gcc/testsuite/ChangeLog PR tree-optimization/70771 PR tree-optimization/70775 * gcc.dg/pr70771.c: New test. * gcc.dg/pr70771.c: New test. From-SVN: r235436
Diffstat (limited to 'gcc/tree-if-conv.c')
-rw-r--r--gcc/tree-if-conv.c73
1 files changed, 10 insertions, 63 deletions
diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c
index 2d14901..744d6f5 100644
--- a/gcc/tree-if-conv.c
+++ b/gcc/tree-if-conv.c
@@ -640,16 +640,11 @@ phi_convertible_by_degenerating_args (gphi *phi)
PHI is not if-convertible if:
- it has more than 2 arguments.
- When we didn't see if-convertible stores, PHI is not
- if-convertible if:
- - a virtual PHI is immediately used in another PHI node,
- - there is a virtual PHI in a BB other than the loop->header.
When the aggressive_if_conv is set, PHI can have more than
two arguments. */
static bool
-if_convertible_phi_p (struct loop *loop, basic_block bb, gphi *phi,
- bool any_mask_load_store)
+if_convertible_phi_p (struct loop *loop, basic_block bb, gphi *phi)
{
if (dump_file && (dump_flags & TDF_DETAILS))
{
@@ -669,36 +664,6 @@ if_convertible_phi_p (struct loop *loop, basic_block bb, gphi *phi,
}
}
- if (any_mask_load_store)
- return true;
-
- /* When there were no if-convertible stores, check
- that there are no memory writes in the branches of the loop to be
- if-converted. */
- if (virtual_operand_p (gimple_phi_result (phi)))
- {
- imm_use_iterator imm_iter;
- use_operand_p use_p;
-
- if (bb != loop->header)
- {
- if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file, "Virtual phi not on loop->header.\n");
- return false;
- }
-
- FOR_EACH_IMM_USE_FAST (use_p, imm_iter, gimple_phi_result (phi))
- {
- if (gimple_code (USE_STMT (use_p)) == GIMPLE_PHI
- && USE_STMT (use_p) != phi)
- {
- if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file, "Difficult to handle this virtual phi.\n");
- return false;
- }
- }
- }
-
return true;
}
@@ -1405,8 +1370,7 @@ if_convertible_loop_p_1 (struct loop *loop,
gphi_iterator itr;
for (itr = gsi_start_phis (bb); !gsi_end_p (itr); gsi_next (&itr))
- if (!if_convertible_phi_p (loop, bb, itr.phi (),
- *any_mask_load_store))
+ if (!if_convertible_phi_p (loop, bb, itr.phi ()))
return false;
}
@@ -1915,27 +1879,13 @@ predicate_all_scalar_phis (struct loop *loop)
if (gsi_end_p (phi_gsi))
continue;
- if (EDGE_COUNT (bb->preds) == 1)
+ gsi = gsi_after_labels (bb);
+ while (!gsi_end_p (phi_gsi))
{
- /* Propagate degenerate PHIs. */
- for (phi_gsi = gsi_start_phis (bb); !gsi_end_p (phi_gsi);
- gsi_next (&phi_gsi))
- {
- gphi *phi = phi_gsi.phi ();
- replace_uses_by (gimple_phi_result (phi),
- gimple_phi_arg_def (phi, 0));
- }
- }
- else
- {
- gsi = gsi_after_labels (bb);
- while (!gsi_end_p (phi_gsi))
- {
- phi = phi_gsi.phi ();
- predicate_scalar_phi (phi, &gsi);
- release_phi_node (phi);
- gsi_next (&phi_gsi);
- }
+ phi = phi_gsi.phi ();
+ predicate_scalar_phi (phi, &gsi);
+ release_phi_node (phi);
+ gsi_next (&phi_gsi);
}
set_phi_nodes (bb, NULL);
@@ -2808,11 +2758,8 @@ tree_if_conversion (struct loop *loop)
}
todo |= TODO_cleanup_cfg;
- if (any_mask_load_store)
- {
- mark_virtual_operands_for_renaming (cfun);
- todo |= TODO_update_ssa_only_virtuals;
- }
+ mark_virtual_operands_for_renaming (cfun);
+ todo |= TODO_update_ssa_only_virtuals;
cleanup:
if (ifc_bbs)