]> 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 <rguenth@gcc.gnu.org>
Wed, 30 Apr 2025 12:45:54 +0000 (14:45 +0200)
commit51ba233fe2db562390a6e0a3618420889761bc77
tree5c27d54b87805130831975124c7e11c7334a4918
parenta85b89e26b1f50997701eb428c2dd71668f216ff
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.
gcc/testsuite/gcc.dg/vect/bb-slp-pr119960-1.c [new file with mode: 0644]
gcc/tree-vect-slp.cc