[Bug tree-optimization/115833] New: SLP of signed short multiply goes wrong
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Jul 9 05:01:24 GMT 2024
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115833
Bug ID: 115833
Summary: SLP of signed short multiply goes wrong
Product: gcc
Version: 15.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: enhancement
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: pinskia at gcc dot gnu.org
Target Milestone: ---
Take:
```
void v4hi_smul(signed short *t, signed short tt)
{
t[0] *= tt;
t[1] *= tt;
t[2] *= tt;
t[3] *= tt;
}
void v4hi_umul(unsigned short *t, unsigned short tt)
{
t[0] *= tt;
t[1] *= tt;
t[2] *= tt;
t[3] *= tt;
}
```
At `-O2 -fno-vect-cost-model ` on x86_64, v4hi_smul code generation is really
bad while v4hi_umul is decent.
Both functions should produce the same code but currently we don't.
I noticed this while adding V2HI support to aarch64 backend and writing up
testcases.
More information about the Gcc-bugs
mailing list