This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gomp4.1] map clause parsing improvements
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Ilya Verbin <iverbin at gmail dot com>
- Cc: Thomas Schwinge <thomas at codesourcery dot com>, gcc-patches at gcc dot gnu dot org, Kirill Yukhin <kirill dot yukhin at gmail dot com>
- Date: Mon, 26 Oct 2015 14:07:13 +0100
- Subject: Re: [gomp4.1] map clause parsing improvements
- Authentication-results: sourceware.org; auth=none
- References: <20150429111406 dot GE1751 at tucnak dot redhat dot com> <874mnzrw1z dot fsf at schwinge dot name> <20150429120644 dot GG1751 at tucnak dot redhat dot com> <20150609183608 dot GA47936 at msticlxl57 dot ims dot intel dot com> <20150611121420 dot GY10247 at tucnak dot redhat dot com> <87zizf9n2w dot fsf at kepler dot schwinge dot homeip dot net> <20151019103408 dot GP478 at tucnak dot redhat dot com> <87vba29a3y dot fsf at schwinge dot name> <20151020100340 dot GX478 at tucnak dot redhat dot com> <20151026125357 dot GA35077 at msticlxl57 dot ims dot intel dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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