diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-11-08 15:45:05 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-11-08 15:45:05 +0000 |
commit | 83d0ccdd20c346854f35a1dac01d153310ef1ad2 (patch) | |
tree | cf6f1e5cffd5ce0c472b54196465cd4ae0dc01d3 /gcc/tree-vect-slp.c | |
parent | 31ba6c3ff2311bad9422246f49d59c532cbb5078 (diff) | |
download | gcc-83d0ccdd20c346854f35a1dac01d153310ef1ad2.tar.gz |
2011-11-08 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 181163 using svnmerge
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@181167 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vect-slp.c')
-rw-r--r-- | gcc/tree-vect-slp.c | 49 |
1 files changed, 46 insertions, 3 deletions
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c index 6628a6fd66d..f54a8a77280 100644 --- a/gcc/tree-vect-slp.c +++ b/gcc/tree-vect-slp.c @@ -202,7 +202,10 @@ vect_get_and_check_slp_defs (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, loop = LOOP_VINFO_LOOP (loop_vinfo); if (is_gimple_call (stmt)) - number_of_oprnds = gimple_call_num_args (stmt); + { + number_of_oprnds = gimple_call_num_args (stmt); + op_idx = 3; + } else if (is_gimple_assign (stmt)) { number_of_oprnds = gimple_num_ops (stmt) - 1; @@ -558,7 +561,25 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, ncopies = vectorization_factor / TYPE_VECTOR_SUBPARTS (vectype); if (is_gimple_call (stmt)) - rhs_code = CALL_EXPR; + { + rhs_code = CALL_EXPR; + if (gimple_call_internal_p (stmt) + || gimple_call_tail_p (stmt) + || gimple_call_noreturn_p (stmt) + || !gimple_call_nothrow_p (stmt) + || gimple_call_chain (stmt)) + { + if (vect_print_dump_info (REPORT_SLP)) + { + fprintf (vect_dump, + "Build SLP failed: unsupported call type "); + print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM); + } + + vect_free_oprnd_info (&oprnds_info, true); + return false; + } + } else rhs_code = gimple_assign_rhs_code (stmt); @@ -653,6 +674,27 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, vect_free_oprnd_info (&oprnds_info, true); return false; } + + if (rhs_code == CALL_EXPR) + { + gimple first_stmt = VEC_index (gimple, stmts, 0); + if (gimple_call_num_args (stmt) != nops + || !operand_equal_p (gimple_call_fn (first_stmt), + gimple_call_fn (stmt), 0) + || gimple_call_fntype (first_stmt) + != gimple_call_fntype (stmt)) + { + if (vect_print_dump_info (REPORT_SLP)) + { + fprintf (vect_dump, + "Build SLP failed: different calls in "); + print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM); + } + + vect_free_oprnd_info (&oprnds_info, true); + return false; + } + } } /* Strided store or load. */ @@ -786,7 +828,8 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, /* Not memory operation. */ if (TREE_CODE_CLASS (rhs_code) != tcc_binary && TREE_CODE_CLASS (rhs_code) != tcc_unary - && rhs_code != COND_EXPR) + && rhs_code != COND_EXPR + && rhs_code != CALL_EXPR) { if (vect_print_dump_info (REPORT_SLP)) { |