Commit 4fd872bc by Julian Brown Committed by Julian Brown

OpenACC 2.6 deep copy: middle-end parts

	gcc/
	* gimplify.c (gimplify_omp_var_data): Add GOVD_MAP_HAS_ATTACHMENTS.
	(insert_struct_comp_map): Support derived-type member mappings
	for arrays with descriptors which use GOMP_MAP_TO_PSET.  Support
	GOMP_MAP_ATTACH_DETACH.
	(gimplify_scan_omp_clauses): Tidy up OACC_ENTER_DATA/OACC_EXIT_DATA
	mappings.  Handle attach/detach clauses and component references.
	(gimplify_adjust_omp_clauses_1): Skip adjustments for explicit
	attach/detach clauses.
	(gimplify_omp_target_update): Handle struct mappings and finalize for
	detach operations.
	* omp-low.c (lower_omp_target): Support GOMP_MAP_ATTACH,
	GOMP_MAP_DETACH, GOMP_MAP_FORCE_DETACH.
	* tree-pretty-print.c (dump_omp_clause): Likewise, plus
	GOMP_MAP_ATTACH_DETACH.

	include/
	* gomp-constants.h (gomp_map_kind): Add GOMP_MAP_ATTACH_DETACH.

From-SVN: r279626
parent 8e7e71ff
2019-12-19 Julian Brown <julian@codesourcery.com>
* gimplify.c (gimplify_omp_var_data): Add GOVD_MAP_HAS_ATTACHMENTS.
(insert_struct_comp_map): Support derived-type member mappings
for arrays with descriptors which use GOMP_MAP_TO_PSET. Support
GOMP_MAP_ATTACH_DETACH.
(gimplify_scan_omp_clauses): Tidy up OACC_ENTER_DATA/OACC_EXIT_DATA
mappings. Handle attach/detach clauses and component references.
(gimplify_adjust_omp_clauses_1): Skip adjustments for explicit
attach/detach clauses.
(gimplify_omp_target_update): Handle struct mappings and finalize for
detach operations.
* omp-low.c (lower_omp_target): Support GOMP_MAP_ATTACH,
GOMP_MAP_DETACH, GOMP_MAP_FORCE_DETACH.
* tree-pretty-print.c (dump_omp_clause): Likewise, plus
GOMP_MAP_ATTACH_DETACH.
2019-12-19 Julian Brown <julian@codesourcery.com>
* gimplify.c (insert_struct_comp_map, extract_base_bit_offset): New.
(gimplify_scan_omp_clauses): Outline duplicated code into calls to
above two functions.
......@@ -11440,6 +11440,9 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_context *ctx)
case GOMP_MAP_FORCE_DEVICEPTR:
case GOMP_MAP_DEVICE_RESIDENT:
case GOMP_MAP_LINK:
case GOMP_MAP_ATTACH:
case GOMP_MAP_DETACH:
case GOMP_MAP_FORCE_DETACH:
gcc_assert (is_gimple_omp_oacc (stmt));
break;
default:
......
......@@ -852,6 +852,18 @@ dump_omp_clause (pretty_printer *pp, tree clause, int spc, dump_flags_t flags)
case GOMP_MAP_LINK:
pp_string (pp, "link");
break;
case GOMP_MAP_ATTACH:
pp_string (pp, "attach");
break;
case GOMP_MAP_DETACH:
pp_string (pp, "detach");
break;
case GOMP_MAP_FORCE_DETACH:
pp_string (pp, "force_detach");
break;
case GOMP_MAP_ATTACH_DETACH:
pp_string (pp, "attach_detach");
break;
default:
gcc_unreachable ();
}
......@@ -873,6 +885,12 @@ dump_omp_clause (pretty_printer *pp, tree clause, int spc, dump_flags_t flags)
case GOMP_MAP_TO_PSET:
pp_string (pp, " [pointer set, len: ");
break;
case GOMP_MAP_ATTACH:
case GOMP_MAP_DETACH:
case GOMP_MAP_FORCE_DETACH:
case GOMP_MAP_ATTACH_DETACH:
pp_string (pp, " [bias: ");
break;
default:
pp_string (pp, " [len: ");
break;
......
2019-12-19 Julian Brown <julian@codesourcery.com>
* gomp-constants.h (gomp_map_kind): Add GOMP_MAP_ATTACH_DETACH.
2019-12-19 Julian Brown <julian@codesourcery.com>
* gomp-constants.h (GOMP_MAP_FLAG_SPECIAL_4, GOMP_MAP_DEEP_COPY):
Define.
(gomp_map_kind): Add GOMP_MAP_ATTACH, GOMP_MAP_DETACH,
......
......@@ -144,7 +144,11 @@ enum gomp_map_kind
/* Do not map, but pointer assign a pointer instead. */
GOMP_MAP_FIRSTPRIVATE_POINTER = (GOMP_MAP_LAST | 1),
/* Do not map, but pointer assign a reference instead. */
GOMP_MAP_FIRSTPRIVATE_REFERENCE = (GOMP_MAP_LAST | 2)
GOMP_MAP_FIRSTPRIVATE_REFERENCE = (GOMP_MAP_LAST | 2),
/* An attach or detach operation. Rewritten to the appropriate type during
gimplification, depending on directive (i.e. "enter data" or
parallel/kernels region vs. "exit data"). */
GOMP_MAP_ATTACH_DETACH = (GOMP_MAP_LAST | 3)
};
#define GOMP_MAP_COPY_TO_P(X) \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment