Re: [PATCH] New attribute to create target clones

2015-11-03 Thread Evgeny Stupachenko
Some tests in the patch already updated (ifunc require condition added) by Uros commit: ac39b078992c27934ea53cb580dbd79f75b6c727 I'll ask to commit attached patch. x86 bootstrap and make check passed. 2015-11-03 Evgeny Stupachenko gcc/ * multiple_target.c

Re: [PATCH] New attribute to create target clones

2015-11-02 Thread Evgeny Stupachenko
Yes, that is exactly what should fix the tests. Unfortunately I don't have access to darwin machine right now. Can you please test if the patch (attached) fixes the tests? gcc/ * multiple_target.c (create_dispatcher_calls): Add target check on ifunc. (create_target_clone):

Re: [PATCH] New attribute to create target clones

2015-11-02 Thread Dominique d'Humières
Evgeny, I have already checked that the addition of +/* { dg-require-ifunc "" } */ fixes the failures. I’ll test your full patch later today (currently chasing regression with gfortran). Thanks, Dominique > Le 2 nov. 2015 à 15:50, Evgeny Stupachenko a écrit : > > Yes,

Re: [PATCH] New attribute to create target clones

2015-11-02 Thread Jeff Law
On 11/02/2015 07:50 AM, Evgeny Stupachenko wrote: Yes, that is exactly what should fix the tests. Unfortunately I don't have access to darwin machine right now. Can you please test if the patch (attached) fixes the tests? gcc/ * multiple_target.c (create_dispatcher_calls): Add target

Re: [PATCH] New attribute to create target clones

2015-10-31 Thread Dominique d'Humières
Evgeny, On darwin I see the following failures FAIL: g++.dg/ext/mvc1.C -std=c++11 (test for excess errors) UNRESOLVED: g++.dg/ext/mvc1.C -std=c++11 compilation failed to produce executable FAIL: g++.dg/ext/mvc1.C -std=c++14 (test for excess errors) UNRESOLVED: g++.dg/ext/mvc1.C -std=c++14

Re: [PATCH] New attribute to create target clones

2015-10-30 Thread Evgeny Stupachenko
I've fixed the misprint and vertical spaces. I'll ask to commit the patch when x86 bootstrap and make check finished. Thanks, Evgeny Updated ChangeLog: 2015-10-30 Evgeny Stupachenko gcc/ * Makefile.in (OBJS): Add multiple_target.o. * attrib.c

Re: [PATCH] New attribute to create target clones

2015-10-29 Thread Evgeny Stupachenko
On Mon, Oct 26, 2015 at 6:50 PM, Jeff Law wrote: > On 10/12/2015 05:35 PM, Evgeny Stupachenko wrote: >> >> Hi All, >> >> Here is a new version of patch (attached). >> Bootstrap and make check are in progress (all new tests passed). >> >> New test case g++.dg/ext/mvc4.C fails with

Re: [PATCH] New attribute to create target clones

2015-10-29 Thread Jan Hubicka
> Yes. This is not necessary. However that way we'll have the following > code in dispatcher: > cmpl$6, __cpu_model+4(%rip) > sete%al > movzbl %al, %eax > testl %eax, %eax > jle .L16 > movl$foo.target_clone.1, %eax > I think it is

Re: [PATCH] New attribute to create target clones

2015-10-29 Thread Evgeny Stupachenko
On Thu, Oct 29, 2015 at 8:02 PM, Jan Hubicka wrote: >> Yes. This is not necessary. However that way we'll have the following >> code in dispatcher: >> cmpl$6, __cpu_model+4(%rip) >> sete%al >> movzbl %al, %eax >> testl %eax, %eax >>

Re: [PATCH] New attribute to create target clones

2015-10-29 Thread Jeff Law
On 10/29/2015 12:13 PM, Evgeny Stupachenko wrote: On Thu, Oct 29, 2015 at 8:02 PM, Jan Hubicka wrote: >>Yes. This is not necessary. However that way we'll have the following >>code in dispatcher: >> cmpl$6, __cpu_model+4(%rip) >> sete%al >>

Re: [PATCH] New attribute to create target clones

