diff options
author | Jakub Jelinek <jakub@redhat.com> | 2014-02-14 08:31:23 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2014-02-14 08:31:23 +0100 |
commit | b010d6017560bcc12beaf0c65ada17f878fa4f72 (patch) | |
tree | a4d5bc6cbd4a114aa316acf111f478c3059b4d08 /gcc/tree-vect-loop.c | |
parent | f2dafb914e2af3bf33984644906acc2d11f5ca5c (diff) | |
download | gcc-b010d6017560bcc12beaf0c65ada17f878fa4f72.zip gcc-b010d6017560bcc12beaf0c65ada17f878fa4f72.tar.gz gcc-b010d6017560bcc12beaf0c65ada17f878fa4f72.tar.bz2 |
tree-vect-loop.c (vect_is_slp_reduction): Don't set use_stmt twice.
* tree-vect-loop.c (vect_is_slp_reduction): Don't set
use_stmt twice.
(get_initial_def_for_induction, vectorizable_induction): Ignore
debug stmts when looking for exit_phi.
(vectorizable_live_operation): Fix up condition.
* gcc.c-torture/compile/20140213.c: New test.
From-SVN: r207778
Diffstat (limited to 'gcc/tree-vect-loop.c')
-rw-r--r-- | gcc/tree-vect-loop.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index ab4d06f..838803e 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -1968,10 +1968,8 @@ vect_is_slp_reduction (loop_vec_info loop_info, gimple phi, gimple first_stmt) FOR_EACH_IMM_USE_FAST (use_p, imm_iter, lhs) { gimple use_stmt = USE_STMT (use_p); - if (is_gimple_debug (use_stmt)) - continue; - - use_stmt = USE_STMT (use_p); + if (is_gimple_debug (use_stmt)) + continue; /* Check if we got back to the reduction phi. */ if (use_stmt == phi) @@ -3507,9 +3505,13 @@ get_initial_def_for_induction (gimple iv_phi) exit_phi = NULL; FOR_EACH_IMM_USE_FAST (use_p, imm_iter, loop_arg) { - if (!flow_bb_inside_loop_p (iv_loop, gimple_bb (USE_STMT (use_p)))) + gimple use_stmt = USE_STMT (use_p); + if (is_gimple_debug (use_stmt)) + continue; + + if (!flow_bb_inside_loop_p (iv_loop, gimple_bb (use_stmt))) { - exit_phi = USE_STMT (use_p); + exit_phi = use_stmt; break; } } @@ -5413,10 +5415,13 @@ vectorizable_induction (gimple phi, gimple_stmt_iterator *gsi ATTRIBUTE_UNUSED, loop_arg = PHI_ARG_DEF_FROM_EDGE (phi, latch_e); FOR_EACH_IMM_USE_FAST (use_p, imm_iter, loop_arg) { - if (!flow_bb_inside_loop_p (loop->inner, - gimple_bb (USE_STMT (use_p)))) + gimple use_stmt = USE_STMT (use_p); + if (is_gimple_debug (use_stmt)) + continue; + + if (!flow_bb_inside_loop_p (loop->inner, gimple_bb (use_stmt))) { - exit_phi = USE_STMT (use_p); + exit_phi = use_stmt; break; } } @@ -5514,7 +5519,7 @@ vectorizable_live_operation (gimple stmt, { gimple use_stmt = USE_STMT (use_p); if (gimple_code (use_stmt) == GIMPLE_PHI - || gimple_bb (use_stmt) == merge_bb) + && gimple_bb (use_stmt) == merge_bb) { if (vec_stmt) { |