RE: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-19 Thread Iyer, Balaji V
ldy >Hernandez (al...@redhat.com); Jeff Law >Subject: Re: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22) > >On 09/11/2012 10:14 AM, Iyer, Balaji V wrote: >> The function mangling handles several of the version inconsistencies >> you have mentioned. If the CPU rev

Re: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-11 Thread Richard Henderson
On 09/11/2012 10:14 AM, Iyer, Balaji V wrote: > The function mangling handles several of the version inconsistencies > you have mentioned. If the CPU revisions, vector lengths are not the > same between the function declaration and the function, then the name > of the function will be different and

RE: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-11 Thread Iyer, Balaji V
f Law >Subject: Re: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22) > >On 09/10/2012 09:09 AM, Iyer, Balaji V wrote: >>> >If that's the case, what's the point in defining an external ABI and >>> >defining what >>> >__attribu

Re: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-11 Thread Marc Glisse
On Tue, 11 Sep 2012, Jakub Jelinek wrote: On Tue, Sep 11, 2012 at 12:29:10PM +0200, Marc Glisse wrote: Note that, apart from preventing external calls, it removes this use case: __attribute__((vector(4))) double mysqrt(double x){return sqrt(x);} __m256d var; mysqrt(var); I don't think those

Re: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-11 Thread Jakub Jelinek
On Tue, Sep 11, 2012 at 12:29:10PM +0200, Marc Glisse wrote: > >Btw, this then happily fits into my suggestion that the "elementalness" > >can be autodetected by the compiler simply by means of a proper IPA > >pass and thus be fully LTO / whole-program aware. No need for an > >attribute (where you

Re: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-11 Thread Marc Glisse
On Tue, 11 Sep 2012, Richard Guenther wrote: On Tue, Sep 11, 2012 at 10:41 AM, Richard Guenther wrote: On Mon, Sep 10, 2012 at 6:37 PM, Richard Henderson wrote: Whether or not the compiler creates a clone COULD BE totally up to the compiler, based on whether or not vectorization is enabled,

Re: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-11 Thread Gabriel Dos Reis
On Tue, Sep 11, 2012 at 4:06 AM, Jakub Jelinek wrote: > On Tue, Sep 11, 2012 at 03:57:44AM -0500, Gabriel Dos Reis wrote: >> On Tue, Sep 11, 2012 at 3:42 AM, Richard Guenther >> wrote: >> >> > Btw, this then happily fits into my suggestion that the "elementalness" >> > can be autodetected by the

Re: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-11 Thread Richard Guenther
On Tue, Sep 11, 2012 at 11:06 AM, Jakub Jelinek wrote: > On Tue, Sep 11, 2012 at 03:57:44AM -0500, Gabriel Dos Reis wrote: >> On Tue, Sep 11, 2012 at 3:42 AM, Richard Guenther >> wrote: >> >> > Btw, this then happily fits into my suggestion that the "elementalness" >> > can be autodetected by the

Re: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-11 Thread Jakub Jelinek
On Tue, Sep 11, 2012 at 03:57:44AM -0500, Gabriel Dos Reis wrote: > On Tue, Sep 11, 2012 at 3:42 AM, Richard Guenther > wrote: > > > Btw, this then happily fits into my suggestion that the "elementalness" > > can be autodetected by the compiler simply by means of a proper IPA > > pass and thus be

Re: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-11 Thread Gabriel Dos Reis
On Tue, Sep 11, 2012 at 3:42 AM, Richard Guenther wrote: > Btw, this then happily fits into my suggestion that the "elementalness" > can be autodetected by the compiler simply by means of a proper IPA > pass and thus be fully LTO / whole-program aware. No need for an > attribute (where you'd nee

Re: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-11 Thread Richard Guenther
On Tue, Sep 11, 2012 at 10:41 AM, Richard Guenther wrote: > On Mon, Sep 10, 2012 at 6:37 PM, Richard Henderson wrote: >> On 09/10/2012 09:09 AM, Iyer, Balaji V wrote: >If that's the case, what's the point in defining an external ABI and >defining what >__attribute__((vector)) plac

Re: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-11 Thread Richard Guenther
On Mon, Sep 10, 2012 at 6:37 PM, Richard Henderson wrote: > On 09/10/2012 09:09 AM, Iyer, Balaji V wrote: >>> >If that's the case, what's the point in defining an external ABI and >>> >defining what >>> >__attribute__((vector)) placed on a function declaration means? > >> When you have __attribut

Re: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-11 Thread Richard Guenther
On Mon, Sep 10, 2012 at 6:30 PM, Richard Henderson wrote: > On 09/10/2012 09:11 AM, Iyer, Balaji V wrote: >> Can you please help me get a start on how to get can be done? From >> what I understand (please correct me if I am wrong), this requires >> rearranging and duplicating a lot of passes and c

Re: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-10 Thread Andi Kleen
On Mon, Sep 10, 2012 at 09:30:15AM -0700, Richard Henderson wrote: > On 09/10/2012 09:11 AM, Iyer, Balaji V wrote: > > Can you please help me get a start on how to get can be done? From > > what I understand (please correct me if I am wrong), this requires > > rearranging and duplicating a lot of p

Re: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-10 Thread Richard Henderson
On 09/10/2012 09:09 AM, Iyer, Balaji V wrote: >> >If that's the case, what's the point in defining an external ABI and >> >defining what >> >__attribute__((vector)) placed on a function declaration means? > When you have __attribute__((vector)) you are asking the compiler to > create a vector AND

Re: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-10 Thread Richard Henderson
On 09/10/2012 09:11 AM, Iyer, Balaji V wrote: > Can you please help me get a start on how to get can be done? From > what I understand (please correct me if I am wrong), this requires > rearranging and duplicating a lot of passes and can potentially open > up to a lot of bugs. Certainly not duplic

RE: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-10 Thread Iyer, Balaji V
f Law >Subject: Re: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22) > >On 09/07/2012 02:00 PM, Iyer, Balaji V wrote: >> So, if I am understanding this correctly, there is no way to have the >> vectorization turned on/off on a function by function basis? I don

RE: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-10 Thread Iyer, Balaji V
>-Original Message- >From: Richard Henderson [mailto:r...@redhat.com] >Sent: Monday, September 10, 2012 12:03 PM >To: Iyer, Balaji V >Cc: Richard Guenther; gcc-patches@gcc.gnu.org; Gabriel Dos Reis; Aldy >Hernandez (al...@redhat.com); Jeff Law >Subject: Re: [PATCH] M

Re: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-10 Thread Richard Henderson
On 09/07/2012 12:31 PM, Iyer, Balaji V wrote: > I hope I have not mistaken your question, but to clarify the > elemental function's definition and body is visible to all passes > after the invocation of gimplify_function_tree (). It is also visible > for the LTO optimization. If that's the case, w

Re: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-10 Thread Richard Henderson
On 09/07/2012 02:00 PM, Iyer, Balaji V wrote: > So, if I am understanding this correctly, there is no way to have the > vectorization turned on/off on a function by function basis? I don't > mind if it is turned off for -O0, but would like it be turned on/off > for anything > -O1. There's probably

RE: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-10 Thread Joseph S. Myers
On Mon, 10 Sep 2012, Iyer, Balaji V wrote: > So, I assume it is OK for me to include testsuites with the > code-changes? I included them separately because I remember someone in > the mailing list saying the patch size must be small and one logical way > is to put test cases separately from the

RE: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-10 Thread Iyer, Balaji V
>-Original Message- >From: Joseph Myers [mailto:jos...@codesourcery.com] >Sent: Monday, September 10, 2012 7:23 AM >To: Iyer, Balaji V >Cc: gcc-patches@gcc.gnu.org; Aldy Hernandez (al...@redhat.com); Jeff Law; >r...@redhat.com >Subject: RE: [PATCH] Merging Cilk Plus i

RE: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-10 Thread Joseph S. Myers
On Sun, 9 Sep 2012, Iyer, Balaji V wrote: > Here is an updated patch. I think I have fixed all the changes you > and others have mentioned. Please let me know if everything looks OK. > Thanks again for doing the review! Has the user documentation for this feature been posted? For patch r

Re: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-10 Thread Richard Guenther
se. > (c_parser_elem_fn_vlength_clause): Likewise. > (c_parser_elem_fn_expr_list): Likewise. > > ======================= > > >>-----Original Message- >>From: Joseph Myers [mailto:jo

RE: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-07 Thread Iyer, Balaji V
dhat.com >Subject: Re: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22) > >On Fri, Sep 07, 2012 at 12:59:26PM -0700, Andi Kleen wrote: >> "Iyer, Balaji V" writes: >> > >> > Yes, I really like this idea and that is kind of what I want. But, how d

Re: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-07 Thread Andi Kleen
Jakub Jelinek writes: > > Nope, -O2 -ftree-vectorize works just fine. Vectorization only needs > if-conversion, but that is enabled by default if -ftree-vectorize > (unless explicitly disabled). How about the tree unrolling? I remember that being enabled for the vectorizer (and then annoying me

Re: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-07 Thread Jakub Jelinek
On Fri, Sep 07, 2012 at 12:59:26PM -0700, Andi Kleen wrote: > "Iyer, Balaji V" writes: > > > > Yes, I really like this idea and that is kind of what I want. But, how do I > > turn on vectorization on a function by function basis? I tried to set > > flag_tree_vectorize=1 but that doesn't seem to

Re: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-07 Thread Andi Kleen
"Iyer, Balaji V" writes: > > Yes, I really like this idea and that is kind of what I want. But, how do I > turn on vectorization on a function by function basis? I tried to set > flag_tree_vectorize=1 but that doesn't seem to do the trick. AFAIK vectorization needs a range of passes to work, so

RE: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-07 Thread Iyer, Balaji V
Hernandez >(al...@redhat.com); Jeff Law >Subject: Re: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22) > >On Thu, Sep 6, 2012 at 5:51 PM, Richard Henderson wrote: >> On 09/06/2012 02:37 AM, Richard Guenther wrote: >>> In all this seems unrelated to CILK+ w

RE: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-07 Thread Iyer, Balaji V
: Re: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22) > >"Iyer, Balaji V" writes: >>> >>>The answer is that you should not enable the vectorizer. >> >> OK. I will fix that. > >It still seems like useful functionality. Otherwise

