diff options
author | Ira Rosen <ira.rosen@linaro.org> | 2011-08-01 16:58:20 +0000 |
---|---|---|
committer | Ira Rosen <irar@gcc.gnu.org> | 2011-08-01 16:58:20 +0000 |
commit | 67f2d54f56cf4e978cf8e2d78330da7948f99591 (patch) | |
tree | ee9c0562d8abcd98e8100161a75488131a8a66cf /gcc/tree-vect-loop.c | |
parent | 2933b16cf255cc606c6b29ee542d3eef6a063315 (diff) | |
download | gcc-67f2d54f56cf4e978cf8e2d78330da7948f99591.zip gcc-67f2d54f56cf4e978cf8e2d78330da7948f99591.tar.gz gcc-67f2d54f56cf4e978cf8e2d78330da7948f99591.tar.bz2 |
re PR tree-optimization/49926 (ice in process_use, at tree-vect-stmts.c:405)
PR tree-optimization/49926
* tree-vect-loop.c (vect_is_slp_reduction): Check that a
statement in a chain doesn't have uses both inside and
outside the loop.
From-SVN: r177063
Diffstat (limited to 'gcc/tree-vect-loop.c')
-rw-r--r-- | gcc/tree-vect-loop.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index 63b3469..505a41a 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -1730,7 +1730,7 @@ vect_is_slp_reduction (loop_vec_info loop_info, gimple phi, gimple first_stmt) tree lhs; imm_use_iterator imm_iter; use_operand_p use_p; - int nloop_uses, size = 0; + int nloop_uses, size = 0, n_out_of_loop_uses; bool found = false; if (loop != vect_loop) @@ -1741,6 +1741,7 @@ vect_is_slp_reduction (loop_vec_info loop_info, gimple phi, gimple first_stmt) while (1) { nloop_uses = 0; + n_out_of_loop_uses = 0; FOR_EACH_IMM_USE_FAST (use_p, imm_iter, lhs) { gimple use_stmt = USE_STMT (use_p); @@ -1757,16 +1758,22 @@ vect_is_slp_reduction (loop_vec_info loop_info, gimple phi, gimple first_stmt) break; } - if (flow_bb_inside_loop_p (loop, gimple_bb (use_stmt)) - && vinfo_for_stmt (use_stmt) - && !STMT_VINFO_IN_PATTERN_P (vinfo_for_stmt (use_stmt))) - { - loop_use_stmt = use_stmt; - nloop_uses++; - } + if (flow_bb_inside_loop_p (loop, gimple_bb (use_stmt))) + { + if (vinfo_for_stmt (use_stmt) + && !STMT_VINFO_IN_PATTERN_P (vinfo_for_stmt (use_stmt))) + { + loop_use_stmt = use_stmt; + nloop_uses++; + } + } + else + n_out_of_loop_uses++; - if (nloop_uses > 1) - return false; + /* There are can be either a single use in the loop or two uses in + phi nodes. */ + if (nloop_uses > 1 || (n_out_of_loop_uses && nloop_uses)) + return false; } if (found) |