2015-10-29 Thread Jan Hubicka
> Ok. I've modified the patch correspondingly. Thanks, the IPA/callgarph parts of the patch looks fine to me except for a typo: +/* Create sting with attributes separated by comma. + Return number of attributes. */ and a fact that sometimes you skip vertical whitespace after variable

Re: [PATCH] New attribute to create target clones

2015-10-26 Thread Jeff Law
On 10/12/2015 05:35 PM, Evgeny Stupachenko wrote: Hi All, Here is a new version of patch (attached). Bootstrap and make check are in progress (all new tests passed). New test case g++.dg/ext/mvc4.C fails with ICE, when options lower than "-mavx" are passed. However it has the same behavior if

Re: [PATCH] New attribute to create target clones

2015-10-22 Thread Evgeny Stupachenko
PING. On Thu, Oct 15, 2015 at 12:32 AM, Evgeny Stupachenko wrote: > Bootstrap and make check for x86 passed. No new fails. > Please ignore an empty line added to omp-low.c in the patch, the > misprint will be removed prior to a commit. > > Thanks, > Evgeny > > On Tue, Oct 13,

Re: [PATCH] New attribute to create target clones

2015-10-14 Thread Evgeny Stupachenko
Bootstrap and make check for x86 passed. No new fails. Please ignore an empty line added to omp-low.c in the patch, the misprint will be removed prior to a commit. Thanks, Evgeny On Tue, Oct 13, 2015 at 2:35 AM, Evgeny Stupachenko wrote: > Hi All, > > Here is a new version

Re: [PATCH] New attribute to create target clones

2015-10-12 Thread Evgeny Stupachenko
Hi All, Here is a new version of patch (attached). Bootstrap and make check are in progress (all new tests passed). New test case g++.dg/ext/mvc4.C fails with ICE, when options lower than "-mavx" are passed. However it has the same behavior if "target_clones" attribute is replaced by 2

Re: [PATCH] New attribute to create target clones

2015-10-09 Thread Evgeny Stupachenko
On Fri, Oct 9, 2015 at 11:04 PM, Jan Hubicka wrote: >> On Fri, Oct 9, 2015 at 9:27 PM, Jan Hubicka wrote: >> >> >Of course it also depends what you inline into function. You can have >> >> > >> >> >bar() target(-mavx) {fancy avx code} >> >> >foobar() { .. if

Re: [PATCH] New attribute to create target clones

2015-10-09 Thread Jeff Law
On 10/08/2015 03:36 PM, Jan Hubicka wrote: Yes, here you have different names for different variants of the function body. Basically this pass takes ctarget attribute and creates bunch of verisons of the functions and assigns them the proper target attributes, right? Right. Given a single

Re: [PATCH] New attribute to create target clones

2015-10-09 Thread Jan Hubicka
> >Of course it also depends what you inline into function. You can have > > > >bar() target(-mavx) {fancy avx code} > >foobar() { .. if (avx) bar();} > >foo() ctarget(-mavx,-mno-avx) {foobar();} > > > >Now if you compile with -mavx and because ctarget takes effect only after >

Re: [PATCH] New attribute to create target clones

2015-10-09 Thread Evgeny Stupachenko
On Fri, Oct 9, 2015 at 9:27 PM, Jan Hubicka wrote: >> >Of course it also depends what you inline into function. You can have >> > >> >bar() target(-mavx) {fancy avx code} >> >foobar() { .. if (avx) bar();} >> >foo() ctarget(-mavx,-mno-avx) {foobar();} "no-" targets

Re: [PATCH] New attribute to create target clones

2015-10-09 Thread Jan Hubicka
> On Fri, Oct 9, 2015 at 9:27 PM, Jan Hubicka wrote: > >> >Of course it also depends what you inline into function. You can have > >> > > >> >bar() target(-mavx) {fancy avx code} > >> >foobar() { .. if (avx) bar();} > >> >foo() ctarget(-mavx,-mno-avx) {foobar();} > >

Re: [PATCH] New attribute to create target clones

2015-10-08 Thread Jeff Law
On 09/22/2015 03:09 PM, 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

Re: [PATCH] New attribute to create target clones

2015-10-08 Thread Jeff Law
On 09/24/2015 04:28 PM, 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

Re: [PATCH] New attribute to create target clones

2015-10-08 Thread Jan Hubicka
> Sorry this has taken so long to come back to... As I mentioned a > couple months ago, I'd hoped Jan would chime in on the IPA/symtab > requirements. But that didn't happen. Sorry for that. I had bit too many real life things this summer and I am still trying to catch up. > > > SO I went

Re: [PATCH] New attribute to create target clones

2015-10-08 Thread Jan Hubicka
> > > >Yes, here you have different names for different variants of the function > >body. Basically this pass takes ctarget attribute and creates bunch of > >verisons > >of the functions and assigns them the proper target attributes, right? > Right. Given a single function in the source tree

Re: [PATCH] New attribute to create target clones

2015-10-08 Thread Jeff Law
On 10/08/2015 02:01 PM, Evgeny Stupachenko wrote: On Thu, Oct 8, 2015 at 10:00 PM, Jeff Law wrote: On 09/24/2015 04:28 PM, Evgeny Stupachenko wrote: I've fixed ICE and review issues. x86 make check and bootstrap passed. Thanks, Evgeny ChangeLog 2015-09-25 Evgeny

Re: [PATCH] New attribute to create target clones

2015-10-08 Thread Jeff Law
On 10/08/2015 01:23 PM, Jan Hubicka wrote: Sorry this has taken so long to come back to... As I mentioned a couple months ago, I'd hoped Jan would chime in on the IPA/symtab requirements. But that didn't happen. Sorry for that. I had bit too many real life things this summer and I am still

Re: [PATCH] New attribute to create target clones

2015-10-08 Thread Evgeny Stupachenko
On Thu, Oct 8, 2015 at 10:00 PM, Jeff Law wrote: > On 09/24/2015 04:28 PM, Evgeny Stupachenko wrote: >> >> I've fixed ICE and review issues. >> x86 make check and bootstrap passed. >> >> Thanks, >> Evgeny >> >> ChangeLog >> >> 2015-09-25 Evgeny Stupachenko >>

Re: [PATCH] New attribute to create target clones

2015-10-02 Thread Evgeny Stupachenko
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

Re: [PATCH] New attribute to create target clones

2015-09-24 Thread Evgeny Stupachenko
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):

