https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117072
--- Comment #9 from rguenther at suse dot de <rguenther at suse dot de> --- On Fri, 11 Oct 2024, liuhongt at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117072 > > --- Comment #8 from Hongtao Liu <liuhongt at gcc dot gnu.org> --- > (In reply to Richard Biener from comment #7) > > OTOH I'll note that no other simplify_* treats canonicalization as > > simplification and the existing swap_commutative_operands_p transform for > > FMA > > is highly uncommon. > > > > So why do we recognize (fma (neg (mem...)) ...) and not only (neg > > (register_operand))? > > I think we can relex register_operand to nonimmediate_operand and rely on RA > to > reload it into a reg just like we did in > <sd_mask_codefor>fma_fnmadd_<mode><sd_maskz_name><round_name>. So a backend > fix > shou be better? I think currently the backend isn't consistent with itself and sure, a backend fix would be better (if it doesn't mean bloating the .md with many more patterns).