public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <law@redhat.com>
To: David Malcolm <dmalcolm@redhat.com>, Andi Kleen <andi@firstfloor.org>
Cc: gcc-patches@gcc.gnu.org, Andi Kleen <ak@linux.intel.com>
Subject: Re: [PATCH] Add XINSN macro and use it within NEXT_INSN/PREV_INSN  (was Re: [PATCH] Force rtl templates to be inlined)
Date: Fri, 05 Sep 2014 18:45:00 -0000	[thread overview]
Message-ID: <540A04B7.4020704@redhat.com> (raw)
In-Reply-To: <1409861057.19403.19.camel@surprise>

On 09/04/14 14:04, David Malcolm wrote:
> On Tue, 2014-09-02 at 19:50 +0200, Andi Kleen wrote:
>>> I suspect the bulk of them currently are coming from the safe_as_a
>>> <rtx_insn *> calls within NEXT_INSN and PREV_INSN; do you happen to have
>>> information handy on that?
>>
>> Yes that's right:
>>
>> -   1.03%  lto1                    [.] bool is_a_helper<rtx_insn*>::test<rtx_def>(rtx_def*)                                                     â–’
>>     - bool is_a_helper<rtx_insn*>::test<rtx_def>(rtx_def*)                                                                                       â–’
>>        - 92.20% bool is_a<rtx_insn*, rtx_def>(rtx_def*)                                                                                          â–’
>>           - 98.53% rtx_insn* safe_as_a<rtx_insn*, rtx_def>(rtx_def*)                                                                             â–’
>>              - 73.28% NEXT_INSN(rtx_insn const*)                                                                                                 â–’
>
> The is_a_helper for rtx_insn * is non-trivial, so it may be worth
> avoiding it, even when inlined.
>
> The attached patch rewrites the inline NEXT_INSN/PREV_INSN to avoid
> doing the safe_as_a, instead tightening up the interface so that one can
> only set them to an insn, and introducing a new XINSN access macro and
> corresponding rt_insn member of the union.
>
> Bootstrapped on x86_64-unknown-linux-gnu (Fedora 20), and has been
> rebuilt as part of a config-list.mk build for all working configurations
> (albeit with other patches for the latter case).
>
> OK for trunk?
So is this just to deal with the overhead in the safe_as_a helper until 
we can strengthen more code?  And is that overhead significant in an 
optimized build?

Would an alternate approach be to make the checking in safe_as_a 
conditionalized on ENABLE_CHECKING?

jeff

  parent reply	other threads:[~2014-09-05 18:45 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-02  7:05 [PATCH] Force rtl templates to be inlined Andi Kleen
2014-09-02  7:09 ` Andrew Pinski
2014-09-02  7:20   ` Andi Kleen
2014-09-02  7:22     ` Andrew Pinski
2014-09-02  8:37       ` Steven Bosscher
2014-09-02  8:42         ` pinskia
2014-09-02  8:43         ` Richard Biener
2014-09-02 16:52           ` Andi Kleen
2014-09-03  9:50             ` Richard Biener
2014-09-04  3:58               ` Andi Kleen
2014-09-04 13:02                 ` Richard Biener
2014-09-04 18:52                   ` Jan Hubicka
2014-09-03  9:52             ` Richard Biener
2014-09-02 14:59 ` David Malcolm
2014-09-02 17:50   ` Andi Kleen
2014-09-04 20:07     ` [PATCH] Add XINSN macro and use it within NEXT_INSN/PREV_INSN (was Re: [PATCH] Force rtl templates to be inlined) David Malcolm
2014-09-04 20:46       ` Jakub Jelinek
2014-09-04 21:23         ` David Malcolm
2014-09-05 18:41           ` Jeff Law
2014-09-05 18:32         ` Jeff Law
2014-09-05 18:45       ` Jeff Law [this message]
2014-09-05 19:05         ` David Malcolm

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=540A04B7.4020704@redhat.com \
    --to=law@redhat.com \
    --cc=ak@linux.intel.com \
    --cc=andi@firstfloor.org \
    --cc=dmalcolm@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    /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).