Re: [PATCH] New attribute to create target clones

2015-09-22 Thread Jeff Law
On 09/21/2015 07:25 AM, Bernd Schmidt wrote: On 08/27/2015 01:18 PM, Evgeny Stupachenko wrote: Based on RFC: https://gcc.gnu.org/ml/gcc-patches/2015-08/msg01322.html The patch implement an extension to Function Multiversioning that allows to clone a function for multiple targets.

Re: [PATCH] New attribute to create target clones

2015-09-22 Thread Bernd Schmidt
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

Re: [PATCH] New attribute to create target clones

2015-09-22 Thread Evgeny Stupachenko
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

Re: [PATCH] New attribute to create target clones

2015-09-21 Thread Bernd Schmidt
On 08/27/2015 01:18 PM, Evgeny Stupachenko wrote: Based on RFC: https://gcc.gnu.org/ml/gcc-patches/2015-08/msg01322.html The patch implement an extension to Function Multiversioning that allows to clone a function for multiple targets. __attribute__((target_clones("avx","arch=slm","default")))

Re: [PATCH] New attribute to create target clones

2015-09-16 Thread Evgeny Stupachenko
PING 2. On Tue, Sep 8, 2015 at 2:27 PM, Evgeny Stupachenko wrote: > Ping. > > On Thu, Aug 27, 2015 at 2:18 PM, Evgeny Stupachenko > wrote: >> Hi All, >> >> Based on RFC: >> https://gcc.gnu.org/ml/gcc-patches/2015-08/msg01322.html >> >> The patch

Re: [PATCH] New attribute to create target clones

2015-09-08 Thread Evgeny Stupachenko
Ping. On Thu, Aug 27, 2015 at 2:18 PM, Evgeny Stupachenko wrote: > Hi All, > > Based on RFC: > https://gcc.gnu.org/ml/gcc-patches/2015-08/msg01322.html > > The patch implement an extension to Function Multiversioning that > allows to clone a function for multiple targets. >

[PATCH] New attribute to create target clones

