aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-nested.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2014-04-24 23:17:32 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2014-04-24 23:17:32 +0200
commitf7468577f88cbfe33e0a5e9a2104a32f7e45c44f (patch)
tree58c72224fbdd8cfd29b26acb0ed228ad9bf56b58 /gcc/tree-nested.c
parent2f7ac5ce576962dc7610d8cb3e0b107b05d77bbf (diff)
downloadgcc-f7468577f88cbfe33e0a5e9a2104a32f7e45c44f.zip
gcc-f7468577f88cbfe33e0a5e9a2104a32f7e45c44f.tar.gz
gcc-f7468577f88cbfe33e0a5e9a2104a32f7e45c44f.tar.bz2
tree.h (OMP_CLAUSE_LINEAR_GIMPLE_SEQ): Define.
* tree.h (OMP_CLAUSE_LINEAR_GIMPLE_SEQ): Define. * gimplify.c (omp_is_private): Change last argument's type to int. Only diagnose lastprivate if the simd argument is 1, only diagnose linear if the simd argument is 2. (gimplify_omp_for): Adjust omp_is_private callers. When adding lastprivate or private, add the clause to OMP_FOR_CLAUSES. Pass GOVD_EXPLICIT to omp_add_variable. For simd with collapse == 1 create OMP_CLAUSE_LINEAR rather than OMP_CLAUSE_PRIVATE for var. If var != decl and decl is in OMP_CLAUSE_LINEAR, gimplify decl increment to OMP_CLAUSE_LINEAR_GIMPLE_SEQ. * omp-low.c (scan_sharing_clauses, lower_lastprivate_clauses): Handle OMP_CLAUSE_LINEAR_GIMPLE_SEQ. * tree-nested.c (convert_nonlocal_omp_clauses, convert_local_omp_clauses): Handle OMP_CLAUSE_LINEAR. * testsuite/libgomp.c/simd-7.c: New test. * testsuite/libgomp.c/simd-8.c: New test. * testsuite/libgomp.c/simd-9.c: New test. * testsuite/libgomp.c/loop-16.c: New test. From-SVN: r209760
Diffstat (limited to 'gcc/tree-nested.c')
-rw-r--r--gcc/tree-nested.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/tree-nested.c b/gcc/tree-nested.c
index df6923f..9c175de 100644
--- a/gcc/tree-nested.c
+++ b/gcc/tree-nested.c
@@ -1082,6 +1082,11 @@ convert_nonlocal_omp_clauses (tree *pclauses, struct walk_stmt_info *wi)
need_stmts = true;
goto do_decl_clause;
+ case OMP_CLAUSE_LINEAR:
+ if (OMP_CLAUSE_LINEAR_GIMPLE_SEQ (clause))
+ need_stmts = true;
+ goto do_decl_clause;
+
case OMP_CLAUSE_PRIVATE:
case OMP_CLAUSE_FIRSTPRIVATE:
case OMP_CLAUSE_COPYPRIVATE:
@@ -1157,6 +1162,12 @@ convert_nonlocal_omp_clauses (tree *pclauses, struct walk_stmt_info *wi)
&OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (clause));
break;
+ case OMP_CLAUSE_LINEAR:
+ walk_body (convert_nonlocal_reference_stmt,
+ convert_nonlocal_reference_op, info,
+ &OMP_CLAUSE_LINEAR_GIMPLE_SEQ (clause));
+ break;
+
default:
break;
}
@@ -1605,6 +1616,11 @@ convert_local_omp_clauses (tree *pclauses, struct walk_stmt_info *wi)
need_stmts = true;
goto do_decl_clause;
+ case OMP_CLAUSE_LINEAR:
+ if (OMP_CLAUSE_LINEAR_GIMPLE_SEQ (clause))
+ need_stmts = true;
+ goto do_decl_clause;
+
case OMP_CLAUSE_PRIVATE:
case OMP_CLAUSE_FIRSTPRIVATE:
case OMP_CLAUSE_COPYPRIVATE:
@@ -1685,6 +1701,12 @@ convert_local_omp_clauses (tree *pclauses, struct walk_stmt_info *wi)
&OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (clause));
break;
+ case OMP_CLAUSE_LINEAR:
+ walk_body (convert_local_reference_stmt,
+ convert_local_reference_op, info,
+ &OMP_CLAUSE_LINEAR_GIMPLE_SEQ (clause));
+ break;
+
default:
break;
}