]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/119960 - failed external SLP promotion
authorRichard Biener <rguenther@suse.de>
Tue, 29 Apr 2025 11:23:41 +0000 (13:23 +0200)
committerRichard Biener <rguenther@suse.de>
Fri, 6 Jun 2025 07:50:04 +0000 (09:50 +0200)
commit8fb3d9066266ea30de62c395239bda4e992297a3
treeecc212a4c013b498b6a5dacabed07a06546fcd3e
parent7da2b6ddf3a8371b585595231cddcb1ad0942ea4
tree-optimization/119960 - failed external SLP promotion

The following addresses a too conservative sanity check of SLP nodes
we want to promote external.  The issue lies in code generation
for such external which relies on get_later_stmt to figure an
insert location.  But get_later_stmt relies on the ability to
totally order stmts, specifically implementation-wise that they
are all from the same BB, which is what is verified at the moment.

The patch changes this to require stmts to be orderable by
dominance queries.  For simplicity and seemingly enough for the
testcase in PR119960, this handles the case of two distinct BBs.

PR tree-optimization/119960
* tree-vect-slp.cc (vect_slp_can_convert_to_external):
Handle cases where defs from multiple BBs are ordered
by their dominance relation.

* gcc.dg/vect/bb-slp-pr119960-1.c: New testcase.

(cherry picked from commit cc74e2f2b39b6debbef1787a087abad2108e95dd)
gcc/testsuite/gcc.dg/vect/bb-slp-pr119960-1.c [new file with mode: 0644]
gcc/tree-vect-slp.cc