]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/117558 - peeling for gaps and VL vectors
authorRichard Biener <rguenther@suse.de>
Fri, 15 Nov 2024 07:42:04 +0000 (08:42 +0100)
committerRichard Biener <rguenth@gcc.gnu.org>
Sat, 16 Nov 2024 13:13:28 +0000 (14:13 +0100)
commit935aaface9469df644a3d926320da68cd796c067
tree2bc105a6445e144d42fc6c842b7e81b08d7b5f7e
parentcee7d080d5c2a5fb8125878998b742c040ec88b4
tree-optimization/117558 - peeling for gaps and VL vectors

The following ensures that peeling a single iteration for gaps is
sufficient by enforcing niter masking (partial vector use) given
we cannot (always) statically decide when the vector size isn't known.
The condition guarding this and thus statically giving a pass in
some cases for VL vectors is questionable, the patch doesn't address
this.

This fixes a set of known failout from enabling
--param vect-force-slp=1 by default.

PR tree-optimization/117558
* tree-vectorizer.h (_loop_vec_info::must_use_partial_vectors_p): New.
(LOOP_VINFO_MUST_USE_PARTIAL_VECTORS_P): Likewise.
* tree-vect-loop.cc (_loop_vec_info::_loop_vec_info): Initialize
must_use_partial_vectors_p.
(vect_determine_partial_vectors_and_peeling): Enforce it.
(vect_analyze_loop_2): Reset before restarting.
* tree-vect-stmts.cc (get_group_load_store_type): When peeling
a single gap iteration cannot be determined safe statically
enforce the use of partial vectors.
gcc/tree-vect-loop.cc
gcc/tree-vect-stmts.cc
gcc/tree-vectorizer.h