}
else if (outer)
x = lookup_decl (var, outer);
- else if (omp_is_reference (var))
+ else if (omp_privatize_by_reference (var))
/* This can happen with orphaned constructs. If var is reference, it is
possible it is shared and as such valid. */
x = var;
}
}
- if (omp_is_reference (var))
+ if (omp_privatize_by_reference (var))
x = build_simple_mem_ref (x);
return x;
}
else if (by_ref)
type = build_pointer_type (type);
- else if ((mask & (32 | 3)) == 1 && omp_is_reference (var))
+ else if ((mask & (32 | 3)) == 1
+ && omp_privatize_by_reference (var))
type = TREE_TYPE (type);
field = build_decl (DECL_SOURCE_LOCATION (var),
if ((! TREE_READONLY (decl) && !OMP_CLAUSE_SHARED_READONLY (c))
|| TREE_ADDRESSABLE (decl)
|| by_ref
- || omp_is_reference (decl))
+ || omp_privatize_by_reference (decl))
{
by_ref = use_pointer_for_field (decl, ctx);
install_var_field (decl, by_ref, 3, ctx);
&& is_gimple_omp_offloaded (ctx->stmt))
{
if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_FIRSTPRIVATE)
- install_var_field (decl, !omp_is_reference (decl), 3, ctx);
+ {
+ by_ref = !omp_privatize_by_reference (decl);
+ install_var_field (decl, by_ref, 3, ctx);
+ }
else if (TREE_CODE (TREE_TYPE (decl)) == ARRAY_TYPE)
install_var_field (decl, true, 3, ctx);
else
by_ref = use_pointer_for_field (decl, NULL);
if (is_task_ctx (ctx)
- && (global || by_ref || omp_is_reference (decl)))
+ && (global || by_ref || omp_privatize_by_reference (decl)))
{
if (ctx->allocate_map
&& ctx->allocate_map->get (decl))
if (lang_hooks.decls.omp_array_data (decl, true))
install_var_field (decl, false, 19, ctx);
else if ((OMP_CLAUSE_CODE (c) == OMP_CLAUSE_USE_DEVICE_ADDR
- && !omp_is_reference (decl)
+ && !omp_privatize_by_reference (decl)
&& !omp_is_allocatable_or_ptr (decl))
|| TREE_CODE (TREE_TYPE (decl)) == ARRAY_TYPE)
install_var_field (decl, true, 11, ctx);
allocator = *allocatorp;
if (allocator == NULL_TREE)
return false;
- if (!is_ref && omp_is_reference (var))
+ if (!is_ref && omp_privatize_by_reference (var))
{
allocator = NULL_TREE;
return false;
case OMP_CLAUSE_LASTPRIVATE:
if (is_variable_sized (OMP_CLAUSE_DECL (c)))
sctx.max_vf = 1;
- else if (omp_is_reference (OMP_CLAUSE_DECL (c)))
+ else if (omp_privatize_by_reference (OMP_CLAUSE_DECL (c)))
{
tree rtype = TREE_TYPE (TREE_TYPE (OMP_CLAUSE_DECL (c)));
if (!TREE_CONSTANT (TYPE_SIZE_UNIT (rtype)))
if (TREE_CODE (OMP_CLAUSE_DECL (c)) == MEM_REF
|| is_variable_sized (OMP_CLAUSE_DECL (c)))
sctx.max_vf = 1;
- else if (omp_is_reference (OMP_CLAUSE_DECL (c)))
+ else if (omp_privatize_by_reference (OMP_CLAUSE_DECL (c)))
{
tree rtype = TREE_TYPE (TREE_TYPE (OMP_CLAUSE_DECL (c)));
if (!TREE_CONSTANT (TYPE_SIZE_UNIT (rtype)))
original address, it is always the address of the
global variable itself. */
if (!DECL_P (var)
- || omp_is_reference (var)
+ || omp_privatize_by_reference (var)
|| !is_global_var
(maybe_lookup_decl_in_outer_ctx (var, ctx)))
{
tree ref = build_outer_var_ref (var, ctx);
/* For ref build_outer_var_ref already performs this. */
if (TREE_CODE (d) == INDIRECT_REF)
- gcc_assert (omp_is_reference (var));
+ gcc_assert (omp_privatize_by_reference (var));
else if (TREE_CODE (d) == ADDR_EXPR)
ref = build_fold_addr_expr (ref);
- else if (omp_is_reference (var))
+ else if (omp_privatize_by_reference (var))
ref = build_fold_addr_expr (ref);
ref = fold_convert_loc (clause_loc, ptype, ref);
if (OMP_CLAUSE_REDUCTION_PLACEHOLDER (c)
bool by_ref = use_pointer_for_field (var, ctx);
x = build_receiver_ref (var, by_ref, ctx);
}
- if (!omp_is_reference (var))
+ if (!omp_privatize_by_reference (var))
x = build_fold_addr_expr (x);
x = fold_convert (ptr_type_node, x);
unsigned cnt = task_reduction_cnt - 1;
else if (pass == 3)
{
tree type = TREE_TYPE (new_var);
- if (!omp_is_reference (var))
+ if (!omp_privatize_by_reference (var))
type = build_pointer_type (type);
if (OMP_CLAUSE_CODE (c) != OMP_CLAUSE_REDUCTION)
{
}
x = fold_convert (type, x);
tree t;
- if (omp_is_reference (var))
+ if (omp_privatize_by_reference (var))
{
gimplify_assign (new_var, x, ilist);
t = new_var;
gimplify_assign (ptr, x, ilist);
}
}
- else if (omp_is_reference (var)
+ else if (omp_privatize_by_reference (var)
&& (c_kind != OMP_CLAUSE_FIRSTPRIVATE
|| !OMP_CLAUSE_FIRSTPRIVATE_NO_REFERENCE (c)))
{
|| (gimple_omp_for_index (ctx->stmt, 0)
!= new_var)))
|| OMP_CLAUSE_CODE (c) == OMP_CLAUSE__CONDTEMP_
- || omp_is_reference (var))
+ || omp_privatize_by_reference (var))
&& lower_rec_simd_input_clauses (new_var, ctx, &sctx,
ivar, lvar))
{
- if (omp_is_reference (var))
+ if (omp_privatize_by_reference (var))
{
gcc_assert (TREE_CODE (new_var) == MEM_REF);
tree new_vard = TREE_OPERAND (new_var, 0);
}
break;
}
- if (omp_is_reference (var))
+ if (omp_privatize_by_reference (var))
{
gcc_assert (TREE_CODE (new_var) == MEM_REF);
tree new_vard = TREE_OPERAND (new_var, 0);
case OMP_CLAUSE_FIRSTPRIVATE:
if (is_task_ctx (ctx))
{
- if ((omp_is_reference (var)
+ if ((omp_privatize_by_reference (var)
&& !OMP_CLAUSE_FIRSTPRIVATE_NO_REFERENCE (c))
|| is_variable_sized (var))
goto do_dtor;
}
}
if (OMP_CLAUSE_FIRSTPRIVATE_NO_REFERENCE (c)
- && omp_is_reference (var))
+ && omp_privatize_by_reference (var))
{
x = build_outer_var_ref (var, ctx);
gcc_assert (TREE_CODE (x) == MEM_REF
if (OMP_CLAUSE_LINEAR_ARRAY (c))
{
- if (omp_is_reference (var))
+ if (omp_privatize_by_reference (var))
{
gcc_assert (TREE_CODE (new_var) == MEM_REF);
tree new_vard = TREE_OPERAND (new_var, 0);
if ((OMP_CLAUSE_CODE (c) != OMP_CLAUSE_LINEAR
|| TREE_ADDRESSABLE (new_var)
- || omp_is_reference (var))
+ || omp_privatize_by_reference (var))
&& lower_rec_simd_input_clauses (new_var, ctx, &sctx,
ivar, lvar))
{
- if (omp_is_reference (var))
+ if (omp_privatize_by_reference (var))
{
gcc_assert (TREE_CODE (new_var) == MEM_REF);
tree new_vard = TREE_OPERAND (new_var, 0);
gimplify_and_add (x, &llist[1]);
break;
}
- if (omp_is_reference (var))
+ if (omp_privatize_by_reference (var))
{
gcc_assert (TREE_CODE (new_var) == MEM_REF);
tree new_vard = TREE_OPERAND (new_var, 0);
NULL_TREE);
x = build_outer_var_ref (var, ctx);
- if (omp_is_reference (var)
+ if (omp_privatize_by_reference (var)
&& !useless_type_conversion_p (ptype, TREE_TYPE (x)))
x = build_fold_addr_expr_loc (clause_loc, x);
}
SET_DECL_VALUE_EXPR (placeholder, x);
DECL_HAS_VALUE_EXPR_P (placeholder) = 1;
tree new_vard = new_var;
- if (omp_is_reference (var))
+ if (omp_privatize_by_reference (var))
{
gcc_assert (TREE_CODE (new_var) == MEM_REF);
new_vard = TREE_OPERAND (new_var, 0);
for it because it is undesirable if SIMD arrays are used.
But if they aren't used, we need to emit the deferred
initialization now. */
- else if (omp_is_reference (var) && is_simd)
+ else if (omp_privatize_by_reference (var) && is_simd)
handle_simd_reference (clause_loc, new_vard, ilist);
tree lab2 = NULL_TREE;
bool is_truth_op
= (code == TRUTH_ANDIF_EXPR || code == TRUTH_ORIF_EXPR);
tree new_vard = new_var;
- if (is_simd && omp_is_reference (var))
+ if (is_simd && omp_privatize_by_reference (var))
{
gcc_assert (TREE_CODE (new_var) == MEM_REF);
new_vard = TREE_OPERAND (new_var, 0);
lower_private_allocate (var, new_var, allocator,
allocate_ptr, ilist, ctx,
false, NULL_TREE);
- if (omp_is_reference (var) && is_simd)
+ if (omp_privatize_by_reference (var) && is_simd)
handle_simd_reference (clause_loc, new_vard, ilist);
if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_REDUCTION
&& OMP_CLAUSE_REDUCTION_INSCAN (c))
}
if (!x)
x = build_outer_var_ref (var, ctx, OMP_CLAUSE_LASTPRIVATE);
- if (omp_is_reference (var))
+ if (omp_privatize_by_reference (var))
new_var = build_simple_mem_ref_loc (clause_loc, new_var);
x = lang_hooks.decls.omp_clause_assign_op (c, x, new_var);
gimplify_and_add (x, this_stmt_list);
&& maybe_lookup_field (orig, outer) && !is_private)
{
ref_to_res = build_receiver_ref (orig, false, outer);
- if (omp_is_reference (orig))
+ if (omp_privatize_by_reference (orig))
ref_to_res = build_simple_mem_ref (ref_to_res);
tree type = TREE_TYPE (var);
if (!ref_to_res)
ref_to_res = integer_zero_node;
- if (omp_is_reference (orig))
+ if (omp_privatize_by_reference (orig))
{
tree type = TREE_TYPE (var);
const char *id = IDENTIFIER_POINTER (DECL_NAME (var));
}
}
new_var = lookup_decl (var, ctx);
- if (var == OMP_CLAUSE_DECL (c) && omp_is_reference (var))
+ if (var == OMP_CLAUSE_DECL (c)
+ && omp_privatize_by_reference (var))
new_var = build_simple_mem_ref_loc (clause_loc, new_var);
ref = build_outer_var_ref (var, ctx, ccode);
code = OMP_CLAUSE_REDUCTION_CODE (c);
if (TREE_CODE (d) == INDIRECT_REF)
{
new_var = build_simple_mem_ref_loc (clause_loc, new_var);
- gcc_assert (omp_is_reference (var) && var == orig_var);
+ gcc_assert (omp_privatize_by_reference (var)
+ && var == orig_var);
}
else if (TREE_CODE (d) == ADDR_EXPR)
{
else
{
gcc_assert (orig_var == var);
- if (omp_is_reference (var))
+ if (omp_privatize_by_reference (var))
ref = build_fold_addr_expr (ref);
}
if (DECL_P (v))
{
tree placeholder = OMP_CLAUSE_REDUCTION_PLACEHOLDER (c);
- if (omp_is_reference (var)
+ if (omp_privatize_by_reference (var)
&& !useless_type_conversion_p (TREE_TYPE (placeholder),
TREE_TYPE (ref)))
ref = build_fold_addr_expr_loc (clause_loc, ref);
ref);
ref = build_fold_indirect_ref_loc (clause_loc, ref);
}
- if (omp_is_reference (var))
+ if (omp_privatize_by_reference (var))
{
ref = fold_convert_loc (clause_loc, TREE_TYPE (new_var), ref);
ref = build_simple_mem_ref_loc (clause_loc, ref);
break;
case OMP_CLAUSE_LASTPRIVATE:
- if (by_ref || omp_is_reference (val))
+ if (by_ref || omp_privatize_by_reference (val))
{
if (OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE (c))
continue;
if (is_task_ctx (ctx))
by_ref = use_pointer_for_field (val, ctx);
else
- do_out = !(by_ref || omp_is_reference (val));
+ do_out = !(by_ref || omp_privatize_by_reference (val));
}
else
by_ref = TREE_CODE (TREE_TYPE (val)) == ARRAY_TYPE;
}
else
{
- if (omp_is_reference (*decl))
+ if (omp_privatize_by_reference (*decl))
*type = TREE_TYPE (*type);
if (pass != (!TREE_CONSTANT (TYPE_SIZE_UNIT (*type))))
continue;
else
{
t = ref = maybe_lookup_decl_in_outer_ctx (var, ctx);
- if (!omp_is_reference (decl))
+ if (!omp_privatize_by_reference (decl))
t = build_fold_addr_expr (t);
}
t = fold_convert (pointer_sized_int_node, t);
build_simple_mem_ref (ptr), field, NULL_TREE);
enum tree_code rcode = OMP_CLAUSE_REDUCTION_CODE (c);
- if (TREE_CODE (decl) != MEM_REF && omp_is_reference (decl))
+ if (TREE_CODE (decl) != MEM_REF
+ && omp_privatize_by_reference (decl))
ref = build_simple_mem_ref (ref);
/* reduction(-:var) sums up the partial results, so it acts
identically to reduction(+:var). */
gimple_seq_add_stmt (end, g);
gimple_seq_add_stmt (end, gimple_build_label (lab5));
}
- if (omp_is_reference (decl)
+ if (omp_privatize_by_reference (decl)
&& !useless_type_conversion_p (TREE_TYPE (placeholder),
TREE_TYPE (ref)))
ref = build_fold_addr_expr_loc (OMP_CLAUSE_LOCATION (c), ref);
gcc_assert (d);
if (DECL_HAS_VALUE_EXPR_P (d))
oldv = DECL_VALUE_EXPR (d);
- if (omp_is_reference (var))
+ if (omp_privatize_by_reference (var))
{
tree v = fold_convert (TREE_TYPE (d),
build_fold_addr_expr (new_var));
tree var4 = NULL_TREE;
tree lane0 = NULL_TREE;
tree new_vard = new_var;
- if (omp_is_reference (var))
+ if (omp_privatize_by_reference (var))
{
new_var = build_simple_mem_ref_loc (clause_loc, new_var);
val = new_var;
tree new_var = lookup_decl (var, ctx);
tree var3 = NULL_TREE;
tree new_vard = new_var;
- if (omp_is_reference (var))
+ if (omp_privatize_by_reference (var))
new_var = build_simple_mem_ref_loc (clause_loc, new_var);
if (OMP_CLAUSE_REDUCTION_PLACEHOLDER (c))
{
sf = *tcctx.cb.decl_map->get (sf);
src = build_simple_mem_ref_loc (loc, sarg);
src = omp_build_component_ref (src, sf);
- if (use_pointer_for_field (decl, NULL) || omp_is_reference (decl))
+ if (use_pointer_for_field (decl, NULL)
+ || omp_privatize_by_reference (decl))
src = build_simple_mem_ref_loc (loc, src);
}
else
if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_FIRSTPRIVATE)
{
gcc_assert (is_gimple_omp_oacc (ctx->stmt));
- if (omp_is_reference (new_var)
+ if (omp_privatize_by_reference (new_var)
&& (TREE_CODE (TREE_TYPE (new_var)) != POINTER_TYPE
|| DECL_BY_REFERENCE (var)))
{
}
map_cnt++;
var = OMP_CLAUSE_DECL (c);
- if (!omp_is_reference (var)
+ if (!omp_privatize_by_reference (var)
&& !is_gimple_reg_type (TREE_TYPE (var)))
{
tree new_var = lookup_decl (var, ctx);
DECL_HAS_VALUE_EXPR_P (new_var) = 1;
}
else if ((OMP_CLAUSE_CODE (c) == OMP_CLAUSE_USE_DEVICE_ADDR
- && !omp_is_reference (var)
+ && !omp_privatize_by_reference (var)
&& !omp_is_allocatable_or_ptr (var)
&& !lang_hooks.decls.omp_array_data (var, true))
|| TREE_CODE (TREE_TYPE (var)) == ARRAY_TYPE)
else if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_FIRSTPRIVATE)
{
gcc_assert (is_gimple_omp_oacc (ctx->stmt));
- if (!omp_is_reference (var))
+ if (!omp_privatize_by_reference (var))
{
if (is_gimple_reg (var)
&& OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT (c))
if (is_gimple_omp_oacc (ctx->stmt))
goto oacc_firstprivate_map;
ovar = OMP_CLAUSE_DECL (c);
- if (omp_is_reference (ovar))
+ if (omp_privatize_by_reference (ovar))
talign = TYPE_ALIGN_UNIT (TREE_TYPE (TREE_TYPE (ovar)));
else
talign = DECL_ALIGN_UNIT (ovar);
x = build_sender_ref (ovar, ctx);
tkind = GOMP_MAP_FIRSTPRIVATE;
type = TREE_TYPE (ovar);
- if (omp_is_reference (ovar))
+ if (omp_privatize_by_reference (ovar))
type = TREE_TYPE (type);
if ((INTEGRAL_TYPE_P (type)
&& TYPE_PRECISION (type) <= POINTER_SIZE)
{
tkind = GOMP_MAP_FIRSTPRIVATE_INT;
tree t = var;
- if (omp_is_reference (var))
+ if (omp_privatize_by_reference (var))
t = build_simple_mem_ref (var);
else if (OMP_CLAUSE_FIRSTPRIVATE_IMPLICIT (c))
suppress_warning (var);
t = fold_convert (TREE_TYPE (x), t);
gimplify_assign (x, t, &ilist);
}
- else if (omp_is_reference (var))
+ else if (omp_privatize_by_reference (var))
gimplify_assign (x, var, &ilist);
else if (is_gimple_reg (var))
{
}
if (tkind == GOMP_MAP_FIRSTPRIVATE_INT)
s = size_int (0);
- else if (omp_is_reference (ovar))
+ else if (omp_privatize_by_reference (ovar))
s = TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (ovar)));
else
s = TYPE_SIZE_UNIT (TREE_TYPE (ovar));
if (lang_hooks.decls.omp_array_data (ovar, true))
var = lang_hooks.decls.omp_array_data (ovar, false);
else if ((OMP_CLAUSE_CODE (c) == OMP_CLAUSE_USE_DEVICE_ADDR
- && !omp_is_reference (ovar)
+ && !omp_privatize_by_reference (ovar)
&& !omp_is_allocatable_or_ptr (ovar))
|| TREE_CODE (type) == ARRAY_TYPE)
var = build_fold_addr_expr (var);
else
{
- if (omp_is_reference (ovar)
+ if (omp_privatize_by_reference (ovar)
|| omp_check_optional_argument (ovar, false)
|| omp_is_allocatable_or_ptr (ovar))
{
&& TREE_CODE (type) != ARRAY_TYPE
&& ((OMP_CLAUSE_CODE (c) != OMP_CLAUSE_USE_DEVICE_ADDR
&& !omp_is_allocatable_or_ptr (ovar))
- || (omp_is_reference (ovar)
+ || (omp_privatize_by_reference (ovar)
&& omp_is_allocatable_or_ptr (ovar))))
var = build_simple_mem_ref (var);
var = fold_convert (TREE_TYPE (x), var);
if (is_gimple_omp_oacc (ctx->stmt))
break;
var = OMP_CLAUSE_DECL (c);
- if (omp_is_reference (var)
+ if (omp_privatize_by_reference (var)
|| is_gimple_reg_type (TREE_TYPE (var)))
{
tree new_var = lookup_decl (var, ctx);
tree type;
type = TREE_TYPE (var);
- if (omp_is_reference (var))
+ if (omp_privatize_by_reference (var))
type = TREE_TYPE (type);
if ((INTEGRAL_TYPE_P (type)
&& TYPE_PRECISION (type) <= POINTER_SIZE)
x = fold_convert (type, x);
gimplify_expr (&x, &new_body, NULL, is_gimple_val,
fb_rvalue);
- if (omp_is_reference (var))
+ if (omp_privatize_by_reference (var))
{
tree v = create_tmp_var_raw (type, get_name (var));
gimple_add_tmp_var (v);
}
else
{
- x = build_receiver_ref (var, !omp_is_reference (var), ctx);
+ bool by_ref = !omp_privatize_by_reference (var);
+ x = build_receiver_ref (var, by_ref, ctx);
gimplify_expr (&x, &new_body, NULL, is_gimple_val,
fb_rvalue);
gimple_seq_add_stmt (&new_body,
if (is_gimple_omp_oacc (ctx->stmt))
break;
var = OMP_CLAUSE_DECL (c);
- if (omp_is_reference (var))
+ if (omp_privatize_by_reference (var))
{
location_t clause_loc = OMP_CLAUSE_LOCATION (c);
tree new_var = lookup_decl (var, ctx);
if (is_array_data)
{
- bool is_ref = omp_is_reference (var);
+ bool is_ref = omp_privatize_by_reference (var);
do_optional_check = true;
/* First, we copy the descriptor data from the host; then
we update its data to point to the target address. */
gimple_build_assign (new_var, x));
}
else if ((OMP_CLAUSE_CODE (c) == OMP_CLAUSE_USE_DEVICE_ADDR
- && !omp_is_reference (var)
+ && !omp_privatize_by_reference (var)
&& !omp_is_allocatable_or_ptr (var))
|| TREE_CODE (TREE_TYPE (var)) == ARRAY_TYPE)
{
{
tree type = TREE_TYPE (var);
new_var = lookup_decl (var, ctx);
- if (omp_is_reference (var))
+ if (omp_privatize_by_reference (var))
{
type = TREE_TYPE (type);
if (POINTER_TYPE_P (type)
&& TREE_CODE (type) != ARRAY_TYPE
&& (OMP_CLAUSE_CODE (c) != OMP_CLAUSE_USE_DEVICE_ADDR
- || (omp_is_reference (var)
+ || (omp_privatize_by_reference (var)
&& omp_is_allocatable_or_ptr (var))))
{
tree v = create_tmp_var_raw (type, get_name (var));
offset));
}
else
- is_ref = omp_is_reference (var);
+ is_ref = omp_privatize_by_reference (var);
if (OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_FIRSTPRIVATE_REFERENCE)
is_ref = false;
bool ref_to_array = false;
gimple_seq_add_stmt (&new_body,
gimple_build_assign (new_pvar, x));
}
- else if (omp_is_reference (var) && !is_gimple_omp_oacc (ctx->stmt))
+ else if (omp_privatize_by_reference (var)
+ && !is_gimple_omp_oacc (ctx->stmt))
{
location_t clause_loc = OMP_CLAUSE_LOCATION (c);
tree new_var = lookup_decl (var, ctx);