diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-05-15 11:35:22 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-05-15 11:35:22 +0000 |
commit | 74fa23922a189845dad4cca1e8854de624b0ca12 (patch) | |
tree | 95f19784c581a1f85cb35235a5b5aea1f6c73e5b /gcc/tree-vect-stmts.c | |
parent | b6297c58cda06dc31302af6bcf3878d96fdcce33 (diff) | |
download | gcc-74fa23922a189845dad4cca1e8854de624b0ca12.tar.gz |
2012-05-15 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 187525 using svnmerge
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@187527 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vect-stmts.c')
-rw-r--r-- | gcc/tree-vect-stmts.c | 97 |
1 files changed, 49 insertions, 48 deletions
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index a0368d83e94..98e5d4594ec 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -74,7 +74,6 @@ read_vector_array (gimple stmt, gimple_stmt_iterator *gsi, tree scalar_dest, vect_name = make_ssa_name (vect, new_stmt); gimple_assign_set_lhs (new_stmt, vect_name); vect_finish_stmt_generation (stmt, new_stmt, gsi); - mark_symbols_for_renaming (new_stmt); return vect_name; } @@ -96,7 +95,6 @@ write_vector_array (gimple stmt, gimple_stmt_iterator *gsi, tree vect, new_stmt = gimple_build_assign (array_ref, vect); vect_finish_stmt_generation (stmt, new_stmt, gsi); - mark_symbols_for_renaming (new_stmt); } /* PTR is a pointer to an array of type TYPE. Return a representation @@ -1032,10 +1030,19 @@ vect_model_load_cost (stmt_vec_info stmt_info, int ncopies, bool load_lanes_p, } /* The loads themselves. */ - vect_get_load_cost (first_dr, ncopies, - ((!STMT_VINFO_GROUPED_ACCESS (stmt_info)) || group_size > 1 - || slp_node), - &inside_cost, &outside_cost); + if (STMT_VINFO_STRIDE_LOAD_P (stmt_info)) + { + /* N scalar loads plus gathering them into a vector. + ??? scalar_to_vec isn't the cost for that. */ + inside_cost += (vect_get_stmt_cost (scalar_load) * ncopies + * TYPE_VECTOR_SUBPARTS (STMT_VINFO_VECTYPE (stmt_info))); + inside_cost += ncopies * vect_get_stmt_cost (scalar_to_vec); + } + else + vect_get_load_cost (first_dr, ncopies, + ((!STMT_VINFO_GROUPED_ACCESS (stmt_info)) + || group_size > 1 || slp_node), + &inside_cost, &outside_cost); if (vect_print_dump_info (REPORT_COST)) fprintf (vect_dump, "vect_model_load_cost: inside_cost = %d, " @@ -1786,7 +1793,6 @@ vectorizable_call (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt, new_temp = make_ssa_name (vec_dest, new_stmt); gimple_call_set_lhs (new_stmt, new_temp); vect_finish_stmt_generation (stmt, new_stmt, gsi); - mark_symbols_for_renaming (new_stmt); VEC_quick_push (gimple, SLP_TREE_VEC_STMTS (slp_node), new_stmt); } @@ -1821,9 +1827,7 @@ vectorizable_call (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt, new_stmt = gimple_build_call_vec (fndecl, vargs); new_temp = make_ssa_name (vec_dest, new_stmt); gimple_call_set_lhs (new_stmt, new_temp); - vect_finish_stmt_generation (stmt, new_stmt, gsi); - mark_symbols_for_renaming (new_stmt); if (j == 0) STMT_VINFO_VEC_STMT (stmt_info) = *vec_stmt = new_stmt; @@ -1876,7 +1880,6 @@ vectorizable_call (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt, new_temp = make_ssa_name (vec_dest, new_stmt); gimple_call_set_lhs (new_stmt, new_temp); vect_finish_stmt_generation (stmt, new_stmt, gsi); - mark_symbols_for_renaming (new_stmt); VEC_quick_push (gimple, SLP_TREE_VEC_STMTS (slp_node), new_stmt); } @@ -1918,9 +1921,7 @@ vectorizable_call (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt, new_stmt = gimple_build_call_vec (fndecl, vargs); new_temp = make_ssa_name (vec_dest, new_stmt); gimple_call_set_lhs (new_stmt, new_temp); - vect_finish_stmt_generation (stmt, new_stmt, gsi); - mark_symbols_for_renaming (new_stmt); if (j == 0) STMT_VINFO_VEC_STMT (stmt_info) = new_stmt; @@ -4010,7 +4011,6 @@ vectorizable_store (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt, new_stmt = gimple_build_call_internal (IFN_STORE_LANES, 1, vec_array); gimple_call_set_lhs (new_stmt, data_ref); vect_finish_stmt_generation (stmt, new_stmt, gsi); - mark_symbols_for_renaming (new_stmt); } else { @@ -4067,7 +4067,6 @@ vectorizable_store (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt, /* Arguments are ready. Create the new vector stmt. */ new_stmt = gimple_build_assign (data_ref, vec_oprnd); vect_finish_stmt_generation (stmt, new_stmt, gsi); - mark_symbols_for_renaming (new_stmt); if (slp) continue; @@ -4210,7 +4209,7 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt, bool load_lanes_p = false; gimple first_stmt; bool inv_p; - bool negative; + bool negative = false; bool compute_in_loop = false; struct loop *at_loop; int vec_num; @@ -4280,17 +4279,6 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt, if (!STMT_VINFO_DATA_REF (stmt_info)) return false; - negative = tree_int_cst_compare (nested_in_vect_loop - ? STMT_VINFO_DR_STEP (stmt_info) - : DR_STEP (dr), - size_zero_node) < 0; - if (negative && ncopies > 1) - { - if (vect_print_dump_info (REPORT_DETAILS)) - fprintf (vect_dump, "multiple types with negative step."); - return false; - } - elem_type = TREE_TYPE (vectype); mode = TYPE_MODE (vectype); @@ -4321,24 +4309,6 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt, } } - if (negative) - { - gcc_assert (!grouped_load && !STMT_VINFO_GATHER_P (stmt_info)); - alignment_support_scheme = vect_supportable_dr_alignment (dr, false); - if (alignment_support_scheme != dr_aligned - && alignment_support_scheme != dr_unaligned_supported) - { - if (vect_print_dump_info (REPORT_DETAILS)) - fprintf (vect_dump, "negative step but alignment required."); - return false; - } - if (!perm_mask_for_reverse (vectype)) - { - if (vect_print_dump_info (REPORT_DETAILS)) - fprintf (vect_dump, "negative step and reversing not supported."); - return false; - } - } if (STMT_VINFO_GATHER_P (stmt_info)) { @@ -4358,7 +4328,41 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt, } else if (STMT_VINFO_STRIDE_LOAD_P (stmt_info)) { - vect_check_strided_load (stmt, loop_vinfo, &stride_base, &stride_step); + if (!vect_check_strided_load (stmt, loop_vinfo, + &stride_base, &stride_step)) + return false; + } + else + { + negative = tree_int_cst_compare (nested_in_vect_loop + ? STMT_VINFO_DR_STEP (stmt_info) + : DR_STEP (dr), + size_zero_node) < 0; + if (negative && ncopies > 1) + { + if (vect_print_dump_info (REPORT_DETAILS)) + fprintf (vect_dump, "multiple types with negative step."); + return false; + } + + if (negative) + { + gcc_assert (!grouped_load); + alignment_support_scheme = vect_supportable_dr_alignment (dr, false); + if (alignment_support_scheme != dr_aligned + && alignment_support_scheme != dr_unaligned_supported) + { + if (vect_print_dump_info (REPORT_DETAILS)) + fprintf (vect_dump, "negative step but alignment required."); + return false; + } + if (!perm_mask_for_reverse (vectype)) + { + if (vect_print_dump_info (REPORT_DETAILS)) + fprintf (vect_dump, "negative step and reversing not supported."); + return false; + } + } } if (!vec_stmt) /* transformation not required. */ @@ -4615,7 +4619,6 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt, vec_inv = build_constructor (vectype, v); new_temp = vect_init_vector (stmt, vec_inv, vectype, gsi); new_stmt = SSA_NAME_DEF_STMT (new_temp); - mark_symbols_for_renaming (new_stmt); if (j == 0) STMT_VINFO_VEC_STMT (stmt_info) = *vec_stmt = new_stmt; @@ -4831,7 +4834,6 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt, new_stmt = gimple_build_call_internal (IFN_LOAD_LANES, 1, data_ref); gimple_call_set_lhs (new_stmt, vec_array); vect_finish_stmt_generation (stmt, new_stmt, gsi); - mark_symbols_for_renaming (new_stmt); /* Extract each vector into an SSA_NAME. */ for (i = 0; i < vec_num; i++) @@ -4964,7 +4966,6 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt, new_temp = make_ssa_name (vec_dest, new_stmt); gimple_assign_set_lhs (new_stmt, new_temp); vect_finish_stmt_generation (stmt, new_stmt, gsi); - mark_symbols_for_renaming (new_stmt); /* 3. Handle explicit realignment if necessary/supported. Create in loop: |