From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7333 invoked by alias); 2 Oct 2015 13:18: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 7323 invoked by uid 89); 2 Oct 2015 13:18:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-vk0-f53.google.com Received: from mail-vk0-f53.google.com (HELO mail-vk0-f53.google.com) (209.85.213.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 02 Oct 2015 13:18:38 +0000 Received: by vkao3 with SMTP id o3so59436660vka.2 for ; Fri, 02 Oct 2015 06:18:36 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.31.1.197 with SMTP id 188mr10353533vkb.153.1443791916127; Fri, 02 Oct 2015 06:18:36 -0700 (PDT) Received: by 10.31.10.14 with HTTP; Fri, 2 Oct 2015 06:18:36 -0700 (PDT) In-Reply-To: References: <56000538.5000800@t-online.de> <5601AEDB.4000100@redhat.com> <5601C375.5050706@redhat.com> Date: Fri, 02 Oct 2015 13:18:00 -0000 Message-ID: Subject: Re: [PATCH] New attribute to create target clones From: Evgeny Stupachenko To: Bernd Schmidt Cc: Jeff Law , Bernd Schmidt , GCC Patches , Jan Hubicka Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-10/txt/msg00211.txt.bz2 PING. On Fri, Sep 25, 2015 at 1:28 AM, Evgeny Stupachenko wrote: > I've fixed ICE and review issues. > x86 make check and bootstrap passed. > > Thanks, > Evgeny > > ChangeLog > > 2015-09-25 Evgeny Stupachenko > > gcc/ > * Makefile.in (OBJS): Add multiple_target.o. > * multiple_target.c (make_attribute): New. > (create_dispatcher_calls): Ditto. > (expand_target_clones): Ditto. > (ipa_target_clone): Ditto. > * passes.def (pass_target_clone): New ipa pass. > * tree-pass.h (make_pass_target_clone): Ditto. > > gcc/c-family > * c-common.c (handle_target_clones_attribute): New. > * (c_common_attribute_table): Add handle_target_clones_attribute. > * (handle_always_inline_attribute): Add check on target_clones > attribute. > * (handle_target_attribute): Ditto. > > gcc/testsuite > * gcc.dg/mvc1.c: New test for multiple targets cloning. > * gcc.dg/mvc2.c: Ditto. > * gcc.dg/mvc3.c: Ditto. > * gcc.dg/mvc4.c: Ditto. > * gcc.dg/mvc5.c: Ditto. > * gcc.dg/mvc6.c: Ditto. > * gcc.dg/mvc7.c: Ditto. > * g++.dg/ext/mvc1.C: Ditto. > * g++.dg/ext/mvc2.C: Ditto. > * g++.dg/ext/mvc3.C: Ditto. > > gcc/doc > * doc/extend.texi (target_clones): New attribute description. > > > On Wed, Sep 23, 2015 at 1:49 AM, Evgeny Stupachenko wrote: >> Thank you for the review. >> The patch still works with gcc 5, but the fail reproduced on trunk >> (looks like it appeared while patch was at review). I'll debug it and >> fix. >> As a workaround to test the feature... >> Removing >> "gimple_call_set_fndecl (call, idecl);" from multiple_target.c >> should resolve the ICE >> >> I'll fix the patch for trunk and send an update. >> >> Thanks, >> Evgeny >> >> >> On Wed, Sep 23, 2015 at 12:09 AM, Bernd Schmidt wrote: >>> On 09/22/2015 09:41 PM, Jeff Law wrote: >>>> >>>> Essentially it allows us to more easily support >>>> per-microarchitecture-optimized versions of functions. You list just >>>> have to list the microarchitectures and the compiler handles the rest. >>>> Very simple, very easy. I'd think it'd be particularly helpful for >>>> vectorization. >>>> >>>> You could emulate this with compiling the same source multiple times >>>> with different flags/defines and wire up on ifunc by hand. But Evgeny's >>>> approach is vastly simpler. >>> >>> >>> As far as I can tell the ifunc is generated automatically (and the >>> functionality is documented as such), so the new target_clone doesn't buy >>> much. But one thing I didn't was that the existing support is only available >>> in C++, while Evgeny's patch works for C. That is probably an argument that >>> could be made for its inclusion. >>> >>> Or at least, it's supposed to work. As I said, I get verify_ssa failures on >>> the included testcases, and for a simpler one I just tried I get the clones >>> of the function, but not the resolver that ought to be generated. >>> >>> >>> Bernd