From: Richard Biener <rguenther@suse.de>
To: "Andre Vieira (lists)" <andre.simoesdiasvieira@arm.com>
Cc: Jan Hubicka <hubicka@ucw.cz>,
Richard Sandiford <richard.sandiford@arm.com>,
"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
"jakub@redhat.com" <jakub@redhat.com>
Subject: Re: [PATCH] inline: improve internal function costs
Date: Mon, 12 Jun 2023 13:01:41 +0000 (UTC) [thread overview]
Message-ID: <nycvar.YFH.7.77.849.2306121259420.4723@jbgna.fhfr.qr> (raw)
In-Reply-To: <600e87e9-1e36-caf1-dc70-5c09c7b3e605@arm.com>
On Mon, 12 Jun 2023, Andre Vieira (lists) wrote:
>
>
> On 05/06/2023 04:04, Jan Hubicka wrote:
> >> 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).
> >
>
> This sounds to me like you agree with my approach to treat internal calls
> different to regular calls.
>
> > 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.
>
> I'm happy to add such a helper function @richi,rsandifo: you ok with that?
It's a bit of an ugly name, if we want something that keys on calls
that have an edge it should be obvious it does this. I wouldn't
add is_noninternal_gimple_call. With LTO and libgcc and internal
optab fns it's also less obvious in cases we want to have say
.DIVMODDI3 (...) which in the end maps to a LTOed libcall from libgcc.a
...
Richard.
prev parent reply other threads:[~2023-06-12 13:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-01 16:30 Andre Vieira (lists)
2023-06-02 9:13 ` Richard Biener
2023-06-02 9:44 ` Andre Vieira (lists)
2023-06-05 3:04 ` Jan Hubicka
2023-06-12 12:38 ` Andre Vieira (lists)
2023-06-12 13:01 ` Richard Biener [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=nycvar.YFH.7.77.849.2306121259420.4723@jbgna.fhfr.qr \
--to=rguenther@suse.de \
--cc=andre.simoesdiasvieira@arm.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=hubicka@ucw.cz \
--cc=jakub@redhat.com \
--cc=richard.sandiford@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).