On Mon, Oct 26, 2015 at 03:53:57PM +0300, Ilya Verbin wrote:
> @@ -7363,7 +7363,7 @@ gimplify_adjust_omp_clauses (gimple_seq *pre_p, tree
> *list_p,
> n = splay_tree_lookup (ctx->variables, (splay_tree_key) decl);
> if ((ctx->region_type & ORT_TARGET) != 0
> && !(n->value & GOVD_SEEN)
> - && ((OMP_CLAUSE_MAP_KIND (c) & GOMP_MAP_FLAG_ALWAYS) == 0
> + && (GOMP_MAP_ALWAYS_P (OMP_CLAUSE_MAP_KIND (c)) == 0
> || OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_STRUCT))
The || OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_STRUCT part can go then too,
it was there only because (OMP_CLAUSE_MAP_KIND (c) & GOMP_MAP_FLAG_ALWAYS)
has been non-zero for GOMP_MAP_STRUCT (and the () pair around the condition
too).
We want to be able to remove all map clauses on the target construct, except
if it is always {to,from,tofrom}.
We do not want to remove release or delete, but those only exist on target
exit data and thus are handled by (ctx->region_type & ORT_TARGET) != 0.
> @@ -142,6 +143,10 @@ enum gomp_map_kind
> #define GOMP_MAP_ALWAYS_FROM_P(X) \
> (((X) == GOMP_MAP_ALWAYS_FROM) || ((X) == GOMP_MAP_ALWAYS_TOFROM))
>
> +#define GOMP_MAP_ALWAYS_P(X) \
> + (((X) == GOMP_MAP_ALWAYS_TO) || ((X) == GOMP_MAP_ALWAYS_FROM) \
> + || ((X) == GOMP_MAP_ALWAYS_TOFROM))
You could simplify this e.g. to
(((X) == GOMP_MAP_ALWAYS_TO) || GOMP_MAP_ALWAYS_FROM_P (X))
or
(GOMP_MAP_ALWAYS_TO_P (X) || ((X) == GOMP_MAP_ALWAYS_FROM))
Otherwise, LGTM.
Jakub