public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: Uros Bizjak <ubizjak@gmail.com>
Cc: "Peryt, Sebastian" <sebastian.peryt@intel.com>,
	Andi Kleen <andi@firstfloor.org>,
	"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	"Metzger, Markus T" <markus.t.metzger@intel.com>,
	Andi Kleen <ak@linux.intel.com>
Subject: Re: [PATCH 1/3] Add PTWRITE builtins for x86
Date: Fri, 11 May 2018 01:57:00 -0000	[thread overview]
Message-ID: <20180511004432.chrv7gicfrmzd6sw@two.firstfloor.org> (raw)
In-Reply-To: <CAFULd4bAfTAcX5DeheEK6biz2r6QhepmS4CAejtj43HRsgeDWQ@mail.gmail.com>

> @@ -31325,7 +31329,21 @@ ix86_init_mmx_sse_builtins (void)
>      continue;
> 
>        ftype = (enum ix86_builtin_func_type) d->flag;
> -      def_builtin2 (d->mask, d->name, ftype, d->code);
> +      decl = def_builtin2 (d->mask, d->name, ftype, d->code);
> +
> +      /* Avoid edges for ptwrites generated by vartrace pass.  */
> +      if (decl)
> +    {
> +      DECL_ATTRIBUTES (decl) = build_tree_list (get_identifier ("leaf"),
> +                            NULL_TREE);
> +      TREE_NOTHROW (decl) = 1;
> +    }
> +      else
> +    {
> +      ix86_builtins_isa[(int)d->code].leaf_p = true;
> +      ix86_builtins_isa[(int)d->code].nothrow_p = true;
> +    }
> +
> 
> Can you please explain what is the purpose of the above change?

With the vartrace patch, which was the next patch in the original
patchkit, the compiler can generate a lot of ptwrite builtins,
and adding so many edges can slow it down. I originally copied
this from the MPX builtins (which had the same problem).

Possibly it could be in another patch, but then it would seem 
better to have the same semantics always. FWIW I don't think
the edges are needed for anything, but of course for moderate
use of the builtin it doesn't really matter.

-Andi

  reply	other threads:[~2018-05-11  0:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-12  2:53 Andi Kleen
2018-02-12  2:53 ` [PATCH 2/3] Add a pass to automatically add ptwrite instrumentation Andi Kleen
2018-02-12  2:53   ` [PATCH 3/3] Add tests for the vartrace pass Andi Kleen
2018-02-12 21:35 ` [PATCH 1/3] Add PTWRITE builtins for x86 Joseph Myers
2018-05-09 11:29 ` Peryt, Sebastian
2018-05-09 12:11   ` Uros Bizjak
2018-05-11  1:57     ` Andi Kleen [this message]
2018-05-11  6:31       ` Uros Bizjak
2018-11-04  6:33 Andi Kleen
2018-11-08 17:10 ` Andi Kleen
2018-11-08 17:30 Uros Bizjak
2018-11-08 18:03 ` Andi Kleen
2018-11-08 18:11   ` Uros Bizjak
2018-11-10  2:54 ` Segher Boessenkool

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=20180511004432.chrv7gicfrmzd6sw@two.firstfloor.org \
    --to=andi@firstfloor.org \
    --cc=ak@linux.intel.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=markus.t.metzger@intel.com \
    --cc=sebastian.peryt@intel.com \
    --cc=ubizjak@gmail.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).