From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 103321 invoked by alias); 11 May 2018 00:44:40 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 103311 invoked by uid 89); 11 May 2018 00:44:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=BAYES_00,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=no version=3.3.2 spammy=vartrace, ptwrites, H*f:sk:2018021, Andi X-HELO: one.firstfloor.org Received: from one.firstfloor.org (HELO one.firstfloor.org) (193.170.194.197) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 11 May 2018 00:44:38 +0000 Received: by one.firstfloor.org (Postfix, from userid 503) id DD080867CC; Fri, 11 May 2018 02:44:34 +0200 (CEST) Date: Fri, 11 May 2018 01:57:00 -0000 From: Andi Kleen To: Uros Bizjak Cc: "Peryt, Sebastian" , Andi Kleen , "gcc-patches@gcc.gnu.org" , "Metzger, Markus T" , Andi Kleen Subject: Re: [PATCH 1/3] Add PTWRITE builtins for x86 Message-ID: <20180511004432.chrv7gicfrmzd6sw@two.firstfloor.org> References: <20180212025317.28068-1-andi@firstfloor.org> <17623B198193D741876BD81A6E3AE5AD3C6AA8EA@irsmsx111.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) X-SW-Source: 2018-05/txt/msg00532.txt.bz2 > @@ -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