Re: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-07 Thread Andi Kleen
"Iyer, Balaji V" writes: >> >>The answer is that you should not enable the vectorizer. > > OK. I will fix that. It still seems like useful functionality. Otherwise you have to compile the whole program with -O3, just to vectoriz a few marked functions or add additional annotations for all of them

RE: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-07 Thread Iyer, Balaji V
[PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22) > >On Thu, Sep 6, 2012 at 8:25 PM, Iyer, Balaji V wrote: >> Hello Richard, >> I forgot to answer one of questions. Please see it below: >> >> Thanks, >> >> Balaji V. Iyer. >>

Re: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-07 Thread Richard Guenther
On Thu, Sep 6, 2012 at 5:51 PM, Richard Henderson wrote: > On 09/06/2012 02:37 AM, Richard Guenther wrote: >> In all this seems unrelated to CILK+ work (even if you make use of this >> from within CILK+). > > While true, we also asked him to split up the work. And this piece, > done correctly, se

Re: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-07 Thread Richard Guenther
On Thu, Sep 6, 2012 at 8:25 PM, Iyer, Balaji V wrote: > Hello Richard, > I forgot to answer one of questions. Please see it below: > > Thanks, > > Balaji V. Iyer. > > >>+static tree >>+handle_vector_attribute (tree *node, tree name ATTRIBUTE_UNUSED, >>+ tree args ATTR

RE: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-06 Thread Joseph S. Myers
On Thu, 6 Sep 2012, Iyer, Balaji V wrote: > >Concepts such as "pentium_4" are architecture-specific and have no place in > >front-end files. This whole mapping from one sort of string to another > >belongs > >within the back end. > > Please excuse me if I am "beating this horse to death." I am

RE: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-06 Thread Iyer, Balaji V
>-Original Message- >From: Joseph Myers [mailto:jos...@codesourcery.com] >Sent: Thursday, September 06, 2012 12:18 PM >To: Iyer, Balaji V >Cc: gcc-patches@gcc.gnu.org; Aldy Hernandez (al...@redhat.com); Jeff Law; >r...@redhat.com >Subject: RE: [PATCH] Merging Cilk P

RE: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-06 Thread Iyer, Balaji V
Hello Richard, I forgot to answer one of questions. Please see it below: Thanks, Balaji V. Iyer. >+static tree >+handle_vector_attribute (tree *node, tree name ATTRIBUTE_UNUSED, >+ tree args ATTRIBUTE_UNUSED, >+ int ARG_UNUSED (flags), bool *n

RE: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-06 Thread Iyer, Balaji V
..@redhat.com); Jeff >Law; >r...@redhat.com >Subject: Re: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22) > >On Thu, 6 Sep 2012, Marc Glisse wrote: > >> AFAIU, my_func is defined in a separate library and because of the >> attribute on the definition, it

