aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2024-09-05 11:18:57 +0200
committerRichard Biener <rguenth@gcc.gnu.org>2024-09-06 09:16:03 +0200
commit6a1a856ba78589f7f5285b00ecd40ba2bbeef8b0 (patch)
treed3d7f545799915ddec03f82640a0de1f5eb9b167 /gcc
parent116bfbc806a7aa3f1ae2a3b3eb38d6bb65e0d0a7 (diff)
downloadgcc-6a1a856ba78589f7f5285b00ecd40ba2bbeef8b0.zip
gcc-6a1a856ba78589f7f5285b00ecd40ba2bbeef8b0.tar.gz
gcc-6a1a856ba78589f7f5285b00ecd40ba2bbeef8b0.tar.bz2
tree-optimization/116610 - wrong SLP induction bias for mask peeling
The following fixes a mistake when applying the bias for peeling via masking to the inital value of SLP inductions. This resolves gcc.target/aarch64/sve/peel_ind_1.c (a scan-assembler only unfortunately) when forcing single-lane SLP for it. PR tree-optimization/116610 * tree-vect-loop.cc (vectorizable_induction): Use MINUS_EXPR to apply a mask peeling adjustment.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/tree-vect-loop.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc
index 31cdc4b..a879a13 100644
--- a/gcc/tree-vect-loop.cc
+++ b/gcc/tree-vect-loop.cc
@@ -10543,7 +10543,7 @@ vectorizable_induction (loop_vec_info loop_vinfo,
vec_steps.safe_push (vec_step);
tree step_mul = gimple_build_vector (&init_stmts, &mul_elts);
if (peel_mul)
- step_mul = gimple_build (&init_stmts, PLUS_EXPR, step_vectype,
+ step_mul = gimple_build (&init_stmts, MINUS_EXPR, step_vectype,
step_mul, peel_mul);
if (!init_node)
vec_init = gimple_build_vector (&init_stmts, &init_elts);