This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: autopar reduction and OMP_ATOMIC gimplify/expand changes - final patch
- From: Zdenek Dvorak <rakdver at kam dot mff dot cuni dot cz>
- To: Razya Ladelsky <RAZYA at il dot ibm dot com>
- Cc: Diego Novillo <dnovillo at google dot com>, gcc-patches at gcc dot gnu dot org
- Date: Mon, 5 Nov 2007 03:45:16 +0100
- Subject: Re: autopar reduction and OMP_ATOMIC gimplify/expand changes - final patch
- References: <20071031120843.GA14817@kam.mff.cuni.cz> <OF761367AA.A85027A9-ONC2257389.005ECC0C-C2257389.005FB9D4@il.ibm.com>
Hi,
> Passed bootstrap and testsuite for x86 and powerpc.
> O.K for mainline?
ok with the (mostly formatting) changes described below.
Zdenek
> --- 518,528 ----
> init = omp_reduction_init (c, TREE_TYPE (bvar));
> reduc->init = init;
>
> /* Replace the argument
> ! representing the initialization value with the initialization
> ! value for the reduction ( neutral element for the
> ! particular operation, e.g. 0 for PLUS_EXPR, 1 for MULT_EXPR, etc).
> ! Keep the old value
> in a new variable "reduction_initial", that will be taken in
> consideration after the parallel computing is done. */
line wraps -- there seems to be no reason for ending the line after
"argument" and "value".
> ! /* Callback for htab_traverse. Adds a field corresponding to the reduction
> ! specified in SLOT. The type is passed in DATA. */
> !
> ! static int
> ! add_field_for_reduction (void **slot, void *data)
> {
> !
> ! struct reduction_info *red = *slot;
> ! tree type = data;
> ! tree var = SSA_NAME_VAR (GIMPLE_STMT_OPERAND (red->reduc_stmt, 0));
> ! tree field = build_decl (FIELD_DECL, DECL_NAME (var), TREE_TYPE (var));
> !
> ! insert_field_into_struct (type, field);
> !
> !
remove (at least one) newline here.
> *************** create_loads_for_reductions (void **slot
> *** 1061,1069 ****
> name = make_ssa_name (bvar, stmt);
> GIMPLE_STMT_OPERAND (stmt, 0) = name;
> SSA_NAME_DEF_STMT (name) = stmt;
> !
> bsi_insert_after (&bsi, stmt, BSI_NEW_STMT);
> -
> x =
> fold_build2 (red->reduction_code, TREE_TYPE (load_struct),
> name, red->initial_value);
> --- 962,969 ----
> name = make_ssa_name (bvar, stmt);
> GIMPLE_STMT_OPERAND (stmt, 0) = name;
> SSA_NAME_DEF_STMT (name) = stmt;
> ! mark_virtual_ops_for_renaming (stmt);
> bsi_insert_after (&bsi, stmt, BSI_NEW_STMT);
> x =
> fold_build2 (red->reduction_code, TREE_TYPE (load_struct),
> name, red->initial_value);
Why is the call to mark_virtual_ops_for_renaming added here?
> *************** create_final_loads_for_reduction (htab_t
> *** 1103,1108 ****
> --- 1003,1037 ----
>
> }
>
> + /* Callback for htab_traverse. Store the neutral value for the
> + particular reduction's operation, e.g. 0 for PLUS_EXPR,
> + 1 for MULT_EXPR, etc.
> + into the reduction field.
do not end the line after etc.
> + The reduction is specified in SLOT. The store information is anootated
anootated in --> passed in
> ! htab_traverse (name_copies, add_field_for_name, type);
> ! if (htab_elements (reduction_list) > 0)
> ! {
> ! /* Create the fields for reductions. */
> ! htab_traverse (reduction_list, add_field_for_reduction,
> ! type);
> ! }
use tab instead of 8 spaces
> layout_type (type);
> +
do not add this empty line
> /* Create the loads and stores. */
> *arg_struct = create_tmp_var (type, ".paral_data_store");
> *************** separate_decls_in_loop (struct loop *loo
> *** 1237,1249 ****
> --- 1169,1185 ----
> ld_st_data->load = *new_arg_struct;
> ld_st_data->store_bb = bb0;
> ld_st_data->load_bb = bb1;
> +
> htab_traverse (name_copies, create_loads_and_stores_for_name,
> ld_st_data);
>
> +
do not add this empty line
> /* Load the calculation from memory into a new
> reduction variable (after the join of the threads). */
> if (htab_elements (reduction_list) > 0)
> {
> + htab_traverse (reduction_list, create_stores_for_reduction,
> + ld_st_data);
tab instead of 8 spaces