Commit 94e14f2e by Jakub Jelinek Committed by Jakub Jelinek

omp-low.c (struct omp_context): Rename combined_into_simd_safelen0 member to…

omp-low.c (struct omp_context): Rename combined_into_simd_safelen0 member to combined_into_simd_safelen1.

	* omp-low.c (struct omp_context): Rename combined_into_simd_safelen0
	member to combined_into_simd_safelen1.
	(lower_rec_input_clauses, lower_omp_1): Adjust uses.
	(lower_lastprivate_clauses): Likewise.  For conditional lastprivate
	clauses if ctx->combined_into_simd_safelen1 put statements after the
	predicate conditionalized block rather than into it.

From-SVN: r273168
parent a10b664e
2019-07-06 Jakub Jelinek <jakub@redhat.com>
* omp-low.c (struct omp_context): Rename combined_into_simd_safelen0
member to combined_into_simd_safelen1.
(lower_rec_input_clauses, lower_omp_1): Adjust uses.
(lower_lastprivate_clauses): Likewise. For conditional lastprivate
clauses if ctx->combined_into_simd_safelen1 put statements after the
predicate conditionalized block rather than into it.
2019-07-06 Richard Sandiford <richard.sandiford@arm.com> 2019-07-06 Richard Sandiford <richard.sandiford@arm.com>
* config/s390/s390.md (*negabs<FP:mode>2_nocc): Use FP for * config/s390/s390.md (*negabs<FP:mode>2_nocc): Use FP for
......
...@@ -140,7 +140,7 @@ struct omp_context ...@@ -140,7 +140,7 @@ struct omp_context
/* True if lower_omp_1 should look up lastprivate conditional in parent /* True if lower_omp_1 should look up lastprivate conditional in parent
context. */ context. */
bool combined_into_simd_safelen0; bool combined_into_simd_safelen1;
/* True if there is nested scan context with inclusive clause. */ /* True if there is nested scan context with inclusive clause. */
bool scan_inclusive; bool scan_inclusive;
...@@ -5703,7 +5703,7 @@ lower_rec_input_clauses (tree clauses, gimple_seq *ilist, gimple_seq *dlist, ...@@ -5703,7 +5703,7 @@ lower_rec_input_clauses (tree clauses, gimple_seq *ilist, gimple_seq *dlist,
if (gimple_omp_for_combined_into_p (ctx->stmt)) if (gimple_omp_for_combined_into_p (ctx->stmt))
{ {
/* Signal to lower_omp_1 that it should use parent context. */ /* Signal to lower_omp_1 that it should use parent context. */
ctx->combined_into_simd_safelen0 = true; ctx->combined_into_simd_safelen1 = true;
for (c = clauses; c ; c = OMP_CLAUSE_CHAIN (c)) for (c = clauses; c ; c = OMP_CLAUSE_CHAIN (c))
if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_LASTPRIVATE if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_LASTPRIVATE
&& OMP_CLAUSE_LASTPRIVATE_CONDITIONAL (c)) && OMP_CLAUSE_LASTPRIVATE_CONDITIONAL (c))
...@@ -6018,6 +6018,7 @@ lower_lastprivate_clauses (tree clauses, tree predicate, gimple_seq *body_p, ...@@ -6018,6 +6018,7 @@ lower_lastprivate_clauses (tree clauses, tree predicate, gimple_seq *body_p,
bool par_clauses = false; bool par_clauses = false;
tree simduid = NULL, lastlane = NULL, simtcond = NULL, simtlast = NULL; tree simduid = NULL, lastlane = NULL, simtcond = NULL, simtlast = NULL;
unsigned HOST_WIDE_INT conditional_off = 0; unsigned HOST_WIDE_INT conditional_off = 0;
gimple_seq post_stmt_list = NULL;
/* Early exit if there are no lastprivate or linear clauses. */ /* Early exit if there are no lastprivate or linear clauses. */
for (; clauses ; clauses = OMP_CLAUSE_CHAIN (clauses)) for (; clauses ; clauses = OMP_CLAUSE_CHAIN (clauses))
...@@ -6107,7 +6108,7 @@ lower_lastprivate_clauses (tree clauses, tree predicate, gimple_seq *body_p, ...@@ -6107,7 +6108,7 @@ lower_lastprivate_clauses (tree clauses, tree predicate, gimple_seq *body_p,
if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_LASTPRIVATE if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_LASTPRIVATE
&& OMP_CLAUSE_LASTPRIVATE_CONDITIONAL (c) && OMP_CLAUSE_LASTPRIVATE_CONDITIONAL (c)
&& ctx->lastprivate_conditional_map && ctx->lastprivate_conditional_map
&& !ctx->combined_into_simd_safelen0) && !ctx->combined_into_simd_safelen1)
{ {
gcc_assert (body_p); gcc_assert (body_p);
if (simduid) if (simduid)
...@@ -6144,6 +6145,12 @@ lower_lastprivate_clauses (tree clauses, tree predicate, gimple_seq *body_p, ...@@ -6144,6 +6145,12 @@ lower_lastprivate_clauses (tree clauses, tree predicate, gimple_seq *body_p,
gimple_seq_add_stmt (this_stmt_list, gimple_build_label (lab1)); gimple_seq_add_stmt (this_stmt_list, gimple_build_label (lab1));
gimplify_assign (mem2, v, this_stmt_list); gimplify_assign (mem2, v, this_stmt_list);
} }
else if (predicate
&& ctx->combined_into_simd_safelen1
&& OMP_CLAUSE_CODE (c) == OMP_CLAUSE_LASTPRIVATE
&& OMP_CLAUSE_LASTPRIVATE_CONDITIONAL (c)
&& ctx->lastprivate_conditional_map)
this_stmt_list = &post_stmt_list;
if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_LASTPRIVATE if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_LASTPRIVATE
|| (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_LINEAR || (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_LINEAR
...@@ -6274,6 +6281,7 @@ lower_lastprivate_clauses (tree clauses, tree predicate, gimple_seq *body_p, ...@@ -6274,6 +6281,7 @@ lower_lastprivate_clauses (tree clauses, tree predicate, gimple_seq *body_p,
if (label) if (label)
gimple_seq_add_stmt (stmt_list, gimple_build_label (label)); gimple_seq_add_stmt (stmt_list, gimple_build_label (label));
gimple_seq_add_seq (stmt_list, post_stmt_list);
} }
/* Lower the OpenACC reductions of CLAUSES for compute axis LEVEL /* Lower the OpenACC reductions of CLAUSES for compute axis LEVEL
...@@ -12412,7 +12420,7 @@ lower_omp_1 (gimple_stmt_iterator *gsi_p, omp_context *ctx) ...@@ -12412,7 +12420,7 @@ lower_omp_1 (gimple_stmt_iterator *gsi_p, omp_context *ctx)
if (tree *v = up->lastprivate_conditional_map->get (lhs)) if (tree *v = up->lastprivate_conditional_map->get (lhs))
{ {
tree clauses; tree clauses;
if (up->combined_into_simd_safelen0) if (up->combined_into_simd_safelen1)
up = up->outer; up = up->outer;
if (gimple_code (up->stmt) == GIMPLE_OMP_FOR) if (gimple_code (up->stmt) == GIMPLE_OMP_FOR)
clauses = gimple_omp_for_clauses (up->stmt); clauses = gimple_omp_for_clauses (up->stmt);
......
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