This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RE: [PING]: [GOMP4] [PATCH] SIMD-Enabled Functions (formerly Elemental functions) for C
- From: "Iyer, Balaji V" <balaji dot v dot iyer at intel dot com>
- To: Aldy Hernandez <aldyh at redhat dot com>
- Cc: 'Jakub Jelinek' <jakub at redhat dot com>, "'gcc-patches at gcc dot gnu dot org'" <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 11 Dec 2013 18:06:23 +0000
- Subject: RE: [PING]: [GOMP4] [PATCH] SIMD-Enabled Functions (formerly Elemental functions) for C
- Authentication-results: sourceware.org; auth=none
- References: <BF230D13CA30DD48930C31D4099330003A4ACA4E at FMSMSX101 dot amr dot corp dot intel dot com> <87mwkp7sgv dot fsf at reynosa dot quesejoda dot com> <BF230D13CA30DD48930C31D4099330003A4ACF5A at FMSMSX101 dot amr dot corp dot intel dot com> <BF230D13CA30DD48930C31D4099330003A4ADAB6 at FMSMSX101 dot amr dot corp dot intel dot com> <52A0E003 dot 7040807 at redhat dot com> <BF230D13CA30DD48930C31D4099330003A4AFEF8 at FMSMSX101 dot amr dot corp dot intel dot com> <52A25AB2 dot 8090200 at redhat dot com> <BF230D13CA30DD48930C31D4099330003A4B060E at FMSMSX101 dot amr dot corp dot intel dot com> <52A7574D dot 4000403 at redhat dot com> <BF230D13CA30DD48930C31D4099330003A4B11FC at FMSMSX101 dot amr dot corp dot intel dot com> <52A8A313 dot 5000903 at redhat dot com>
> -----Original Message-----
> From: Aldy Hernandez [mailto:aldyh@redhat.com]
> Sent: Wednesday, December 11, 2013 12:38 PM
> To: Iyer, Balaji V
> Cc: 'Jakub Jelinek'; 'gcc-patches@gcc.gnu.org'
> Subject: Re: [PING]: [GOMP4] [PATCH] SIMD-Enabled Functions (formerly
> Elemental functions) for C
>
> On 12/11/13 09:31, Iyer, Balaji V wrote:
> >
> >
> >> -----Original Message-----
> >> From: gcc-patches-owner@gcc.gnu.org [mailto:gcc-patches-
> >> owner@gcc.gnu.org] On Behalf Of Aldy Hernandez
> >> Sent: Tuesday, December 10, 2013 1:03 PM
> >> To: Iyer, Balaji V
> >> Cc: 'Jakub Jelinek'; 'gcc-patches@gcc.gnu.org'
> >> Subject: Re: [PING]: [GOMP4] [PATCH] SIMD-Enabled Functions (formerly
> >> Elemental functions) for C
> >>
> >>
> >>>> But aren't both OpenMP and Cilk Plus simd clones marked as "omp
> >>>> declare simd"? In which case you shouldn't have to do anything?
> >>>> Are the Cilk Plus clones not being marked as "omp declare simd" in
> >>>> the front-ends?
> >>>>
> >>>
> >>> ....Didn't you mention in this thread
> >>> (http://gcc.gnu.org/ml/gcc-patches/2013-11/msg03506.html) that Cilk
> >>> Plus SIMD-enabled functions must be marked as "cilk plus elementals"
> >>> (as it wsa called then)? Did I misunderstand you?
> >>
> >> Both OpenMP and Cilk Plus clones should be marked with "omp declare
> >> simd". But Cilk Plus should _also_ be marked with "cilk plus
> >> elementals" (or "cilk simd function" now). In which case the
> >> aforementioned function doesn't require any changes because Cilk Plus
> >> clones will be seen as they are marked with "omp declare simd".
> >>
> >> So...
> >>
> >> OpenMP declare simd gets tagged as:
> >> "omp declare simd"
> >> Cilk Plus vector functions gets tagged as:
> >> "omp declare simd"
> >> "cilk simd function"
> >>
> >
> > Ok, so you want the same clauses included in both omp declare simd and
> cilk simd function tree lists?
> >
> > For example in the c-parser.c, I have something like this:
> >
> > if (is_cilkplus_cilk_simd_fn)
> > c = build_tree_list (get_identifier ("cilk simd function"), c);
> > else
> > c = build_tree_list (get_identifier ("omp declare simd"), c);
> > TREE_CHAIN (c) = DECL_ATTRIBUTES (fndecl);
> > DECL_ATTRIBUTES (fndecl) = c;
> >
> >
> > You want to change it something like this?
> >
> >
> > If (is_cilkplus_cilk_simd_fn)
> > {
> > tree c_cilk = build_tree_list (get_identifier ("cilk simd function"), c);
> > TREE_CHAIN (c_cilk) = DECL_ATTRIBUTES (fndecl);
> > DECL_ATTRIBUTES (fndecl) = c_cilk;
> > }
> > c = build_tree_list (get_identififer ("omp declare simd"), c);
> > TREE_CHAIN (c) =DECL_ATTRIBUTES (fndecl); DECL_ATTRIBUTES (fndecl) =
> > c;
> >
> >
>
> Yes.
The issue with doing this is that it is creating duplicate clones. If I just kept the patch as is, it does not.
For example:
__attribute__((vector (vectorlength(sizeof(int)))))
int func3 (int x)
{
return x;
}
Should create two clones: mask and unmask (_ZGVbN4v_func3 and _ZGVbM4v_func3). It is doing that if I kept the patch AS-IS.
Now, if I make the modification that I mentioned above and remove the handling of cilk simd function in omp-low.c it is creating 6 clones: _ZGVdM4v_func3, _ZGVbN4v_func3, _ZGVcN4v_func3, _ZGVcM4v_func3, _ZGVdN4v_func3
Thanks,
Balaji V. Iyer.