aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vectorizer.h
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2024-11-15 08:42:04 +0100
committerRichard Biener <rguenth@gcc.gnu.org>2024-11-16 14:13:28 +0100
commit935aaface9469df644a3d926320da68cd796c067 (patch)
tree2bc105a6445e144d42fc6c842b7e81b08d7b5f7e /gcc/tree-vectorizer.h
parentcee7d080d5c2a5fb8125878998b742c040ec88b4 (diff)
downloadgcc-935aaface9469df644a3d926320da68cd796c067.zip
gcc-935aaface9469df644a3d926320da68cd796c067.tar.gz
gcc-935aaface9469df644a3d926320da68cd796c067.tar.bz2
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.
Diffstat (limited to 'gcc/tree-vectorizer.h')
-rw-r--r--gcc/tree-vectorizer.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h
index 273e8c6..ebd1d89 100644
--- a/gcc/tree-vectorizer.h
+++ b/gcc/tree-vectorizer.h
@@ -913,6 +913,9 @@ public:
fewer than VF scalars. */
bool can_use_partial_vectors_p;
+ /* Records whether we must use niter masking for correctness reasons. */
+ bool must_use_partial_vectors_p;
+
/* True if we've decided to use partially-populated vectors, so that
the vector loop can handle fewer than VF scalars. */
bool using_partial_vectors_p;
@@ -1051,6 +1054,7 @@ public:
#define LOOP_VINFO_VERSIONING_THRESHOLD(L) (L)->versioning_threshold
#define LOOP_VINFO_VECTORIZABLE_P(L) (L)->vectorizable
#define LOOP_VINFO_CAN_USE_PARTIAL_VECTORS_P(L) (L)->can_use_partial_vectors_p
+#define LOOP_VINFO_MUST_USE_PARTIAL_VECTORS_P(L) (L)->must_use_partial_vectors_p
#define LOOP_VINFO_USING_PARTIAL_VECTORS_P(L) (L)->using_partial_vectors_p
#define LOOP_VINFO_USING_DECREMENTING_IV_P(L) (L)->using_decrementing_iv_p
#define LOOP_VINFO_USING_SELECT_VL_P(L) (L)->using_select_vl_p