]> git.ipfire.org Git - thirdparty/gcc.git/commit
tree-optimization/121049 - avoid loop masking with even/odd reduction
authorRichard Biener <rguenther@suse.de>
Wed, 16 Jul 2025 13:07:58 +0000 (15:07 +0200)
committerRichard Biener <rguenther@suse.de>
Wed, 16 Jul 2025 17:44:21 +0000 (19:44 +0200)
commitbc5570f7ef796fa7f5ab89b34ed9de2be5299f0e
tree0ee9741f44ef00bcb18198d7e87661704370ed91
parent4d6c3f3b4fbf8c2774848fcb36705ea5f0d514d4
tree-optimization/121049 - avoid loop masking with even/odd reduction

The following disables loop masking when we are using an even/odd
widening operation in a reduction because the loop mask then aligns
to the wrong elements.

PR tree-optimization/121049
* internal-fn.h (widening_evenodd_fn_p): Declare.
* internal-fn.cc (widening_evenodd_fn_p): New function.
* tree-vect-stmts.cc (vectorizable_conversion): When using
an even/odd widening function disable loop masking.

* gcc.dg/vect/pr121049.c: New testcase.
gcc/internal-fn.cc
gcc/internal-fn.h
gcc/testsuite/gcc.dg/vect/pr121049.c [new file with mode: 0644]
gcc/tree-vect-stmts.cc