https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122364
Bug ID: 122364
Summary: Missed reduction chain vectorization
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: rguenth at gcc dot gnu.org
Target Milestone: ---
int q[32];
unsigned __attribute__((noipa))
foo ()
{
unsigned res = 0;
for (int i = 0; i < 8; ++i)
res += q[4*i] + q[4*i+1] + q[4*i+2] + q[4*i+3];
return res;
}
is still not discovered as reduction chain which is because of the
unsigned conversion getting in the way of vect_slp_linearize_chain.
Recursively skipping sign conversions on leafs might work around this
and more complicated examples (short of simply pattern matching this
very case).