Re: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-06 Thread Gabriel Dos Reis
On Thu, Sep 6, 2012 at 11:11 AM, Iyer, Balaji V wrote: >>> On Wed, Sep 5, 2012 at 5:09 PM, Iyer, Balaji V >>> wrote: Let's say we have two for loops like this: int my_func (int x, int y); For (ii = 0; ii < 1; ii++) X[ii] = my_func (Y[ii], Z[ii]); >> >>I

RE: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-06 Thread Joseph S. Myers
On Thu, 6 Sep 2012, Iyer, Balaji V wrote: > Ok, I was mistaken there. I thought we had to add a changelog entry for > every function and not every file. I will fix it in the updated patch I > send soon. For functions in existing files you do need to mention each function - but not for new file

Re: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-06 Thread Gabriel Dos Reis
On Thu, Sep 6, 2012 at 10:51 AM, Richard Henderson wrote: > On 09/06/2012 02:37 AM, Richard Guenther wrote: >> In all this seems unrelated to CILK+ work (even if you make use of this >> from within CILK+). > > While true, we also asked him to split up the work. And this piece, > done correctly, s

RE: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-06 Thread Iyer, Balaji V
V; gcc-patches@gcc.gnu.org; Aldy Hernandez >(al...@redhat.com); Jeff Law; r...@redhat.com >Subject: Re: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22) > >On Wed, 5 Sep 2012, Gabriel Dos Reis wrote: > >> On Wed, Sep 5, 2012 at 5:09 PM, Iyer, Balaji V >> wrote

