On Tue, 29 Jul 2025, Richard Biener wrote: > On Tue, 29 Jul 2025, Robin Dapp wrote: > > > > - if (len >= 3 > > > + if (!reassoc_insert_powi_p > > > + && len >= 3 > > > && (!has_fma > > > /* width > 1 means ranking ops results in better > > > parallelism. Check current value to avoid > > > > Last time I tried this I saw x86 regressions in bswap test cases (hence we > > decided not to go forward with it). I'm assuming they didn't show up in > > your > > regtest but I wonder what's different now. > > > > > FAIL: gcc.target/i386/pr115102.c scan-assembler bswaphisi2_lowpart > > > FAIL: gcc.target/i386/xchg-4.c scan-assembler rolw > > > FAIL: gcc.target/i386/xchg-4.c scan-assembler-not mov > > They did, but somehow I thought they must come from an unrelated > change. They could be fixed by allowing == 3 ops re-assocs but > in the end improving rotate detection in forwprop and bswap > in the bswap pass would be better. It's also that == 3 will > still break reduction chains, just for 2 elements: > > double > frd (double *p, double *lastone) > { > double sum = 0; > for (; p <= lastone; p += 2) > sum += p[0] + p[1]; > return sum; > } > > I'll add a testcase for that case as well.
I have opened PR121298. Richard.