This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH] Improve -Ofast vectorization of std::sin etc. (PR libstdc++/81706)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: "Joseph S. Myers" <joseph at codesourcery dot com>, Marek Polacek <polacek at redhat dot com>, Jonathan Wakely <jwakely at redhat dot com>, gcc-patches List <gcc-patches at gcc dot gnu dot org>, libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Tue, 12 Sep 2017 09:49:20 +0200
- Subject: Re: [PATCH] Improve -Ofast vectorization of std::sin etc. (PR libstdc++/81706)
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jakub at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1D9FFC0587CB
- References: <20170807090825.GK2123@tucnak> <d8d629b2-86f6-9c1f-f627-814f73274fd1@redhat.com> <20170807152742.GM2123@tucnak> <20170901111249.GD2323@tucnak> <CADzB+2m-cY+mF4SP0wf=GcyDWrRdDePbQKdo59Fd12t=Kpa_kg@mail.gmail.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Sat, Sep 09, 2017 at 03:42:35PM +0200, Jason Merrill wrote:
> On Fri, Sep 1, 2017 at 1:12 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> > + tree s = lookup_attribute ("omp declare simd",
> > + DECL_ATTRIBUTES (newdecl));
> > + if (s)
> > + {
> > + tree b
> > + = builtin_decl_explicit (DECL_FUNCTION_CODE (newdecl));
> > + if (b)
> > + duplicate_one_attribute (&DECL_ATTRIBUTES (b), s,
> > + "omp declare simd");
> > + }
>
> Is there a reason not to set b first and move the lookup of s into the
> function as well?
I wanted to handle the most common case (no DECL_ATTRIBUTES at all) and the
second most common case (lookup_attribute returning NULL) inline, otherwise
we'll do an extra function call for all builtins in all cases.
But if you strongly prefer that lookup to be in duplicate_one_attribute,
I can change the patch and retest.
Jakub