From aed93b23d7a09f4875e31a3472f8c900ddbad462 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Tue, 16 Jun 2015 11:42:28 +0000 Subject: [PATCH] tree-vect-stmts.c (vectorizable_store): Adjust. 2015-06-16 Richard Biener * tree-vect-stmts.c (vectorizable_store): Adjust. (vectorizable_load): Likewise. * tree-vect-data-refs.c (vect_create_addr_base_for_vector_ref): Simplify. (vect_create_data_ref_ptr): Likewise. (bump_vector_ptr): Adjust. * gcc.target/i386/recip-vec-sqrtf-avx.c: Disable unrolling. From-SVN: r224514 --- gcc/ChangeLog | 9 +++++ gcc/testsuite/ChangeLog | 4 ++ .../gcc.target/i386/recip-vec-sqrtf-avx.c | 2 +- gcc/tree-vect-data-refs.c | 35 ++++------------- gcc/tree-vect-stmts.c | 39 ++++++++++++------- 5 files changed, 46 insertions(+), 43 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6090a2d029c..92bd3a2ed96 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2015-06-16 Richard Biener + + * tree-vect-stmts.c (vectorizable_store): Adjust. + (vectorizable_load): Likewise. + * tree-vect-data-refs.c (vect_create_addr_base_for_vector_ref): + Simplify. + (vect_create_data_ref_ptr): Likewise. + (bump_vector_ptr): Adjust. + 2015-06-16 Richard Biener * tree-vect-stmts.c (vectorizable_load): Properly start loads diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0d738506152..82a19fdda9c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2015-06-16 Richard Biener + + * gcc.target/i386/recip-vec-sqrtf-avx.c: Disable unrolling. + 2015-06-16 James Greenhalgh * gcc.target/arm/pr65647.c: Do not override -mfloat-abi directives diff --git a/gcc/testsuite/gcc.target/i386/recip-vec-sqrtf-avx.c b/gcc/testsuite/gcc.target/i386/recip-vec-sqrtf-avx.c index 9cf3cc81be5..d11bc093890 100644 --- a/gcc/testsuite/gcc.target/i386/recip-vec-sqrtf-avx.c +++ b/gcc/testsuite/gcc.target/i386/recip-vec-sqrtf-avx.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -ffast-math -ftree-vectorize -mavx -mtune=generic -mfpmath=sse -mrecip" } */ +/* { dg-options "-O2 -ffast-math -ftree-vectorize -mavx -mtune=generic -mfpmath=sse -mrecip --param max-completely-peel-times=1" } */ float a[32]; float b[32]; diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c index 0f85ae1f319..36d9ff1eb04 100644 --- a/gcc/tree-vect-data-refs.c +++ b/gcc/tree-vect-data-refs.c @@ -3956,13 +3956,13 @@ vect_create_addr_base_for_vector_ref (gimple stmt, } vect_ptr_type = build_pointer_type (STMT_VINFO_VECTYPE (stmt_info)); - addr_base = fold_convert (vect_ptr_type, addr_base); dest = vect_get_new_vect_var (vect_ptr_type, vect_pointer_var, base_name); - addr_base = force_gimple_operand (addr_base, &seq, false, dest); + addr_base = force_gimple_operand (addr_base, &seq, true, dest); gimple_seq_add_seq (new_stmt_list, seq); if (DR_PTR_INFO (dr) - && TREE_CODE (addr_base) == SSA_NAME) + && TREE_CODE (addr_base) == SSA_NAME + && !SSA_NAME_PTR_INFO (addr_base)) { vect_duplicate_ssa_name_ptr_info (addr_base, dr, stmt_info); if (offset || byte_offset) @@ -4048,7 +4048,6 @@ vect_create_data_ref_ptr (gimple stmt, tree aggr_type, struct loop *at_loop, tree aggr_ptr_type; tree aggr_ptr; tree new_temp; - gimple vec_stmt; gimple_seq new_stmt_list = NULL; edge pe = NULL; basic_block new_bb; @@ -4196,28 +4195,7 @@ vect_create_data_ref_ptr (gimple stmt, tree aggr_type, struct loop *at_loop, } *initial_address = new_temp; - - /* Create: p = (aggr_type *) initial_base */ - if (TREE_CODE (new_temp) != SSA_NAME - || !useless_type_conversion_p (aggr_ptr_type, TREE_TYPE (new_temp))) - { - vec_stmt = gimple_build_assign (aggr_ptr, - fold_convert (aggr_ptr_type, new_temp)); - aggr_ptr_init = make_ssa_name (aggr_ptr, vec_stmt); - /* Copy the points-to information if it exists. */ - if (DR_PTR_INFO (dr)) - vect_duplicate_ssa_name_ptr_info (aggr_ptr_init, dr, stmt_info); - gimple_assign_set_lhs (vec_stmt, aggr_ptr_init); - if (pe) - { - new_bb = gsi_insert_on_edge_immediate (pe, vec_stmt); - gcc_assert (!new_bb); - } - else - gsi_insert_before (gsi, vec_stmt, GSI_SAME_STMT); - } - else - aggr_ptr_init = new_temp; + aggr_ptr_init = new_temp; /* (3) Handle the updating of the aggregate-pointer inside the loop. This is needed when ONLY_INIT is false, and also when AT_LOOP is the @@ -4342,7 +4320,10 @@ bump_vector_ptr (tree dataref_ptr, gimple ptr_incr, gimple_stmt_iterator *gsi, if (bump) update = bump; - new_dataref_ptr = copy_ssa_name (dataref_ptr); + if (TREE_CODE (dataref_ptr) == SSA_NAME) + new_dataref_ptr = copy_ssa_name (dataref_ptr); + else + new_dataref_ptr = make_ssa_name (TREE_TYPE (dataref_ptr)); incr_stmt = gimple_build_assign (new_dataref_ptr, POINTER_PLUS_EXPR, dataref_ptr, update); vect_finish_stmt_generation (stmt, incr_stmt, gsi); diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index 59a4390c153..12829de3d15 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -5572,11 +5572,12 @@ vectorizable_store (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt, vect_permute_store_chain(). */ vec_oprnd = result_chain[i]; - data_ref = build2 (MEM_REF, TREE_TYPE (vec_oprnd), dataref_ptr, - dataref_offset - ? dataref_offset - : build_int_cst (reference_alias_ptr_type - (DR_REF (first_dr)), 0)); + data_ref = fold_build2 (MEM_REF, TREE_TYPE (vec_oprnd), + dataref_ptr, + dataref_offset + ? dataref_offset + : build_int_cst (reference_alias_ptr_type + (DR_REF (first_dr)), 0)); align = TYPE_ALIGN_UNIT (vectype); if (aligned_access_p (first_dr)) misalign = 0; @@ -5595,7 +5596,8 @@ vectorizable_store (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt, TYPE_ALIGN (elem_type)); misalign = DR_MISALIGNMENT (first_dr); } - if (dataref_offset == NULL_TREE) + if (dataref_offset == NULL_TREE + && TREE_CODE (dataref_ptr) == SSA_NAME) set_ptr_info_alignment (get_ptr_info (dataref_ptr), align, misalign); @@ -6643,11 +6645,11 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt, unsigned int align, misalign; data_ref - = build2 (MEM_REF, vectype, dataref_ptr, - dataref_offset - ? dataref_offset - : build_int_cst (reference_alias_ptr_type - (DR_REF (first_dr)), 0)); + = fold_build2 (MEM_REF, vectype, dataref_ptr, + dataref_offset + ? dataref_offset + : build_int_cst (reference_alias_ptr_type + (DR_REF (first_dr)), 0)); align = TYPE_ALIGN_UNIT (vectype); if (alignment_support_scheme == dr_aligned) { @@ -6669,7 +6671,8 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt, TYPE_ALIGN (elem_type)); misalign = DR_MISALIGNMENT (first_dr); } - if (dataref_offset == NULL_TREE) + if (dataref_offset == NULL_TREE + && TREE_CODE (dataref_ptr) == SSA_NAME) set_ptr_info_alignment (get_ptr_info (dataref_ptr), align, misalign); break; @@ -6686,7 +6689,10 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt, dr_explicit_realign, dataref_ptr, NULL); - ptr = copy_ssa_name (dataref_ptr); + if (TREE_CODE (dataref_ptr) == SSA_NAME) + ptr = copy_ssa_name (dataref_ptr); + else + ptr = make_ssa_name (TREE_TYPE (dataref_ptr)); new_stmt = gimple_build_assign (ptr, BIT_AND_EXPR, dataref_ptr, build_int_cst @@ -6716,7 +6722,7 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt, build_int_cst (TREE_TYPE (ptr), -(HOST_WIDE_INT)TYPE_ALIGN_UNIT (vectype))); - ptr = copy_ssa_name (dataref_ptr, new_stmt); + ptr = copy_ssa_name (ptr, new_stmt); gimple_assign_set_lhs (new_stmt, ptr); vect_finish_stmt_generation (stmt, new_stmt, gsi); data_ref @@ -6726,7 +6732,10 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt, break; } case dr_explicit_realign_optimized: - new_temp = copy_ssa_name (dataref_ptr); + if (TREE_CODE (dataref_ptr) == SSA_NAME) + new_temp = copy_ssa_name (dataref_ptr); + else + new_temp = make_ssa_name (TREE_TYPE (dataref_ptr)); new_stmt = gimple_build_assign (new_temp, BIT_AND_EXPR, dataref_ptr, build_int_cst -- 2.30.2