Hi, On Tue, Aug 21, 2012 at 08:55:02AM +0200, Jan Hubicka wrote: > > Hi, > this patch adds a hint that if inlining makes bounds on loop iterations known, > it is probably good idea. This is primarely targetting Fortran's array > descriptors, but should be generally useful. > > Fortran will still need a bit more work. Often we disregard inlining because > we > think the call is cold (because it comes from Main) so inlining heuristic will > need more updating and apparently we will also need to update for PHI > conditionals as done in Martin's patch 3/3.
My patch helps only a bit, for example on the pr48636.f90 testcase it still does not help to discover a loop bound hint because the patch, being overly simple, looks at edge->aux predicates to construct predicates of phi results constantness and those are computed before we start populating nonconstant_names. So phi nodes for any conditions based on expressions (as opposed to direct parameter values) are not considered. I'll see how far I can get by re-evaluating the condition instead (but eventually we will probably want to do the full propagation, though perhaps not in 4.8). > At the moment the hint is interpreted same way as the indirect_call hint from > previous patch. > > Martin: I think ipa-cp should also make use of this hint. Resolving > number of loop iterations is important enough reason to specialize > in many cases. I think it already has logic for devirtualization > but perhaps it should be made more aggressive? I was sort of > surprised that for Mozila the inlining hint makes us to catch 20 > times more cases than before. Most of the cases sounds like good > ipa-cp candidates. Interesting, I can experiment with that, sure. On the other hand, I'd be careful about any measurements taken after August 13 because of PR 54394 which might have caused some edges to be considered much cooler than they are. I'll post a patch for it in a minute. > > Also can you please try to finaly make param notes to be used by the virtual > clones machinery and thus make it possible for ipa-cp to specialize for known > aggregate parameters? This should make a lot of difference for Fortran, I > think. Yeah, that's the next big item on my list to do after I finish all the little ones (like the PHIs, for example), but hopefully, I'll have that done soon. Martin