find_omp_clause (tree clauses, enum tree_code kind)
{
for (; clauses ; clauses = OMP_CLAUSE_CHAIN (clauses))
- if (TREE_CODE (clauses) == kind)
+ if (OMP_CLAUSE_CODE (clauses) == kind)
return clauses;
return NULL_TREE;
fd->chunk_size = NULL_TREE;
for (t = OMP_FOR_CLAUSES (for_stmt); t ; t = OMP_CLAUSE_CHAIN (t))
- switch (TREE_CODE (t))
+ switch (OMP_CLAUSE_CODE (t))
{
case OMP_CLAUSE_NOWAIT:
fd->have_nowait = true;
{
bool by_ref;
- switch (TREE_CODE (c))
+ switch (OMP_CLAUSE_CODE (c))
{
case OMP_CLAUSE_PRIVATE:
decl = OMP_CLAUSE_DECL (c);
break;
}
/* We don't need to copy const scalar vars back. */
- TREE_SET_CODE (c, OMP_CLAUSE_FIRSTPRIVATE);
+ OMP_CLAUSE_SET_CODE (c, OMP_CLAUSE_FIRSTPRIVATE);
goto do_private;
case OMP_CLAUSE_LASTPRIVATE:
case OMP_CLAUSE_NUM_THREADS:
case OMP_CLAUSE_SCHEDULE:
if (ctx->outer)
- scan_omp (&TREE_OPERAND (c, 0), ctx->outer);
+ scan_omp (&OMP_CLAUSE_OPERAND (c, 0), ctx->outer);
break;
case OMP_CLAUSE_NOWAIT:
for (c = clauses; c; c = OMP_CLAUSE_CHAIN (c))
{
- switch (TREE_CODE (c))
+ switch (OMP_CLAUSE_CODE (c))
{
case OMP_CLAUSE_LASTPRIVATE:
/* Let the corresponding firstprivate clause create
if (is_variable_sized (decl))
install_var_local (decl, ctx);
fixup_remapped_decl (decl, ctx,
- TREE_CODE (c) == OMP_CLAUSE_PRIVATE
+ OMP_CLAUSE_CODE (c) == OMP_CLAUSE_PRIVATE
&& OMP_CLAUSE_PRIVATE_DEBUG (c));
- if (TREE_CODE (c) == OMP_CLAUSE_REDUCTION
+ if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_REDUCTION
&& OMP_CLAUSE_REDUCTION_PLACEHOLDER (c))
scan_array_reductions = true;
break;
if (scan_array_reductions)
for (c = clauses; c; c = OMP_CLAUSE_CHAIN (c))
- if (TREE_CODE (c) == OMP_CLAUSE_REDUCTION
+ if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_REDUCTION
&& OMP_CLAUSE_REDUCTION_PLACEHOLDER (c))
{
scan_omp (&OMP_CLAUSE_REDUCTION_INIT (c), ctx);
{
for (c = clauses; c ; c = OMP_CLAUSE_CHAIN (c))
{
- enum tree_code c_kind = TREE_CODE (c);
+ enum omp_clause_code c_kind = OMP_CLAUSE_CODE (c);
tree var, new_var;
bool by_ref;
else if (pass != 0)
continue;
- switch (TREE_CODE (c))
+ switch (OMP_CLAUSE_CODE (c))
{
case OMP_CLAUSE_SHARED:
/* Set up the DECL_VALUE_EXPR for shared variables now. This
{
tree var, new_var;
- if (TREE_CODE (c) != OMP_CLAUSE_LASTPRIVATE)
+ if (OMP_CLAUSE_CODE (c) != OMP_CLAUSE_LASTPRIVATE)
continue;
var = OMP_CLAUSE_DECL (c);
/* First see if there is exactly one reduction clause. Use OMP_ATOMIC
update in that case, otherwise use a lock. */
for (c = clauses; c && count < 2; c = OMP_CLAUSE_CHAIN (c))
- if (TREE_CODE (c) == OMP_CLAUSE_REDUCTION)
+ if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_REDUCTION)
{
if (OMP_CLAUSE_REDUCTION_PLACEHOLDER (c))
{
tree var, ref, new_var;
enum tree_code code;
- if (TREE_CODE (c) != OMP_CLAUSE_REDUCTION)
+ if (OMP_CLAUSE_CODE (c) != OMP_CLAUSE_REDUCTION)
continue;
var = OMP_CLAUSE_DECL (c);
tree var, ref, x;
bool by_ref;
- if (TREE_CODE (c) != OMP_CLAUSE_COPYPRIVATE)
+ if (OMP_CLAUSE_CODE (c) != OMP_CLAUSE_COPYPRIVATE)
continue;
var = OMP_CLAUSE_DECL (c);
tree val, ref, x, var;
bool by_ref, do_in = false, do_out = false;
- switch (TREE_CODE (c))
+ switch (OMP_CLAUSE_CODE (c))
{
case OMP_CLAUSE_FIRSTPRIVATE:
case OMP_CLAUSE_COPYIN:
continue;
by_ref = use_pointer_for_field (val, false);
- switch (TREE_CODE (c))
+ switch (OMP_CLAUSE_CODE (c))
{
case OMP_CLAUSE_FIRSTPRIVATE:
case OMP_CLAUSE_COPYIN:
entry_bb = bb_for_stmt (region->entry);
exit_bb = bb_for_stmt (region->exit);
- /* Barriers at the end of the function are not necessary and can be
- removed. Since the caller will have a barrier of its own, this
- one is superfluous. */
- remove_exit_barrier (region);
-
if (is_combined_parallel (region))
- ws_args = region->ws_args;
+ {
+ ws_args = region->ws_args;
+
+ /* For combined parallel+workshare calls, barriers at the end of
+ the function are not necessary and can be removed. Since the
+ caller will have a barrier of its own, the workshare barrier is
+ superfluous. */
+ remove_exit_barrier (region);
+ }
else
ws_args = NULL_TREE;
gcc_unreachable ();
}
+ /* Expansion adds and removes basic block, edges, creates
+ and exposes unreachable regions that need to be cleaned up
+ before proceeding. */
+ free_dominance_info (CDI_DOMINATORS);
+ free_dominance_info (CDI_POST_DOMINATORS);
+ cleanup_tree_cfg ();
+
region = region->next;
}
}
splay_tree_delete (omp_regions);
root_omp_region = NULL;
omp_regions = NULL;
- free_dominance_info (CDI_DOMINATORS);
- free_dominance_info (CDI_POST_DOMINATORS);
}
-
- /* Expansion adds basic blocks that may be merged. */
- cleanup_tree_cfg ();
}
static bool