https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113583
--- Comment #18 from Robin Dapp <rdapp at gcc dot gnu.org> --- A bit of a follow-up: I'm working on a patch for reassociation that can handle the mentioned cases and some more but it will still require a bit of time to get everything regression free and correct. What it does is allow reassoc to look through constant multiplications and negates to provide more freedom in the optimization process. Regarding the mentioned element-wise costing how should we proceed here? I'm going to remove the hunk in question, run SPEC2017 on x86 and post a patch in order to get some data and basis for discussion.