This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: std::pow implementation
- From: Richard Guenther <rguenth at tat dot physik dot uni-tuebingen dot de>
- To: Daniel Berlin <dberlin at dberlin dot org>
- Cc: Joe Buck <jbuck at synopsys dot com>, Scott Robert Ladd <coyote at coyotegulch dot com>, Gabriel Dos Reis <gdr at integrable-solutions dot net>, Alexandre Oliva <aoliva at redhat dot com>, Steven Bosscher <s dot bosscher at student dot tudelft dot nl>, <gcc at gcc dot gnu dot org>
- Date: Wed, 30 Jul 2003 19:45:44 +0200 (CEST)
- Subject: Re: std::pow implementation
On Wed, 30 Jul 2003, Daniel Berlin wrote:
>
> On Wednesday, July 30, 2003, at 1:06 PM, Richard Guenther wrote:
>
> > On Wed, 30 Jul 2003, Joe Buck wrote:
> >
> >> However, that doesn't get around the fact that we have an -O3 switch,
> >> enabling a mode where the compiler has to make decisions to inline
> >> additional functions.
> >>
> >> In such cases, the compiler cannot ignore the effect of constant
> >> arguments
> >> causing much of the code in a called function to disappear when the
> >> called
> >> function is inlined.
> >
> > We may be able to do this now with unit-at-a-time and callgraph by
> > duplicating the trees for function calls with constant arguments and
> > binding the constant arguments and doing the tree-optimizations on
> > these
> > bodies before deciding inlining (and we may even just emit this new
> > function out of line if not inlined).
>
> Actually, the heuristic is usually something like:
> If number of calls to function with constant arguments is estimated or
> actually high (IE function is on some critical performance path):
> <clone and optimize>
>
> Otherwise, you would waste so much time trying to determine what to
> clone, it's absurd.
So this would be only practical with profiling feedback then?
Richard.