]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-optimization/125124 - disable sanity checking of BB SLP partitioning
authorRichard Biener <rguenther@suse.de>
Mon, 4 May 2026 12:08:07 +0000 (14:08 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 5 May 2026 07:27:40 +0000 (09:27 +0200)
The following disables a sanity check that BB SLP partitioning correctly
partitioned the SLP graph.

PR tree-optimization/125124
* tree-vect-slp.cc (vect_bb_slp_scalar_cost): Disable
BB SLP partitioning sanity-check.

* gcc.dg/torture/pr125124.c: New testcase.

gcc/testsuite/gcc.dg/torture/pr125124.c [new file with mode: 0644]
gcc/tree-vect-slp.cc

diff --git a/gcc/testsuite/gcc.dg/torture/pr125124.c b/gcc/testsuite/gcc.dg/torture/pr125124.c
new file mode 100644 (file)
index 0000000..dd087a8
--- /dev/null
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-ftree-vectorize" } */
+
+char ff_rv60_idct16x16_add_dst_1, ff_rv60_idct16x16_add___trans_tmp_1;
+short ff_rv60_idct16x16_add_tmp[56];
+void ff_rv60_idct16x16_add() {
+  for (int y; y; y++) {
+    int tmp00 = 31 * ff_rv60_idct16x16_add_tmp[y * 16] -
+                7 * ff_rv60_idct16x16_add_tmp[y * 16 + 1] -
+                6 * ff_rv60_idct16x16_add_tmp[y * 16 + 10] -
+                20 * ff_rv60_idct16x16_add_tmp[y * 16 + 4],
+        tmp02 = 20 * ff_rv60_idct16x16_add_tmp[y * 16] -
+                6 * ff_rv60_idct16x16_add_tmp[y * 16 + 1] +
+                7 * ff_rv60_idct16x16_add_tmp[y * 16 + 10] +
+                31 * ff_rv60_idct16x16_add_tmp[y * 16 + 4];
+    ff_rv60_idct16x16_add_dst_1 = (tmp00 >> 7) + (tmp02 >> 7);
+    {
+      if (ff_rv60_idct16x16_add_dst_1)
+        ff_rv60_idct16x16_add___trans_tmp_1 = ff_rv60_idct16x16_add_dst_1;
+    }
+    ff_rv60_idct16x16_add_dst_1 = ff_rv60_idct16x16_add___trans_tmp_1;
+  }
+}
index 17b8dc5b9dc2eef1da0551afd2164d152a4ed1a7..40ddae3526b16e0cf9cb6c8a3ff2d7dc65cab1eb 100644 (file)
@@ -9452,7 +9452,14 @@ vect_bb_slp_scalar_cost (bb_vec_info vinfo,
            continue;
        }
 
-      gcc_assert (!gimple_visited_p (stmt->stmt));
+      /* The following assert verifies that vect_bb_partition_graph
+        partitions the SLP graph in a way that each scalar stmt of
+        the coverage of the SLP graph belongs to exactly one subgraph.
+        ???  This is currently not guaranteed since the function
+        works purely on SLP_TREE_SCALAR_STMTS, resulting in the assert
+        tripping or scalar stmts costed multiple times, making vectorization
+        more profitable than it really is.  */
+      /* gcc_checking_assert (!gimple_visited_p (stmt->stmt)); */
 
       if (vect_nop_conversion_p (stmt))
        ;