> On Thu, 1 Jun 2023, Andre Vieira (lists) wrote:
> 
> > Hi,
> > 
> > This is a follow-up of the internal function patch to add widening and
> > narrowing patterns.  This patch improves the inliner cost estimation for
> > internal functions.
> 
> I have no idea why calls are special in IPA analyze_function_body
> and so I cannot say whether treating all internal fn calls as
> non-calls is correct there.  Honza?

The reason is that normal statements are acconted as part of the
function body, while calls have their costs attached to call edges
(so it can be adjusted when call is inlined to otherwise optimized).

However since internal functions have no cgraph edges, this looks like
a bug that we do not test it.  (the code was written before internal
calls was introduced).

I wonder if we don't want to have is_noninternal_gimple_call that could
be used by IPA code to test whether cgraph edge should exist for
the statement.
> 
> The tree-inline.cc change is OK though (you can push that separately).
The rest is OK too.
Honza
> 
> Thanks,
> Richard.
> 
> > Bootstrapped and regression tested on aarch64-unknown-linux-gnu.
> > 
> > gcc/ChangeLog:
> > 
> >         * ipa-fnsummary.cc (analyze_function_body): Correctly handle
> >         non-zero costed internal functions.
> >         * tree-inline.cc (estimate_num_insns): Improve costing for internal
> >         functions.
> > 
> 
> -- 
> Richard Biener <rguent...@suse.de>
> SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg,
> Germany; GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman;
> HRB 36809 (AG Nuernberg)

Reply via email to