]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2016-01-15 Richard Biener <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 15 Jan 2016 11:49:43 +0000 (11:49 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 15 Jan 2016 11:49:43 +0000 (11:49 +0000)
PR tree-optimization/68961
* tree-vect-slp.c (vect_analyze_slp_cost_1): Consider cost
of invariants in stores again.

* gcc.dg/vect/costmodel/x86_64/costmodel-pr68961.c: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232415 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-pr68961.c [new file with mode: 0644]
gcc/tree-vect-slp.c

index e0da4441ea8d5ddaac04bf40ac7c5fd83197ff9e..500ba65c7f1bac390696ba97dffdc6ecd2d5bab8 100644 (file)
@@ -1,3 +1,9 @@
+2016-01-15  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/68961
+       * tree-vect-slp.c (vect_analyze_slp_cost_1): Consider cost
+       of invariants in stores again.
+
 2016-01-15  Sebastian Huber  <sebastian.huber@embedded-brains.de>
 
        * config/arm/t-rtems: Add cortex-m7/fpv5-d16 multilib.
index 456edf205c711cec0a5195c289f7d74398772618..f8d58ce87061243449a8b8ee9c85004b4346e5d8 100644 (file)
@@ -1,3 +1,8 @@
+2016-01-15  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/68961
+       * gcc.dg/vect/costmodel/x86_64/costmodel-pr68961.c: New testcase.
+
 2016-01-15  Ilya Enkovich  <enkovich.gnu@gmail.com>
 
        * gcc.target/i386/pr65105-5.c: New test.
diff --git a/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-pr68961.c b/gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-pr68961.c
new file mode 100644 (file)
index 0000000..a88b148
--- /dev/null
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-fdump-tree-slp-details" } */
+
+struct x { double d[2]; };
+
+struct x
+pack (double a, double aa)
+{
+  struct x u;
+  u.d[0] = a;
+  u.d[1] = aa;
+  return u;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorization is not profitable" 1 "slp2" } } */
index 161655a084fa9d8f16472052944c4307cdb8e72e..fe422f858fe7ce41ca373b432382bd17d2ddac26 100644 (file)
@@ -1453,18 +1453,20 @@ vect_analyze_slp_cost_1 (slp_instance instance, slp_tree node,
          /* Record the cost for the vector loads.  */
          vect_model_load_cost (stmt_info, ncopies_for_cost, false,
                                node, prologue_cost_vec, body_cost_vec);
+         return;
        }
-      return;
     }
-
-  record_stmt_cost (body_cost_vec, ncopies_for_cost, vector_stmt,
-                   stmt_info, 0, vect_body);
-  if (SLP_TREE_TWO_OPERATORS (node))
+  else
     {
       record_stmt_cost (body_cost_vec, ncopies_for_cost, vector_stmt,
                        stmt_info, 0, vect_body);
-      record_stmt_cost (body_cost_vec, ncopies_for_cost, vec_perm,
-                       stmt_info, 0, vect_body);
+      if (SLP_TREE_TWO_OPERATORS (node))
+       {
+         record_stmt_cost (body_cost_vec, ncopies_for_cost, vector_stmt,
+                           stmt_info, 0, vect_body);
+         record_stmt_cost (body_cost_vec, ncopies_for_cost, vec_perm,
+                           stmt_info, 0, vect_body);
+       }
     }
 
   /* Push SLP node def-type to stmts.  */