This is the mail archive of the gcc-patches@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]

Re: [PATCH] do not lower a/b to a*(1/b)



We still don't do it for straight line code on the tree level.
For an example:
double f(double a, double b, double c)
{
  return a/c + b/c;
}

I know, but the biggest benefit is to do it in loops; a function such as f will hopefully be inlined (and if in a loop, we'll optimize it). extract_muldiv could easily be improved to handle this; right now, I believe that the code in expr.c does more harm than good.


Paolo


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