diff options
author | Jakub Jelinek <jakub@redhat.com> | 2016-04-12 09:05:29 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-04-12 09:05:29 +0200 |
commit | 21f3a2369bb56501115221846f63f54a035233bc (patch) | |
tree | 7d2a75e2cbcd54347feb0c7ddb5e8f6d35f11e2c /gcc/omp-low.c | |
parent | a3f90b8c03e73c7a2a596f3f4112eca53ea19cdf (diff) | |
download | gcc-21f3a2369bb56501115221846f63f54a035233bc.zip gcc-21f3a2369bb56501115221846f63f54a035233bc.tar.gz gcc-21f3a2369bb56501115221846f63f54a035233bc.tar.bz2 |
omp-low.c (lower_omp_target): Use GOMP_MAP_FIRSTPRIVATE_INT regardless whether there are depend clauses or not.
* omp-low.c (lower_omp_target): Use GOMP_MAP_FIRSTPRIVATE_INT
regardless whether there are depend clauses or not.
* libgomp.h (struct gomp_target_task): Remove firstprivate_copies
field.
* target.c (gomp_target_fallback_firstprivate,
gomp_target_unshare_firstprivate): Removed.
(GOMP_target_ext): Copy firstprivate vars into gomp_allocaed memory
before waiting for dependencies.
(gomp_target_task_fn): Don't copy firstprivate vars here.
* task.c (GOMP_PLUGIN_target_task_completion): Don't free
firstprivate_copies here.
(gomp_create_target_task): Don't initialize firstprivate_copies field.
* testsuite/libgomp.c/target-25.c (main): Use map (to:) instead of
explicit/implicit firstprivate.
From-SVN: r234894
Diffstat (limited to 'gcc/omp-low.c')
-rw-r--r-- | gcc/omp-low.c | 70 |
1 files changed, 1 insertions, 69 deletions
diff --git a/gcc/omp-low.c b/gcc/omp-low.c index d25c51f..7335abc 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -15730,7 +15730,6 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_context *ctx) location_t loc = gimple_location (stmt); bool offloaded, data_region; unsigned int map_cnt = 0; - bool has_depend = false; offloaded = is_gimple_omp_offloaded (stmt); switch (gimple_omp_target_kind (stmt)) @@ -15765,7 +15764,6 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_context *ctx) dep_bind = gimple_build_bind (NULL, NULL, make_node (BLOCK)); lower_depend_clauses (gimple_omp_target_clauses_ptr (stmt), &dep_ilist, &dep_olist); - has_depend = true; } tgt_bind = NULL; @@ -16280,44 +16278,9 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_context *ctx) type = TREE_TYPE (ovar); if (is_reference (ovar)) type = TREE_TYPE (type); - bool use_firstprivate_int, force_addr; - use_firstprivate_int = false; - force_addr = false; if ((INTEGRAL_TYPE_P (type) && TYPE_PRECISION (type) <= POINTER_SIZE) || TREE_CODE (type) == POINTER_TYPE) - use_firstprivate_int = true; - if (has_depend) - { - if (is_reference (var)) - use_firstprivate_int = false; - else if (is_gimple_reg (var)) - { - if (DECL_HAS_VALUE_EXPR_P (var)) - { - tree v = get_base_address (var); - if (DECL_P (v) && TREE_ADDRESSABLE (v)) - { - use_firstprivate_int = false; - force_addr = true; - } - else - switch (TREE_CODE (v)) - { - case INDIRECT_REF: - case MEM_REF: - use_firstprivate_int = false; - force_addr = true; - break; - default: - break; - } - } - } - else - use_firstprivate_int = false; - } - if (use_firstprivate_int) { tkind = GOMP_MAP_FIRSTPRIVATE_INT; tree t = var; @@ -16332,7 +16295,7 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_context *ctx) } else if (is_reference (var)) gimplify_assign (x, var, &ilist); - else if (!force_addr && is_gimple_reg (var)) + else if (is_gimple_reg (var)) { tree avar = create_tmp_var (TREE_TYPE (var)); mark_addressable (avar); @@ -16470,40 +16433,9 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_context *ctx) type = TREE_TYPE (var); if (is_reference (var)) type = TREE_TYPE (type); - bool use_firstprivate_int; - use_firstprivate_int = false; if ((INTEGRAL_TYPE_P (type) && TYPE_PRECISION (type) <= POINTER_SIZE) || TREE_CODE (type) == POINTER_TYPE) - use_firstprivate_int = true; - if (has_depend) - { - tree v = lookup_decl_in_outer_ctx (var, ctx); - if (is_reference (v)) - use_firstprivate_int = false; - else if (is_gimple_reg (v)) - { - if (DECL_HAS_VALUE_EXPR_P (v)) - { - v = get_base_address (v); - if (DECL_P (v) && TREE_ADDRESSABLE (v)) - use_firstprivate_int = false; - else - switch (TREE_CODE (v)) - { - case INDIRECT_REF: - case MEM_REF: - use_firstprivate_int = false; - break; - default: - break; - } - } - } - else - use_firstprivate_int = false; - } - if (use_firstprivate_int) { x = build_receiver_ref (var, false, ctx); if (TREE_CODE (type) != POINTER_TYPE) |