https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128938
Bug ID: 128938
Summary: [15/16/17 Regression] vector Reduction cost seems not
to be taken into account at -O2
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: pinskia at gcc dot gnu.org
Target Milestone: ---
Target: x86_64
Created attachment 66251
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=66251&action=edit
testcase
As reported on fedi:
https://hachyderm.io/@dalias/117645616011442290
The cost assoicated with plus reduction on x86_64 seems not to be taken into
account at -O2 and the code grows a lot.
testcase attached.
This is a simple reduction of truncated differences of two arrays of size 13.
The other thing is difference seems to be done in short and then truncated.
Why not use a V8QI here and then V4QI and then QI? with a widening to short for
the reduction?