Get rid of 'gcc/omp-oacc-neuter-broadcast.cc:oacc_build_component_ref'
Clean-up for commite2a58ed6dc
"openacc: Middle-end worker-partitioning support": as of commit2a3f9f6532
"openacc: Shared memory layout optimisation", we're no longer running into the vectorizer ICEs for '!ADDR_SPACE_GENERIC_P'. gcc/ * omp-low.cc (omp_build_component_ref): Move function... * omp-general.cc (omp_build_component_ref): ... here. Remove 'static'. * omp-general.h (omp_build_component_ref): Declare function. * omp-oacc-neuter-broadcast.cc (oacc_build_component_ref): Remove function. (build_receiver_ref, build_sender_ref): Call 'omp_build_component_ref' instead.
This commit is contained in:
parent
0fe9176f41
commit
54f7450232
@ -2980,4 +2980,18 @@ oacc_get_ifn_dim_arg (const gimple *stmt)
|
||||
return (int) axis;
|
||||
}
|
||||
|
||||
/* Build COMPONENT_REF and set TREE_THIS_VOLATILE and TREE_READONLY on it
|
||||
as appropriate. */
|
||||
|
||||
tree
|
||||
omp_build_component_ref (tree obj, tree field)
|
||||
{
|
||||
tree ret = build3 (COMPONENT_REF, TREE_TYPE (field), obj, field, NULL);
|
||||
if (TREE_THIS_VOLATILE (field))
|
||||
TREE_THIS_VOLATILE (ret) |= 1;
|
||||
if (TREE_READONLY (field))
|
||||
TREE_READONLY (ret) |= 1;
|
||||
return ret;
|
||||
}
|
||||
|
||||
#include "gt-omp-general.h"
|
||||
|
@ -149,4 +149,6 @@ get_openacc_privatization_dump_flags ()
|
||||
return l_dump_flags;
|
||||
}
|
||||
|
||||
extern tree omp_build_component_ref (tree obj, tree field);
|
||||
|
||||
#endif /* GCC_OMP_GENERAL_H */
|
||||
|
@ -621,21 +621,6 @@ omp_copy_decl_1 (tree var, omp_context *ctx)
|
||||
return omp_copy_decl_2 (var, DECL_NAME (var), TREE_TYPE (var), ctx);
|
||||
}
|
||||
|
||||
/* Build COMPONENT_REF and set TREE_THIS_VOLATILE and TREE_READONLY on it
|
||||
as appropriate. */
|
||||
/* See also 'gcc/omp-oacc-neuter-broadcast.cc:oacc_build_component_ref'. */
|
||||
|
||||
static tree
|
||||
omp_build_component_ref (tree obj, tree field)
|
||||
{
|
||||
tree ret = build3 (COMPONENT_REF, TREE_TYPE (field), obj, field, NULL);
|
||||
if (TREE_THIS_VOLATILE (field))
|
||||
TREE_THIS_VOLATILE (ret) |= 1;
|
||||
if (TREE_READONLY (field))
|
||||
TREE_READONLY (ret) |= 1;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Build tree nodes to access the field for VAR on the receiver side. */
|
||||
|
||||
static tree
|
||||
|
@ -937,35 +937,13 @@ worker_single_simple (basic_block from, basic_block to,
|
||||
}
|
||||
}
|
||||
|
||||
/* Build COMPONENT_REF and set TREE_THIS_VOLATILE and TREE_READONLY on it
|
||||
as appropriate. */
|
||||
/* Adapted from 'gcc/omp-low.cc:omp_build_component_ref'. */
|
||||
|
||||
static tree
|
||||
oacc_build_component_ref (tree obj, tree field)
|
||||
{
|
||||
tree field_type = TREE_TYPE (field);
|
||||
tree obj_type = TREE_TYPE (obj);
|
||||
if (!ADDR_SPACE_GENERIC_P (TYPE_ADDR_SPACE (obj_type)))
|
||||
field_type = build_qualified_type
|
||||
(field_type,
|
||||
KEEP_QUAL_ADDR_SPACE (TYPE_QUALS (obj_type)));
|
||||
|
||||
tree ret = build3 (COMPONENT_REF, field_type, obj, field, NULL);
|
||||
if (TREE_THIS_VOLATILE (field))
|
||||
TREE_THIS_VOLATILE (ret) |= 1;
|
||||
if (TREE_READONLY (field))
|
||||
TREE_READONLY (ret) |= 1;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static tree
|
||||
build_receiver_ref (tree var, tree receiver_decl, field_map_t *fields)
|
||||
{
|
||||
tree x = build_simple_mem_ref (receiver_decl);
|
||||
tree field = *fields->get (var);
|
||||
TREE_THIS_NOTRAP (x) = 1;
|
||||
x = oacc_build_component_ref (x, field);
|
||||
x = omp_build_component_ref (x, field);
|
||||
return x;
|
||||
}
|
||||
|
||||
@ -975,7 +953,7 @@ build_sender_ref (tree var, tree sender_decl, field_map_t *fields)
|
||||
if (POINTER_TYPE_P (TREE_TYPE (sender_decl)))
|
||||
sender_decl = build_simple_mem_ref (sender_decl);
|
||||
tree field = *fields->get (var);
|
||||
return oacc_build_component_ref (sender_decl, field);
|
||||
return omp_build_component_ref (sender_decl, field);
|
||||
}
|
||||
|
||||
static int
|
||||
|
Loading…
Reference in New Issue
Block a user