Added support for Cilk Plus SIMD-enabled function for C.
commit74acc7033622011364c71b05078fa77399065913
authorbviyer <bviyer@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 18 Dec 2013 19:00:21 +0000 (18 19:00 +0000)
committerbviyer <bviyer@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 18 Dec 2013 19:00:21 +0000 (18 19:00 +0000)
treeba7d0bcea3d0e1e595579b1bf0fa901020c0989d
parent4cca655bbb846bb4395a7e3f5a0631e22881d1dc
Added support for Cilk Plus SIMD-enabled function for C.
+++ gcc/ChangeLog
+2013-12-18  Balaji V. Iyer  <balaji.v.iyer@intel.com>
+
+       * omp-low.c (simd_clone_clauses_extract): Replaced the string
+       "cilk simd elemental" with "cilk simd function."
+       * config/i386/i386.c (ix86_simd_clone_compute_vecsize_and_simdlen):
+       Removed a carriage-return from a warning string.
+
+++ gcc/c-family/ChangeLog
+2013-12-18  Balaji V. Iyer  <balaji.v.iyer@intel.com>
+
+       * c-common.c (c_common_attribute_table): Added "cilk simd function"
+       attribute.
+       * c-pragma.h (enum pragma_cilk_clause): Remove.
+       (enum pragma_omp_clause):  Added the following fields:
+       PRAGMA_CILK_CLAUSE_NOMASK, PRAGMA_CILK_CLAUSE_MASK,
+       PRAGMA_CILK_CLAUSE_VECTORLENGTH, PRAGMA_CILK_CLAUSE_NONE,
+       PRAGMA_CILK_CLAUSE_LINEAR, PRAGMA_CILK_CLAUSE_PRIVATE,
+       PRAGMA_CILK_CLAUSE_FIRSTPRIVATE, PRAGMA_CILK_CLAUSE_LASTPRIVATE,
+       PRAGMA_CILK_CLAUSE_UNIFORM.
+
+

+++ gcc/c/ChangeLog
+2013-12-18  Balaji V. Iyer  <balaji.v.iyer@intel.com>
+
+       * c-parser.c (struct c_parser::cilk_simd_fn_tokens): Added new field.
+       (c_parser_declaration_or_fndef): Added a check if cilk_simd_fn_tokens
+       field in parser is not empty.  If not-empty, call the function
+       c_parser_finish_omp_declare_simd.
+       (c_parser_cilk_clause_vectorlength): Modified function to be shared
+       between SIMD-enabled functions and #pragma simd.  Added new parameter.
+       (c_parser_cilk_all_clauses): Modified the usage of the function
+       c_parser_cilk_clause_vectorlength as mentioned above.
+       (c_parser_cilk_simd_fn_vector_attrs): New function.
+       (c_finish_cilk_simd_fn_tokens): Likewise.
+       (is_cilkplus_vector_p): Likewise.
+       (c_parser_omp_clause_name): Added checking for "vectorlength,"
+       "nomask," and "mask" strings in clause name.
+       (c_parser_omp_all_clauses): Added 3 new case statements:
+       PRAGMA_CILK_CLAUSE_VECTORLENGTH, PRAGMA_CILK_CLAUSE_MASK and
+       PRAGMA_CILK_CLAUSE_NOMASK.
+       (c_parser_attributes): Added a cilk_simd_fn_tokens parameter.  Added a
+       check for vector attribute and if so call the function
+       c_parser_cilk_simd_fn_vector_attrs.  Also, when Cilk plus is enabled,
+       called the function c_finish_cilk_simd_fn_tokens.
+       (c_finish_omp_declare_simd): Added a check if cilk_simd_fn_tokens
in
+       parser field is non-empty.  If so, parse them as you would parse
+       the omp declare simd pragma.
+       (c_parser_omp_clause_linear): Added a new bool parm. is_cilk_simd_fn.
+       Added a check when step is a parameter and flag it as error.
+       (CILK_SIMD_FN_CLAUSE_MASK): New #define.
+       (c_parser_cilk_clause_name): Changed pragma_cilk_clause to
+       pragma_omp_clause.
+

+++ gcc/testsuite/ChangeLog
+2013-12-18  Balaji V. Iyer  <balaji.v.iyer@intel.com>
+
+       * c-c++-common/cilk-plus/SE/ef_test.c: New test.
+       * c-c++-common/cilk-plus/SE/ef_test2.c: Likewise.
+       * c-c++-common/cilk-plus/SE/vlength_errors.c: Likewise.
+       * c-c++-common/cilk-plus/SE/ef_error.c: Likewise.
+       * c-c++-common/cilk-plus/SE/ef_error2.c: Likewise.
+       * c-c++-common/cilk-plus/SE/ef_error3.c: Likewise.
+       * gcc.dg/cilk-plus/cilk-plus.exp: Added calls for the above tests.
+

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206095 138bc75d-0d04-0410-961f-82ee72b054a4
17 files changed:
gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/c-family/c-pragma.h
gcc/c/ChangeLog
gcc/c/c-parser.c
gcc/config/i386/i386.c
gcc/cp/parser.c
gcc/omp-low.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/cilk-plus/SE/ef_error.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/cilk-plus/SE/ef_error2.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/cilk-plus/SE/ef_error3.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/cilk-plus/SE/ef_test.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/cilk-plus/SE/ef_test2.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/cilk-plus/SE/vlength_errors.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/cilk-plus/cilk-plus.exp