This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/77568] [7 regression] CSE/PRE/Hoisting blocks common instruction contractions


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77568

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #6)
> Note that all "bad" transforms can be done by users on the source level
> already.  So the _only_ proper solution is to handle the situation in the
> passes that now refuse to do an important optimization (like combine).

For an example take:
float f(float x, float y, float z, int a)
{
   float t = y * z;
   if (a > 100)
     x += t;
   else
     x -= t;
   return x;
}

Note we are able to optimize the follow (use -O2) to use fmadds:
float f(float x, float y, float z, int a)
{
   float t = y * z;
   x += t;
   x -= t;
   return x;
}

---- CUT ----
and it is optimized in the widening_mul pass (which includes the FMA
optimization pass).

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]