@@ -26,67 +26,65 @@
2011-08-08 Balaji V. Iyer <balaji.v.iyer@intel.com>
- * c-parser.c (c_parse_init): Added if statement to check if flag_enable_cilk is
- turned off. If so, then or D_CILK mask with mask.
+ * c-parser.c (c_parse_init): Added if statement to check if
+ flag_enable_cilk is turned off. If so, then or D_CILK mask with mask.
(c_parser_cilk_for_statement): Added new function
- (c_parser_cilk_grainsize): Added new function
- (c_parser_simd_linear): Added new function
- (c_parser_simd_private): Added new function
- (c_parser_simd_assert): Added new function
- (c_parser_simd_vectorlength): Added new function
- (c_parser_simd_reduction): Added new function
+ (c_parser_cilk_grainsize): Likewise.
+ (c_parser_simd_linear): Likewise.
+ (c_parser_simd_private): Likewise.
+ (c_parser_simd_assert): Likewise.
+ (c_parser_simd_vectorlength): Likewise.
+ (c_parser_simd_reduction): Likewise.
(c_parser_statement_after_labels): Added new case labels to handle
RID_CILK_FOR and RID_CILK_SYNC.
- * c-typeck.c (c_finish_bc_stmt): Added "case 2" to check to see if there
- are break statements inside a cilk_for loop
- (c_finish_cilk_loop): Added new function
- (c_build_sync): Added new function
- (c_calls_spawns): Added new function
+ * c-typeck.c (c_finish_bc_stmt): Added "case 2" to check to see if
+ there are break statements inside a cilk_for loop.
+ (c_finish_cilk_loop): Added new function.
+ (c_build_sync): Likewise.
+ (c_calls_spawns): Likewise.
* cilk.c: New file.
- * cilk.h: New file.
- * cilk-spawn.c: New file.
- * function.h (struct GTY(()) function): Added "cilk_frame_decl" and
+ * cilk.h: Likewise.
+ * cilk-spawn.c: Likewise.
+ * function.h (struct GTY(()) function): Added "cilk_frame_decl" and
"is_cilk_function" elements into this structure.
- * gimplify.c (gimplify_call_expr): Added code to check if (is_detach) is set.
- If so, then output the appropriate code for detach expression. Also, output
- appropriate code for pop_frame operation.
- (gimplify_expr): Check if a valid found is encountered. If found,
+ * gimplify.c (gimplify_call_expr): Added code to check if (is_detach)
+ is set. If so, then output the appropriate code for detach expression.
+ Also, output appropriate code for pop_frame operation.
+ (gimplify_expr): Check if a valid found is encountered. If found,
then do "cilk_gimplify_spawn" on the expression.
- (gimplify_expr): Added case statements for CILK_FOR_STMT and
- SYNC_STMT.
+ (gimplify_expr): Added case statements for CILK_FOR_STMT and
+ SYNC_STMT.
* Make-lang.in: Added the newly added files into the compiliation list.
* Makefile.in: Added cilk files to compile with the gcc files.
* pragma_simd.c: New file.
* passes.c(init_optimization_passes): Added NEXT_PASS(pass_expand_cilk)
- * tree-pretty-print.c (dump_generic_node): Added a new case statement SYNC_STMT,
- CILK_FOR_STMT, to print a cilk_for and sync statement.
- * tree.h (struct GTY(()) tree base): Added "is_cilk_spawn" element into
+ * tree-pretty-print.c (dump_generic_node): Added a new case statement
+ SYNC_STMT, CILK_FOR_STMT, to print a cilk_for and sync statement.
+ * tree.h (struct GTY(()) tree base): Added "is_cilk_spawn" element into
structure. Also added "pragma_simd_index" element into this structure.
(SPAWN_CALL_P, SPAWN_DETACH_POINT, DECL_DETACHES_P, DECL_SET_KNOT):
- New defines
+ New defines.
(CILK_KNOT_NONE, CILK_KNOT_SPAWN, CILK_KNOT_SYNC, CILK_KNOT_FLUSH):
- New defines
- (struct GTY(()) tree_function_decl): Added "cilk_knot_type" and
- "cilk_hyper_flag" into this structure
- (FOR_STMT_CHECK2): Added new define to check if it is for or cilk_for
- (FOR_INIT_STMT, FOR_COND, FOR_EXPR, FOR_BODY): New defines
- (CILK_FOR_VAR, CILK_FOR_INIT, CILK_FOR_GRAIN): New defines
- (INVALID_PRAGMA_SIMD_SLOT): New define
- (enum pragma_simd_kind) : Newly added enum to hold different pragma simd
- clauses
+ Likewise.
+ (struct GTY(()) tree_function_decl): Added "cilk_knot_type" and
+ "cilk_hyper_flag" into this structure.
+ (FOR_STMT_CHECK2): Added new define to check if it is for or cilk_for.
+ (FOR_INIT_STMT, FOR_COND, FOR_EXPR, FOR_BODY): New defines.
+ (CILK_FOR_VAR, CILK_FOR_INIT, CILK_FOR_GRAIN): Likewise.
+ (INVALID_PRAGMA_SIMD_SLOT): Likewise.
+ (enum pragma_simd_kind) : Newly added enum to hold different pragma
+ simd clauses.
(struct reduction values): New structure to hold #pragma simd reduction
- information
- (struct pragma_simd_values): Structure to hold pragma simd clause
- values
- (PRAGMA_SIMD_INDEX): New define
- (LABEL_EXPR_PRAGMA_SIMD_INDEX): New define
- (struct GTY(()) tree_label_decl): Added new variable "pragma_simd_index"
- * tree-inline.c (struct copy_body_data): Added remap_var_for_cilk variable
- * tree-vect-loop.c (vect_determine_vectorization_factor): Added if
- statements in multiple locations to check if flag enable cilk is enabled
- and if pragma simd assert is requested. If so, then print appropriate
- error message.
- (vect_determine_vectorization_factor): Added if statements
- in multiple locations to check if flag_enable_cilk is enabled and if the
- vectorlength constraint is not met. If so, then print an appropriate error
- message.
+ information.
+ (struct pragma_simd_values): Structure to hold pragma simd clause
+ values.
+ (PRAGMA_SIMD_INDEX): New define.
+ (LABEL_EXPR_PRAGMA_SIMD_INDEX): Likewise.
+ (struct GTY(()) tree_label_decl): Added new variable
+ "pragma_simd_index"
+ * tree-inline.c (struct copy_body_data): Added remap_var_for_cilk
+ variable.
+ * tree-vect-loop.c (vect_determine_vectorization_factor): Added if
+ statements in multiple locations to check if flag enable cilk is
+ enabled and if pragma simd assert is requested. If so, then print
+ appropriate error message.
@@ -785,13 +785,13 @@ DEF_BUILTIN_STUB (BUILT_IN_EH_FILTER, "__builtin_eh_filter")
DEF_BUILTIN_STUB (BUILT_IN_EH_COPY_VALUES, "__builtin_eh_copy_values")
/* Cilk */
-DEF_BUILTIN_STUB(BUILT_IN_CILK_WORKER_ID, "__cilkrts_current_worker_id")
-DEF_BUILTIN_STUB(BUILT_IN_CILK_WORKER_PTR, "__cilkrts_current_worker")
-DEF_BUILTIN_STUB(BUILT_IN_CILK_DETACH, "__cilkrts_detach")
-DEF_BUILTIN_STUB(BUILT_IN_CILK_SYNCHED, "__cilkrts_synched")
-DEF_BUILTIN_STUB(BUILT_IN_CILK_STOLEN, "__cilkrts_was_stolen")
-DEF_BUILTIN_STUB(BUILT_IN_CILK_ENTER_FRAME, "__cilkrts_enter_frame")
-DEF_BUILTIN_STUB(BUILT_IN_CILK_POP_FRAME, "__cilkrts_pop_frame")
+DEF_BUILTIN_STUB (BUILT_IN_CILK_WORKER_ID, "__cilkrts_current_worker_id")
+DEF_BUILTIN_STUB (BUILT_IN_CILK_WORKER_PTR, "__cilkrts_current_worker")
+DEF_BUILTIN_STUB (BUILT_IN_CILK_DETACH, "__cilkrts_detach")
+DEF_BUILTIN_STUB (BUILT_IN_CILK_SYNCHED, "__cilkrts_synched")
+DEF_BUILTIN_STUB (BUILT_IN_CILK_STOLEN, "__cilkrts_was_stolen")
+DEF_BUILTIN_STUB (BUILT_IN_CILK_ENTER_FRAME, "__cilkrts_enter_frame")
+DEF_BUILTIN_STUB (BUILT_IN_CILK_POP_FRAME, "__cilkrts_pop_frame")
/* Synchronization Primitives. */
#include "sync-builtins.def"
@@ -1,11 +1,11 @@
2011-08-08 Balaji V. Iyer <balaji.v.iyer@intel.com>
- * c-common.c (c_common_reswords[]): Added "cilk_for", "cilk_spawn"
+ * c-common.c (c_common_reswords[]): Added "cilk_for", "cilk_spawn"
and "cilk_sync" keywords.]
(c_common_init_ts): Added MARK_TS_TYPED(CILK_FOR_STMT)
(c_define_builtins): Called the function "cilk_init_builtins()"
- * c.opt: Added support for flag_enable_cilk(fcilk), fcilk_builtin and
+ * c.opt: Added support for flag_enable_cilk(fcilk), fcilk_builtin and
started adding support for Cilkscreen
- * c-pragmas.c (init_pragma): if flag_enable_cilk is turned on and
+ * c-pragmas.c (init_pragma): if flag_enable_cilk is turned on and
preprocess only is off, tthen we call cpp_register_deferred pragmas on
- pragma cilk gransize, pragma simd assert, noasssert, vectorlength,
+ pragma cilk gransize, pragma simd assert, noasssert, vectorlength,
private, linear and reduction.
@@ -10937,8 +10937,8 @@ c_finish_cilk_loop (location_t start_locus ATTRIBUTE_UNUSED, tree cvar,
tree init;
tree c_tree;
- if ((cvar == error_mark_node) || (cond == error_mark_node) ||
- (incr == error_mark_node) || (body == error_mark_node))
+ if (cvar == error_mark_node || cond == error_mark_node
+ || incr == error_mark_node || body == error_mark_node)
return;
if (!cond)
@@ -2477,7 +2477,7 @@ gimplify_cilk_for_2 (struct cilk_for_desc *cfd,
tree grain = NULL_TREE;
- if (POINTER_TYPE_P(TREE_TYPE(var)))
+ if (POINTER_TYPE_P (TREE_TYPE (var)))
{
extract_free_variables (cfd->lower_bound, &cfd->wd, ADD_WRITE);
}
@@ -2695,10 +2695,10 @@ gimplify_cilk_for_1 (struct cilk_for_desc *cfd,
if (cfd->grain == NULL_TREE)
{
- grain = get_formal_tmp_var (build_int_cst(cfd->count_type, 0), pre_p);
+ grain = get_formal_tmp_var (build_int_cst (cfd->count_type, 0), pre_p);
}
- else if (TYPE_MAIN_VARIANT(TREE_TYPE(cfd->grain)) !=
- TYPE_MAIN_VARIANT(cfd->count_type))
+ else if (TYPE_MAIN_VARIANT (TREE_TYPE (cfd->grain)) !=
+ TYPE_MAIN_VARIANT (cfd->count_type))
{
grain = convert (cfd->count_type, cfd->grain);
}
@@ -485,11 +485,11 @@ expand_builtin_cilk_enter (tree exp)
w->current <- self
*/
x = arrow (fptr, CILK_TI_FRAME_FLAGS, false);
- mem = expand_expr (x, NULL_RTX,
- TYPE_MODE (TREE_TYPE (cilk_trees[CILK_TI_FRAME_FLAGS])),
+ mem = expand_expr
+ (x, NULL_RTX, TYPE_MODE (TREE_TYPE (cilk_trees[CILK_TI_FRAME_FLAGS])),
EXPAND_WRITE);
- emit_move_insn (mem,
- GEN_INT (cfun->always_detaches ? CILK_FRAME_DETACHED : 0));
+ emit_move_insn
+ (mem, GEN_INT (cfun->always_detaches ? CILK_FRAME_DETACHED : 0));
return const0_rtx;
}
return NULL_RTX;
@@ -163,7 +163,6 @@ extern void cilk_init_frame (tree frame);
the current frame. */
extern rtx allocate_cilk_dynamic (rtx target, rtx size);
-
/* Like build_stack_save_restore, but handles Cilk dynamic frame
extensions instead of updating the stack pointer. */
extern void build_stack_save_restore_cilk (tree *save, tree *restore);
@@ -15,33 +15,32 @@
2011-08-08 Balaji V. Iyer <balaji.v.iyer@intel.com>
* call.c: Added #include "cilk.h"
- (build_over_call, build_call_n, build_call_a,
- build_new_function_call, build_op_call_1, build_op_call,
+ (build_over_call, build_call_n, build_call_a,
+ build_new_function_call, build_op_call_1, build_op_call,
build_over_call, build_cxx_call, build_special_member_call,
build_new_method_call_1, build_new_method_call): Added a new parameter
called "enum call_context" to pass in whether it is a spawned function
or not.
* cilk.c: Added new file.
- * cp-gimpify.c (cp_gimplify_expr): Added CILK_FOR_STMT, and
+ * cp-gimpify.c (cp_gimplify_expr): Added CILK_FOR_STMT, and
SPAWN_STMT case statements.
* cp-tree.def: Added "CILK_FOR_STMT"
(lang_name_cilk): New define
- (CILK_FOR_VAR, CILK_FOR_INIT, CILK_FOR_GRAIN): New defines
- (FOR_INIT_STMT, FOR_COND, FOR_EXPR,FOR_BODY, FOR_SCOPE):
- New defines
- (SF_CILK_NESTED): New define
- (BUILT_IN_CILK_SYNC, BUILT_IN_CILK_FRAME): New defines
- (BUILT_IN_CILK_DISABLE, BUILT_IN_CILK_ENABLE): New defines
- (BUILT_IN_CILK_CLEAN, BUILD_IN_CILK_WRITE): New defines
- (BUILT_IN_CILK_ACQUIRE, BUILT_IN_CILK_RELEASE): New defines
- (BUILT_IN_CILK_WORKER): New defines
+ (CILK_FOR_VAR, CILK_FOR_INIT, CILK_FOR_GRAIN): Likewise.
+ (FOR_INIT_STMT, FOR_COND, FOR_EXPR,FOR_BODY, FOR_SCOPE): Likewise.
+ (SF_CILK_NESTED): Likewise.
+ (BUILT_IN_CILK_SYNC, BUILT_IN_CILK_FRAME): Likewise.
+ (BUILT_IN_CILK_DISABLE, BUILT_IN_CILK_ENABLE): Likewise.
+ (BUILT_IN_CILK_CLEAN, BUILD_IN_CILK_WRITE): Likewise.
+ (BUILT_IN_CILK_ACQUIRE, BUILT_IN_CILK_RELEASE): Likewise.
+ (BUILT_IN_CILK_WORKER): Likewise
(enum call_context): New enum to say the context of the
function call.
- * decl.c (pop_label): Added a if statement to check if flag enable
+ * decl.c (pop_label): Added a if statement to check if flag enable
cilk is turned on. If so, then we exit.
(is_cilk_function_decl): Added new function.
- (duplicate_decls): Added new if statement to see if
- flag_enable_cilk is set and if it is a is_cilk_function_decl. If so
+ (duplicate_decls): Added new if statement to see if
+ flag_enable_cilk is set and if it is a is_cilk_function_decl. If so
then we return newdecl.
(initialize_predefined_identifiers): Added "Cilk+" element.
(finish_function_body): Check if cfun->calls_spawns is set.
@@ -49,40 +48,41 @@
* name-lookup.c (typedef enum scope_kind): Added "sk_cilk_for" and
"sk_cilk_block" type.
* parser.c (cp_parser_cilk_for): Added new function.
- (cp_parser_cilk_for_init_statement): Added new function.
- (cp_parser_cilk_grainsize): Added new function.
- (cp_parser_cilk_for_condition): Added new function.
- (cp_parser_cilk_for_expression_iterator): Added new function.
- (cp_parser_simd_private): Added new function.
- (cp_parser_simd_reduction): Added new function.
- (cp_parser_simd_linear): Added new function.
- (cp_parser_simd_assert): Added new function.
- (cp_parser_simd_vectorlength): Added new function.
+ (cp_parser_cilk_for_init_statement): Likewise.
+ (cp_parser_cilk_grainsize): Likewise.
+ (cp_parser_cilk_for_condition): Likewise.
+ (cp_parser_cilk_for_expression_iterator): Likewise.
+ (cp_parser_simd_private): Likewise.
+ (cp_parser_simd_reduction): Likewise.
+ (cp_parser_simd_linear): Likewise.
+ (cp_parser_simd_assert): Likewise.
+ (cp_parser_simd_vectorlength): Likewise.
(cp_parser_postfix_expression): Added new case statements
"RID_CILK_SPAWN" to handle cilk_spawn
- (cp_parser_statement): Added new case statement
- "RID_CILK_FOR," "RID_CILK_SYNC,"
- (cp_parser_jump_statement): Added new case statement
+ (cp_parser_statement): Added new case statement
+ "RID_CILK_FOR," "RID_CILK_SYNC."
+ (cp_parser_jump_statement): Added new case statement.
IN_CILK_SPAWN and IN_CILK_FOR in multiple places.
(cp_parser_pragma): Added the following case statements:
- PRAGMA_SIMD_ASSERT, PRAGMA_SIMD_NOASSERT, PRAGMA_SIMD_VECTORLENGTH,
+ PRAGMA_SIMD_ASSERT, PRAGMA_SIMD_NOASSERT, PRAGMA_SIMD_VECTORLENGTH,
PRAGMA_SIMD_PRIVATE, PRAGMA_SIMD_LINEAR, PRAGMA_SIMD_REDUCTION.
* pt.c (lookup_template_class_1): Check if the record is cilk or
if the template arguments are of type cilk. If so, set the appropriate
defines.
(tsubst_expr): Added "CILK_FOR_STMT" case statement.
* semantics.c (finish_cilk_for_cond): Added new function.
- (finish_cilk_for_init_stmt): Added new function.
- (begin_cilk_block): Added new function
- (finish_cilk_block): Added new function
- (finish_sync_stmt): Added new function.
- (begin_cilk_for_stmt): Added new function.
- (finish_cilk_for_stmt): Added new function.
- (finish_cilk_for_init_stmt): Added new function.
- (finish_cilk_for_cond): Added new function.
- * Make-lang.in: Added cilk files and functions so that we can compile
- them with the gcc files
- * tree.c (struct attribute_spec cxx_attribute table): Added "cilk" entry
+ (finish_cilk_for_init_stmt): Likewise.
+ (begin_cilk_block): Likewise.
+ (finish_cilk_block): Likewise.
+ (finish_sync_stmt): Likewise.
+ (begin_cilk_for_stmt): Likewise.
+ (finish_cilk_for_stmt): Likewise.
+ (finish_cilk_for_init_stmt): Likewise.
+ (finish_cilk_for_cond): Likewise.
+ * Make-lang.in: Added cilk files and functions so that we can compile
+ them with the gcc files.
+ * tree.c (struct attribute_spec cxx_attribute table): Added "cilk"
+ entry.
(handle_cilk_linkage_attribute): New function.
* typeck.c (cp_build_function_call, cp_build_function_call_nary):
Added a new parameter called "enum call_context" to pass in whether
@@ -160,14 +160,14 @@ enum tls_model cilk_tls_model (tree decl ATTRIBUTE_UNUSED);
* returns true
*/
bool
-is_cilk_function_type(tree fntype ATTRIBUTE_UNUSED)
+is_cilk_function_type (tree fntype ATTRIBUTE_UNUSED)
{
return true;
}
/* This function will check if we are inside a cilk function */
bool
-in_cilk_function(void)
+in_cilk_function (void)
{
if (!current_function_decl)
return false;
@@ -212,7 +212,8 @@ initialize_cilk_for_desc (struct cilk_for_desc *cfd)
/* this function will destroy the function that we allocated in the function
* above
*/
-static void release_cilk_for_desc (struct cilk_for_desc *cfd)
+static void
+release_cilk_for_desc (struct cilk_for_desc *cfd)
{
pointer_map_destroy (cfd->decl_map);
cfd->decl_map = NULL;
@@ -511,23 +512,21 @@ cp_build_cilk_for_body (struct cilk_for_desc *cfd)
if (IDENTIFIER_POINTER (DECL_NAME (outer)))
{
int str_length = strlen (IDENTIFIER_POINTER (DECL_NAME (outer)));
- function_name = (char *)xmalloc(sizeof(char) * (str_length + 1));
- strcpy(function_name, IDENTIFIER_POINTER (DECL_NAME (outer)));
+ function_name = (char *)xmalloc (sizeof (char) * (str_length + 1));
+ strcpy (function_name, IDENTIFIER_POINTER (DECL_NAME (outer)));
}
else
{
- function_name =(char *)xmalloc(sizeof(char) * (strlen("no_name")+1));
- strcpy(function_name, "no_name");
+ function_name =(char *)xmalloc (sizeof (char) * (strlen ("no_name") + 1));
+ strcpy (function_name, "no_name");
}
file_location = expand_location (DECL_SOURCE_LOCATION (outer));
- name = (char *)xcalloc(72, sizeof (char));
+ name = (char *)xcalloc (72, sizeof (char));
- sprintf (name, "cilk_loop_line_%d_%d",
- file_location.line,
- ++counter);
+ sprintf (name, "cilk_loop_line_%d_%d", file_location.line, ++counter);
/* we do this because sometimes there are spaces at the end of the function
* name,This loop will get rid of it
@@ -592,7 +591,7 @@ cp_build_cilk_for_body (struct cilk_for_desc *cfd)
lower_bound = cfd->var;
hack = build_decl (UNKNOWN_LOCATION, VAR_DECL,
- get_identifier("cilk_lower_bound_local_copy"),
+ get_identifier ("cilk_lower_bound_local_copy"),
TREE_TYPE (lower_bound));
DECL_CONTEXT (hack) = DECL_CONTEXT (lower_bound);
@@ -602,7 +601,7 @@ cp_build_cilk_for_body (struct cilk_for_desc *cfd)
}
loop_var = build_decl (UNKNOWN_LOCATION,VAR_DECL, NULL_TREE,
- TREE_TYPE(cfd->min_parm));
+ TREE_TYPE (cfd->min_parm));
DECL_CONTEXT(loop_var) = fndecl;
@@ -615,8 +614,8 @@ cp_build_cilk_for_body (struct cilk_for_desc *cfd)
count_type = cfd->count_type;
- gcc_assert (TYPE_MAIN_VARIANT(TREE_TYPE (loop_var)) ==
- TYPE_MAIN_VARIANT(count_type));
+ gcc_assert (TYPE_MAIN_VARIANT (TREE_TYPE (loop_var)) ==
+ TYPE_MAIN_VARIANT (count_type));
/* The new loop body is
@@ -682,7 +681,7 @@ cp_build_cilk_for_body (struct cilk_for_desc *cfd)
expand_or_defer_fn (fndecl);
- pop_function_context();
+ pop_function_context ();
return fndecl;
@@ -700,8 +699,8 @@ compute_loop_var (struct cilk_for_desc *cfd, tree loop_var, tree lower_bound)
int incr_sign = cfd->incr_sign;
enum tree_code add_op = (incr_sign >= 0) ? PLUS_EXPR : MINUS_EXPR;
- gcc_assert (TYPE_MAIN_VARIANT(TREE_TYPE (loop_var)) ==
- TYPE_MAIN_VARIANT(count_type));
+ gcc_assert (TYPE_MAIN_VARIANT (TREE_TYPE (loop_var)) ==
+ TYPE_MAIN_VARIANT (count_type));
/* Compute an expression to be added or subtracted.
@@ -885,10 +884,10 @@ callable(enum tree_code code, tree op0, tree op1, const char *what, bool cry)
if (code == INIT_EXPR)
{
- VEC(tree,gc) *op1_vec = make_tree_vector_single(op1);
+ VEC(tree,gc) *op1_vec = make_tree_vector_single (op1);
return build_special_member_call(NULL_TREE, complete_ctor_identifier,
&op1_vec,
- TYPE_MAIN_VARIANT(TREE_TYPE(op1)), 0,
+ TYPE_MAIN_VARIANT (TREE_TYPE (op1)), 0,
CALL_NORMAL, tf_warning_or_error);
}
@@ -899,7 +898,7 @@ callable(enum tree_code code, tree op0, tree op1, const char *what, bool cry)
return build_special_member_call(NULL_TREE,
complete_dtor_identifier,
&op1_vec,
- TYPE_MAIN_VARIANT(TREE_TYPE(op1)),
+ TYPE_MAIN_VARIANT (TREE_TYPE (op1)),
0, CALL_NORMAL,
tf_warning_or_error);
}
@@ -910,10 +909,9 @@ callable(enum tree_code code, tree op0, tree op1, const char *what, bool cry)
flags |= LOOKUP_COMPLAIN;
}
- exp = build_new_op(code, flags, op0, op1, NULL_TREE, NULL, 0);
+ exp = build_new_op (code, flags, op0, op1, NULL_TREE, NULL, 0);
- if ((exp != NULL_TREE) &&
- (exp != error_mark_node))
+ if ((exp != NULL_TREE) && (exp != error_mark_node))
{
return exp;
}
@@ -941,18 +939,15 @@ check_limit_record (tree cond, tree var, int *direction)
{
int dir = 0;
- if ((TREE_CODE (cond) == LT_EXPR) ||
- (TREE_CODE (cond) == LE_EXPR))
+ if ((TREE_CODE (cond) == LT_EXPR) || (TREE_CODE (cond) == LE_EXPR))
{
dir = 1;
}
- else if ((TREE_CODE (cond) == ERROR_MARK) ||
- (TREE_CODE (cond) == NE_EXPR))
+ else if ((TREE_CODE (cond) == ERROR_MARK) || (TREE_CODE (cond) == NE_EXPR))
{
dir = 0;
}
- else if ((TREE_CODE (cond) == GE_EXPR) ||
- (TREE_CODE (cond) == GT_EXPR))
+ else if ((TREE_CODE (cond) == GE_EXPR) || (TREE_CODE (cond) == GT_EXPR))
{
dir = -1;
}
@@ -1079,8 +1074,8 @@ check_incr(tree var, tree arith_type, tree incr)
gcc_assert(arith_type != error_mark_node);
}
- if ((incr) && (TYPE_UNSIGNED (arith_type)) &&
- (!TYPE_UNSIGNED (TREE_TYPE (incr))) && (tree_int_cst_sgn (incr) >= 0))
+ if (incr && (TYPE_UNSIGNED (arith_type))
+ && (!TYPE_UNSIGNED (TREE_TYPE (incr))) && (tree_int_cst_sgn (incr) >= 0))
{
warning(OPT_Wcilk_for,
"signed increment implicitly converted to unsigned");
@@ -1100,7 +1095,8 @@ check_incr(tree var, tree arith_type, tree incr)
TYPE_MAIN_VARIANT (TREE_TYPE (exp_incr)),
TREE_TYPE (exp_incr), 0)))
{
- error("loop increment expression is not convertable to type loop var.\n");
+ error("loop increment expression is not convertable to type "
+ "loop var");
return false;
}
}
@@ -1122,7 +1118,8 @@ check_incr(tree var, tree arith_type, tree incr)
}
-static bool check_limit_scalar(tree var, tree cond)
+static bool
+check_limit_scalar(tree var, tree cond)
{
tree limit = NULL_TREE;
tree op0 = NULL_TREE;
@@ -1179,10 +1176,11 @@ static bool check_limit_scalar(tree var, tree cond)
error("Loop condition applies type conversion to loop variable.\n");
}
- if (((DECL_P(op0)) && (TREE_CONSTANT(op1))) ||
- ((DECL_P(op1)) && (TREE_CONSTANT(op0))))
+ if ((DECL_P(op0) && TREE_CONSTANT(op1))
+ || (DECL_P(op1) && TREE_CONSTANT(op0)))
{
- error("loop condition is not a simple comparison of the loop variables.");
+ error("loop condition is not a simple comparison of the "
+ "loop variables.");
}
return false;
@@ -1197,20 +1195,20 @@ static bool check_limit_scalar(tree var, tree cond)
limit = op0;
}
- if ((TREE_CODE (TREE_TYPE (limit)) != INTEGER_TYPE) &&
- (TREE_CODE (TREE_TYPE (limit)) != POINTER_TYPE) &&
- (TREE_CODE (TREE_TYPE (limit)) != BOOLEAN_TYPE) &&
- (TREE_CODE (TREE_TYPE (limit)) != ENUMERAL_TYPE) &&
- (TREE_CODE (TREE_TYPE (limit)) != FUNCTION_TYPE) &&
- (TREE_CODE (TREE_TYPE (limit)) != ARRAY_TYPE))
+ if ((TREE_CODE (TREE_TYPE (limit)) != INTEGER_TYPE)
+ && (TREE_CODE (TREE_TYPE (limit)) != POINTER_TYPE)
+ && (TREE_CODE (TREE_TYPE (limit)) != BOOLEAN_TYPE)
+ && (TREE_CODE (TREE_TYPE (limit)) != ENUMERAL_TYPE)
+ && (TREE_CODE (TREE_TYPE (limit)) != FUNCTION_TYPE)
+ && (TREE_CODE (TREE_TYPE (limit)) != ARRAY_TYPE))
{
error("loop limit has invalid type %qT", TREE_TYPE(limit));
return false;
}
- if ((TYPE_PRECISION (TREE_TYPE (limit)) > TYPE_PRECISION (TREE_TYPE (var))) &&
- ((TREE_CODE (limit) != INTEGER_CST) ||
- (!int_fits_type_p (limit, TREE_TYPE (var)))))
+ if ((TYPE_PRECISION (TREE_TYPE (limit)) > TYPE_PRECISION (TREE_TYPE (var)))
+ && (TREE_CODE (limit) != INTEGER_CST
+ || !int_fits_type_p (limit, TREE_TYPE (var))))
{
warning(OPT_Wcilk_for,"loop condition compares loop var. to wider type.");
}
@@ -1232,9 +1230,9 @@ check_loop_difference_type (tree type)
error("loop variable difference type is bigger than long long ");
return NULL_TREE;
}
- else if ((TYPE_PRECISION (type) > TYPE_PRECISION(long_unsigned_type_node)) ||
- (same_type_p (type, long_long_integer_type_node)) ||
- (same_type_p (type, long_long_unsigned_type_node)))
+ else if ((TYPE_PRECISION (type) > TYPE_PRECISION(long_unsigned_type_node))
+ || same_type_p (type, long_long_integer_type_node)
+ || same_type_p (type, long_long_unsigned_type_node))
{
return long_long_unsigned_type_node;
}
@@ -1295,11 +1293,11 @@ validate_for_record(tree c_for_stmt, tree var)
l_type = TREE_TYPE (limit);
hack = build_decl(UNKNOWN_LOCATION, VAR_DECL, get_identifier("loop_bound"),
- build_qualified_type(l_type,TYPE_QUAL_CONST));
+ build_qualified_type(l_type, TYPE_QUAL_CONST));
if (direction >= 0)
{
- exp_up = callable (MINUS_EXPR, hack, var," control variable", true);
+ exp_up = callable (MINUS_EXPR, hack, var, " control variable", true);
if (!exp_up)
{
return false;
@@ -1338,17 +1336,17 @@ validate_for_record(tree c_for_stmt, tree var)
return false;
}
- if ((TYPE_MAIN_VARIANT (TREE_TYPE (exp_plus)) != var_type) &&
- (!can_convert_arg (var_type, TREE_TYPE (exp_plus), exp_plus, 0)))
+ if (TYPE_MAIN_VARIANT (TREE_TYPE (exp_plus)) != var_type
+ && !can_convert_arg (var_type, TREE_TYPE (exp_plus), exp_plus, 0))
{
error("result of operation%c(%T,%T) not convertable to type of loop var.",
(direction >= 0) ? '+' : '-', var_type, d_type);
}
- if ((cp_tree_uses_cilk (exp_plus)) ||
- (cp_tree_uses_cilk (callable (INIT_EXPR, NULL_TREE, var, 0, false))) ||
- (cp_tree_uses_cilk (callable (PSEUDO_DTOR_EXPR, NULL_TREE, var, 0,
- false))))
+ if (cp_tree_uses_cilk (exp_plus)
+ || cp_tree_uses_cilk (callable (INIT_EXPR, NULL_TREE, var, 0, false))
+ || cp_tree_uses_cilk (callable (PSEUDO_DTOR_EXPR, NULL_TREE, var, 0,
+ false)))
{
CILK_FOR_NO_DEMOTE (c_for_stmt) = 1;
}
@@ -1395,22 +1393,22 @@ cilk_validate_for(tree c_for_stmt)
return false;
}
- if ((grain != NULL_TREE) && (grain != error_mark_node) )
+ if (grain && (grain != error_mark_node) )
{
grain_type = TREE_TYPE (grain);
gcc_assert (grain_type != NULL);
- if ((TREE_CODE (grain_type) != INTEGER_TYPE) &&
- (TREE_CODE (grain_type) != ENUMERAL_TYPE))
+ if ((TREE_CODE (grain_type) != INTEGER_TYPE)
+ && (TREE_CODE (grain_type) != ENUMERAL_TYPE))
{
error ("Pragma grainsize argument must be an integer.\n");
CILK_FOR_GRAIN (c_for_stmt) = NULL_TREE;
grain = NULL_TREE;
return false;
}
- else if ((!TYPE_UNSIGNED (grain_type)) &&
- (TREE_CODE (grain_type) == INTEGER_TYPE) &&
- (TREE_INT_CST_HIGH (grain) < 0))
+ else if (!TYPE_UNSIGNED (grain_type)
+ && (TREE_CODE (grain_type) == INTEGER_TYPE)
+ && (TREE_INT_CST_HIGH (grain) < 0))
{
warning(OPT_Wcilk_for,
"Pragma grainsize should be positive.\nIgnoring this value.");
@@ -1420,8 +1418,8 @@ cilk_validate_for(tree c_for_stmt)
}
else if (TREE_SIDE_EFFECTS (grain))
{
- while ((TREE_CODE (grain) == CONVERT_EXPR) ||
- (TREE_CODE (grain) == NOP_EXPR))
+ while ((TREE_CODE (grain) == CONVERT_EXPR)
+ || (TREE_CODE (grain) == NOP_EXPR))
{
grain = TREE_OPERAND (grain, 0);
if (TREE_CODE (grain) != CALL_EXPR)
@@ -1491,7 +1489,7 @@ add_variable (struct pointer_map_t *decl_map, tree var,
{
void **valp;
- valp = pointer_map_contains(decl_map, (void*)var);
+ valp = pointer_map_contains (decl_map, (void*)var);
if (valp)
{
@@ -1533,9 +1531,8 @@ add_variable (struct pointer_map_t *decl_map, tree var,
work anyway. Warn here. This misses one case: if the
register variable is used as the loop bound or increment it
has already been added to the map. */
- if ((how != ADD_BIND) && (TREE_CODE (var) == VAR_DECL) &&
- !DECL_EXTERNAL (var)
- && DECL_HARD_REGISTER (var))
+ if ((how != ADD_BIND) && (TREE_CODE (var) == VAR_DECL)
+ && !DECL_EXTERNAL (var) && DECL_HARD_REGISTER (var))
warning (0,
"register assignment ignored for %qD used in Cilk block",
var);
@@ -1954,8 +1951,6 @@ gimplify_cilk_for_stmt_1 (struct cilk_for_desc *cfd, gimple_seq *pre_p)
evaluated, in the context containing the for loop. */
fn = cp_build_cilk_for_body (cfd);
-
-
if (cfd->nested_ok)
{
@@ -1966,12 +1961,9 @@ gimplify_cilk_for_stmt_1 (struct cilk_for_desc *cfd, gimple_seq *pre_p)
DECL_STATIC_CHAIN(fn) = 1;
cg_hacks(fn, false);
-
return fn;
}
-
-
/* This is mostly a subset of cp_build_cilk_for_body */
static tree
build_cilk_run_body (tree stmt, tree rv)
@@ -2182,8 +2174,6 @@ mangle_count (tree count, enum tree_code op, tree incr, bool negate, tree type)
return count;
}
-
-
/* this function will count the number of iterations that Cilk_for loop will
* run (this number could definitely be a polynomial) */
static tree
@@ -2298,12 +2288,12 @@ compute_loop_count (struct cilk_for_desc *cfd)
}
else if (direction <= 0)
{
- if (TREE_CODE(high) == TARGET_EXPR)
+ if (TREE_CODE (high) == TARGET_EXPR)
{
high = TARGET_EXPR_INITIAL (high);
}
- if (TREE_CODE(low) == TARGET_EXPR)
+ if (TREE_CODE (low) == TARGET_EXPR)
{
low = TARGET_EXPR_INITIAL (low);
}
@@ -2459,8 +2449,6 @@ cp_extract_for_fields (struct cilk_for_desc *cfd, tree for_stmt)
tree body, grain;
gcc_assert (var != NULL_TREE);
-
-
/* The parser requires an explicit comparison operation,
not something like (bool)x. */
@@ -2527,11 +2515,8 @@ cp_extract_for_fields (struct cilk_for_desc *cfd, tree for_stmt)
case UNION_TYPE:
{
tree exp = NULL_TREE, hack = NULL_TREE;
-
- {
- hack = build_decl (UNKNOWN_LOCATION, VAR_DECL, NULL_TREE,
- TREE_TYPE (limit));
- }
+ hack = build_decl (UNKNOWN_LOCATION, VAR_DECL, NULL_TREE,
+ TREE_TYPE (limit));
if (cond_direction >= 0)
exp = callable (MINUS_EXPR, hack, var, NULL, false);
else
@@ -2759,7 +2744,7 @@ gimplify_cilk_for_stmt (tree *for_p, gimple_seq *pre_p)
gcc_assert (cfd.var != error_mark_node);
- cfd.nested_ok = !DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P(current_function_decl);
+ cfd.nested_ok = !DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (current_function_decl);
if (cfd.grain != NULL_TREE)
{
@@ -2871,11 +2856,11 @@ gimplify_cilk_for_stmt (tree *for_p, gimple_seq *pre_p)
ctx = cfd.ctx_arg;
if (TREE_TYPE (ctx) != ptr_type_node)
{
- ctx = build1(NOP_EXPR, ptr_type_node, ctx);
+ ctx = build1 (NOP_EXPR, ptr_type_node, ctx);
}
if (!DECL_P (ctx))
{
- ctx = get_formal_tmp_var(ctx, &inner_seq);
+ ctx = get_formal_tmp_var (ctx, &inner_seq);
}
fn = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (fn)), fn);
}
@@ -2904,9 +2889,9 @@ gimplify_cilk_for_stmt (tree *for_p, gimple_seq *pre_p)
new_for = fold_build_cleanup_point_expr
- (void_type_node, build3 (COND_EXPR,void_type_node, cond,
- build_call_expr(libfun, 4, fn, ctx, count, grain),
- build_empty_stmt(UNKNOWN_LOCATION)));
+ (void_type_node, build3 (COND_EXPR, void_type_node, cond,
+ build_call_expr (libfun, 4, fn, ctx, count, grain),
+ build_empty_stmt (UNKNOWN_LOCATION)));
gimplify_and_add(new_for, &inner_seq);
@@ -3021,7 +3006,8 @@ cilk_init_common (void)
{
tree off1 = DECL_FIELD_OFFSET (field); /* bytes */
tree off2 = DECL_FIELD_BIT_OFFSET (field); /* bits */
- cilk_field_offsets[i] = tree_low_cst (off1, 0) + tree_low_cst (off2, 0) / BITS_PER_UNIT;
+ cilk_field_offsets[i] = tree_low_cst (off1, 0)
+ + tree_low_cst (off2, 0) / BITS_PER_UNIT;
}
}
@@ -3030,7 +3016,8 @@ cilk_init_common (void)
cilk_save_ra = GET_CODE (INCOMING_RETURN_ADDR_RTX) == MEM;*/
if (flag_cilkscreen)
- cilk_metadata_default_section = get_section (".clkmtdt", SECTION_DEBUG|SECTION_NOTYPE, 0);
+ cilk_metadata_default_section =
+ get_section (".clkmtdt", SECTION_DEBUG | SECTION_NOTYPE, 0);
}
static tree
@@ -3050,9 +3037,6 @@ cilk_find_parent_frame (void)
return parm;
}
-
-
-
tree
cilk_detach (tree worker_ptr)
{
@@ -3079,8 +3063,6 @@ cilk_detach (tree worker_ptr)
return pre;
}
-
-
/* A Cilk function needs a frame descriptor if it or its
children invoke spawn.
@@ -3157,9 +3139,6 @@ cilk_init_frame_descriptor (struct function *fdesc,
store it into the frame. */
}
-
-
-
/* FNDECL has been promoted. Fix up its struct function. */
void
cilk_promote_struct_function (tree fndecl)
@@ -3184,7 +3163,6 @@ cilk_promote_struct_function (tree fndecl)
f->linkage = linkage_cilk;
}
-
void
cilk_promote (tree fndecl)
{
@@ -3231,7 +3209,6 @@ is_cp_cilk_tree (tree t)
}
}
-
/* If the body of FNDECL contains calls to Cilk functions,
promote the entire function to Cilk and return true. */
bool
@@ -3292,7 +3269,6 @@ declare_cilk_void_wrapper (tree fn, int style)
return fndecl;
}
-
tree
push_cilk_void_wrapper (tree fn, int style)
{
@@ -1243,8 +1243,7 @@ is_cilk_function_decl (tree olddecl, tree newdecl)
/* char *cc = NULL; */
/* int ii = 0; */
- if ((DECL_NAME (olddecl) == NULL_TREE) ||
- (DECL_NAME (newdecl) == NULL_TREE))
+ if ((DECL_NAME (olddecl) == NULL_TREE) || (DECL_NAME (newdecl) == NULL_TREE))
return false;
if (TREE_CODE (DECL_NAME (olddecl)) != IDENTIFIER_NODE)
@@ -26733,10 +26733,10 @@ cp_parser_cilk_for (cp_parser *parser, tree grain, int in_statement)
decl = error_mark_node;
valid = false;
}
- else if ((processing_template_decl == 0) &&
- (DECL_NONTRIVIALLY_INITIALIZED_P (decl) == 0) &&
- (DECL_INITIAL (decl) = NULL_TREE) &&
- (TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (decl)) == 0))
+ else if ((processing_template_decl == 0)
+ && (DECL_NONTRIVIALLY_INITIALIZED_P (decl) == 0)
+ && (DECL_INITIAL (decl) = NULL_TREE)
+ && (TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (decl)) == 0))
{
/* If we are here, then the type has has no initializer and/or a default
* constructor. This is a problem because then the loop has no
@@ -26772,7 +26772,6 @@ cp_parser_cilk_for (cp_parser *parser, tree grain, int in_statement)
}
else
{
-
condition = cp_parser_cilk_for_condition (parser);
}
@@ -26815,12 +26814,11 @@ cp_parser_cilk_for (cp_parser *parser, tree grain, int in_statement)
cp_parser_already_scoped_statement (parser);
parser->in_statement = in_statement;
-
finish_cilk_for_stmt (statement);
- if ((valid == false) ||
- ((processing_template_decl == 0) &&
- (cilk_validate_for (statement) == false) ))
+ if ((valid == false)
+ || (processing_template_decl == 0
+ && cilk_validate_for (statement) == false))
{
cilk_erase_for (statement);
gcc_assert (errorcount || sorrycount);
@@ -26873,8 +26871,8 @@ cp_parser_cilk_for_condition (cp_parser *parser)
cp_lexer_consume_token (parser->lexer);
- rhs=cp_parser_binary_expression (parser, false, false, PREC_SHIFT_EXPRESSION,
- NULL);
+ rhs = cp_parser_binary_expression
+ (parser, false, false, PREC_SHIFT_EXPRESSION, NULL);
/* initializing vars */
@@ -26882,8 +26880,8 @@ cp_parser_cilk_for_condition (cp_parser *parser)
parser->qualifying_scope = NULL_TREE;
parser->object_scope = NULL_TREE;
- if ((code == ERROR_MARK) || (lhs == error_mark_node) ||
- (rhs == error_mark_node))
+ if ((code == ERROR_MARK) || (lhs == error_mark_node)
+ || (rhs == error_mark_node))
{
return error_mark_node;
}
@@ -26907,7 +26905,6 @@ cp_parser_cilk_for_expression_iterator (cp_parser *parser)
error ("missing loop expression.\n");
return error_mark_node;
}
-
if (token->type == CPP_PLUS_PLUS)
{
cp_lexer_consume_token (parser->lexer);
@@ -26928,7 +26925,7 @@ cp_parser_cilk_for_expression_iterator (cp_parser *parser)
return error_mark_node;
}
- name=cp_parser_lookup_name (parser, token->u.value, none_type, false, false,
+ name = cp_parser_lookup_name (parser, token->u.value, none_type, false, false,
false, NULL, token->location);
if (name == error_mark_node)
{
@@ -26936,14 +26933,14 @@ cp_parser_cilk_for_expression_iterator (cp_parser *parser)
}
/* now we see if it is a decl, if not, then the loop is not valid */
- if (DECL_P (name) == 0)
+ if (!DECL_P (name))
{
error ("invalid loop increment expression.\n");
return error_mark_node;
}
cp_lexer_consume_token (parser->lexer);
- token=cp_lexer_peek_token (parser->lexer);
+ token = cp_lexer_peek_token (parser->lexer);
if (t_code != NOP_EXPR)
{
@@ -26992,10 +26989,10 @@ cp_parser_cilk_for_expression_iterator (cp_parser *parser)
{
t_code = MINUS_EXPR;
}
- else if ((token->type == CPP_MOD_EQ) || (token->type == CPP_XOR_EQ) ||
- (token->type == CPP_DIV_EQ) || (token->type == CPP_AND_EQ) ||
- (token->type == CPP_OR_EQ) || (token->type == CPP_MULT_EQ) ||
- (token->type == CPP_LSHIFT_EQ) || (token->type == CPP_RSHIFT_EQ))
+ else if ((token->type == CPP_MOD_EQ) || (token->type == CPP_XOR_EQ)
+ || (token->type == CPP_DIV_EQ) || (token->type == CPP_AND_EQ)
+ || (token->type == CPP_OR_EQ) || (token->type == CPP_MULT_EQ)
+ || (token->type == CPP_LSHIFT_EQ) || (token->type == CPP_RSHIFT_EQ))
{
error ("Invalid loop increment operation.");
return error_mark_node;
@@ -27007,15 +27004,15 @@ cp_parser_cilk_for_expression_iterator (cp_parser *parser)
}
/* now we read a logical or expression */
- expr = cp_parser_binary_expression(parser, false, false, PREC_NOT_OPERATOR,
- NULL);
+ expr = cp_parser_binary_expression (parser, false, false, PREC_NOT_OPERATOR,
+ NULL);
if (expr == error_mark_node)
{
return expr;
}
return build2 (MODIFY_EXPR, void_type_node, name,
- build2 (t_code, TREE_TYPE(name), name, expr));
+ build2 (t_code, TREE_TYPE (name), name, expr));
}
/* this function will parse the pragma simd vector length */
@@ -27070,8 +27067,8 @@ cp_parser_simd_vectorlength (cp_parser *parser, cp_token *pragma_token)
local_simd_values.pragma_encountered = true;
- if ((cp_lexer_next_token_is (parser->lexer, CPP_NAME)) ||
- (cp_lexer_next_token_is (parser->lexer, CPP_KEYWORD)))
+ if (cp_lexer_next_token_is (parser->lexer, CPP_NAME)
+ || cp_lexer_next_token_is (parser->lexer, CPP_KEYWORD))
{
token = cp_lexer_peek_token (parser->lexer);
cp_lexer_consume_token (parser->lexer);
@@ -27100,7 +27097,8 @@ cp_parser_simd_vectorlength (cp_parser *parser, cp_token *pragma_token)
if (same_var_in_multiple_lists_p (&local_simd_values))
{
cp_parser_error (parser,
- "ill-formed pragma: Same variable in multiple clause");
+ "ill-formed pragma: Same variable in multiple "
+ "clause");
}
cp_lexer_consume_token (parser->lexer);
cp_parser_for (parser, &local_simd_values);
@@ -27142,7 +27140,7 @@ cp_parser_simd_private (cp_parser *parser, cp_token *pragma_token)
{
cp_parser_error (parser, "expected variable");
cp_parser_skip_to_pragma_eol (parser, pragma_token);
- exit(-1);
+ exit (-1);
/* you exit here because this shouldn't happen. If it does
* something VERY BAD! is going on */
}
@@ -27170,8 +27168,8 @@ cp_parser_simd_private (cp_parser *parser, cp_token *pragma_token)
local_simd_values.types |= P_SIMD_PRIVATE;
local_simd_values.private_vars = private_var_list;
- if ((cp_lexer_next_token_is (parser->lexer, CPP_NAME)) ||
- (cp_lexer_next_token_is (parser->lexer, CPP_KEYWORD)))
+ if (cp_lexer_next_token_is (parser->lexer, CPP_NAME)
+ || cp_lexer_next_token_is (parser->lexer, CPP_KEYWORD))
{
token = cp_lexer_peek_token (parser->lexer);
cp_lexer_consume_token (parser->lexer);
@@ -27200,7 +27198,8 @@ cp_parser_simd_private (cp_parser *parser, cp_token *pragma_token)
if (same_var_in_multiple_lists_p (&local_simd_values))
{
cp_parser_error (parser,
- "ill-formed pragma: Same variable in multiple clause");
+ "ill-formed pragma: Same variable in multiple "
+ "clause");
}
cp_lexer_consume_token (parser->lexer);
cp_parser_for (parser, &local_simd_values);
@@ -27316,8 +27315,8 @@ cp_parser_simd_reduction (cp_parser *parser, cp_token *pragma_token)
- if ((cp_lexer_next_token_is (parser->lexer, CPP_NAME)) ||
- (cp_lexer_next_token_is (parser->lexer, CPP_KEYWORD)))
+ if (cp_lexer_next_token_is (parser->lexer, CPP_NAME)
+ || cp_lexer_next_token_is (parser->lexer, CPP_KEYWORD))
{
token = cp_lexer_peek_token (parser->lexer);
cp_lexer_consume_token (parser->lexer);
@@ -27346,7 +27345,8 @@ cp_parser_simd_reduction (cp_parser *parser, cp_token *pragma_token)
if (same_var_in_multiple_lists_p (&local_simd_values) == true)
{
cp_parser_error (parser,
- "ill-formed pragma: Same variable in multiple clause");
+ "ill-formed pragma: Same variable in multiple "
+ "clause");
}
cp_lexer_consume_token (parser->lexer);
cp_parser_for (parser, &local_simd_values);
@@ -27408,8 +27408,8 @@ cp_parser_simd_linear (cp_parser *parser, cp_token *pragma_token)
cp_lexer_consume_token (parser->lexer);
}
}
- else if (cp_lexer_next_token_is (parser->lexer, CPP_COMMA) ||
- cp_lexer_next_token_is (parser->lexer, CPP_CLOSE_PAREN))
+ else if (cp_lexer_next_token_is (parser->lexer, CPP_COMMA)
+ || cp_lexer_next_token_is (parser->lexer, CPP_CLOSE_PAREN))
{
linear_step = integer_one_node;
}
@@ -27419,7 +27419,6 @@ cp_parser_simd_linear (cp_parser *parser, cp_token *pragma_token)
cp_parser_skip_to_pragma_eol (parser, pragma_token);
return;
}
-
if (cp_lexer_next_token_is (parser->lexer, CPP_CLOSE_PAREN))
{
cp_lexer_consume_token (parser->lexer);
@@ -27427,7 +27426,6 @@ cp_parser_simd_linear (cp_parser *parser, cp_token *pragma_token)
linear_steps_list);
break;
}
-
if (cp_lexer_next_token_is (parser->lexer, CPP_COMMA))
{
cp_lexer_consume_token (parser->lexer);
@@ -27445,8 +27443,8 @@ cp_parser_simd_linear (cp_parser *parser, cp_token *pragma_token)
gcc_assert (list_length (linear_steps_list) ==
list_length (linear_var_list));
- if ((cp_lexer_next_token_is (parser->lexer, CPP_NAME)) ||
- (cp_lexer_next_token_is (parser->lexer, CPP_KEYWORD)))
+ if (cp_lexer_next_token_is (parser->lexer, CPP_NAME)
+ || cp_lexer_next_token_is (parser->lexer, CPP_KEYWORD))
{
token = cp_lexer_peek_token (parser->lexer);
cp_lexer_consume_token (parser->lexer);
@@ -27474,8 +27472,8 @@ cp_parser_simd_linear (cp_parser *parser, cp_token *pragma_token)
{
if (same_var_in_multiple_lists_p (&local_simd_values) == true)
{
- cp_parser_error (parser,
- "ill-formed pragma: Same variable in multiple clause");
+ cp_parser_error (parser, "ill-formed pragma: Same variable in "
+ "multiple clause");
}
cp_lexer_consume_token (parser->lexer);
cp_parser_for (parser, &local_simd_values);
@@ -27485,7 +27483,6 @@ cp_parser_simd_linear (cp_parser *parser, cp_token *pragma_token)
cp_parser_error (parser, "for statement expected");
}
}
-
return;
}
@@ -27511,8 +27508,8 @@ cp_parser_simd_assert(cp_parser *parser, cp_token *pragma_token,
local_simd_values.pragma_encountered = true;
- if ((cp_lexer_next_token_is (parser->lexer, CPP_NAME)) ||
- (cp_lexer_next_token_is (parser->lexer, CPP_KEYWORD)))
+ if (cp_lexer_next_token_is (parser->lexer, CPP_NAME)
+ || cp_lexer_next_token_is (parser->lexer, CPP_KEYWORD))
{
token = cp_lexer_peek_token (parser->lexer);
cp_lexer_consume_token (parser->lexer);
@@ -27573,7 +27570,7 @@ cp_parser_cilk_grainsize (cp_parser *parser, cp_token *pragma_token)
return;
}
- if (cp_parser_require (parser, CPP_EQ, RT_EQ) != 0)
+ if (cp_parser_require (parser, CPP_EQ, RT_EQ))
{
exp = cp_parser_binary_expression (parser, false, false,
PREC_NOT_OPERATOR, NULL);
@@ -27584,23 +27581,21 @@ cp_parser_cilk_grainsize (cp_parser *parser, cp_token *pragma_token)
next_token = cp_lexer_peek_token (parser->lexer);
/* mke sure the pragma is right before a cilk_for */
- if ((next_token != NULL) &&
- (next_token->type == CPP_KEYWORD) &&
- (next_token->keyword == RID_CILK_FOR))
+ if ((next_token != NULL) && (next_token->type == CPP_KEYWORD)
+ && (next_token->keyword == RID_CILK_FOR))
{
cp_lexer_consume_token (parser->lexer);
loop = cp_parser_cilk_for (parser, exp, parser->in_statement);
- if ((loop != NULL_TREE) &&
- (STATEMENT_CODE_P (TREE_CODE (loop)) != 0))
+ if ((loop != NULL_TREE) && STATEMENT_CODE_P (TREE_CODE (loop)))
{
SET_EXPR_LOCATION (loop, next_token->location);
}
}
else
{
- warning (0,
- "%<#pragma cilk grainsize is not followed by %<cilk_for%>");
+ warning (0, "%<#pragma cilk grainsize is not followed by "
+ "%<cilk_for%>");
}
return;
}
@@ -27616,7 +27611,7 @@ cp_parser_cilk_for_init_statement (cp_parser *parser, tree *init)
{
cp_decl_specifier_seq specs;
cp_token *token;
- tree decl = NULL_TREE,type = NULL_TREE;
+ tree decl = NULL_TREE, type = NULL_TREE;
int flags = 0;
token = cp_lexer_peek_token (parser->lexer);
@@ -27629,8 +27624,7 @@ cp_parser_cilk_for_init_statement (cp_parser *parser, tree *init)
{
type = cp_parser_lookup_name_simple (parser, token->u.value,
token->location);
- if ((TREE_CODE (type) == VAR_DECL) ||
- (TREE_CODE (type) == PARM_DECL))
+ if ((TREE_CODE (type) == VAR_DECL) || (TREE_CODE (type) == PARM_DECL))
{
error ("Cilk for loop initializer must declare variable.\n");
cp_parser_skip_to_end_of_statement (parser);
@@ -27639,7 +27633,7 @@ cp_parser_cilk_for_init_statement (cp_parser *parser, tree *init)
}
cp_parser_decl_specifier_seq (parser, CP_PARSER_FLAGS_NONE, &specs, &flags);
- if (flags != 0)
+ if (flags)
{
warning (0, "Cilk for init declaration defines type.\n");
}
@@ -27661,16 +27655,16 @@ cp_parser_cilk_for_init_statement (cp_parser *parser, tree *init)
return error_mark_node;
}
- decl = cp_parser_cilk_init_declarator (parser, &specs, NULL, init, false,
- false, flags, NULL);
+ decl = cp_parser_cilk_init_declarator
+ (parser, &specs, NULL, init, false, false, flags, NULL);
/* initializing some vars */
parser->scope = NULL_TREE;
parser->qualifying_scope = NULL_TREE;
parser->object_scope = NULL_TREE;
- if ((decl == error_mark_node) || (DECL_INITIAL (decl) == error_mark_node) ||
- (TREE_TYPE (decl) == error_mark_node))
+ if ((decl == error_mark_node) || (DECL_INITIAL (decl) == error_mark_node)
+ || (TREE_TYPE (decl) == error_mark_node))
{
cp_parser_skip_to_end_of_statement (parser);
gcc_assert (errorcount || sorrycount);
@@ -7834,8 +7834,8 @@ potential_constant_expression_1 (tree t, bool want_rval, tsubst_flags_t flags)
tree x = get_nth_callarg (t, 0);
if (is_this_parameter (x))
{
- if (!flag_enable_cilk &&
- DECL_CONSTRUCTOR_P (DECL_CONTEXT (x)))
+ if (!flag_enable_cilk
+ && DECL_CONSTRUCTOR_P (DECL_CONTEXT (x)))
{
if (flags & tf_error)
sorry ("calling a member function of the "
@@ -9163,7 +9163,7 @@ finish_sync_stmt (bool implicit)
}
tree
-begin_cilk_for_stmt(void)
+begin_cilk_for_stmt (void)
{
tree c_tree = NULL_TREE;
@@ -3535,8 +3535,7 @@ handle_cilk_linkage_attribute (tree *node, tree name,
{
tree target = *node;
- if ((TREE_CODE (target) != FUNCTION_TYPE) &&
- (TREE_CODE (target) != METHOD_TYPE))
+ if (TREE_CODE (target) != FUNCTION_TYPE && TREE_CODE (target) != METHOD_TYPE)
{
warning(0, "%qs attribute only applies to functions",
IDENTIFIER_POINTER (name));
@@ -3545,7 +3544,7 @@ handle_cilk_linkage_attribute (tree *node, tree name,
{
if (FUNCTION_TYPE_LINKAGE (target) != linkage_cilk)
{
- *node = build_function_linkage_variant(target, linkage_cilk);
+ *node = build_function_linkage_variant (target, linkage_cilk);
}
else
*node = target;
@@ -60,8 +60,7 @@ clause_resolved_p (enum pragma_simd_kind clause_type, int pragma_simd_index)
for (ps_iter = psv_head; ps_iter != NULL; ps_iter = ps_iter->ptr_next)
{
- if ((ps_iter->pragma_encountered == true) &&
- (ps_iter->index == pragma_simd_index))
+ if (ps_iter->pragma_encountered && (ps_iter->index == pragma_simd_index))
{
switch (clause_type)
{
@@ -101,8 +100,7 @@ set_OK_for_certain_clause (enum pragma_simd_kind clause_type, bool set_value,
for (ps_iter = psv_head; ps_iter != NULL; ps_iter = ps_iter->ptr_next)
{
- if ((ps_iter->pragma_encountered == true) &&
- (ps_iter->index == pragma_simd_index))
+ if (ps_iter->pragma_encountered && (ps_iter->index == pragma_simd_index))
break;
}
if (ps_iter == NULL)
@@ -168,8 +166,7 @@ psv_find_node(int psv_index)
for (ps_iter = psv_head; ps_iter != NULL; ps_iter = ps_iter->ptr_next)
{
- if ((ps_iter->index == psv_index) &&
- (ps_iter->pragma_encountered == true))
+ if ((ps_iter->index == psv_index) && ps_iter->pragma_encountered)
{
return ps_iter;
}
@@ -289,8 +286,7 @@ pragma_simd_assert_requested_p(int ps_index)
for (ps_iter = psv_head; ps_iter != NULL; ps_iter = ps_iter->ptr_next)
{
- if ((ps_iter->pragma_encountered == true) &&
- (ps_iter->index == ps_index))
+ if ((ps_iter->pragma_encountered == true) && (ps_iter->index == ps_index))
{
if ((ps_iter->types & P_SIMD_NOASSERT))
return false;
@@ -338,8 +334,7 @@ pragma_simd_acceptable_vlength_p(int ps_index,
for (ps_iter = psv_head; ps_iter != NULL; ps_iter = ps_iter->ptr_next)
{
- if ((ps_iter->pragma_encountered == true) &&
- (ps_iter->index == ps_index))
+ if ((ps_iter->pragma_encountered == true) && (ps_iter->index == ps_index))
{
break;
}
@@ -356,11 +351,11 @@ pragma_simd_acceptable_vlength_p(int ps_index,
}
for (ii_tree = ps_iter->vectorlength; ii_tree != NULL_TREE;
- ii_tree = TREE_CHAIN(ii_tree))
+ ii_tree = TREE_CHAIN (ii_tree))
{
- ii_value = TREE_VALUE(ii_tree);
- if ((TREE_CODE(ii_value) == INTEGER_CST) &&
- (tree_int_cst_equal ((const_tree)ii_value, (const_tree)vl_tree)))
+ ii_value = TREE_VALUE (ii_tree);
+ if ((TREE_CODE (ii_value) == INTEGER_CST)
+ && tree_int_cst_equal ((const_tree)ii_value, (const_tree)vl_tree))
{
/* we found a match, so we give the YES! */
return true;
@@ -645,7 +640,7 @@ find_var_decl (tree t, const char *var_name, tree *var)
case TARGET_EXPR:
{
- find_var_decl (TREE_OPERAND (t, 0),var_name, var);
+ find_var_decl (TREE_OPERAND (t, 0), var_name, var);
find_var_decl (TREE_OPERAND (t, 1), var_name, var);
find_var_decl (TREE_OPERAND (t, 2), var_name, var);
if (TREE_OPERAND (t, 3) != TREE_OPERAND (t, 1))
@@ -688,9 +683,9 @@ find_var_decl (tree t, const char *var_name, tree *var)
{
int len = 0;
int ii = 0;
- if (TREE_CODE(TREE_OPERAND (t,0)) == INTEGER_CST)
+ if (TREE_CODE(TREE_OPERAND (t, 0)) == INTEGER_CST)
{
- len = TREE_INT_CST_LOW(TREE_OPERAND(t,0));
+ len = TREE_INT_CST_LOW(TREE_OPERAND(t, 0));
for (ii = 0; ii < len; ii++)
{
@@ -1103,8 +1098,8 @@ same_var_in_multiple_lists_p(struct pragma_simd_values *ps_values)
vl_tree = ps_values->vectorlength;
pr_tree = ps_values->private_vars;
- while ((vl_tree != NULL_TREE) || (rd_tree != NULL_TREE) ||
- (pr_tree != NULL_TREE))
+ while ((vl_tree != NULL_TREE) || (rd_tree != NULL_TREE)
+ || (pr_tree != NULL_TREE))
{
if (vl_tree != NULL_TREE)
vl_value = TREE_VALUE (vl_tree);
@@ -1121,12 +1116,12 @@ same_var_in_multiple_lists_p(struct pragma_simd_values *ps_values)
else
rd_value = NULL_TREE;
- if (((vl_value != NULL_TREE || pr_value != NULL_TREE) &&
- (simple_cst_equal (vl_value, pr_value) == 1)) ||
- ((vl_value != NULL_TREE || rd_value != NULL_TREE) &&
- (simple_cst_equal (vl_value, rd_value) == 1)) ||
- ((pr_value != NULL_TREE || rd_value != NULL_TREE) &&
- (simple_cst_equal (pr_value, rd_value) == 1)))
+ if (((vl_value != NULL_TREE || pr_value != NULL_TREE)
+ && (simple_cst_equal (vl_value, pr_value) == 1))
+ || ((vl_value != NULL_TREE || rd_value != NULL_TREE)
+ && (simple_cst_equal (vl_value, rd_value) == 1))
+ || ((pr_value != NULL_TREE || rd_value != NULL_TREE)
+ && (simple_cst_equal (pr_value, rd_value) == 1)))
{
return true;
}
@@ -1144,9 +1139,8 @@ same_var_in_multiple_lists_p(struct pragma_simd_values *ps_values)
}
else
{
- while ((vl_tree != NULL_TREE) ||
- (rd_tree != NULL_TREE) ||
- (pr_tree != NULL_TREE))
+ while ((vl_tree != NULL_TREE) || (rd_tree != NULL_TREE)
+ || (pr_tree != NULL_TREE))
{
if (vl_tree != NULL_TREE)
vl_value = TREE_VALUE (vl_tree);
@@ -1165,12 +1159,12 @@ same_var_in_multiple_lists_p(struct pragma_simd_values *ps_values)
/* IF either one is not NULL and the trees are equal, then we
* say we have found a duplicate */
- if (((vl_value != NULL_TREE || pr_value != NULL_TREE) &&
- (simple_cst_equal (vl_value, pr_value) == 1)) ||
- ((vl_value != NULL_TREE || rd_value != NULL_TREE) &&
- (simple_cst_equal (vl_value, rd_value) == 1)) ||
- ((pr_value != NULL_TREE || rd_value != NULL_TREE) &&
- (simple_cst_equal (pr_value, rd_value) == 1)))
+ if (((vl_value != NULL_TREE || pr_value != NULL_TREE)
+ && (simple_cst_equal (vl_value, pr_value) == 1))
+ || ((vl_value != NULL_TREE || rd_value != NULL_TREE)
+ && (simple_cst_equal (vl_value, rd_value) == 1))
+ || ((pr_value != NULL_TREE || rd_value != NULL_TREE)
+ && (simple_cst_equal (pr_value, rd_value) == 1)))
{
return true;
}
@@ -1229,8 +1223,7 @@ check_off_reduction_var (gimple reduc_stmt, int pragma_simd_index)
for (ps_iter = psv_head; ps_iter != NULL; ps_iter = ps_iter->ptr_next)
{
- if ((ps_iter->pragma_encountered == true) &&
- (ps_iter->index == pragma_simd_index))
+ if (ps_iter->pragma_encountered && (ps_iter->index == pragma_simd_index))
{
break;
}
@@ -1243,8 +1236,7 @@ check_off_reduction_var (gimple reduc_stmt, int pragma_simd_index)
{
if (rv_iter->reduction_operator == op_code)
{
- for (ii_iter = rv_iter->tree_reduction_var_list;
- ii_iter != NULL_TREE;
+ for (ii_iter = rv_iter->tree_reduction_var_list; ii_iter != NULL_TREE;
ii_iter = TREE_CHAIN (ii_iter))
{
ii_value = TREE_VALUE (ii_iter);
@@ -1280,14 +1272,12 @@ find_linear_step_size (int pragma_simd_index, tree var)
for (ps_iter = psv_head; ps_iter != NULL; ps_iter = ps_iter->ptr_next)
{
- if ((ps_iter->pragma_encountered == true) &&
- (ps_iter->index == pragma_simd_index))
+ if (ps_iter->pragma_encountered && (ps_iter->index == pragma_simd_index))
{
ii_var_iter = ps_iter->linear_vars;
ii_step_iter = ps_iter->linear_steps;
- while ((ii_var_iter != NULL_TREE) &&
- (ii_step_iter != NULL_TREE))
+ while ((ii_var_iter != NULL_TREE) && (ii_step_iter != NULL_TREE))
{
ii_var_value = TREE_VALUE (ii_var_iter);
ii_step_value = TREE_VALUE (ii_step_iter);
@@ -224,8 +224,8 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
"not vectorized: unsupported data-type ");
print_generic_expr (vect_dump, scalar_type, TDF_SLIM);
}
- if (flag_enable_cilk &&
- pragma_simd_assert_requested_p(loop->pragma_simd_index))
+ if (flag_enable_cilk && pragma_simd_assert_requested_p
+ (loop->pragma_simd_index))
{
error ("Loop not vectorized. "
"Exiting as requested by Pragma SIMD");
@@ -375,8 +375,8 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
fprintf (vect_dump, "not vectorized: irregular stmt.");
print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
}
- if (flag_enable_cilk &&
- pragma_simd_assert_requested_p (loop->pragma_simd_index))
+ if (flag_enable_cilk && pragma_simd_assert_requested_p
+ (loop->pragma_simd_index))
{
error ("Loop not vectorized. "
"Exiting as requested by PRAGMA SIMD");
@@ -391,8 +391,8 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
fprintf (vect_dump, "not vectorized: vector stmt in loop:");
print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
}
- if (flag_enable_cilk &&
- pragma_simd_assert_requested_p (loop->pragma_simd_index))
+ if (flag_enable_cilk && pragma_simd_assert_requested_p
+ (loop->pragma_simd_index))
{
error ("Loop not vectorized. "
"Exiting as requested by PRAGMA SIMD");
@@ -427,8 +427,8 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
"not vectorized: unsupported data-type ");
print_generic_expr (vect_dump, scalar_type, TDF_SLIM);
}
- if (flag_enable_cilk &&
- pragma_simd_assert_requested_p (loop->pragma_simd_index))
+ if (flag_enable_cilk && pragma_simd_assert_requested_p
+ (loop->pragma_simd_index))
{
error ("Loop not vectorized. "
"Exiting as requested by PRAGMA SIMD");
@@ -473,8 +473,8 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
"not vectorized: unsupported data-type ");
print_generic_expr (vect_dump, scalar_type, TDF_SLIM);
}
- if (flag_enable_cilk &&
- pragma_simd_assert_requested_p (loop->pragma_simd_index))
+ if (flag_enable_cilk && pragma_simd_assert_requested_p
+ (loop->pragma_simd_index))
{
error ("Loop not vectorized. "
"Exiting as requested by PRAGMA SIMD");
@@ -494,8 +494,8 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
fprintf (vect_dump, " and ");
print_generic_expr (vect_dump, vf_vectype, TDF_SLIM);
}
- if (flag_enable_cilk &&
- pragma_simd_assert_requested_p (loop->pragma_simd_index))
+ if (flag_enable_cilk && pragma_simd_assert_requested_p
+ (loop->pragma_simd_index))
{
error ("Loop not vectorized. "
"Exiting as requested by PRAGMA SIMD");
@@ -556,8 +556,8 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
if (vect_print_dump_info (REPORT_UNVECTORIZED_LOCATIONS))
fprintf (vect_dump, "not vectorized: unsupported data-type");
- if (flag_enable_cilk &&
- pragma_simd_assert_requested_p (loop->pragma_simd_index))
+ if (flag_enable_cilk && pragma_simd_assert_requested_p
+ (loop->pragma_simd_index))
{
error ("Loop not vectorized. "
"Exiting as requested by Pragma SIMD");
@@ -191,9 +191,9 @@ vectorize_loops (void)
than all previously defined loops. This fact allows us to run
only over initial loops skipping newly generated ones. */
FOR_EACH_LOOP (li, loop, 0)
- if (((!flag_enable_cilk) && (optimize_loop_nest_for_speed_p (loop))) ||
- (flag_enable_cilk &&
- (pragma_simd_vectorize_loop_p (loop->pragma_simd_index))))
+ if (((!flag_enable_cilk) && (optimize_loop_nest_for_speed_p (loop)))
+ || (flag_enable_cilk
+ && (pragma_simd_vectorize_loop_p (loop->pragma_simd_index))))
{
loop_vec_info loop_vinfo;