On Thu, Aug 2, 2012 at 12:28 PM, Martin Jambor <mjam...@suse.cz> wrote: > Hi, > > this patch uses the aggregate jump functions created by the previous > patch in the series to determine benefits of inlining a particular > call graph edge. It has not changed much since the last time I posted > it, except for the presence of by_ref flags and removal of checks > required by TBAA which we now do not use. > > The patch works in fairly straightforward way. It ads two flags to > struct condition to specify it actually refers to an aggregate passed > by value or something passed by reference, in both cases at a > particular offset, also newly stored in the structures. Functions > which build the predicates specifying under which conditions CFG edges > will be taken or individual statements are actually executed then > simply also look whether a value comes from an aggregate passed to us > in a parameter (either by value or reference) and if so, create > appropriate conditions. Later on, predicates are evaluated as before, > we only also look at aggregate contents of the jump functions of the > edge we are considering to inline when evaluating the predicates, and > also remap the offsets of the jump functions when remapping over an > ancestor jump function. > > This patch alone makes us inline the function bar in testcase of PR > 48636 in comment #4. It also passes bootstrap and testing on > x86_64-linux. I successfully LTO-built Firefox with it too. > > Thanks for all comments and suggestions, > > Martin > > > 2012-07-31 Martin Jambor <mjam...@suse.cz> > > PR fortran/48636 > * ipa-inline.h (condition): New fields offset, agg_contents and > by_ref. > * ipa-inline-analysis.c (agg_position_info): New type. > (add_condition): New parameter aggpos, also store agg_contents, by_ref > and offset. > (dump_condition): Also dump aggregate conditions. > (evaluate_conditions_for_known_args): Also handle aggregate > conditions. New parameter known_aggs. > (evaluate_properties_for_edge): Gather known aggregate contents. > (inline_node_duplication_hook): Pass NULL known_aggs to > evaluate_conditions_for_known_args. > (unmodified_parm): Split into unmodified_parm and unmodified_parm_1. > (unmodified_parm_or_parm_agg_item): New function. > (set_cond_stmt_execution_predicate): Handle values passed in > aggregates. > (set_switch_stmt_execution_predicate): Likewise. > (will_be_nonconstant_predicate): Likewise. > (estimate_edge_devirt_benefit): Pass new parameter known_aggs to > ipa_get_indirect_edge_target. > (estimate_calls_size_and_time): New parameter known_aggs, pass it > recrsively to itself and to estimate_edge_devirt_benefit. > (estimate_node_size_and_time): New vector known_aggs, pass it o > functions which need it. > (remap_predicate): New parameter offset_map, use it to remap aggregate > conditions. > (remap_edge_summaries): New parameter offset_map, pass it recursively > to itself and to remap_predicate. > (inline_merge_summary): Also create and populate vector offset_map. > (do_estimate_edge_time): New vector of known aggregate contents, > passed to functions which need it. > (inline_read_section): Stream new fields of condition. > (inline_write_summary): Likewise. > * ipa-cp.c (ipa_get_indirect_edge_target): Also examine the aggregate > contents. Let all local callers pass NULL for known_aggs. >
This caused: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54409 H.J.