https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115710
--- Comment #11 from rguenther at suse dot de <rguenther at suse dot de> --- On Sun, 30 Jun 2024, pinskia at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115710 > > --- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> --- > I wonder if we could also add: > +/* cabs(x+0i) or cabs(0+xi) -> abs(x). */ > +(simplify > + (CABS (complex:c @0 real_zerop@1)) > + (abs @0)) > > > + /* cabs(x+xi) -> fabs(x)*sqrt(2). */ > + (simplify > + (CABS (complex @0 @0)) > + (mult (abs @0) { build_real_truncate (type, dconst_sqrt2 ()); }))) > > > to the lowering part. > > let me look into doing that but it will be 3rd part to the patch series. Since > we should have this info already ... Complex lowering should use its lattice to do the usual simplifications, sure. Having those simplification patterns would be OK as well of course.