]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/121395 - SLP of SIMD calls w/o LHS
authorRichard Biener <rguenther@suse.de>
Mon, 4 Aug 2025 12:45:53 +0000 (14:45 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 5 Aug 2025 11:10:25 +0000 (13:10 +0200)
commit32b1be7eb434addefe203249746dc6bbdc185403
tree06cc837d5a43678c5ed4d6dec8597db9c4979ea7
parent9732b57443917fb913959740c471295205bcf2f5
tree-optimization/121395 - SLP of SIMD calls w/o LHS

The following records the alternate SLP instance entries coming from
stmts with stores that have no SSA def, like OMP SIMD calls without LHS.
There's a bit of fallout with having a SLP tree with a NULL vectype,
but nothing too gross.

PR tree-optimization/121395
* tree-vectorizer.h (_loop_vec_info::alternate_defs): New member.
(LOOP_VINFO_ALTERNATE_DEFS): New.
* tree-vect-stmts.cc (vect_stmt_relevant_p): Populate it.
(vectorizable_simd_clone_call): Do not register a SLP def
when there is none.
* tree-vect-slp.cc (vect_build_slp_tree_1): Allow a NULL
vectype when there's no LHS.  Allow all calls w/o LHS.
(vect_analyze_slp): Process LOOP_VINFO_ALTERNATE_DEFS as
SLP graph entries.
(vect_make_slp_decision): Handle a NULL SLP_TREE_VECTYPE.
(vect_slp_analyze_node_operations_1): Likewise.
(vect_schedule_slp_node): Likewise.

* gcc.dg/vect/pr59984.c: Adjust.
gcc/testsuite/gcc.dg/vect/pr59984.c
gcc/tree-vect-slp.cc
gcc/tree-vect-stmts.cc
gcc/tree-vectorizer.h