tree-vect-stmts.c (vectorizable_store): Adjust.
authorRichard Biener <rguenther@suse.de>
Tue, 16 Jun 2015 11:42:28 +0000 (11:42 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 16 Jun 2015 11:42:28 +0000 (11:42 +0000)
2015-06-16  Richard Biener  <rguenther@suse.de>

* 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
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/recip-vec-sqrtf-avx.c
gcc/tree-vect-data-refs.c
gcc/tree-vect-stmts.c

index 6090a2d029c636f17620a0c14172027d78dc47a8..92bd3a2ed967f45c0c903cb97c4d9d4066189f5d 100644 (file)
@@ -1,3 +1,12 @@
+2015-06-16  Richard Biener  <rguenther@suse.de>
+
+       * 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  <rguenther@suse.de>
 
        * tree-vect-stmts.c (vectorizable_load): Properly start loads
index 0d738506152746cba97464e9ee0ee46cdeb70830..82a19fdda9cce2763a809568de1ac6996694f82a 100644 (file)
@@ -1,3 +1,7 @@
+2015-06-16  Richard Biener  <rguenther@suse.de>
+
+       * gcc.target/i386/recip-vec-sqrtf-avx.c: Disable unrolling.
+
 2015-06-16  James Greenhalgh  <james.greenhalgh@arm.com>
 
        * gcc.target/arm/pr65647.c: Do not override -mfloat-abi directives
index 9cf3cc81be5dc38fb968daaf93c43bb505059359..d11bc0938901bbacd1f03f32c07f4f515676c82c 100644 (file)
@@ -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];
index 0f85ae1f31921f3df7e134364d276ee2776decec..36d9ff1eb04dcf178cdd8556bd0d297de6ee00ca 100644 (file)
@@ -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);
index 59a4390c153bf4e1290049c91db58f7aba9793ca..12829de3d15683b6944b193b9124fef5040b09a0 100644 (file)
@@ -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