Commit dfa6e5b4 by Jakub Jelinek Committed by Jakub Jelinek

gimple.h (enum gf_mask): Remove GF_OMP_FOR_SIMD...

	* gimple.h (enum gf_mask): Remove GF_OMP_FOR_SIMD, change
	GF_OMP_FOR_KIND_SIMD to a value serially after other kinds,
	divide GF_OMP_FOR_KIND_MASK, GF_OMP_FOR_COMBINED,
	GF_OMP_FOR_COMBINED_INTO, GF_OMP_FOR_GRID_PHONY,
	GF_OMP_FOR_GRID_INTRA_GROUP and GF_OMP_FOR_GRID_GROUP_ITER by two.
	* omp-grid.c (grid_process_grid_body,
	grid_eliminate_combined_simd_part): Use GF_OMP_FOR_KIND_SIMD instead
	of GF_OMP_FOR_SIMD, don't test & GF_OMP_FOR_SIMD but
	== GF_OMP_FOR_KIND_SIMD.
	* omp-low.c (build_outer_var_ref, scan_sharing_clauses,
	check_omp_nesting_restrictions, scan_omp_1_stmt,
	lower_rec_input_clauses, lower_lastprivate_conditional_clauses,
	lower_lastprivate_clauses, lower_reduction_clauses, lower_omp_scan,
	omp_find_scan): Likewise.
	* omp-expand.c (expand_omp_for): Likewise.
	* omp-general.c (omp_extract_for_data): Likewise.

