]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-optimization/99924 - visit permute nodes again when partitioning
authorRichard Biener <rguenther@suse.de>
Tue, 6 Apr 2021 09:21:47 +0000 (11:21 +0200)
committerRichard Biener <rguenther@suse.de>
Tue, 6 Apr 2021 10:15:30 +0000 (12:15 +0200)
Since SLP graph partitioning works on scalar stmts (because it's done
for costing) we have to make sure to visit permute nodes multiple
times since they will not pull partitions together.

2021-04-06  Richard Biener  <rguenther@suse.de>

PR tree-optimization/99924
* tree-vect-slp.c (vect_bb_partition_graph_r): Do not mark
nodes w/o scalar stmts as visited.

* gfortran.dg/vect/pr99924.f90: New testcase.

gcc/testsuite/gfortran.dg/vect/pr99924.f90 [new file with mode: 0644]
gcc/tree-vect-slp.c

diff --git a/gcc/testsuite/gfortran.dg/vect/pr99924.f90 b/gcc/testsuite/gfortran.dg/vect/pr99924.f90
new file mode 100644 (file)
index 0000000..f271ea1
--- /dev/null
@@ -0,0 +1,12 @@
+! { dg-do compile }
+! { dg-additional-options "-march=armv8.3-a" { target aarch64-*-* } }
+subroutine cunhj (tfn, asum, bsum)
+  implicit none
+  complex :: up, tfn, asum, bsum
+  real :: ar
+
+  up = tfn * ar
+  bsum = up + ar
+  asum = up + asum
+  return
+end subroutine cunhj
index ceec7f5c41092926c139f937e7a0bda689449862..58dedfc35b7147a0a616ab8e000a4bb12c7a4a97 100644 (file)
@@ -4224,7 +4224,7 @@ vect_bb_partition_graph_r (bb_vec_info bb_vinfo,
       stmt_instance = instance;
     }
 
-  if (visited.add (node))
+  if (!SLP_TREE_SCALAR_STMTS (node).is_empty () && visited.add (node))
     return;
 
   slp_tree child;