From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2283 invoked by alias); 6 Jul 2012 09:14:20 -0000 Received: (qmail 2274 invoked by uid 22791); 6 Jul 2012 09:14:19 -0000 X-SWARE-Spam-Status: No, hits=-4.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-ob0-f175.google.com (HELO mail-ob0-f175.google.com) (209.85.214.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 06 Jul 2012 09:14:03 +0000 Received: by obcva7 with SMTP id va7so15629959obc.20 for ; Fri, 06 Jul 2012 02:14:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.60.13.228 with SMTP id k4mr30099708oec.28.1341566043162; Fri, 06 Jul 2012 02:14:03 -0700 (PDT) Received: by 10.76.82.4 with HTTP; Fri, 6 Jul 2012 02:14:03 -0700 (PDT) In-Reply-To: References: <20120307004630.A503DB21B6@azwildcat.mtv.corp.google.com> Date: Fri, 06 Jul 2012 09:14:00 -0000 Message-ID: Subject: Re: User directed Function Multiversioning via Function Overloading (issue5752064) From: Richard Guenther To: Sriraman Tallam Cc: jason@redhat.com, mark@codesourcery.com, nathan@codesourcery.com, "H.J. Lu" , Jan Hubicka , Uros Bizjak , reply@codereview.appspotmail.com, gcc-patches@gcc.gnu.org, David Li Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes 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 X-SW-Source: 2012-07/txt/msg00227.txt.bz2 On Thu, Jun 14, 2012 at 10:13 PM, Sriraman Tallam wrote: > +cc c++ front-end maintainers > > Hi, > > C++ Frontend maintainers, Could you please take a look at the > front-end part when you find the time? So you have (for now?) omitted the C frontend change(s)? > Honza, your thoughts on the callgraph part? > > Richard, any further comments/feedback? Overall I like it - the cgraph portions need comments from Honza and the C++ portions from a C++ maintainer though. I would appreciate a C version, too. As you are tackling the C++ frontend first you should add some C++ specific testcases - if only to verify you properly reject cases you do not or can not implement. Like eventually class Foo { virtual void bar() __attribute__((target("sse"))); virtual void bar() __attribute__((target("sse2"))); }; or template void bar (T t) __attribute__((target("sse"))); template void bar (T t) __attribute__((target("sse2"))); template <> void bar (int t); (how does regular C++ overload resolution / template specialization interfere with the target overloads?) Thanks, Richard. > Additionally, I am working on generating better mangled names for > function versions, along the lines of C++ thunks. > > Thanks, > -Sri. > > On Mon, Jun 4, 2012 at 11:59 AM, Sriraman Tallam wrote: >> Hi, >> >> Attaching updated patch for function multiversioning which brings >> in plenty of changes. >> >> * As suggested by Richard earlier, I have made cgraph aware of >> function versions. All nodes of function versions are chained and the >> dispatcher bodies are created on demand while building cgraph edges. >> The dispatcher body will be created if and only if there is a call or >> reference to a versioned function. Previously, I was maintaining the >> list of versions separately in a hash map, all that is gone now. >> * Now, the file multiverison.c has some helper routines that are used >> in the context of function versioning. There are no new passes and no >> new globals. >> * More tests, updated existing tests. >> * Fixed lots of bugs. >> * Updated patch description. >> >> Patch attached. Patch also available for review at >> http://codereview.appspot.com/5752064 >> >> Please let me know what you think, >> >> Thanks, >> -Sri. >> >> >> On Mon, May 14, 2012 at 11:28 AM, Sriraman Tallam wrote: >>> Hi H.J, >>> >>> Attaching new patch with 2 test cases, mv2.C checks ISAs only and >>> mv1.C checks ISAs and arches mixed. Right now, checking only arches is >>> not needed as they are mutually exclusive, any order should be fine. >>> >>> Patch also available for review here: http://codereview.appspot.com/5752064 >>> >>> Thanks, >>> -Sri. >>> >>> On Sat, May 12, 2012 at 6:37 AM, H.J. Lu wrote: >>>> On Fri, May 11, 2012 at 7:04 PM, Sriraman Tallam wrote: >>>>> Hi H.J., >>>>> >>>>> I have updated the patch to improve the dispatching method like we >>>>> discussed. Each feature gets a priority now, and the dispatching is >>>>> done in priority order. Please see i386.c for the changes. >>>>> >>>>> Patch also available for review here: http://codereview.appspot.com/5752064 >>>>> >>>> >>>> I think you need 3 tests: >>>> >>>> 1. Only with ISA. >>>> 2. Only with arch >>>> 3. Mixed with ISA and arch >>>> >>>> since test mixed ISA and arch may hide issues with ISA only or arch only. >>>> >>>> -- >>>> H.J.