Re: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-06 Thread Richard Henderson
On 09/05/2012 03:09 PM, Iyer, Balaji V wrote: > If we annotate *both* the function declaration and the function with the > following attribute, the compiler will create a vector and scalar version of > the function. > > __attribute__((vector)) my_func (int x, int y); > > __attribute__((vector)

RE: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-06 Thread Iyer, Balaji V
l...@redhat.com); Jeff Law; >r...@redhat.com >Subject: Re: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22) > >On Wed, 5 Sep 2012, Iyer, Balaji V wrote: > >> Attached, please find the 1st of ~22 patches that implements Cilk >> Plus. This patch wil

Re: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-06 Thread Richard Henderson
On 09/06/2012 02:37 AM, Richard Guenther wrote: > In all this seems unrelated to CILK+ work (even if you make use of this > from within CILK+). While true, we also asked him to split up the work. And this piece, done correctly, seems useful even if the rest of cilk is ignored. r~

Re: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-06 Thread Marc Glisse
On Thu, 6 Sep 2012, Marc Glisse wrote: AFAIU, my_func is defined in a separate library and because of the attribute on the definition, it will actually export overloads: int myfunc(int,int); v2si myfunc(v2si,v2si); v4si myfunc(v4si,v4si); etc (where does it stop? seems problematic if the librar

Re: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-06 Thread Gabriel Dos Reis
On Thu, Sep 6, 2012 at 1:06 AM, Marc Glisse wrote: > On Wed, 5 Sep 2012, Gabriel Dos Reis wrote: > >> On Wed, Sep 5, 2012 at 5:09 PM, Iyer, Balaji V >> wrote: >>> >>> Let's say we have two for loops like this: >>> >>> int my_func (int x, int y); >>> >>> For (ii = 0; ii < 1; ii++) >>>

Re: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-06 Thread Richard Guenther
On Thu, Sep 6, 2012 at 8:06 AM, Marc Glisse wrote: > On Wed, 5 Sep 2012, Gabriel Dos Reis wrote: > >> On Wed, Sep 5, 2012 at 5:09 PM, Iyer, Balaji V >> wrote: >>> >>> Let's say we have two for loops like this: >>> >>> int my_func (int x, int y); >>> >>> For (ii = 0; ii < 1; ii++) >>>

Re: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-05 Thread Marc Glisse
On Wed, 5 Sep 2012, Gabriel Dos Reis wrote: On Wed, Sep 5, 2012 at 5:09 PM, Iyer, Balaji V wrote: Let's say we have two for loops like this: int my_func (int x, int y); For (ii = 0; ii < 1; ii++) X[ii] = my_func (Y[ii], Z[ii]); I assume X, Y and Z are __restrict pointers (or so

Re: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-05 Thread Gabriel Dos Reis
On Wed, Sep 5, 2012 at 5:09 PM, Iyer, Balaji V wrote: > Hello Everyone, > Attached, please find the 1st of ~22 patches that implements Cilk > Plus. This patch will implement Elemental Functions into the C compiler. > Please check it in to the trunk if it looks OK. > > Below, I w

Re: [PATCH] Merging Cilk Plus into Trunk (Patch 1 of approximately 22)

2012-09-05 Thread Joseph S. Myers
On Wed, 5 Sep 2012, Iyer, Balaji V wrote: > Attached, please find the 1st of ~22 patches that implements Cilk > Plus. This patch will implement Elemental Functions into the C compiler. > Please check it in to the trunk if it looks OK. > > Below, I will give you a small example abou