Hi, > Jan, > > The following patch started as a one-liner for ipa-inline-analysis.c: > account_size_time() to merge predicates when we are adding data to entry[0] > (i.e., when space for 32 size_time entries is exhausted): > > @@ -537,6 +592,9 @@ account_size_time (struct inline_summary > } > else > { > + e->predicate = or_predicates (summary->conds, &e->predicate, pred); > e->size += size; > e->time += time; > if (e->time > MAX_TIME * INLINE_TIME_SCALE)
As we discussed, this is not needed in current form because we arrange first predicate to be always true and thus we could always place there all the costs that did not fit elwhere. The patch has a problem with fact that the predicates must be always conservative i.e. when they are proved to be false the code must be unreachable after inlining. We could either go with your patch with the distance fuction modified to accept only predicates such that the new predicate is implied by them. If you are willing to play with this, I have no problem with going for this. The accounting is run just at most N statements of time, so the overall time should not be too bad. We could also stay with current logic until we hit real world testcases that demonstrate need for something like this and drop comment in the code above explaning why or is not needed to avoid confussion. Honza