On Tue, May 03, 2005 at 04:42:47PM -0400, Diego Novillo wrote:
>   GENERIC
>   GIMPLE
>       GOMP_ATOMIC <expression-statement>

Do we gain anything over expanding this to the approprate __sync_foo
builtin in the front end.?

>   GENERIC
>   GIMPLE
>       GOMP_FLUSH <var-list>

Likewise.

> #pragma omp threadprivate
> -------------------------
> 
>   This will just set an attribute in each affected _DECL.
>   Accessible with GOMP_THREADPRIVATE.

My intention is to use TLS for this, and to NOT support this feature
on any system that doesn't support TLS.  Thus this bit is synonymous
with DECL_THREAD_LOCAL.

>   GIMPLE      Same, with EXPR in GIMPLE form as per FE rules.
>               If missing, it defaults to INTEGER_ONE_NODE for
>               GOMP_SCHED_DYNAMIC and GOMP_SCHED_GUIDED.  It
>               defaults to iteration-space / num-threads for
>               GOMP_SCHED_STATIC and it emits getenv reads from
>               environment for GOM_SCHED_RUNTIME.

The getenv is done in the library.  You can leave the kind field
NULL, or set it to INTEGER_ZERO_NODE as you choose for the tree
level.

> data_clauses
> ------------
> 
> * CLAUSE      private (variable_list)
>               copyprivate (variable_list)
>               firstprivate (variable_list)
>               lastprivate (variable_list)
>               shared (variable_list)
>               copyin (variable_list)
>       
>   GENERIC     These are fields in the GOMP_PARALLEL expression.
>               Accessed with:
> 
>               GOMP_PRIVATE
>               GOMP_FIRSTPRIVATE
>               GOMP_SHARED
>               GOMP_COPYIN
> 
>   GIMPLE      Same, with variable_list gimplified as per FE
>               rules.

These shouldn't need gimplification.  We should only have decls in
this list.

> * CLAUSE      default (shared | none)
> 
>   GENERIC     This is a boolean field in the GOMP_PARALLEL
>               expression.
> 
>   GIMPLE      Same.

IMO this shouldn't escape the front end.  We have different requirements
for Fortran and C.  We should require that front ends do all symbol
resolution and provide GENERIC with a complete list of decls.  What 
reaches GENERIC should be equivalent to default(none) -- that is, all
variables are either (1) declared inside BIND_EXPRs inside the body of
the block, or (2) mentioned in one of the relevant variable lists.

> * CLAUSE      reduction (operator : variable_list)
> 
>   GENERIC     A structure inside GOMP_PARALLEL with two fields
> 
>               enum tree_code operator -> PLUS_EXPR,
>                                          MULT_EXPR,
>                                          MINUS_EXPR,
>                                          BIT_AND_EXPR,
>                                          BIT_XOR_EXPR,
>                                          BIT_IOR_EXPR,
>                                          AND_EXPR,
>                                          OR_EXPR
>               tree variable_list
> 
>   GIMPLE      Same, with variable_list gimplified as per FE
>               rules.

This isn't generic enough.  The reduction clause can be specified multiple
times.  Thus we can see

        #pragma omp for reduction(+: a, b) reduction(*: c, d)

I assume the best option would be a list or vector of operator/variable
pairs.

Also note that reduction is also legal on for constructs, and that the
firstprivate, lastprivate, and copyprivate clauses are legal on other
work sharing constructs.


r~

Reply via email to