From-SVN: r273544
parent 7eb5baff
2019-07-17 Jakub Jelinek <jakub@redhat.com> 2019-07-17 Jakub Jelinek <jakub@redhat.com>
* gimple.h (enum gf_mask): Remove GF_OMP_FOR_SIMD, change
GF_OMP_FOR_KIND_SIMD to a value serially after other kinds,
divide GF_OMP_FOR_KIND_MASK, GF_OMP_FOR_COMBINED,
GF_OMP_FOR_COMBINED_INTO, GF_OMP_FOR_GRID_PHONY,
GF_OMP_FOR_GRID_INTRA_GROUP and GF_OMP_FOR_GRID_GROUP_ITER by two.
* omp-grid.c (grid_process_grid_body,
grid_eliminate_combined_simd_part): Use GF_OMP_FOR_KIND_SIMD instead
of GF_OMP_FOR_SIMD, don't test & GF_OMP_FOR_SIMD but
== GF_OMP_FOR_KIND_SIMD.
* omp-low.c (build_outer_var_ref, scan_sharing_clauses,
check_omp_nesting_restrictions, scan_omp_1_stmt,
lower_rec_input_clauses, lower_lastprivate_conditional_clauses,
lower_lastprivate_clauses, lower_reduction_clauses, lower_omp_scan,
omp_find_scan): Likewise.
* omp-expand.c (expand_omp_for): Likewise.
* omp-general.c (omp_extract_for_data): Likewise.
PR tree-optimization/91157 PR tree-optimization/91157
* tree-vect-generic.c (expand_vector_comparison): Handle lhs being * tree-vect-generic.c (expand_vector_comparison): Handle lhs being
a vector boolean with scalar mode. a vector boolean with scalar mode.
......
...@@ -153,24 +153,22 @@ enum gf_mask { ...@@ -153,24 +153,22 @@ enum gf_mask {
GF_OMP_PARALLEL_GRID_PHONY = 1 << 1, GF_OMP_PARALLEL_GRID_PHONY = 1 << 1,
GF_OMP_TASK_TASKLOOP = 1 << 0, GF_OMP_TASK_TASKLOOP = 1 << 0,
GF_OMP_TASK_TASKWAIT = 1 << 1, GF_OMP_TASK_TASKWAIT = 1 << 1,
GF_OMP_FOR_KIND_MASK = (1 << 4) - 1, GF_OMP_FOR_KIND_MASK = (1 << 3) - 1,
GF_OMP_FOR_KIND_FOR = 0, GF_OMP_FOR_KIND_FOR = 0,
GF_OMP_FOR_KIND_DISTRIBUTE = 1, GF_OMP_FOR_KIND_DISTRIBUTE = 1,
GF_OMP_FOR_KIND_TASKLOOP = 2, GF_OMP_FOR_KIND_TASKLOOP = 2,
GF_OMP_FOR_KIND_OACC_LOOP = 4, GF_OMP_FOR_KIND_OACC_LOOP = 4,
GF_OMP_FOR_KIND_GRID_LOOP = 5, GF_OMP_FOR_KIND_GRID_LOOP = 5,
/* Flag for SIMD variants of OMP_FOR kinds. */ GF_OMP_FOR_KIND_SIMD = 6,
GF_OMP_FOR_SIMD = 1 << 3, GF_OMP_FOR_COMBINED = 1 << 3,
GF_OMP_FOR_KIND_SIMD = GF_OMP_FOR_SIMD | 0, GF_OMP_FOR_COMBINED_INTO = 1 << 4,
GF_OMP_FOR_COMBINED = 1 << 4,
GF_OMP_FOR_COMBINED_INTO = 1 << 5,
/* The following flag must not be used on GF_OMP_FOR_KIND_GRID_LOOP loop /* The following flag must not be used on GF_OMP_FOR_KIND_GRID_LOOP loop
statements. */ statements. */
GF_OMP_FOR_GRID_PHONY = 1 << 6, GF_OMP_FOR_GRID_PHONY = 1 << 5,
/* The following two flags should only be set on GF_OMP_FOR_KIND_GRID_LOOP /* The following two flags should only be set on GF_OMP_FOR_KIND_GRID_LOOP
loop statements. */ loop statements. */
GF_OMP_FOR_GRID_INTRA_GROUP = 1 << 6, GF_OMP_FOR_GRID_INTRA_GROUP = 1 << 5,
GF_OMP_FOR_GRID_GROUP_ITER = 1 << 7, GF_OMP_FOR_GRID_GROUP_ITER = 1 << 6,
GF_OMP_TARGET_KIND_MASK = (1 << 4) - 1, GF_OMP_TARGET_KIND_MASK = (1 << 4) - 1,
GF_OMP_TARGET_KIND_REGION = 0, GF_OMP_TARGET_KIND_REGION = 0,
GF_OMP_TARGET_KIND_DATA = 1, GF_OMP_TARGET_KIND_DATA = 1,
......
...@@ -6532,7 +6532,7 @@ expand_omp_for (struct omp_region *region, gimple *inner_stmt) ...@@ -6532,7 +6532,7 @@ expand_omp_for (struct omp_region *region, gimple *inner_stmt)
original loops from being detected. Fix that up. */ original loops from being detected. Fix that up. */
loops_state_set (LOOPS_NEED_FIXUP); loops_state_set (LOOPS_NEED_FIXUP);
if (gimple_omp_for_kind (fd.for_stmt) & GF_OMP_FOR_SIMD) if (gimple_omp_for_kind (fd.for_stmt) == GF_OMP_FOR_KIND_SIMD)
expand_omp_simd (region, &fd); expand_omp_simd (region, &fd);
else if (gimple_omp_for_kind (fd.for_stmt) == GF_OMP_FOR_KIND_OACC_LOOP) else if (gimple_omp_for_kind (fd.for_stmt) == GF_OMP_FOR_KIND_OACC_LOOP)
{ {
......
...@@ -156,7 +156,7 @@ omp_extract_for_data (gomp_for *for_stmt, struct omp_for_data *fd, ...@@ -156,7 +156,7 @@ omp_extract_for_data (gomp_for *for_stmt, struct omp_for_data *fd,
int i; int i;
struct omp_for_data_loop dummy_loop; struct omp_for_data_loop dummy_loop;
location_t loc = gimple_location (for_stmt); location_t loc = gimple_location (for_stmt);
bool simd = gimple_omp_for_kind (for_stmt) & GF_OMP_FOR_SIMD; bool simd = gimple_omp_for_kind (for_stmt) == GF_OMP_FOR_KIND_SIMD;
bool distribute = gimple_omp_for_kind (for_stmt) bool distribute = gimple_omp_for_kind (for_stmt)
== GF_OMP_FOR_KIND_DISTRIBUTE; == GF_OMP_FOR_KIND_DISTRIBUTE;
bool taskloop = gimple_omp_for_kind (for_stmt) bool taskloop = gimple_omp_for_kind (for_stmt)
......
...@@ -1002,7 +1002,7 @@ grid_process_grid_body (gimple_stmt_iterator *gsi, bool *handled_ops_p, ...@@ -1002,7 +1002,7 @@ grid_process_grid_body (gimple_stmt_iterator *gsi, bool *handled_ops_p,
*handled_ops_p = false; *handled_ops_p = false;
gimple *stmt = gsi_stmt (*gsi); gimple *stmt = gsi_stmt (*gsi);
if (gimple_code (stmt) == GIMPLE_OMP_FOR if (gimple_code (stmt) == GIMPLE_OMP_FOR
&& (gimple_omp_for_kind (stmt) & GF_OMP_FOR_SIMD)) && gimple_omp_for_kind (stmt) == GF_OMP_FOR_KIND_SIMD)
{ {
gomp_for *loop = as_a <gomp_for *> (stmt); gomp_for *loop = as_a <gomp_for *> (stmt);
tree clauses = gimple_omp_for_clauses (loop); tree clauses = gimple_omp_for_clauses (loop);
...@@ -1030,14 +1030,14 @@ grid_eliminate_combined_simd_part (gomp_for *parloop) ...@@ -1030,14 +1030,14 @@ grid_eliminate_combined_simd_part (gomp_for *parloop)
memset (&wi, 0, sizeof (wi)); memset (&wi, 0, sizeof (wi));
wi.val_only = true; wi.val_only = true;
enum gf_mask msk = GF_OMP_FOR_SIMD; enum gf_mask msk = GF_OMP_FOR_KIND_SIMD;
wi.info = (void *) &msk; wi.info = (void *) &msk;
walk_gimple_seq (gimple_omp_body (parloop), omp_find_combined_for, NULL, &wi); walk_gimple_seq (gimple_omp_body (parloop), omp_find_combined_for, NULL, &wi);
gimple *stmt = (gimple *) wi.info; gimple *stmt = (gimple *) wi.info;
/* We expect that the SIMD id the only statement in the parallel loop. */ /* We expect that the SIMD id the only statement in the parallel loop. */
gcc_assert (stmt gcc_assert (stmt
&& gimple_code (stmt) == GIMPLE_OMP_FOR && gimple_code (stmt) == GIMPLE_OMP_FOR
&& (gimple_omp_for_kind (stmt) == GF_OMP_FOR_SIMD) && (gimple_omp_for_kind (stmt) == GF_OMP_FOR_KIND_SIMD)
&& gimple_omp_for_combined_into_p (stmt) && gimple_omp_for_combined_into_p (stmt)
&& !gimple_omp_for_combined_p (stmt)); && !gimple_omp_for_combined_p (stmt));
gomp_for *simd = as_a <gomp_for *> (stmt); gomp_for *simd = as_a <gomp_for *> (stmt);
......
...@@ -580,7 +580,7 @@ build_outer_var_ref (tree var, omp_context *ctx, ...@@ -580,7 +580,7 @@ build_outer_var_ref (tree var, omp_context *ctx,
x = build_receiver_ref (var, by_ref, ctx); x = build_receiver_ref (var, by_ref, ctx);
} }
else if ((gimple_code (ctx->stmt) == GIMPLE_OMP_FOR else if ((gimple_code (ctx->stmt) == GIMPLE_OMP_FOR
&& gimple_omp_for_kind (ctx->stmt) & GF_OMP_FOR_SIMD) && gimple_omp_for_kind (ctx->stmt) == GF_OMP_FOR_KIND_SIMD)
|| (code == OMP_CLAUSE_PRIVATE || (code == OMP_CLAUSE_PRIVATE
&& (gimple_code (ctx->stmt) == GIMPLE_OMP_FOR && (gimple_code (ctx->stmt) == GIMPLE_OMP_FOR
|| gimple_code (ctx->stmt) == GIMPLE_OMP_SECTIONS || gimple_code (ctx->stmt) == GIMPLE_OMP_SECTIONS
...@@ -1441,7 +1441,7 @@ scan_sharing_clauses (tree clauses, omp_context *ctx) ...@@ -1441,7 +1441,7 @@ scan_sharing_clauses (tree clauses, omp_context *ctx)
install_var_local (decl, ctx); install_var_local (decl, ctx);
} }
else if (gimple_code (ctx->stmt) == GIMPLE_OMP_FOR else if (gimple_code (ctx->stmt) == GIMPLE_OMP_FOR
&& (gimple_omp_for_kind (ctx->stmt) & GF_OMP_FOR_SIMD) && gimple_omp_for_kind (ctx->stmt) == GF_OMP_FOR_KIND_SIMD
&& !OMP_CLAUSE__CONDTEMP__ITER (c)) && !OMP_CLAUSE__CONDTEMP__ITER (c))
install_var_local (decl, ctx); install_var_local (decl, ctx);
break; break;
...@@ -2750,7 +2750,7 @@ check_omp_nesting_restrictions (gimple *stmt, omp_context *ctx) ...@@ -2750,7 +2750,7 @@ check_omp_nesting_restrictions (gimple *stmt, omp_context *ctx)
switch (gimple_code (stmt)) switch (gimple_code (stmt))
{ {
case GIMPLE_OMP_FOR: case GIMPLE_OMP_FOR:
if (gimple_omp_for_kind (stmt) & GF_OMP_FOR_SIMD) if (gimple_omp_for_kind (stmt) == GF_OMP_FOR_KIND_SIMD)
return true; return true;
if (gimple_omp_for_kind (stmt) == GF_OMP_FOR_KIND_DISTRIBUTE) if (gimple_omp_for_kind (stmt) == GF_OMP_FOR_KIND_DISTRIBUTE)
{ {
...@@ -3496,7 +3496,7 @@ scan_omp_1_stmt (gimple_stmt_iterator *gsi, bool *handled_ops_p, ...@@ -3496,7 +3496,7 @@ scan_omp_1_stmt (gimple_stmt_iterator *gsi, bool *handled_ops_p,
{ {
if (ctx if (ctx
&& gimple_code (ctx->stmt) == GIMPLE_OMP_FOR && gimple_code (ctx->stmt) == GIMPLE_OMP_FOR
&& gimple_omp_for_kind (ctx->stmt) == GF_OMP_FOR_SIMD && gimple_omp_for_kind (ctx->stmt) == GF_OMP_FOR_KIND_SIMD
&& setjmp_or_longjmp_p (fndecl)) && setjmp_or_longjmp_p (fndecl))
{ {
remove = true; remove = true;
...@@ -4118,7 +4118,7 @@ lower_rec_input_clauses (tree clauses, gimple_seq *ilist, gimple_seq *dlist, ...@@ -4118,7 +4118,7 @@ lower_rec_input_clauses (tree clauses, gimple_seq *ilist, gimple_seq *dlist,
bool reduction_omp_orig_ref = false; bool reduction_omp_orig_ref = false;
int pass; int pass;
bool is_simd = (gimple_code (ctx->stmt) == GIMPLE_OMP_FOR bool is_simd = (gimple_code (ctx->stmt) == GIMPLE_OMP_FOR
&& gimple_omp_for_kind (ctx->stmt) & GF_OMP_FOR_SIMD); && gimple_omp_for_kind (ctx->stmt) == GF_OMP_FOR_KIND_SIMD);
omplow_simd_context sctx = omplow_simd_context (); omplow_simd_context sctx = omplow_simd_context ();
tree simt_lane = NULL_TREE, simtrec = NULL_TREE; tree simt_lane = NULL_TREE, simtrec = NULL_TREE;
tree ivar = NULL_TREE, lvar = NULL_TREE, uid = NULL_TREE; tree ivar = NULL_TREE, lvar = NULL_TREE, uid = NULL_TREE;
...@@ -6093,7 +6093,7 @@ lower_lastprivate_conditional_clauses (tree *clauses, omp_context *ctx) ...@@ -6093,7 +6093,7 @@ lower_lastprivate_conditional_clauses (tree *clauses, omp_context *ctx)
tree cond_ptr = NULL_TREE; tree cond_ptr = NULL_TREE;
tree iter_var = NULL_TREE; tree iter_var = NULL_TREE;
bool is_simd = (gimple_code (ctx->stmt) == GIMPLE_OMP_FOR bool is_simd = (gimple_code (ctx->stmt) == GIMPLE_OMP_FOR
&& gimple_omp_for_kind (ctx->stmt) & GF_OMP_FOR_SIMD); && gimple_omp_for_kind (ctx->stmt) == GF_OMP_FOR_KIND_SIMD);
tree next = *clauses; tree next = *clauses;
for (tree c = *clauses; c; c = OMP_CLAUSE_CHAIN (c)) for (tree c = *clauses; c; c = OMP_CLAUSE_CHAIN (c))
if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_LASTPRIVATE if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_LASTPRIVATE
...@@ -6225,7 +6225,7 @@ lower_lastprivate_clauses (tree clauses, tree predicate, gimple_seq *body_p, ...@@ -6225,7 +6225,7 @@ lower_lastprivate_clauses (tree clauses, tree predicate, gimple_seq *body_p,
bool maybe_simt = false; bool maybe_simt = false;
if (gimple_code (ctx->stmt) == GIMPLE_OMP_FOR if (gimple_code (ctx->stmt) == GIMPLE_OMP_FOR
&& gimple_omp_for_kind (ctx->stmt) & GF_OMP_FOR_SIMD) && gimple_omp_for_kind (ctx->stmt) == GF_OMP_FOR_KIND_SIMD)
{ {
maybe_simt = omp_find_clause (orig_clauses, OMP_CLAUSE__SIMT_); maybe_simt = omp_find_clause (orig_clauses, OMP_CLAUSE__SIMT_);
simduid = omp_find_clause (orig_clauses, OMP_CLAUSE__SIMDUID_); simduid = omp_find_clause (orig_clauses, OMP_CLAUSE__SIMDUID_);
...@@ -6707,7 +6707,7 @@ lower_reduction_clauses (tree clauses, gimple_seq *stmt_seqp, ...@@ -6707,7 +6707,7 @@ lower_reduction_clauses (tree clauses, gimple_seq *stmt_seqp,
/* SIMD reductions are handled in lower_rec_input_clauses. */ /* SIMD reductions are handled in lower_rec_input_clauses. */
if (gimple_code (ctx->stmt) == GIMPLE_OMP_FOR if (gimple_code (ctx->stmt) == GIMPLE_OMP_FOR
&& gimple_omp_for_kind (ctx->stmt) & GF_OMP_FOR_SIMD) && gimple_omp_for_kind (ctx->stmt) == GF_OMP_FOR_KIND_SIMD)
return; return;
/* inscan reductions are handled elsewhere. */ /* inscan reductions are handled elsewhere. */
...@@ -8923,7 +8923,7 @@ lower_omp_scan (gimple_stmt_iterator *gsi_p, omp_context *ctx) ...@@ -8923,7 +8923,7 @@ lower_omp_scan (gimple_stmt_iterator *gsi_p, omp_context *ctx)
bool input_phase = has_clauses ^ octx->scan_inclusive; bool input_phase = has_clauses ^ octx->scan_inclusive;
bool is_simd = (gimple_code (octx->stmt) == GIMPLE_OMP_FOR bool is_simd = (gimple_code (octx->stmt) == GIMPLE_OMP_FOR
&& (gimple_omp_for_kind (octx->stmt) & GF_OMP_FOR_SIMD)); && gimple_omp_for_kind (octx->stmt) == GF_OMP_FOR_KIND_SIMD);
bool is_for = (gimple_code (octx->stmt) == GIMPLE_OMP_FOR bool is_for = (gimple_code (octx->stmt) == GIMPLE_OMP_FOR
&& gimple_omp_for_kind (octx->stmt) == GF_OMP_FOR_KIND_FOR && gimple_omp_for_kind (octx->stmt) == GF_OMP_FOR_KIND_FOR
&& !gimple_omp_for_combined_p (octx->stmt)); && !gimple_omp_for_combined_p (octx->stmt));
...@@ -9409,7 +9409,7 @@ omp_find_scan (gimple_stmt_iterator *gsi_p, bool *handled_ops_p, ...@@ -9409,7 +9409,7 @@ omp_find_scan (gimple_stmt_iterator *gsi_p, bool *handled_ops_p,
WALK_SUBSTMTS; WALK_SUBSTMTS;
case GIMPLE_OMP_FOR: case GIMPLE_OMP_FOR:
if ((gimple_omp_for_kind (stmt) & GF_OMP_FOR_SIMD) if (gimple_omp_for_kind (stmt) == GF_OMP_FOR_KIND_SIMD
&& gimple_omp_for_combined_into_p (stmt)) && gimple_omp_for_combined_into_p (stmt))
*handled_ops_p = false; *handled_ops_p = false;
break; break;
......
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