From 62c004451aaecf4d5cfdd0db776165410e017f75 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Thu, 29 Jan 2015 12:53:39 +0000 Subject: re PR target/64844 (Vectorization inhibited in gcc5 when loop starts with elem[1], aarch64 perf regression from 4.9.1) 2015-01-29 Richard Biener PR tree-optimization/64844 * tree-vect-loop.c (vect_estimate_min_profitable_iters): Always dump cost model analysis. * tree-vect-data-refs.c (vect_enhance_data_refs_alignment): Do not register adjusted load/store costs here. * gcc.dg/vect/pr64844.c: New testcase. From-SVN: r220244 --- gcc/tree-vect-data-refs.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) (limited to 'gcc/tree-vect-data-refs.c') diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c index 52d6a86..302f2df 100644 --- a/gcc/tree-vect-data-refs.c +++ b/gcc/tree-vect-data-refs.c @@ -1763,9 +1763,6 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo) if (do_peeling) { - stmt_info_for_cost *si; - void *data = LOOP_VINFO_TARGET_COST_DATA (loop_vinfo); - /* (1.2) Update the DR_MISALIGNMENT of each data reference DR_i. If the misalignment of DR_i is identical to that of dr0 then set DR_MISALIGNMENT (DR_i) to zero. If the misalignment of DR_i and @@ -1791,20 +1788,10 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo) dump_printf_loc (MSG_NOTE, vect_location, "Peeling for alignment will be applied.\n"); } - /* We've delayed passing the inside-loop peeling costs to the - target cost model until we were sure peeling would happen. - Do so now. */ - if (body_cost_vec.exists ()) - { - FOR_EACH_VEC_ELT (body_cost_vec, i, si) - { - struct _stmt_vec_info *stmt_info - = si->stmt ? vinfo_for_stmt (si->stmt) : NULL; - (void) add_stmt_cost (data, si->count, si->kind, stmt_info, - si->misalign, vect_body); - } - body_cost_vec.release (); - } + /* The inside-loop cost will be accounted for in vectorizable_load + and vectorizable_store correctly with adjusted alignments. + Drop the body_cst_vec on the floor here. */ + body_cost_vec.release (); stat = vect_verify_datarefs_alignment (loop_vinfo, NULL); gcc_assert (stat); -- cgit v1.1