2015-08-27 Thread Evgeny Stupachenko
Hi All, Based on RFC: https://gcc.gnu.org/ml/gcc-patches/2015-08/msg01322.html The patch implement an extension to Function Multiversioning that allows to clone a function for multiple targets. __attribute__((target_clones(avx,arch=slm,default))) int foo () ... Will create 3 clones of foo().

Re: [RFC, patch] New attribute to create target clones

2015-08-21 Thread Jeff Law
On 08/20/2015 05:38 PM, Evgeny Stupachenko wrote: On Mon, Aug 3, 2015 at 9:43 PM, Jeff Law l...@redhat.com wrote: On 07/30/2015 04:19 PM, Evgeny Stupachenko wrote: Hi All, The patch enables new attribute 'ctarget', The attribute force compiler to create clones of a function with the

Re: [RFC, patch] New attribute to create target clones

2015-08-20 Thread Evgeny Stupachenko
On Mon, Aug 3, 2015 at 9:43 PM, Jeff Law l...@redhat.com wrote: On 07/30/2015 04:19 PM, Evgeny Stupachenko wrote: Hi All, The patch enables new attribute 'ctarget', The attribute force compiler to create clones of a function with the attribute. For example:

Re: [RFC, patch] New attribute to create target clones

2015-08-03 Thread Jeff Law
On 07/30/2015 04:19 PM, Evgeny Stupachenko wrote: Hi All, The patch enables new attribute 'ctarget', The attribute force compiler to create clones of a function with the attribute. For example: __attribute__((ctarget(avx,arch=slm,arch=core-avx2,default))) So presumably we're allowing both

Re: [RFC, patch] New attribute to create target clones

2015-07-31 Thread Jeff Law
On 07/31/2015 05:50 AM, Evgeny wrote: New ctarget attribute automatically clone function and optimize for corresponding target. For target attribute if you specify avx,sse4 you will get only 1 function optimized for the target with higher priority, while ctarget will generate 2 functions: one

[RFC, patch] New attribute to create target clones

2015-07-30 Thread Evgeny Stupachenko
Hi All, The patch enables new attribute 'ctarget', The attribute force compiler to create clones of a function with the attribute. For example: __attribute__((ctarget(avx,arch=slm,arch=core-avx2,default))) int foo () will create 3 clones of foo() optimized for corresponding targets and replace

Re: [RFC, patch] New attribute to create target clones

2015-07-30 Thread Evgeny Stupachenko
You can't apply both 'ctarget' and 'target' attributes to a function. The patch uses same target specific methods to create dispatcher and target clones. On Fri, Jul 31, 2015 at 1:30 AM, Andrew Pinski pins...@gmail.com wrote: On Thu, Jul 30, 2015 at 3:19 PM, Evgeny Stupachenko evstu...@gmail.com

Re: [RFC, patch] New attribute to create target clones

2015-07-30 Thread Joseph Myers
On Fri, 31 Jul 2015, Evgeny Stupachenko wrote: The patch enables new attribute 'ctarget', Attributes should be documented in extend.texi. -- Joseph S. Myers jos...@codesourcery.com

Re: [RFC, patch] New attribute to create target clones

2015-07-30 Thread Andrew Pinski
On Thu, Jul 30, 2015 at 3:19 PM, Evgeny Stupachenko evstu...@gmail.com wrote: Hi All, The patch enables new attribute 'ctarget', The attribute force compiler to create clones of a function with the attribute. For example: __attribute__((ctarget(avx,arch=slm,arch=core-avx2,default))) int

Re: [RFC, patch] New attribute to create target clones

2015-07-30 Thread Jeff Law
On 07/30/2015 04:19 PM, Evgeny Stupachenko wrote: Hi All, The patch enables new attribute 'ctarget', The attribute force compiler to create clones of a function with the attribute. For example: __attribute__((ctarget(avx,arch=slm,arch=core-avx2,default))) int foo () will create 3 clones of

Re: [RFC, patch] New attribute to create target clones

2015-07-30 Thread Evgeny Stupachenko
Forget C++ tests. On Fri, Jul 31, 2015 at 1:19 AM, Evgeny Stupachenko evstu...@gmail.com wrote: Hi All, The patch enables new attribute 'ctarget', The attribute force compiler to create clones of a function with the attribute. For example: