[Bug tree-optimization/121949] Missed shift vectorization when IV value has a different datatype
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Oct 14 09:25:42 GMT 2025
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121949
--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tamar Christina <tnfchris@gcc.gnu.org>:
https://gcc.gnu.org/g:c078309cda304ffa18d2bd322512530e6feffdfb
commit r16-4414-gc078309cda304ffa18d2bd322512530e6feffdfb
Author: Tamar Christina <tamar.christina@arm.com>
Date: Tue Oct 14 10:24:13 2025 +0100
middle-end: Relax vect_recog_vector_vector_shift_pattern STMT def type
[PR121949]
The example
void f(long long* acc)
{
for (int row = 0; row < 64; ++row)
acc[row] = acc[row] << row;
}
fails to vectorize because the size of row is different than the size of
the
being shifted value.
The vectorizer has a pattern that should deal with such shifts in
vect_recog_vector_vector_shift_pattern however this pattern is using
vect_get_internal_def to get the definition of the shift operand.
This needlessly restricts the pattern to only internal_defs. The
vectorizer
can deal with casts on any operand type so this restriction isn't needed
and
this is dropped.
gcc/ChangeLog:
PR tree-optimization/121949
* tree-vect-patterns.cc (vect_recog_vector_vector_shift_pattern):
Remove
restriction on internal_def.
gcc/testsuite/ChangeLog:
PR tree-optimization/121949
* gcc.dg/vect/pr121949_1.c: New test.
* gcc.dg/vect/pr121949_2.c: New test.
* gcc.dg/vect/pr121949_3.c: New test.
More information about the Gcc-bugs
mailing list