On Wed, Jul 24, 2019 at 11:29 AM Eric Botcazou <ebotca...@adacore.com> wrote: > > Hi, > > for EH cleanups, the branch probability heuristics can consider that edges are > never taken, i.e. their profile count is set to zero. In this case, no matter > how you tweak the inlining parameters, you cannot get function calls inlined, > but -Winline nevertheless prints the standard message about unlikely calls as > in the cases when tweaking the inlining parameters can work. > > Therefore the attached patch adds a new CIF code with the warning message: > > "call is never executed and code size would grow [-Winline]" > > for this case, thus signaling the user that he'd better not waste time trying > to get the call inlined. > > Tested on x86_64-suse-linux, OK for the mainline?
Looks good besides + if (e->count.ipa () == profile_count::zero ()) + e->inline_failed = CIF_NEVER_CALL; does it actually matter what kind of profile quality e->count.ipa has compared to profile_count::zero ()? Also +/* Call is considered never executed. */ +DEFCIFCODE(NEVER_CALL, CIF_FINAL_NORMAL, + N_("call is never executed and code size would grow")) suggests the call is never executed, but we only assume that (or the profile training run never hit it). Richard. > > > 2019-07-24 Eric Botcazou <ebotca...@adacore.com> > > * cif-code.def (NEVER_CALL): New code. > * ipa-inline.c (want_inline_small_function_p): Fix formatting issues. > Set the failure to CIF_NEVER_CALL if the IPA count is zero. > > -- > Eric Botcazou