This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] remove cilk-plus
On Thu, Nov 30, 2017 at 06:25:24PM +0100, Jakub Jelinek wrote:
> grep finds actually tons of further stuff:
Here is what I'm bootstrapping/regtesting and will commit if
it succeeds as obvious:
2017-12-01 Jakub Jelinek <jakub@redhat.com>
* function.h (struct function): Remove cilk_frame_decl,
is_cilk_function and calls_cilk_spawn fields.
* tree-inline.h (struct copy_body_data): Remove remap_var_for_cilk
field.
* omp-simd-clone.c (simd_clone_clauses_extract): Don't clear
cilk_elemental field.
* cgraph.h (struct cgraph_simd_clone): Remove cilk_elemental field.
* target.def: Adjust comment.
c-family/
* c-attribs.c (c_common_attribute_table): Remove "cilk simd function"
attribute.
(handle_simd_attribute): Don't check for "cilk simd function"
attribute. Reindent, formatting changes.
cp/
* parser.c (cp_parser_new): Don't clear cilk_simd_fn_info.
(parsing_nsdmi): Adjust comment.
(cp_parser_omp_for_loop_init): Likewise.
* parser.h (struct cp_omp_declare_simd_data): Adjust comment.
(struct cp_parser): Remove cilk_simd_fn_info field.
* cp-tree.h (cilk_valid_spawn): Remove.
--- gcc/function.h.jj 2017-11-23 21:13:30.000000000 +0100
+++ gcc/function.h 2017-12-01 00:20:33.409466054 +0100
@@ -262,9 +262,6 @@ struct GTY(()) function {
/* Vector of function local variables, functions, types and constants. */
vec<tree, va_gc> *local_decls;
- /* In a Cilk function, the VAR_DECL for the frame descriptor. */
- tree cilk_frame_decl;
-
/* For md files. */
/* tm.h can use this to store whatever it likes. */
@@ -323,12 +320,6 @@ struct GTY(()) function {
either as a subroutine or builtin. */
unsigned int calls_alloca : 1;
- /* This will indicate whether a function is a cilk function */
- unsigned int is_cilk_function : 1;
-
- /* Nonzero if this is a Cilk function that spawns. */
- unsigned int calls_cilk_spawn : 1;
-
/* Nonzero if function being compiled receives nonlocal gotos
from nested functions. */
unsigned int has_nonlocal_label : 1;
--- gcc/tree-inline.h.jj 2017-03-29 07:11:22.000000000 +0200
+++ gcc/tree-inline.h 2017-12-01 00:23:07.319590773 +0100
@@ -149,10 +149,6 @@ struct copy_body_data
when inlining a call within an OpenMP SIMD-on-SIMT loop. */
vec<tree> *dst_simt_vars;
- /* Cilk keywords currently need to replace some variables that
- ordinary nested functions do not. */
- bool remap_var_for_cilk;
-
/* Do not create new declarations when within type remapping. */
bool prevent_decl_creation_for_types;
};
--- gcc/omp-simd-clone.c.jj 2017-11-28 12:11:41.000000000 +0100
+++ gcc/omp-simd-clone.c 2017-12-01 00:21:03.865102032 +0100
@@ -116,7 +116,6 @@ simd_clone_clauses_extract (struct cgrap
clone which will require a mask argument. */
struct cgraph_simd_clone *clone_info = simd_clone_struct_alloc (n + 1);
clone_info->nargs = n;
- clone_info->cilk_elemental = false;
if (!clauses)
goto out;
--- gcc/cgraph.h.jj 2017-11-14 09:06:48.000000000 +0100
+++ gcc/cgraph.h 2017-12-01 00:19:38.668120351 +0100
@@ -823,9 +823,6 @@ struct GTY(()) cgraph_simd_clone {
otherwise false. */
unsigned int inbranch : 1;
- /* True if this is a Cilk Plus variant. */
- unsigned int cilk_elemental : 1;
-
/* Doubly linked list of SIMD clones. */
cgraph_node *prev_clone, *next_clone;
--- gcc/target.def.jj 2017-11-22 21:37:46.000000000 +0100
+++ gcc/target.def 2017-12-01 00:21:55.114475498 +0100
@@ -1637,7 +1637,7 @@ void, (rtx_insn *insn, int max_pri, int
HOOK_VECTOR_END (sched)
-/* Functions relating to OpenMP and Cilk Plus SIMD clones. */
+/* Functions relating to OpenMP SIMD and __attribute__((simd)) clones. */
#undef HOOK_PREFIX
#define HOOK_PREFIX "TARGET_SIMD_CLONE_"
HOOK_VECTOR (TARGET_SIMD_CLONE, simd_clone)
--- gcc/c-family/c-attribs.c.jj 2017-10-20 16:02:57.000000000 +0200
+++ gcc/c-family/c-attribs.c 2017-12-01 00:25:51.513578913 +0100
@@ -343,8 +343,6 @@ const struct attribute_spec c_common_att
handle_returns_nonnull_attribute, false },
{ "omp declare simd", 0, -1, true, false, false,
handle_omp_declare_simd_attribute, false },
- { "cilk simd function", 0, -1, true, false, false,
- handle_omp_declare_simd_attribute, false },
{ "simd", 0, 1, true, false, false,
handle_simd_attribute, false },
{ "omp declare target", 0, 0, true, false, false,
@@ -2435,50 +2433,37 @@ handle_simd_attribute (tree *node, tree
{
if (TREE_CODE (*node) == FUNCTION_DECL)
{
- if (lookup_attribute ("cilk simd function",
- DECL_ATTRIBUTES (*node)) != NULL)
+ tree t = get_identifier ("omp declare simd");
+ tree attr = NULL_TREE;
+ if (args)
{
- error_at (DECL_SOURCE_LOCATION (*node),
- "%<__simd__%> attribute cannot be used in the same "
- "function marked as a Cilk Plus SIMD-enabled function");
- *no_add_attrs = true;
- }
- else
- {
- tree t = get_identifier ("omp declare simd");
- tree attr = NULL_TREE;
- if (args)
- {
- tree id = TREE_VALUE (args);
+ tree id = TREE_VALUE (args);
- if (TREE_CODE (id) != STRING_CST)
- {
- error ("attribute %qE argument not a string", name);
- *no_add_attrs = true;
- return NULL_TREE;
- }
-
- if (strcmp (TREE_STRING_POINTER (id), "notinbranch") == 0)
- attr = build_omp_clause (DECL_SOURCE_LOCATION (*node),
- OMP_CLAUSE_NOTINBRANCH);
- else
- if (strcmp (TREE_STRING_POINTER (id), "inbranch") == 0)
- attr = build_omp_clause (DECL_SOURCE_LOCATION (*node),
- OMP_CLAUSE_INBRANCH);
- else
- {
- error ("only %<inbranch%> and %<notinbranch%> flags are "
- "allowed for %<__simd__%> attribute");
- *no_add_attrs = true;
- return NULL_TREE;
- }
+ if (TREE_CODE (id) != STRING_CST)
+ {
+ error ("attribute %qE argument not a string", name);
+ *no_add_attrs = true;
+ return NULL_TREE;
}
- DECL_ATTRIBUTES (*node) = tree_cons (t,
- build_tree_list (NULL_TREE,
- attr),
- DECL_ATTRIBUTES (*node));
+ if (strcmp (TREE_STRING_POINTER (id), "notinbranch") == 0)
+ attr = build_omp_clause (DECL_SOURCE_LOCATION (*node),
+ OMP_CLAUSE_NOTINBRANCH);
+ else if (strcmp (TREE_STRING_POINTER (id), "inbranch") == 0)
+ attr = build_omp_clause (DECL_SOURCE_LOCATION (*node),
+ OMP_CLAUSE_INBRANCH);
+ else
+ {
+ error ("only %<inbranch%> and %<notinbranch%> flags are "
+ "allowed for %<__simd__%> attribute");
+ *no_add_attrs = true;
+ return NULL_TREE;
+ }
}
+
+ DECL_ATTRIBUTES (*node)
+ = tree_cons (t, build_tree_list (NULL_TREE, attr),
+ DECL_ATTRIBUTES (*node));
}
else
{
--- gcc/cp/parser.c.jj 2017-11-30 23:45:44.000000000 +0100
+++ gcc/cp/parser.c 2017-12-01 00:29:35.547850825 +0100
@@ -3915,7 +3915,6 @@ cp_parser_new (void)
/* Special parsing data structures. */
parser->omp_declare_simd = NULL;
- parser->cilk_simd_fn_info = NULL;
parser->oacc_routine = NULL;
/* Not declaring an implicit function template. */
@@ -20675,8 +20674,7 @@ parsing_nsdmi (void)
Returns the type indicated by the type-id.
In addition to this, parse any queued up #pragma omp declare simd
- clauses, Cilk Plus SIMD-enabled functions' vector attributes, and
- #pragma acc routine clauses.
+ clauses, and #pragma acc routine clauses.
QUALS is either a bitmask of cv_qualifiers or -1 for a non-member
function. */
@@ -34535,8 +34533,7 @@ cp_parser_omp_for_incr (cp_parser *parse
return build2 (MODIFY_EXPR, TREE_TYPE (decl), decl, rhs);
}
-/* Parse the initialization statement of either an OpenMP for loop or
- a Cilk Plus for loop.
+/* Parse the initialization statement of an OpenMP for loop.
Return true if the resulting construct should have an
OMP_CLAUSE_PRIVATE added to it. */
--- gcc/cp/parser.h.jj 2017-11-28 12:11:39.000000000 +0100
+++ gcc/cp/parser.h 2017-12-01 00:30:14.878373559 +0100
@@ -199,8 +199,7 @@ struct GTY (()) cp_parser_context {
};
-/* Helper data structure for parsing #pragma omp declare simd, and Cilk Plus
- SIMD-enabled functions' vector attribute. */
+/* Helper data structure for parsing #pragma omp declare simd. */
struct cp_omp_declare_simd_data {
bool error_seen; /* Set if error has been reported. */
bool fndecl_seen; /* Set if one fn decl/definition has been seen already. */
@@ -369,10 +368,6 @@ struct GTY(()) cp_parser {
helper data structure. */
cp_omp_declare_simd_data * GTY((skip)) omp_declare_simd;
- /* When parsing Cilk Plus SIMD-enabled functions' vector attributes,
- this is a pointer to a helper data structure. */
- cp_omp_declare_simd_data * GTY((skip)) cilk_simd_fn_info;
-
/* When parsing #pragma acc routine, this is a pointer to a helper data
structure. */
cp_oacc_routine_data * GTY((skip)) oacc_routine;
--- gcc/cp/cp-tree.h.jj 2017-11-28 22:23:34.000000000 +0100
+++ gcc/cp/cp-tree.h 2017-12-01 00:28:35.447580126 +0100
@@ -7402,9 +7402,6 @@ extern vec<tree> cx_error_context
extern tree fold_sizeof_expr (tree);
extern void clear_cv_and_fold_caches (void);
-/* In c-family/cilk.c */
-extern bool cilk_valid_spawn (tree);
-
/* In cp-ubsan.c */
extern void cp_ubsan_maybe_instrument_member_call (tree);
extern void cp_ubsan_instrument_member_accesses (tree *);
Jakub