This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/77568] [7 regression] CSE/PRE/Hoisting blocks common instruction contractions
- From: "pinskia at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 13 Sep 2016 13:32:25 +0000
- Subject: [Bug middle-end/77568] [7 regression] CSE/PRE/Hoisting blocks common instruction contractions
- Auto-submitted: auto-generated
- References: <bug-77568-4@http.gcc.gnu.org/bugzilla/>
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).