> -----Original Message-----
> From: Aldy Hernandez [mailto:al...@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-ow...@gcc.gnu.org [mailto:gcc-patches-
> >> ow...@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.

Reply via email to