diff options
Diffstat (limited to 'gcc/omp-low.c')
-rw-r--r-- | gcc/omp-low.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/gcc/omp-low.c b/gcc/omp-low.c index 3a3d09c..04fc5f6 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -3783,6 +3783,7 @@ lower_rec_input_clauses (tree clauses, gimple_seq *ilist, gimple_seq *dlist, tree simt_lane = NULL_TREE, simtrec = NULL_TREE; tree ivar = NULL_TREE, lvar = NULL_TREE, uid = NULL_TREE; gimple_seq llist[3] = { }; + tree nonconst_simd_if = NULL_TREE; copyin_seq = NULL; sctx.is_simt = is_simd && omp_find_clause (clauses, OMP_CLAUSE__SIMT_); @@ -3814,6 +3815,8 @@ lower_rec_input_clauses (tree clauses, gimple_seq *ilist, gimple_seq *dlist, case OMP_CLAUSE_IF: if (integer_zerop (OMP_CLAUSE_IF_EXPR (c))) sctx.max_vf = 1; + else if (TREE_CODE (OMP_CLAUSE_IF_EXPR (c)) != INTEGER_CST) + nonconst_simd_if = OMP_CLAUSE_IF_EXPR (c); break; case OMP_CLAUSE_SIMDLEN: if (integer_onep (OMP_CLAUSE_SIMDLEN_EXPR (c))) @@ -5190,6 +5193,17 @@ lower_rec_input_clauses (tree clauses, gimple_seq *ilist, gimple_seq *dlist, if (known_eq (sctx.max_vf, 1U)) sctx.is_simt = false; + if (nonconst_simd_if) + { + if (sctx.lane == NULL_TREE) + { + sctx.idx = create_tmp_var (unsigned_type_node); + sctx.lane = create_tmp_var (unsigned_type_node); + } + /* FIXME: For now. */ + sctx.is_simt = false; + } + if (sctx.lane || sctx.is_simt) { uid = create_tmp_var (ptr_type_node, "simduid"); @@ -5219,8 +5233,9 @@ lower_rec_input_clauses (tree clauses, gimple_seq *ilist, gimple_seq *dlist, } if (sctx.lane) { - gimple *g - = gimple_build_call_internal (IFN_GOMP_SIMD_LANE, 1, uid); + gimple *g = gimple_build_call_internal (IFN_GOMP_SIMD_LANE, + 1 + (nonconst_simd_if != NULL), + uid, nonconst_simd_if); gimple_call_set_lhs (g, sctx.lane); gimple_stmt_iterator gsi = gsi_start_1 (gimple_omp_body_ptr (ctx->stmt)); gsi_insert_before_without_update (&gsi, g, GSI_SAME_STMT); |