------- Comment #47 from rguenth at gcc dot gnu dot org  2010-03-19 10:26 
-------
(In reply to comment #46)
> The answer to the question (b) in comment #35:
> 
> > (b) why !optimize_size has been replaced with optimize_insn_for_speed_p ()?
> 
> seems to be
> 
> > this patch replace some of optimize_size tests by
> > optimize_insn_for_speed_p predicate so we can make decisions on per-BB
> > granuality.
> 
> from http://gcc.gnu.org/ml/gcc-patches/2008-08/msg00121.html  (revision 138565
> by hubicka, Sun Aug 3 12:04:49 2008 UTC).
> 
> Why is there any need to expand pow(x,n) "on per-BB granularity"? is not
> !optimize_size enough for this case?

optimize_insn_for_speed_p is more precise in that it allows hot functions
to be optimized for speed even with -Os.  This is quite important for
embedded targets where you generally want to optimize for size but want
performance sensitive parts to be optimized for speed.

I think there are two good solutions to this PR.

 1) re-work how the profile is computed for deep loop nests

 2) improve the code-size estimate of these expanders (a simple convincing
 heuristic is that if the target has an optab for sqrt then x * sqrt (x)
 is not going to be larger than pow(x, 1.5)).

2) would fix the air case but not really the underlying problem which is
1).  2) would be easy to implement and appropriate for 4.5 - I can't see
how to address 1) with a reasonably sized patch.

Note that this PR isn't too serious as -fwhole-file isn't the default
for Fortran so we do not run into this unfortunate interaction of
profile estimation and inlining.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40106

Reply via email to