From 7aa0d35066596b3c0fefb385bbe1ee43f75f8ec1 Mon Sep 17 00:00:00 2001 From: irar Date: Sun, 12 Jul 2009 07:09:07 +0000 Subject: * tree-parloops.c (loop_parallel_p): Call vect_is_simple_reduction with additional argument. * tree-vectorizer.h (enum vect_def_type): Add vect_double_reduction_def. (vect_is_simple_reduction): Add argument. * tree-vect-loop.c (vect_determine_vectorization_factor): Fix indentation. (vect_analyze_scalar_cycles_1): Detect double reduction. Call vect_is_simple_reduction with additional argument. (vect_analyze_loop_operations): Handle exit phi nodes in case of double reduction. (reduction_code_for_scalar_code): Handle additional codes by returning ERROR_MARK for them. Fix comment and indentation. (vect_is_simple_reduction): Fix comment, add argument to specify double reduction. Detect double reduction. (get_initial_def_for_induction): Fix indentation. (get_initial_def_for_reduction): Fix comment and indentation. Handle double reduction. Create initial definitions that do not require adjustment if ADJUSTMENT_DEF is NULL. Handle additional cases. (vect_create_epilog_for_reduction): Fix comment, add argument to handle double reduction. Use PLUS_EXPR in case of MINUS_EXPR in epilogue result extraction. Create double reduction phi node and replace relevant uses. (vectorizable_reduction): Call vect_is_simple_reduction with additional argument. Fix indentation. Update epilogue code treatment according to the changes in reduction_code_for_scalar_code. Check for double reduction. Call vect_create_epilog_for_reduction with additional argument. * tree-vect-stmts.c (process_use): Handle double reduction, update documentation. (vect_mark_stmts_to_be_vectorized): Handle double reduction. (vect_get_vec_def_for_operand): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149526 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-parloops.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gcc/tree-parloops.c') diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c index 5f11fc77a1b..28c96a26f59 100644 --- a/gcc/tree-parloops.c +++ b/gcc/tree-parloops.c @@ -284,13 +284,15 @@ loop_parallel_p (struct loop *loop, htab_t reduction_list, { gimple phi = gsi_stmt (gsi); gimple reduc_stmt = NULL; + bool dummy; /* ??? TODO: Change this into a generic function that recognizes reductions. */ if (!is_gimple_reg (PHI_RESULT (phi))) continue; if (simple_loop_info) - reduc_stmt = vect_is_simple_reduction (simple_loop_info, phi, true); + reduc_stmt = vect_is_simple_reduction (simple_loop_info, phi, true, + &dummy); /* Create a reduction_info struct, initialize it and insert it to the reduction list. */ -- cgit v1.2.1 From 5fa90eea4b059f09eabb66106ff877544e73a8b5 Mon Sep 17 00:00:00 2001 From: razya Date: Thu, 30 Jul 2009 08:39:57 +0000 Subject: 2009-07-30 Razya Ladelsky * ssa-loop-manip.c: Include langhooks.h. (rewrite_phi_with_iv): New. (rewrite_all_phi_nodes_with_iv): New. (canonicalize_loop_ivs): Move here from tree-parloops.c. Remove reduction_list argument. Use rewrite_all_phi_nodes_with_iv. * tree-parloops.c (loop_parallel_p): Move out all conditions except dependency check. (canonicalize_loop_ivs): Move to tree-ssa-loop-manip.c. (gen_parallel_loop): Call canonicalize_loop_ivs without reduction_list argument. (build_new_reduction): New. (gather_scalar_reductions): New. (try_get_loop_niter): New. (try_create_reduction_list): New. (parallleize_loops): Change the parallel conditions check. * tree-flow.h (canonicalize_loop_ivs): Remove one argument. * Makefile.in (tree-ssa-loop-manip.o): Add langhooks.h dependency. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150250 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-parloops.c | 494 +++++++++++++++++++++++----------------------------- 1 file changed, 214 insertions(+), 280 deletions(-) (limited to 'gcc/tree-parloops.c') diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c index 28c96a26f59..f9a2e40d480 100644 --- a/gcc/tree-parloops.c +++ b/gcc/tree-parloops.c @@ -241,175 +241,22 @@ name_to_copy_elt_hash (const void *aa) return (hashval_t) a->version; } -/* Returns true if the iterations of LOOP are independent on each other (that - is, if we can execute them in parallel), and if LOOP satisfies other - conditions that we need to be able to parallelize it. Description of number - of iterations is stored to NITER. Reduction analysis is done, if - reductions are found, they are inserted to the REDUCTION_LIST. */ + +/* Data dependency analysis. Returns true if the iterations of LOOP + are independent on each other (that is, if we can execute them + in parallel). */ static bool -loop_parallel_p (struct loop *loop, htab_t reduction_list, - struct tree_niter_desc *niter) +loop_parallel_p (struct loop *loop) { - edge exit = single_dom_exit (loop); VEC (ddr_p, heap) * dependence_relations; VEC (data_reference_p, heap) *datarefs; lambda_trans_matrix trans; bool ret = false; - gimple_stmt_iterator gsi; - loop_vec_info simple_loop_info; - - /* Only consider innermost loops with just one exit. The innermost-loop - restriction is not necessary, but it makes things simpler. */ - if (loop->inner || !exit) - return false; if (dump_file && (dump_flags & TDF_DETAILS)) fprintf (dump_file, "\nConsidering loop %d\n", loop->num); - /* We need to know # of iterations, and there should be no uses of values - defined inside loop outside of it, unless the values are invariants of - the loop. */ - if (!number_of_iterations_exit (loop, exit, niter, false)) - { - if (dump_file && (dump_flags & TDF_DETAILS)) - fprintf (dump_file, " FAILED: number of iterations not known\n"); - return false; - } - - vect_dump = NULL; - simple_loop_info = vect_analyze_loop_form (loop); - - for (gsi = gsi_start_phis (loop->header); !gsi_end_p (gsi); gsi_next (&gsi)) - { - gimple phi = gsi_stmt (gsi); - gimple reduc_stmt = NULL; - bool dummy; - - /* ??? TODO: Change this into a generic function that - recognizes reductions. */ - if (!is_gimple_reg (PHI_RESULT (phi))) - continue; - if (simple_loop_info) - reduc_stmt = vect_is_simple_reduction (simple_loop_info, phi, true, - &dummy); - - /* Create a reduction_info struct, initialize it and insert it to - the reduction list. */ - - if (reduc_stmt) - { - PTR *slot; - struct reduction_info *new_reduction; - - if (dump_file && (dump_flags & TDF_DETAILS)) - { - fprintf (dump_file, - "Detected reduction. reduction stmt is: \n"); - print_gimple_stmt (dump_file, reduc_stmt, 0, 0); - fprintf (dump_file, "\n"); - } - - new_reduction = XCNEW (struct reduction_info); - - new_reduction->reduc_stmt = reduc_stmt; - new_reduction->reduc_phi = phi; - new_reduction->reduction_code = gimple_assign_rhs_code (reduc_stmt); - slot = htab_find_slot (reduction_list, new_reduction, INSERT); - *slot = new_reduction; - } - } - - /* Get rid of the information created by the vectorizer functions. */ - destroy_loop_vec_info (simple_loop_info, true); - - for (gsi = gsi_start_phis (exit->dest); !gsi_end_p (gsi); gsi_next (&gsi)) - { - gimple phi = gsi_stmt (gsi); - struct reduction_info *red; - imm_use_iterator imm_iter; - use_operand_p use_p; - gimple reduc_phi; - tree val = PHI_ARG_DEF_FROM_EDGE (phi, exit); - - if (is_gimple_reg (val)) - { - if (dump_file && (dump_flags & TDF_DETAILS)) - { - fprintf (dump_file, "phi is "); - print_gimple_stmt (dump_file, phi, 0, 0); - fprintf (dump_file, "arg of phi to exit: value "); - print_generic_expr (dump_file, val, 0); - fprintf (dump_file, " used outside loop\n"); - fprintf (dump_file, - " checking if it a part of reduction pattern: \n"); - } - if (htab_elements (reduction_list) == 0) - { - if (dump_file && (dump_flags & TDF_DETAILS)) - fprintf (dump_file, - " FAILED: it is not a part of reduction.\n"); - return false; - } - reduc_phi = NULL; - FOR_EACH_IMM_USE_FAST (use_p, imm_iter, val) - { - if (flow_bb_inside_loop_p (loop, gimple_bb (USE_STMT (use_p)))) - { - reduc_phi = USE_STMT (use_p); - break; - } - } - red = reduction_phi (reduction_list, reduc_phi); - if (red == NULL) - { - if (dump_file && (dump_flags & TDF_DETAILS)) - fprintf (dump_file, - " FAILED: it is not a part of reduction.\n"); - return false; - } - if (dump_file && (dump_flags & TDF_DETAILS)) - { - fprintf (dump_file, "reduction phi is "); - print_gimple_stmt (dump_file, red->reduc_phi, 0, 0); - fprintf (dump_file, "reduction stmt is "); - print_gimple_stmt (dump_file, red->reduc_stmt, 0, 0); - } - - } - } - - /* The iterations of the loop may communicate only through bivs whose - iteration space can be distributed efficiently. */ - for (gsi = gsi_start_phis (loop->header); !gsi_end_p (gsi); gsi_next (&gsi)) - { - gimple phi = gsi_stmt (gsi); - tree def = PHI_RESULT (phi); - affine_iv iv; - - if (is_gimple_reg (def) && !simple_iv (loop, loop, def, &iv, true)) - { - struct reduction_info *red; - - red = reduction_phi (reduction_list, phi); - if (red == NULL) - { - if (dump_file && (dump_flags & TDF_DETAILS)) - fprintf (dump_file, - " FAILED: scalar dependency between iterations\n"); - return false; - } - } - } - - /* We need to version the loop to verify assumptions in runtime. */ - if (!can_duplicate_loop_p (loop)) - { - if (dump_file && (dump_flags & TDF_DETAILS)) - fprintf (dump_file, " FAILED: cannot be duplicated\n"); - return false; - } - /* Check for problems with dependences. If the loop can be reversed, the iterations are independent. */ datarefs = VEC_alloc (data_reference_p, heap, 10); @@ -1330,114 +1177,6 @@ create_loop_fn (void) return decl; } -/* Bases all the induction variables in LOOP on a single induction - variable (unsigned with base 0 and step 1), whose final value is - compared with *NIT. When the IV type precision has to be larger - than *NIT type precision, *NIT is converted to the larger type, the - conversion code is inserted before the loop, and *NIT is updated to - the new definition. The induction variable is incremented in the - loop latch. REDUCTION_LIST describes the reductions in LOOP. - Return the induction variable that was created. */ - -tree -canonicalize_loop_ivs (struct loop *loop, htab_t reduction_list, tree *nit) -{ - unsigned precision = TYPE_PRECISION (TREE_TYPE (*nit)); - unsigned original_precision = precision; - tree res, type, var_before, val, atype, mtype; - gimple_stmt_iterator gsi, psi; - gimple phi, stmt; - bool ok; - affine_iv iv; - edge exit = single_dom_exit (loop); - struct reduction_info *red; - gimple_seq stmts; - - for (psi = gsi_start_phis (loop->header); - !gsi_end_p (psi); gsi_next (&psi)) - { - phi = gsi_stmt (psi); - res = PHI_RESULT (phi); - - if (is_gimple_reg (res) && TYPE_PRECISION (TREE_TYPE (res)) > precision) - precision = TYPE_PRECISION (TREE_TYPE (res)); - } - - type = lang_hooks.types.type_for_size (precision, 1); - - if (original_precision != precision) - { - *nit = fold_convert (type, *nit); - *nit = force_gimple_operand (*nit, &stmts, true, NULL_TREE); - if (stmts) - gsi_insert_seq_on_edge_immediate (loop_preheader_edge (loop), stmts); - } - - gsi = gsi_last_bb (loop->latch); - create_iv (build_int_cst_type (type, 0), build_int_cst (type, 1), NULL_TREE, - loop, &gsi, true, &var_before, NULL); - - gsi = gsi_after_labels (loop->header); - for (psi = gsi_start_phis (loop->header); !gsi_end_p (psi); ) - { - phi = gsi_stmt (psi); - res = PHI_RESULT (phi); - - if (!is_gimple_reg (res) || res == var_before) - { - gsi_next (&psi); - continue; - } - - ok = simple_iv (loop, loop, res, &iv, true); - - if (reduction_list) - red = reduction_phi (reduction_list, phi); - else - red = NULL; - - /* We preserve the reduction phi nodes. */ - if (!ok && red) - { - gsi_next (&psi); - continue; - } - else - gcc_assert (ok); - remove_phi_node (&psi, false); - - atype = TREE_TYPE (res); - mtype = POINTER_TYPE_P (atype) ? sizetype : atype; - val = fold_build2 (MULT_EXPR, mtype, unshare_expr (iv.step), - fold_convert (mtype, var_before)); - val = fold_build2 (POINTER_TYPE_P (atype) - ? POINTER_PLUS_EXPR : PLUS_EXPR, - atype, unshare_expr (iv.base), val); - val = force_gimple_operand_gsi (&gsi, val, false, NULL_TREE, true, - GSI_SAME_STMT); - stmt = gimple_build_assign (res, val); - gsi_insert_before (&gsi, stmt, GSI_SAME_STMT); - SSA_NAME_DEF_STMT (res) = stmt; - } - - stmt = last_stmt (exit->src); - /* Make the loop exit if the control condition is not satisfied. */ - if (exit->flags & EDGE_TRUE_VALUE) - { - edge te, fe; - - extract_true_false_edges_from_block (exit->src, &te, &fe); - te->flags = EDGE_FALSE_VALUE; - fe->flags = EDGE_TRUE_VALUE; - } - gimple_cond_set_code (stmt, LT_EXPR); - gimple_cond_set_lhs (stmt, var_before); - gimple_cond_set_rhs (stmt, *nit); - update_stmt (stmt); - - return var_before; -} - /* Moves the exit condition of LOOP to the beginning of its header, and duplicates the part of the last iteration that gets disabled to the exit of the loop. NIT is the number of iterations of the loop @@ -1675,12 +1414,14 @@ create_parallel_loop (struct loop *loop, tree loop_fn, tree data, return paral_bb; } -/* Generates code to execute the iterations of LOOP in N_THREADS threads in - parallel. NITER describes number of iterations of LOOP. +/* Generates code to execute the iterations of LOOP in N_THREADS + threads in parallel. + + NITER describes number of iterations of LOOP. REDUCTION_LIST describes the reductions existent in the LOOP. */ static void -gen_parallel_loop (struct loop *loop, htab_t reduction_list, +gen_parallel_loop (struct loop *loop, htab_t reduction_list, unsigned n_threads, struct tree_niter_desc *niter) { struct loop *nloop; @@ -1782,7 +1523,7 @@ gen_parallel_loop (struct loop *loop, htab_t reduction_list, free_original_copy_tables (); /* Base all the induction variables in LOOP on a single control one. */ - canonicalize_loop_ivs (loop, reduction_list, &nit); + canonicalize_loop_ivs (loop, &nit); /* Ensure that the exit condition is the first statement in the loop. */ transform_to_exit_first_loop (loop, reduction_list, nit); @@ -1848,6 +1589,184 @@ loop_has_vector_phi_nodes (struct loop *loop ATTRIBUTE_UNUSED) return res; } +/* Create a reduction_info struct, initialize it with REDUC_STMT + and PHI, insert it to the REDUCTION_LIST. */ + +static void +build_new_reduction (htab_t reduction_list, gimple reduc_stmt, gimple phi) +{ + PTR *slot; + struct reduction_info *new_reduction; + + gcc_assert (reduc_stmt); + + if (dump_file && (dump_flags & TDF_DETAILS)) + { + fprintf (dump_file, + "Detected reduction. reduction stmt is: \n"); + print_gimple_stmt (dump_file, reduc_stmt, 0, 0); + fprintf (dump_file, "\n"); + } + + new_reduction = XCNEW (struct reduction_info); + + new_reduction->reduc_stmt = reduc_stmt; + new_reduction->reduc_phi = phi; + new_reduction->reduction_code = gimple_assign_rhs_code (reduc_stmt); + slot = htab_find_slot (reduction_list, new_reduction, INSERT); + *slot = new_reduction; +} + +/* Detect all reductions in the LOOP, insert them into REDUCTION_LIST. */ + +static void +gather_scalar_reductions (loop_p loop, htab_t reduction_list) +{ + gimple_stmt_iterator gsi; + loop_vec_info simple_loop_info; + + vect_dump = NULL; + simple_loop_info = vect_analyze_loop_form (loop); + + for (gsi = gsi_start_phis (loop->header); !gsi_end_p (gsi); gsi_next (&gsi)) + { + gimple phi = gsi_stmt (gsi); + affine_iv iv; + tree res = PHI_RESULT (phi); + bool double_reduc; + + if (!is_gimple_reg (res)) + continue; + + if (!simple_iv (loop, loop, res, &iv, true) + && simple_loop_info) + { + gimple reduc_stmt = vect_is_simple_reduction (simple_loop_info, phi, true, &double_reduc); + if (reduc_stmt) + build_new_reduction (reduction_list, reduc_stmt, phi); + } + } + destroy_loop_vec_info (simple_loop_info, true); +} + +/* Try to initialize NITER for code generation part. */ + +static bool +try_get_loop_niter (loop_p loop, struct tree_niter_desc *niter) +{ + edge exit = single_dom_exit (loop); + + gcc_assert (exit); + + /* We need to know # of iterations, and there should be no uses of values + defined inside loop outside of it, unless the values are invariants of + the loop. */ + if (!number_of_iterations_exit (loop, exit, niter, false)) + { + if (dump_file && (dump_flags & TDF_DETAILS)) + fprintf (dump_file, " FAILED: number of iterations not known\n"); + return false; + } + + return true; +} + +/* Try to initialize REDUCTION_LIST for code generation part. + REDUCTION_LIST describes the reductions. */ + +static bool +try_create_reduction_list (loop_p loop, htab_t reduction_list) +{ + edge exit = single_dom_exit (loop); + gimple_stmt_iterator gsi; + + gcc_assert (exit); + + gather_scalar_reductions (loop, reduction_list); + + + for (gsi = gsi_start_phis (exit->dest); !gsi_end_p (gsi); gsi_next (&gsi)) + { + gimple phi = gsi_stmt (gsi); + struct reduction_info *red; + imm_use_iterator imm_iter; + use_operand_p use_p; + gimple reduc_phi; + tree val = PHI_ARG_DEF_FROM_EDGE (phi, exit); + + if (is_gimple_reg (val)) + { + if (dump_file && (dump_flags & TDF_DETAILS)) + { + fprintf (dump_file, "phi is "); + print_gimple_stmt (dump_file, phi, 0, 0); + fprintf (dump_file, "arg of phi to exit: value "); + print_generic_expr (dump_file, val, 0); + fprintf (dump_file, " used outside loop\n"); + fprintf (dump_file, + " checking if it a part of reduction pattern: \n"); + } + if (htab_elements (reduction_list) == 0) + { + if (dump_file && (dump_flags & TDF_DETAILS)) + fprintf (dump_file, + " FAILED: it is not a part of reduction.\n"); + return false; + } + reduc_phi = NULL; + FOR_EACH_IMM_USE_FAST (use_p, imm_iter, val) + { + if (flow_bb_inside_loop_p (loop, gimple_bb (USE_STMT (use_p)))) + { + reduc_phi = USE_STMT (use_p); + break; + } + } + red = reduction_phi (reduction_list, reduc_phi); + if (red == NULL) + { + if (dump_file && (dump_flags & TDF_DETAILS)) + fprintf (dump_file, + " FAILED: it is not a part of reduction.\n"); + return false; + } + if (dump_file && (dump_flags & TDF_DETAILS)) + { + fprintf (dump_file, "reduction phi is "); + print_gimple_stmt (dump_file, red->reduc_phi, 0, 0); + fprintf (dump_file, "reduction stmt is "); + print_gimple_stmt (dump_file, red->reduc_stmt, 0, 0); + } + } + } + + /* The iterations of the loop may communicate only through bivs whose + iteration space can be distributed efficiently. */ + for (gsi = gsi_start_phis (loop->header); !gsi_end_p (gsi); gsi_next (&gsi)) + { + gimple phi = gsi_stmt (gsi); + tree def = PHI_RESULT (phi); + affine_iv iv; + + if (is_gimple_reg (def) && !simple_iv (loop, loop, def, &iv, true)) + { + struct reduction_info *red; + + red = reduction_phi (reduction_list, phi); + if (red == NULL) + { + if (dump_file && (dump_flags & TDF_DETAILS)) + fprintf (dump_file, + " FAILED: scalar dependency between iterations\n"); + return false; + } + } + } + + + return true; +} + /* Detect parallel loops and generate parallel code using libgomp primitives. Returns true if some loop was parallelized, false otherwise. */ @@ -1867,26 +1786,41 @@ parallelize_loops (void) return false; reduction_list = htab_create (10, reduction_info_hash, - reduction_info_eq, free); + reduction_info_eq, free); init_stmt_vec_info_vec (); FOR_EACH_LOOP (li, loop, 0) { htab_empty (reduction_list); - if (/* Do not bother with loops in cold areas. */ - optimize_loop_nest_for_size_p (loop) - /* Or loops that roll too little. */ - || expected_loop_iterations (loop) <= n_threads - /* And of course, the loop must be parallelizable. */ - || !can_duplicate_loop_p (loop) + + /* FIXME: Only consider innermost loops with just one exit. */ + if (loop->inner || !single_dom_exit (loop)) + continue; + + if (/* And of course, the loop must be parallelizable. */ + !can_duplicate_loop_p (loop) || loop_has_blocks_with_irreducible_flag (loop) /* FIXME: the check for vector phi nodes could be removed. */ - || loop_has_vector_phi_nodes (loop) - || !loop_parallel_p (loop, reduction_list, &niter_desc)) + || loop_has_vector_phi_nodes (loop)) + continue; + + if (/* Do not bother with loops in cold areas. */ + optimize_loop_nest_for_size_p (loop) + /* Or loops that roll too little. */ + || expected_loop_iterations (loop) <= n_threads) + continue; + if (!try_get_loop_niter (loop, &niter_desc)) + continue; + + if (!try_create_reduction_list (loop, reduction_list)) + continue; + + if (!loop_parallel_p (loop)) continue; changed = true; - gen_parallel_loop (loop, reduction_list, n_threads, &niter_desc); + gen_parallel_loop (loop, reduction_list, + n_threads, &niter_desc); verify_flow_info (); verify_dominators (CDI_DOMINATORS); verify_loop_structure (); -- cgit v1.2.1 From efbcb6defd4842cee3bc73eec195fe425457ea13 Mon Sep 17 00:00:00 2001 From: amacleod Date: Thu, 30 Jul 2009 18:36:30 +0000 Subject: Add source_location support to PHI arguments. 2009-07-29 Andrew MacLeod PR debug 26475 * tree-into-ssa.c (insert_phi_nodes_for, rewrite_add_phi_arguments): Set location for phi arguments. (rewrite_update_phi_arguments): Find locations for reaching defs. * tree-ssa-threadupdate.c (create_edge_and_update_destination_phis): Add location to add_phi_arg calls. * tree-loop-districbution.c (update_phis_for_loop_copy): Add locations. * tree-ssa-loop-manip.c (create_iv, add_exit_phis_edge, split_loop_exit_edge, tree_transform_and_unroll_loop): Add locations. * tree-tailcall.c (add_successor_phi_arg, eliminate_tail_call, create_tailcall_accumulator, tree_optimize_tail_calls_1): Add locations. * tree.h (struct phi_arg_d): Add location_t to PHI arguments. * tree-phinodes.c (make_phi_node): Initialize location. (resize_phi_node): Initialize location to UNKNOWN_LOCATION. (add_phi_arg): Add location parameter. (remove_phi_arg_num): Move location when moving phi argument. * omp-low.c (expand_parallel_call, expand_omp_for_static_chunk): Set location. * tree-vect-loop-manip.c (slpeel_update_phis_for_duplicate_loop, slpeel_update_phi_nodes_for_guard1, slpeel_update_phi_nodes_for_guard2, slpeel_tree_duplicate_loop_to_edge_cfg, set_prologue_iterations, vect_loop_versioning): Set locations. * tree-parloops.c (create_phi_for_local_result, transform_to_exit_first_loop, create_parallel_loop): Add locations. * gimple-pretty-print.c (dump_gimple_phi): Dump lineno's if present. * tree-vect-loop.c (get_initial_def_for_induction, vect_create_epilog_for_reduction, vect_finalize_reduction): Add locations. * tree-flow-inline.h (gimple_phi_arg_location): New. Return locus. (gimple_phi_arg_location_from_edge): New. Return locus from an edge. (gimple_phi_arg_set_location): New. Set locus. (gimple_phi_arg_has_location): New. Check for locus. (redirect_edge_var_map_location): New. Return locus from var_map. * tree-vect-data-refs.c (vect_setup_realignment): Set location. * tree-ssa-phiopt.c (conditional_replacement): Set locus when combining PHI arguments. (cond_store_replacement): Set location. * cfgexpand.c (gimple_assign_rhs_to_tree): Transfer locus if possible. * grpahite.c (add_loop_exit_phis, add_guard_exit_phis, scop_add_exit_phis_edge): Add locations. * tree-cfgcleanup.c (remove_forwarder_block, remove_forwarder_block_with_phi): Add locations. * tree-ssa-pre.c (insert_into_preds_of_block): Add locations. * tree-predcom.c (initialize_root_vars, initialize_root_vars_lm): Add locations. * tree-ssa-dce.c (forward_edge_to_pdom): Add locations. * tree-ssa.c (redirect_edge_var_map_add, ssa_redirect_edge, flush_pending_stmts): Add source location. * lambda-code.c (perfect_nestify): Maintain location stack with argument stack to preserve locations. * tree-vect-stmts.c (vectorizable_load): Add location. * tree-inline.c (copy_phis_for_bb): Copy locus. (setup_one_parameter): Add call locus to inlined parameter stmts. (initialize_inlined_parameters): Pass in call location as parameter assignment locus. (tree_function_versioning): Pass location to setup_one_parameter. * tree-ssa-phiprop.c (phiprop_insert_phi): Set locations. * tree-outof-ssa.c (struct _elim_graph): Add source_location vecs for copy and edge lists. (insert_partition_copy_on_edge, insert_value_copy_on_edge, insert_rtx_to_part_on_edge, insert_part_to_rtx_on_edge): Provide a locus parameter and override the stmt default if provided. (new_elim_graph, clear_elim_graph, delete_elim_graph, elim_graph_add_edge, elim_graph_remove_succ_edge, FOR_EACH_ELIM_GRAPH_SUCC, FOR_EACH_ELIM_GRAPH_PRED, eliminate_build, elim_forward, elim_unvisited_predecessor, elim_backward, elim_create, eliminate_phi): Add locus info in elimination graph for each edge and value copy. (insert_backedge_copies): Copy locus if present. * tree-flow.h (struct _edge_var_map): Add locus field. * tree-switch_conversions.c (fix_phi_nodes): Add locations. * tree-cfg.c (reinstall_phi_args, gimple_make_forwarder_block, add_phi_args_after_copy_edge, gimple_lv_adjust_loop_header_phi): Add locations. * ipa-struct-reorg.c (make_edge_and_fix_phis_of_dest): Add locations. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150267 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-parloops.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'gcc/tree-parloops.c') diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c index f9a2e40d480..9acf0ff75f0 100644 --- a/gcc/tree-parloops.c +++ b/gcc/tree-parloops.c @@ -747,6 +747,7 @@ create_phi_for_local_result (void **slot, void *data) gimple new_phi; basic_block store_bb; tree local_res; + source_location locus; /* STORE_BB is the block where the phi should be stored. It is the destination of the loop exit. @@ -765,11 +766,12 @@ create_phi_for_local_result (void **slot, void *data) local_res = make_ssa_name (SSA_NAME_VAR (gimple_assign_lhs (reduc->reduc_stmt)), NULL); + locus = gimple_location (reduc->reduc_stmt); new_phi = create_phi_node (local_res, store_bb); SSA_NAME_DEF_STMT (local_res) = new_phi; - add_phi_arg (new_phi, reduc->init, e); + add_phi_arg (new_phi, reduc->init, e, locus); add_phi_arg (new_phi, gimple_assign_lhs (reduc->reduc_stmt), - FALLTHRU_EDGE (loop->latch)); + FALLTHRU_EDGE (loop->latch), locus); reduc->new_phi = new_phi; return 1; @@ -1219,7 +1221,7 @@ transform_to_exit_first_loop (struct loop *loop, htab_t reduction_list, tree nit nphi = create_phi_node (res, orig_header); SSA_NAME_DEF_STMT (res) = nphi; - add_phi_arg (nphi, t, hpred); + add_phi_arg (nphi, t, hpred, UNKNOWN_LOCATION); if (res == control) { @@ -1370,14 +1372,20 @@ create_parallel_loop (struct loop *loop, tree loop_fn, tree data, end = make_edge (loop->latch, ex_bb, EDGE_FALLTHRU); for (gsi = gsi_start_phis (ex_bb); !gsi_end_p (gsi); gsi_next (&gsi)) { + source_location locus; + tree def; phi = gsi_stmt (gsi); res = PHI_RESULT (phi); stmt = SSA_NAME_DEF_STMT (PHI_ARG_DEF_FROM_EDGE (phi, exit)); - add_phi_arg (phi, - PHI_ARG_DEF_FROM_EDGE (stmt, loop_preheader_edge (loop)), - guard); - add_phi_arg (phi, PHI_ARG_DEF_FROM_EDGE (stmt, loop_latch_edge (loop)), - end); + + def = PHI_ARG_DEF_FROM_EDGE (stmt, loop_preheader_edge (loop)); + locus = gimple_phi_arg_location_from_edge (stmt, + loop_preheader_edge (loop)); + add_phi_arg (phi, def, guard, locus); + + def = PHI_ARG_DEF_FROM_EDGE (stmt, loop_latch_edge (loop)); + locus = gimple_phi_arg_location_from_edge (stmt, loop_latch_edge (loop)); + add_phi_arg (phi, def, end, locus); } e = redirect_edge_and_branch (exit, nexit->dest); PENDING_STMT (e) = NULL; -- cgit v1.2.1 From 525c22c498481eed78b279ca708cf4d60509c90c Mon Sep 17 00:00:00 2001 From: spop Date: Wed, 12 Aug 2009 14:18:17 +0000 Subject: Measure time spent in DD analysis and in code gen. 2009-08-05 Sebastian Pop * graphite-clast-to-gimple.c (gloog): Add time to TV_GRAPHITE_CODE_GEN. * graphite-dependences.c (graphite_legal_transform): Add time to TV_GRAPHITE_DATA_DEPS. (dependency_between_pbbs_p): Same. * timevar.def (TV_GRAPHITE_DATA_DEPS, TV_GRAPHITE_CODE_GEN): New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150683 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-parloops.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'gcc/tree-parloops.c') diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c index 9acf0ff75f0..9b9ac758dc2 100644 --- a/gcc/tree-parloops.c +++ b/gcc/tree-parloops.c @@ -1801,6 +1801,11 @@ parallelize_loops (void) { htab_empty (reduction_list); + /* If we use autopar in graphite pass, we use it's marked dependency + checking results. */ + if (flag_loop_parallelize_all && !loop->can_be_parallel) + continue; + /* FIXME: Only consider innermost loops with just one exit. */ if (loop->inner || !single_dom_exit (loop)) continue; @@ -1811,19 +1816,22 @@ parallelize_loops (void) /* FIXME: the check for vector phi nodes could be removed. */ || loop_has_vector_phi_nodes (loop)) continue; - - if (/* Do not bother with loops in cold areas. */ - optimize_loop_nest_for_size_p (loop) - /* Or loops that roll too little. */ - || expected_loop_iterations (loop) <= n_threads) + + /* FIXME: Bypass this check as graphite doesn't update the + count and frequency correctly now. */ + if (!flag_loop_parallelize_all + && (expected_loop_iterations (loop) <= n_threads + /* Do not bother with loops in cold areas. */ + || optimize_loop_nest_for_size_p (loop))) continue; + if (!try_get_loop_niter (loop, &niter_desc)) continue; if (!try_create_reduction_list (loop, reduction_list)) continue; - if (!loop_parallel_p (loop)) + if (!flag_loop_parallelize_all && !loop_parallel_p (loop)) continue; changed = true; -- cgit v1.2.1 From 9845d1202fec65574ca05d780859eb8c25489566 Mon Sep 17 00:00:00 2001 From: aoliva Date: Wed, 2 Sep 2009 02:42:21 +0000 Subject: gcc/ChangeLog: * doc/invoke.texi (-fvar-tracking-assignments): New. (-fvar-tracking-assignments-toggle): New. (-fdump-final-insns=file): Mark filename as optional. (--param min-nondebug-insn-uid): New. (-gdwarf-@{version}): Mention version 4. * opts.c (common_handle_option): Accept it. * tree-vrp.c (find_assert_locations_1): Skip debug stmts. * regrename.c (regrename_optimize): Drop last. Don't count debug insns as uses. Don't reject change because of debug insn. (do_replace): Reject DEBUG_INSN as chain starter. Take base_regno from the chain starter, and check for inexact matches in DEBUG_INSNS. (scan_rtx_reg): Accept inexact matches in DEBUG_INSNs. (build_def_use): Simplify and fix the marking of DEBUG_INSNs. * sched-ebb.c (schedule_ebbs): Skip boundary debug insns. * fwprop.c (forward_propagate_and_simplify): ...into debug insns. * doc/gimple.texi (is_gimple_debug): New. (gimple_debug_bind_p): New. (is_gimple_call, gimple_assign_cast_p): End sentence with period. * doc/install.texi (bootstrap-debug): More details. (bootstrap-debug-big, bootstrap-debug-lean): Document. (bootstrap-debug-lib): More details. (bootstrap-debug-ckovw): Update. (bootstrap-time): New. * tree-into-ssa.c (mark_def_sites): Skip debug stmts. (insert_phi_nodes_for): Insert debug stmts. (rewrite_stmt): Take iterator. Insert debug stmts. (rewrite_enter_block): Adjust. (maybe_replace_use_in_debug_stmt): New. (rewrite_update_stmt): Use it. (mark_use_interesting): Return early for debug stmts. * tree-ssa-loop-im.c (rewrite_bittest): Propagate DEFs into debug stmts before replacing stmt. (move_computations_stmt): Likewise. * ira-conflicts.c (add_copies): Skip debug insns. * regstat.c (regstat_init_n_sets_and_refs): Discount debug insns. (regstat_bb_compute_ri): Skip debug insns. * tree-ssa-threadupdate.c (redirection_block_p): Skip debug stmts. * tree-ssa-loop-manip.c (find_uses_to_rename_stmt, check_loop_closed_ssa_stmt): Skip debug stmts. * tree-tailcall.c (find_tail_calls): Likewise. * tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Likewise. * tree.h (MAY_HAVE_DEBUG_STMTS): New. (build_var_debug_value_stat): Declare. (build_var_debug_value): Define. (target_for_debug_bind): Declare. * reload.c (find_equiv_reg): Skip debug insns. * rtlanal.c (reg_used_between_p): Skip debug insns. (side_effects_p): Likewise. (canonicalize_condition): Likewise. * ddg.c (create_ddg_dep_from_intra_loop_link): Check that non-debug insns never depend on debug insns. (create_ddg_dep_no_link): Likewise. (add_cross_iteration_register_deps): Use ANTI_DEP for debug insns. Don't add inter-loop dependencies for debug insns. (build_intra_loop_deps): Likewise. (create_ddg): Count debug insns. * ddg.h (struct ddg::num_debug): New. (num_backargs): Pair up with previous int field. * diagnostic.c (diagnostic_report_diagnostic): Skip notes on -fcompare-debug-second. * final.c (get_attr_length_1): Skip debug insns. (rest_of_clean-state): Don't dump CFA_RESTORE_STATE. * gcc.c (invoke_as): Call compare-debug-dump-opt. (driver_self_specs): Map -fdump-final-insns to -fdump-final-insns=.. (get_local_tick): New. (compare_debug_dump_opt_spec_function): Test for . argument and compute output name. Compute temp output spec without flag name. Compute -frandom-seed. (OPT): Undef after use. * cfgloopanal.c (num_loop_insns): Skip debug insns. (average_num_loop_insns): Likewise. * params.h (MIN_NONDEBUG_INSN_UID): New. * gimple.def (GIMPLE_DEBUG): New. * ipa-reference.c (scan_stmt_for_static_refs): Skip debug stmts. * auto-inc-dec.c (merge_in_block): Skip debug insns. (merge_in_block): Fix whitespace. * toplev.c (flag_var_tracking): Update comment. (flag_var_tracking_assignments): New. (flag_var_tracking_assignments_toggle): New. (process_options): Don't open final insns dump file if we're not going to write to it. Compute defaults for var_tracking. * df-scan.c (df_insn_rescan_debug_internal): New. (df_uses_record): Handle debug insns. * haifa-sched.c (ready): Initialize n_debug. (contributes_to_priority): Skip debug insns. (dep_list_size): New. (priority): Use it. (rank_for_schedule): Likewise. Schedule debug insns as soon as they're ready. Disregard previous debug insns to make decisions. (queue_insn): Never queue debug insns. (ready_add, ready_remove_first, ready_remove): Count debug insns. (schedule_insn): Don't reject debug insns because of issue rate. (get_ebb_head_tail, no_real_insns_p): Skip boundary debug insns. (queue_to_ready): Skip and discount debug insns. (choose_ready): Let debug insns through. (schedule_block): Check boundary debug insns. Discount debug insns, schedule them early. Adjust whitespace. (set_priorities): Check for boundary debug insns. (add_jump_dependencies): Use dep_list_size. (prev_non_location_insn): New. (check_cfg): Use it. * tree-ssa-loop-ivopts.c (find-interesting_users): Skip debug stmts. (remove_unused_ivs): Reset debug stmts. * modulo-sched.c (const_iteration_count): Skip debug insns. (res_MII): Discount debug insns. (loop_single_full_bb_p): Skip debug insns. (sms_schedule): Likewise. (sms_schedule_by_order): Likewise. (ps_has_conflicts): Likewise. * caller-save.c (refmarker_fn): New. (save_call_clobbered_regs): Replace regs with saved mem in debug insns. (mark_referenced_regs): Take pointer, mark and arg. Adjust. Call refmarker_fn mark for hardregnos. (mark_reg_as_referenced): New. (replace_reg_with_saved_mem): New. * ipa-pure-const.c (check_stmt): Skip debug stmts. * cse.c (cse_insn): Canonicalize debug insns. Skip them when searching back. (cse_extended_basic_block): Skip debug insns. (count_reg_usage): Likewise. (is_dead_reg): New, split out of... (set_live_p): ... here. (insn_live_p): Use it for debug insns. * tree-stdarg.c (check_all_va_list_escapes): Skip debug stmts. (execute_optimize_stdarg): Likewise. * tree-ssa-dom.c (propagate_rhs_into_lhs): Likewise. * tree-ssa-propagate.c (substitute_and_fold): Don't regard changes in debug stmts as changes. * sel-sched.c (moving_insn_creates_bookkeeping_block_p): New. (moveup_expr): Don't move across debug insns. Don't move debug insn if it would create a bookkeeping block. (moveup_expr_cached): Don't use cache for debug insns that are heads of blocks. (compute_av_set_inside_bb): Skip debug insns. (sel_rank_for_schedule): Schedule debug insns first. Remove dead code. (block_valid_for_bookkeeping_p); Support lax searches. (create_block_for_bookkeeping): Adjust block numbers when encountering debug-only blocks. (find_place_for_bookkeeping): Deal with debug-only blocks. (generate_bookkeeping_insn): Accept no place to insert. (remove_temp_moveop_nops): New argument full_tidying. (prepare_place_to_insert): Deal with debug insns. (advance_state_on_fence): Debug insns don't start cycles. (update_boundaries): Take fence as argument. Deal with debug insns. (schedule_expr_on_boundary): No full_tidying on debug insns. (fill_insns): Deal with debug insns. (track_scheduled_insns_and_blocks): Don't count debug insns. (need_nop_to_preserve_insn_bb): New, split out of... (remove_insn_from_stream): ... this. (fur_orig_expr_not_found): Skip debug insns. * rtl.def (VALUE): Move up. (DEBUG_INSN): New. * tree-ssa-sink.c (all_immediate_uses_same_place): Skip debug stmts. (nearest_common_dominator_of_uses): Take debug_stmts argument. Set it if debug stmts are found. (statement_sink_location): Skip debug stmts. Propagate moving defs into debug stmts. * ifcvt.c (first_active_insn): Skip debug insns. (last_active_insns): Likewise. (cond_exec_process_insns): Likewise. (noce_process_if_block): Likewise. (check_cond_move_block): Likewise. (cond_move_convert_if_block): Likewise. (block_jumps_and_fallthru_p): Likewise. (dead_or_predicable): Likewise. * dwarf2out.c (debug_str_hash_forced): New. (find_AT_string): Add comment. (gen_label_for_indirect_string): New. (get_debug_string_label): New. (AT_string_form): Use it. (mem_loc_descriptor): Handle non-TLS symbols. Handle MINUS , DIV, MOD, AND, IOR, XOR, NOT, ABS, NEG, and CONST_STRING. Accept but discard COMPARE, IF_THEN_ELSE, ROTATE, ROTATERT, TRUNCATE and several operations that cannot be represented with DWARF opcodes. (loc_descriptor): Ignore SIGN_EXTEND and ZERO_EXTEND. Require dwarf_version 4 for DW_OP_implicit_value and DW_OP_stack_value. (dwarf2out_var_location): Take during-call mark into account. (output_indirect_string): Update comment. Output if there are label and references. (prune_indirect_string): New. (prune_unused_types): Call it if debug_str_hash_forced. More in dwarf2out.c, from Jakub Jelinek : (dw_long_long_const): Remove. (struct dw_val_struct): Change val_long_long type to rtx. (print_die, attr_checksum, same_dw_val_p, loc_descriptor): Adjust for val_long_long change to CONST_DOUBLE rtx from a long hi/lo pair. (output_die): Likewise. Use HOST_BITS_PER_WIDE_INT size of each component instead of HOST_BITS_PER_LONG. (output_loc_operands): Likewise. For const8* assert HOST_BITS_PER_WIDE_INT rather than HOST_BITS_PER_LONG is >= 64. (output_loc_operands_raw): For const8* assert HOST_BITS_PER_WIDE_INT rather than HOST_BITS_PER_LONG is >= 64. (add_AT_long_long): Remove val_hi and val_lo arguments, add val_const_double. (size_of_die): Use HOST_BITS_PER_WIDE_INT size multiplier instead of HOST_BITS_PER_LONG for dw_val_class_long_long. (add_const_value_attribute): Adjust add_AT_long_long caller. Don't handle TLS SYMBOL_REFs. If CONST wraps a constant, tail recurse. (dwarf_stack_op_name): Handle DW_OP_implicit_value and DW_OP_stack_value. (size_of_loc_descr, output_loc_operands, output_loc_operands_raw): Handle DW_OP_implicit_value. (extract_int): Move prototype earlier. (mem_loc_descriptor): For SUBREG punt if inner mode size is wider than DWARF2_ADDR_SIZE. Handle SIGN_EXTEND and ZERO_EXTEND by DW_OP_shl and DW_OP_shr{a,}. Handle EQ, NE, GT, GE, LT, LE, GTU, GEU, LTU, LEU, SMIN, SMAX, UMIN, UMAX, SIGN_EXTRACT, ZERO_EXTRACT. (loc_descriptor): Compare mode size with DWARF2_ADDR_SIZE instead of Pmode size. (loc_descriptor): Add MODE argument. Handle CONST_INT, CONST_DOUBLE, CONST_VECTOR, CONST, LABEL_REF and SYMBOL_REF if mode != VOIDmode, attempt to handle other expressions. Don't handle TLS SYMBOL_REFs. (concat_loc_descriptor, concatn_loc_descriptor, loc_descriptor_from_tree_1): Adjust loc_descriptor callers. (add_location_or_const_value_attribute): Likewise. For single location loc_lists attempt to use add_const_value_attribute for constant decls. Add DW_AT_const_value even if NOTE_VAR_LOCATION is VAR_LOCATION with CONSTANT_P or CONST_STRING in its expression. * cfgbuild.c (inside_basic_block_p): Handle debug insns. (control_flow_insn_p): Likewise. * tree-parloops.c (eliminate_local_variables_stmt): Handle debug stmt. (separate_decls_in_region_debug_bind): New. (separate_decls_in_region): Process debug bind stmts afterwards. * recog.c (verify_changes): Handle debug insns. (extract_insn): Likewise. (peephole2_optimize): Skip debug insns. * dse.c (scan_insn): Skip debug insns. * sel-sched-ir.c (return_nop_to_pool): Take full_tidying argument. Pass it on. (setup_id_for_insn): Handle debug insns. (maybe_tidy_empty_bb): Adjust whitespace. (tidy_control_flow): Skip debug insns. (sel_remove_insn): Adjust for debug insns. (sel_estimate_number_of_insns): Skip debug insns. (create_insn_rtx_from_pattern): Handle debug insns. (create_copy_of_insn_rtx): Likewise. * sel-sched-.h (sel_bb_end): Declare. (sel_bb_empty_or_nop_p): New. (get_all_loop_exits): Use it. (_eligible_successor_edge_p): Likewise. (return_nop_to_pool): Adjust. * tree-eh.c (tre_empty_eh_handler_p): Skip debug stmts. * ira-lives.c (process_bb_node_lives): Skip debug insns. * gimple-pretty-print.c (dump_gimple_debug): New. (dump_gimple_stmt): Use it. (dump_bb_header): Skip gimple debug stmts. * regmove.c (optimize_reg_copy_1): Discount debug insns. (fixup_match_2): Likewise. (regmove_backward_pass): Likewise. Simplify combined replacement. Handle debug insns. * function.c (instantiate_virtual_regs): Handle debug insns. * function.h (struct emit_status): Add x_cur_debug_insn_uid. * print-rtl.h: Include cselib.h. (print_rtx): Print VALUEs. Split out and recurse for VAR_LOCATIONs. * df.h (df_inns_rescan_debug_internal): Declare. * gcse.c (alloc_hash_table): Estimate n_insns. (cprop_insn): Don't regard debug insns as changes. (bypass_conditional_jumps): Skip debug insns. (one_pre_gcse_pass): Adjust. (one_code_hoisting_pass): Likewise. (compute_ld_motion_mems): Skip debug insns. (one_cprop_pass): Adjust. * tree-if-conv.c (tree_if_convert_stmt): Reset debug stmts. (if_convertible_stmt_p): Handle debug stmts. * init-regs.c (initialize_uninitialized_regs): Skip debug insns. * tree-vect-loop.c (vect_is_simple_reduction): Skip debug stmts. * ira-build.c (create_bb_allocnos): Skip debug insns. * tree-flow-inline.h (has_zero_uses): Discount debug stmts. (has_single_use): Likewise. (single_imm_use): Likewise. (num_imm_uses): Likewise. * tree-ssa-phiopt.c (empty_block_p): Skip debug stmts. * tree-ssa-coalesce.c (build_ssa_conflict_graph): Skip debug stmts. (create_outofssa_var_map): Likewise. * lower-subreg.c (adjust_decomposed_uses): New. (resolve_debug): New. (decompose_multiword_subregs): Use it. * tree-dfa.c (find_referenced_vars): Skip debug stmts. * emit-rtl.c: Include params.h. (cur_debug_insn_uid): Define. (set_new_first_and_last_insn): Set cur_debug_insn_uid too. (copy_rtx_if_shared_1): Handle debug insns. (reset_used_flags): Likewise. (set_used_flags): LIkewise. (get_max_insn_count): New. (next_nondebug_insn): New. (prev_nondebug_insn): New. (make_debug_insn_raw): New. (emit_insn_before_noloc): Handle debug insns. (emit_jump_insn_before_noloc): Likewise. (emit_call_insn_before_noloc): Likewise. (emit_debug_insn_before_noloc): New. (emit_insn_after_noloc): Handle debug insns. (emit_jump_insn_after_noloc): Likewise. (emit_call_insn_after_noloc): Likewise. (emit_debug_insn_after_noloc): Likewise. (emit_insn_after): Take loc from earlier non-debug insn. (emit_jump_insn_after): Likewise. (emit_call_insn_after): Likewise. (emit_debug_insn_after_setloc): New. (emit_debug_insn_after): New. (emit_insn_before): Take loc from later non-debug insn. (emit_jump_insn_before): Likewise. (emit_call_insn_before): Likewise. (emit_debug_insn_before_setloc): New. (emit_debug_insn_before): New. (emit_insn): Handle debug insns. (emit_debug_insn): New. (emit_jump_insn): Handle debug insns. (emit_call_insn): Likewise. (emit): Likewise. (init_emit): Take min-nondebug-insn-uid into account. Initialize cur_debug_insn_uid. (emit_copy_of_insn_after): Handle debug insns. * cfgexpand.c (gimple_assign_rhs_to_tree): Do not overwrite location of single rhs in place. (maybe_dump_rtl_for_gimple_stmt): Dump lineno. (floor_sdiv_adjust): New. (cell_sdiv_adjust): New. (cell_udiv_adjust): New. (round_sdiv_adjust): New. (round_udiv_adjust): New. (wrap_constant): Moved from cselib. (unwrap_constant): New. (expand_debug_expr): New. (expand_debug_locations): New. (expand_gimple_basic_block): Drop hiding redeclaration. Expand debug bind stmts. (gimple_expand_cfg): Expand debug locations. * cselib.c: Include tree-pass.h. (struct expand_value_data): New. (cselib_record_sets_hook): New. (PRESERVED_VALUE_P, LONG_TERM_PRESERVED_VALUE_P): New. (cselib_clear_table): Move, and implemnet in terms of... (cselib_reset_table_with_next_value): ... this. (cselib_get_next_unknown_value): New. (discard_useless_locs): Don't discard preserved values. (cselib_preserve_value): New. (cselib_preserved_value_p): New. (cselib_preserve_definitely): New. (cselib_clear_preserve): New. (cselib_preserve_only_values): New. (new_cselib_val): Take rtx argument. Dump it in details. (cselib_lookup_mem): Adjust. (expand_loc): Take regs_active in struct. Adjust. Silence dumps unless details are requested. (cselib_expand_value_rtx_cb): New. (cselib_expand_value_rtx): Rename and reimplment in terms of... (cselib_expand_value_rtx_1): ... this. Adjust. Silence dumps without details. Copy more subregs. Try to resolve values using a callback. Wrap constants. (cselib_subst_to_values): Adjust. (cselib_log_lookup): New. (cselib_lookup): Call it. (cselib_invalidate_regno): Don't count preserved values as useless. (cselib_invalidate_mem): Likewise. (cselib_record_set): Likewise. (struct set): Renamed to cselib_set, moved to cselib.h. (cselib_record_sets): Adjust. Call hook. (cselib_process_insn): Reset table when it would be cleared. (dump_cselib_val): New. (dump_cselib_table): New. * tree-cfgcleanup.c (tree_forwarded_block_p): Skip debug stmts. (remove_forwarder_block): Support moving debug stmts. * cselib.h (cselib_record_sets_hook): Declare. (cselib_expand_callback): New type. (cselib_expand_value_rtx_cb): Declare. (cselib_reset_table_with_next_value): Declare. (cselib_get_next_unknown_value): Declare. (cselib_preserve_value): Declare. (cselib_preserved_value_p): Declare. (cselib_preserve_only_values): Declare. (dump_cselib_table): Declare. * cfgcleanup.c (flow_find_cross_jump): Skip debug insns. (try_crossjump_to_edge): Likewise. (delete_unreachable_blocks): Remove dominant GIMPLE blocks after dominated blocks when debug stmts are present. * simplify-rtx.c (delegitimize_mem_from_attrs): New. * tree-ssa-live.c (remove_unused_locals): Skip debug stmts. (set_var_live_on_entry): Likewise. * loop-invariant.c (find_invariants_bb): Skip debug insns. * cfglayout.c (curr_location, last_location): Make static. (set_curr_insn_source_location): Don't avoid bouncing. (get_curr_insn_source_location): New. (get_curr_insn_block): New. (duplicate_insn_chain): Handle debug insns. * tree-ssa-forwprop.c (forward_propagate_addr_expr): Propagate into debug stmts. * common.opt (fcompare-debug): Move to sort order. (fdump-unnumbered-links): Likewise. (fvar-tracking-assignments): New. (fvar-tracking-assignments-toggle): New. * tree-ssa-dce.c (mark_stmt_necessary): Don't mark blocks because of debug stmts. (mark_stmt_if_obviously_necessary): Mark debug stmts. (eliminate_unnecessary_stmts): Walk dominated blocks before dominators. * tree-ssa-ter.c (find_replaceable_in_bb): Skip debug stmts. * ira.c (memref_used_between_p): Skip debug insns. (update_equiv_regs): Likewise. * sched-deps.c (sd_lists_size): Accept empty list. (sd_init_insn): Mark debug insns. (sd_finish_insn): Unmark them. (sd_add_dep): Reject non-debug deps on debug insns. (fixup_sched_groups): Give debug insns group treatment. Skip debug insns. (sched_analyze_reg): Don't mark debug insns for sched before call. (sched_analyze_2): Handle debug insns. (sched_analyze_insn): Compute next non-debug insn. Handle debug insns. (deps_analyze_insn): Handle debug insns. (deps_start_bb): Skip debug insns. (init_deps): Initialize last_debug_insn. * tree-ssa.c (target_for_debug_bind): New. (find_released_ssa_name): New. (propagate_var_def_into_debug_stmts): New. (propagate_defs_into_debug_stmts): New. (verify_ssa): Skip debug bind stmts without values. (warn_uninialized_vars): Skip debug stmts. * target-def.h (TARGET_DELEGITIMIZE_ADDRESS): Set default. * rtl.c (rtx_equal_p_cb): Handle VALUEs. (rtx_equal_p): Likewise. * ira-costs.c (scan_one_insn): Skip debug insns. (process_bb_node_for_hard_reg_moves): Likewise. * rtl.h (DEBUG_INSN_P): New. (NONDEBUG_INSN_P): New. (MAY_HAVE_DEBUG_INSNS): New. (INSN_P): Accept debug insns. (RTX_FRAME_RELATED_P): Likewise. (INSN_DELETED_P): Likewise (PAT_VAR_LOCATION_DECL): New. (PAT_VAR_LOCATION_LOC): New. (PAT_VAR_OCATION_STATUS): New. (NOTE_VAR_LOCATION_DECL): Reimplement. (NOTE_VAR_LOCATION_LOC): Likewise. (NOTE_VAR_LOCATION_STATUS): Likewise. (INSN_VAR_LOCATION): New. (INSN_VAR_LOCATION_DECL): New. (INSN_VAR_LOCATION_LOC): New. (INSN_VAR_LOCATION_STATUS): New. (gen_rtx_UNKNOWN_VAR_LOC): New. (VAR_LOC_UNKNOWN_P): New. (NOTE_DURING_CALL_P): New. (SCHED_GROUP_P): Accept debug insns. (emit_debug_insn_before): Declare. (emit_debug_insn_before_noloc): Declare. (emit_debug_insn_beore_setloc): Declare. (emit_debug_insn_after): Declare. (emit_debug_insn_after_noloc): Declare. (emit_debug_insn_after_setloc): Declare. (emit_debug_insn): Declare. (make_debug_insn_raw): Declare. (prev_nondebug_insn): Declare. (next_nondebug_insn): Declare. (delegitimize_mem_from_attrs): Declare. (get_max_insn_count): Declare. (wrap_constant): Declare. (unwrap_constant): Declare. (get_curr_insn_source_location): Declare. (get_curr_insn_block): Declare. * tree-inline.c (insert_debug_decl_map): New. (processing_debug_stmt): New. (remap_decl): Don't create new mappings in debug stmts. (remap_gimple_op_r): Don't add references in debug stmts. (copy_tree_body_r): Likewise. (remap_gimple_stmt): Handle debug bind stmts. (copy_bb): Skip debug stmts. (copy_edges_for_bb): Likewise. (copy_debug_stmt): New. (copy_debug_stmts): New. (copy_body): Copy debug stmts at the end. (insert_init_debug_bind): New. (insert_init_stmt): Take id. Skip and emit debug stmts. (setup_one_parameter): Remap variable earlier, register debug mapping. (estimate_num_insns): Skip debug stmts. (expand_call_inline): Preserve debug_map. (optimize_inline_calls): Check for no debug_stmts left-overs. (unsave_expr_now): Preserve debug_map. (copy_gimple_seq_and_replace_locals): Likewise. (tree_function_versioning): Check for no debug_stmts left-overs. Init and destroy debug_map as needed. Split edges unconditionally. (build_duplicate_type): Init and destroy debug_map as needed. * tree-inline.h: Include gimple.h instead of pointer-set.h. (struct copy_body_data): Add debug_stmts and debug_map. * sched-int.h (struct ready_list): Add n_debug. (struct deps): Add last_debug_insn. (DEBUG_INSN_SCHED_P): New. (BOUNDARY_DEBUG_INSN_P): New. (SCHEDULE_DEBUG_INSN_P): New. (sd_iterator_cond): Accept empty list. * combine.c (create_log_links): Skip debug insns. (combine_instructions): Likewise. (cleanup_auto_inc_dec): New. From Jakub Jelinek: Make sure the return value is always unshared. (struct rtx_subst_pair): New. (auto_adjust_pair): New. (propagate_for_debug_subst): New. (propagate_for_debug): New. (try_combine): Skip debug insns. Propagate removed defs into debug insns. (next_nonnote_nondebug_insn): New. (distribute_notes): Use it. Skip debug insns. (distribute_links): Skip debug insns. * tree-outof-ssa.c (set_location_for_edge): Likewise. * resource.c (mark_target_live_regs): Likewise. * var-tracking.c: Include cselib.h and target.h. (enum micro_operation_type): Add MO_VAL_USE, MO_VAL_LOC, and MO_VAL_SET. (micro_operation_type_name): New. (enum emit_note_where): Add EMIT_NOTE_AFTER_CALL_INSN. (struct micro_operation_def): Update comments. (decl_or_value): New type. Use instead of decls. (struct emit_note_data_def): Add vars. (struct attrs_def): Use decl_or_value. (struct variable_tracking_info_def): Add permp, flooded. (struct location_chain_def): Update comment. (struct variable_part_def): Use decl_or_value. (struct variable_def): Make var_part a variable length array. (valvar_pool): New. (scratch_regs): New. (cselib_hook_called): New. (dv_is_decl_p): New. (dv_is_value_p): New. (dv_as_decl): New. (dv_as_value): New. (dv_as_opaque): New. (dv_onepart_p): New. (dv_pool): New. (IS_DECL_CODE): New. (check_value_is_not_decl): New. (dv_from_decl): New. (dv_from_value): New. (dv_htab_hash): New. (variable_htab_hash): Use it. (variable_htab_eq): Support values. (variable_htab_free): Free from the right pool. (attrs_list_member, attrs_list_insert): Use decl_or_value. (attrs_list_union): Adjust. (attrs_list_mpdv_union): New. (tie_break_pointers): New. (canon_value_cmp): New. (unshare_variable): Return possibly-modified slot. (vars_copy_1): Adjust. (var_reg_decl_set): Adjust. Split out of... (var_reg_set): ... this. (get_init_value): Adjust. (var_reg_delete_and_set): Adjust. (var_reg_delete): Adjust. (var_regno_delete): Adjust. (var_mem_decl_set): Split out of... (var_mem_set): ... this. (var_mem_delete_and_set): Adjust. (var_mem_delete): Adjust. (val_store): New. (val_reset): New. (val_resolve): New. (variable_union): Adjust. Speed up merge of 1-part vars. (variable_canonicalize): Use unshared slot. (VALUED_RECURSED_INTO): New. (find_loc_in_1pdv): New. (struct dfset_merge): New. (insert_into_intersection): New. (intersect_loc_chains): New. (loc_cmp): New. (canonicalize_loc_order_check): New. (canonicalize_values_mark): New. (canonicalize_values_star): New. (variable_merge_over_cur): New. (variable_merge_over_src): New. (dataflow_set_merge): New. (dataflow_set_equiv_regs): New. (remove_duplicate_values): New. (struct dfset_post_merge): New. (variable_post_merge_new_vals): New. (variable_post_merge_perm_vals): New. (dataflow_post_merge_adjust): New. (find_mem_expr_in_1pdv): New. (dataflow_set_preserve_mem_locs): New. (dataflow_set_remove_mem_locs): New. (dataflow_set_clear_at_call): New. (onepart_variable_different_p): New. (variable_different_p): Use it. (dataflow_set_different_1): Adjust. Make detailed dump more verbose. (track_expr_p): Add need_rtl parameter. Don't generate rtl if not needed. (track_loc_p): Pass it true. (struct count_use_info): New. (find_use_val): New. (replace_expr_with_values): New. (log_op_type): New. (use_type): New, partially split out of... (count_uses): ... this. Count new micro-ops. (count_uses_1): Adjust. (count_stores): Adjust. (count_with_sets): New. (VAL_NEEDS_RESOLUTION): New. (VAL_HOLDS_TRACK_EXPR): New. (VAL_EXPR_IS_COPIED): New. (VAL_EXPR_IS_CLOBBERED): New. (add_uses): Adjust. Generate new micro-ops. (add_uses_1): Adjust. (add_stores): Generate new micro-ops. (add_with_sets): New. (find_src_status): Adjust. (find_src_set_src): Adjust. (compute_bb_dataflow): Use dataflow_set_clear_at_call. Handle new micro-ops. Canonicalize value equivalances. (vt_find_locations): Compute total size of hash tables for dumping. Perform merge for var-tracking-assignments. Don't disregard single-block loops. (dump_attrs_list): Handle decl_or_value. (dump_variable): Take variable. Deal with decl_or_value. (dump_variable_slot): New. (dump_vars): Use it. (dump_dataflow_sets): Adjust. (set_slot_part): New, extended to support one-part variables after splitting out of... (set_variable_part): ... this. (clobber_slot_part): New, split out of... (clobber_variable_part): ... this. (delete_slot_part): New, split out of... (delete_variable_part): .... this. (check_wrap_constant): New. (vt_expand_loc_callback): New. (vt_expand_loc): New. (emit_note_insn_var_location): Adjust. Handle values. Handle EMIT_NOTE_AFTER_CALL_INSN. (emit_notes_for_differences_1): Adjust. Handle values. (emit_notes_for_differences_2): Likewise. (emit_notes_for_differences): Adjust. (emit_notes_in_bb): Take pointer to set. Emit AFTER_CALL_INSN notes. Adjust. Handle new micro-ops. (vt_add_function_parameters): Adjust. Create and bind values. (vt_initialize): Adjust. Initialize scratch_regs and valvar_pool, flooded and perm.. Initialize and use cselib. Log operations. Move some code to count_with_sets and add_with_sets. (delete_debug_insns): New. (vt_debug_insns_local): New. (vt_finalize): Release permp, valvar_pool, scratch_regs. Finish cselib. (var_tracking_main): If var-tracking-assignments is enabled but var-tracking isn't, delete debug insns and leave. Likewise if we exceed limits or fail the stack adjustments tests, and after all var-tracking processing. More in var-tracking, from Jakub Jelinek : (dataflow_set): Add traversed_vars. (value_chain, const_value_chain): New typedefs. (value_chain_pool, value_chains): New variables. (value_chain_htab_hash, value_chain_htab_eq, add_value_chain, add_value_chains, add_cselib_value_chains, remove_value_chain, remove_value_chains, remove_cselib_value_chains): New functions. (shared_hash_find_slot_unshare_1, shared_hash_find_slot_1, shared_hash_find_slot_noinsert_1, shared_hash_find_1): New static inlines. (shared_hash_find_slot_unshare, shared_hash_find_slot, shared_hash_find_slot_noinsert, shared_hash_find): Update. (dst_can_be_shared): New variable. (unshare_variable): Unshare set->vars if shared, use shared_hash_*. Clear dst_can_be_shared. If set->traversed_vars is non-NULL and different from set->vars, look up slot again instead of using the passed in slot. (dataflow_set_init): Initialize traversed_vars. (variable_union): Use shared_hash_*. Use initially NO_INSERT lookup if set->vars is shared. Don't keep slot cleared before calling unshare_variable. Unshare set->vars if needed. Adjust unshare_variable callers. Clear dst_can_be_shared if needed. Even ->refcount == 1 vars must be unshared if set->vars is shared and var needs to be modified. (dataflow_set_union): Set traversed_vars during canonicalization. (VALUE_CHANGED, DECL_CHANGED): Define. (set_dv_changed, dv_changed_p): New static inlines. (track_expr_p): Clear DECL_CHANGED. (dump_dataflow_sets): Set it. (variable_was_changed): Call set_dv_changed. (emit_note_insn_var_location): Likewise. (changed_variables_stack): New variable. (check_changed_vars_1, check_changed_vars_2): New functions. (emit_notes_for_changes): Do nothing if changed_variables is empty. Traverse changed_variables with check_changed_vars_1, call check_changed_vars_2 on each changed_variables_stack entry. (emit_notes_in_bb): Add SET argument. Just clear it at the beginning, use it instead of local &set, don't destroy it at the end. (vt_emit_notes): Call dataflow_set_clear early on all VTI(bb)->out sets, never use them, instead use emit_notes_in_bb computed set, dataflow_set_clear also VTI(bb)->in when we are done with the basic block. Initialize changed_variables_stack, free it afterwards. If ENABLE_CHECKING verify that after noting differences to an empty set value_chains hash table is empty. (vt_initialize): Initialize value_chains and value_chain_pool. (vt_finalize): Delete value_chains htab, free value_chain_pool. (variable_tracking_main): Call dump_dataflow_sets before calling vt_emit_notes, not after it. * tree-flow.h (propagate_defs_into_debug_stmts): Declare. (propagate_var_def_into_debug_stmts): Declare. * df-problems.c (df_lr_bb_local_compute): Skip debug insns. (df_set_note): Reject debug insns. (df_whole_mw_reg_dead_p): Take added_notes_p argument. Don't add notes to debug insns. (df_note_bb_compute): Adjust. Likewise. (df_simulate_uses): Skip debug insns. (df_simulate_initialize_backwards): Likewise. * reg-stack.c (subst_stack_regs_in_debug_insn): New. (subst_stack_regs_pat): Reject debug insns. (convert_regs_1): Handle debug insns. * Makefile.in (TREE_INLINE_H): Take pointer-set.h from GIMPLE_H. (print-rtl.o): Depend on cselib.h. (cselib.o): Depend on TREE_PASS_H. (var-tracking.o): Depend on cselib.h and TARGET_H. * sched-rgn.c (rgn_estimate_number_of_insns): Discount debug insns. (init_ready_list): Skip boundary debug insns. (add_branch_dependences): Skip debug insns. (free_block_dependencies): Check for blocks with only debug insns. (compute_priorities): Likewise. * gimple.c (gss_for_code): Handle GIMPLE_DEBUG. (gimple_build_with_ops_stat): Take subcode as unsigned. Adjust all callers. (gimple_build_debug_bind_stat): New. (empty_body_p): Skip debug stmts. (gimple_has_side_effects): Likewise. (gimple_rhs_has_side_effects): Likewise. * gimple.h (enum gimple_debug_subcode, GIMPLE_DEBUG_BIND): New. (gimple_build_debug_bind_stat): Declare. (gimple_build_debug_bind): Define. (is_gimple_debug): New. (gimple_debug_bind_p): New. (gimple_debug_bind_get_var): New. (gimple_debug_bind_get_value): New. (gimple_debug_bind_get_value_ptr): New. (gimple_debug_bind_set_var): New. (gimple_debug_bind_set_value): New. (GIMPLE_DEBUG_BIND_NOVALUE): New internal temporary macro. (gimple_debug_bind_reset_value): New. (gimple_debug_bind_has_value_p): New. (gsi_next_nondebug): New. (gsi_prev_nondebug): New. (gsi_start_nondebug_bb): New. (gsi_last_nondebug_bb): New. * sched-vis.c (print_pattern): Handle VAR_LOCATION. (print_insn): Handle DEBUG_INSN. * tree-cfg.c (remove_bb): Walk stmts backwards. Let loc of first insn prevail. (first_stmt): Skip debug stmts. (first_non_label_stmt): Likewise. (last_stmt): Likewise. (has_zero_uses_1): New. (single_imm_use_1): New. (verify_gimple_debug): New. (verify_types_in_gimple_stmt): Handle debug stmts. (verify_stmt): Likewise. (debug_loop_num): Skip debug stmts. (remove_edge_and_dominated_blocks): Remove dominators last. * tree-ssa-reasssoc.c (rewrite_expr_tree): Propagate into debug stmts. (linearize_expr): Likewise. * config/i386/i386.c (ix86_delegitimize_address): Call default implementation. * config/ia64/ia64.c (ia64_safe_itanium_class): Handle debug insns. (group_barrier_needed): Skip debug insns. (emit_insn_group_barriers): Likewise. (emit_all_insn_group_barriers): Likewise. (ia64_variable_issue): Handle debug insns. (ia64_dfa_new_cycle): Likewise. (final_emit_insn_group_barriers): Skip debug insns. (ia64_dwarf2out_def_steady_cfa): Take frame argument. Don't def cfa without frame. (process_set): Likewise. (process_for_unwind_directive): Pass frame on. * config/rs6000/rs6000.c (TARGET_DELEGITIMIZE_ADDRESS): Define. (rs6000_delegitimize_address): New. (rs6000_debug_adjust_cost): Handle debug insns. (is_microcoded_insn): Likewise. (is_cracked_insn): Likewise. (is_nonpipeline_insn): Likewise. (insn_must_be_first_in_group): Likewise. (insn_must_be_last_in_group): Likewise. (force_new_group): Likewise. * cfgrtl.c (rtl_split_block): Emit INSN_DELETED note if block contains only debug insns. (rtl_merge_blocks): Skip debug insns. (purge_dead_edges): Likewise. (rtl_block_ends_with_call_p): Skip debug insns. * dce.c (deletable_insn_p): Handle VAR_LOCATION. (mark_reg_dependencies): Skip debug insns. * params.def (PARAM_MIN_NONDEBUG_INSN_UID): New. * tree-ssanames.c (release_ssa_name): Propagate def into debug stmts. * tree-ssa-threadedge.c (record_temporary_equivalences_from_stmts): Skip debug stmts. * regcprop.c (replace_oldest_value_addr): Skip debug insns. (replace_oldest_value_mem): Use ALL_REGS for debug insns. (copyprop_hardreg_forward_1): Handle debug insns. * reload1.c (reload): Skip debug insns. Replace unassigned pseudos in debug insns with their equivalences. (eliminate_regs_in_insn): Skip debug insns. (emit_input_reload_insns): Skip debug insns at first, adjust them later. * tree-ssa-operands.c (add_virtual_operand): Reject debug stmts. (get_indirect_ref_operands): Pass opf_no_vops on. (get_expr_operands): Likewise. Skip debug stmts. (parse_ssa_operands): Scan debug insns with opf_no_vops. gcc/testsuite/ChangeLog: * gcc.dg/guality/guality.c: New. * gcc.dg/guality/guality.h: New. * gcc.dg/guality/guality.exp: New. * gcc.dg/guality/example.c: New. * lib/gcc-dg.exp (cleanup-dump): Remove .gk files. (cleanup-saved-temps): Likewise, .gkd files too. gcc/cp/ChangeLog: * cp-tree.h (TFF_NO_OMIT_DEFAULT_TEMPLATE_ARGUMENTS): New. * cp-lang.c (cxx_dwarf_name): Pass it. * error.c (count_non_default_template_args): Take flags as argument. Adjust all callers. Skip counting of default arguments if the new flag is given. ChangeLog: * Makefile.tpl (BUILD_CONFIG): Default to bootstrap-debug. * Makefile.in: Rebuilt. contrib/ChangeLog: * compare-debug: Look for .gkd files and compare them. config/ChangeLog: * bootstrap-debug.mk: Add comments. * bootstrap-debug-big.mk: New. * bootstrap-debug-lean.mk: New. * bootstrap-debug-ckovw.mk: Add comments. * bootstrap-debug-lib.mk: Drop CFLAGS for stages. Use -g0 for TFLAGS in stage1. Drop -fvar-tracking-assignments-toggle. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151312 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-parloops.c | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 91 insertions(+), 3 deletions(-) (limited to 'gcc/tree-parloops.c') diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c index 9b9ac758dc2..a6d8f215914 100644 --- a/gcc/tree-parloops.c +++ b/gcc/tree-parloops.c @@ -508,7 +508,11 @@ eliminate_local_variables_stmt (edge entry, gimple stmt, dta.decl_address = decl_address; dta.changed = false; - walk_gimple_op (stmt, eliminate_local_variables_1, &dta.info); + if (gimple_debug_bind_p (stmt)) + walk_tree (gimple_debug_bind_get_value_ptr (stmt), + eliminate_local_variables_1, &dta.info, NULL); + else + walk_gimple_op (stmt, eliminate_local_variables_1, &dta.info); if (dta.changed) update_stmt (stmt); @@ -692,6 +696,53 @@ separate_decls_in_region_stmt (edge entry, edge exit, gimple stmt, } } +/* Finds the ssa names used in STMT that are defined outside the + region between ENTRY and EXIT and replaces such ssa names with + their duplicates. The duplicates are stored to NAME_COPIES. Base + decls of all ssa names used in STMT (including those defined in + LOOP) are replaced with the new temporary variables; the + replacement decls are stored in DECL_COPIES. */ + +static bool +separate_decls_in_region_debug_bind (gimple stmt, + htab_t name_copies, htab_t decl_copies) +{ + use_operand_p use; + ssa_op_iter oi; + tree var, name; + struct int_tree_map ielt; + struct name_to_copy_elt elt; + void **slot, **dslot; + + var = gimple_debug_bind_get_var (stmt); + gcc_assert (DECL_P (var) && SSA_VAR_P (var)); + ielt.uid = DECL_UID (var); + dslot = htab_find_slot_with_hash (decl_copies, &ielt, ielt.uid, NO_INSERT); + if (!dslot) + return true; + gimple_debug_bind_set_var (stmt, ((struct int_tree_map *) *dslot)->to); + + FOR_EACH_PHI_OR_STMT_USE (use, stmt, oi, SSA_OP_USE) + { + name = USE_FROM_PTR (use); + if (TREE_CODE (name) != SSA_NAME) + continue; + + elt.version = SSA_NAME_VERSION (name); + slot = htab_find_slot_with_hash (name_copies, &elt, elt.version, NO_INSERT); + if (!slot) + { + gimple_debug_bind_reset_value (stmt); + update_stmt (stmt); + break; + } + + SET_USE (use, ((struct name_to_copy_elt *) *slot)->new_name); + } + + return false; +} + /* Callback for htab_traverse. Adds a field corresponding to the reduction specified in SLOT. The type is passed in DATA. */ @@ -1027,6 +1078,7 @@ separate_decls_in_region (edge entry, edge exit, htab_t reduction_list, basic_block bb; basic_block entry_bb = bb1; basic_block exit_bb = exit->dest; + bool has_debug_stmt = false; entry = single_succ_edge (entry_bb); gather_blocks_in_sese_region (entry_bb, exit_bb, &body); @@ -1040,11 +1092,47 @@ separate_decls_in_region (edge entry, edge exit, htab_t reduction_list, name_copies, decl_copies); for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi)) - separate_decls_in_region_stmt (entry, exit, gsi_stmt (gsi), - name_copies, decl_copies); + { + gimple stmt = gsi_stmt (gsi); + + if (is_gimple_debug (stmt)) + has_debug_stmt = true; + else + separate_decls_in_region_stmt (entry, exit, stmt, + name_copies, decl_copies); + } } } + /* Now process debug bind stmts. We must not create decls while + processing debug stmts, so we defer their processing so as to + make sure we will have debug info for as many variables as + possible (all of those that were dealt with in the loop above), + and discard those for which we know there's nothing we can + do. */ + if (has_debug_stmt) + for (i = 0; VEC_iterate (basic_block, body, i, bb); i++) + if (bb != entry_bb && bb != exit_bb) + { + for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi);) + { + gimple stmt = gsi_stmt (gsi); + + if (gimple_debug_bind_p (stmt)) + { + if (separate_decls_in_region_debug_bind (stmt, + name_copies, + decl_copies)) + { + gsi_remove (&gsi, true); + continue; + } + } + + gsi_next (&gsi); + } + } + VEC_free (basic_block, heap, body); if (htab_elements (name_copies) == 0 && reduction_list == 0) -- cgit v1.2.1 From 8d0991cf43d2f803eb41a51d4a3a8be1c2aa0985 Mon Sep 17 00:00:00 2001 From: razya Date: Thu, 3 Sep 2009 08:59:25 +0000 Subject: PR tree-optimization/38275 * tree-parloops.c (parallelize_loops): Replace profitability condition for expected number of iterations. * testsuite/gcc.dg/autopar/reduc-1char.c: Increase number of iterations. Adjust the logic accordingly. * testsuite/gcc.dg/autopar/reduc-2char.c: Ditto. * testsuite/gcc.dg/autopar/reduc-1.c: Ditto. * testsuite/gcc.dg/autopar/reduc-2.c: Ditto. * testsuite/gcc.dg/autopar/reduc-3.c: Ditto. * testsuite/gcc.dg/autopar/reduc-6.c: Ditto. * testsuite/gcc.dg/autopar/reduc-7.c: Ditto. * testsuite/gcc.dg/autopar/reduc-8.c: Ditto. * testsuite/gcc.dg/autopar/reduc-9.c: Ditto. * testsuite/gcc.dg/autopar/pr39500-1.c: Ditto. * testsuite/gcc.dg/autopar/reduc-1short.c: Ditto. * testsuite/gcc.dg/autopar/reduc-2short.c: Ditto. * testsuite/gcc.dg/autopar/parallelization-1.c: Ditto. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151372 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-parloops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/tree-parloops.c') diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c index a6d8f215914..b1ef83550da 100644 --- a/gcc/tree-parloops.c +++ b/gcc/tree-parloops.c @@ -1908,7 +1908,7 @@ parallelize_loops (void) /* FIXME: Bypass this check as graphite doesn't update the count and frequency correctly now. */ if (!flag_loop_parallelize_all - && (expected_loop_iterations (loop) <= n_threads + && (estimated_loop_iterations_int (loop, false)<= n_threads * MIN_PER_THREAD /* Do not bother with loops in cold areas. */ || optimize_loop_nest_for_size_p (loop))) continue; -- cgit v1.2.1 From bea31c0cdbeeac63603f181da1d71597f23ed495 Mon Sep 17 00:00:00 2001 From: razya Date: Thu, 3 Sep 2009 09:10:36 +0000 Subject: * tree-parloops.c (separate_decls_in_region): Change the condition checking if there are reductions in the loop. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151373 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-parloops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/tree-parloops.c') diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c index b1ef83550da..b671fd70836 100644 --- a/gcc/tree-parloops.c +++ b/gcc/tree-parloops.c @@ -1135,7 +1135,7 @@ separate_decls_in_region (edge entry, edge exit, htab_t reduction_list, VEC_free (basic_block, heap, body); - if (htab_elements (name_copies) == 0 && reduction_list == 0) + if (htab_elements (name_copies) == 0 && htab_elements (reduction_list)==0) { /* It may happen that there is nothing to copy (if there are only loop carried and external variables in the loop). */ -- cgit v1.2.1 From 47dab8d2204ff6faf196d321f66d2ed97d06b4fb Mon Sep 17 00:00:00 2001 From: razya Date: Thu, 3 Sep 2009 09:38:54 +0000 Subject: * tree-parloops.c (separate_decls_in_region): Add space git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151374 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-parloops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/tree-parloops.c') diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c index b671fd70836..0053ad28c96 100644 --- a/gcc/tree-parloops.c +++ b/gcc/tree-parloops.c @@ -1135,7 +1135,7 @@ separate_decls_in_region (edge entry, edge exit, htab_t reduction_list, VEC_free (basic_block, heap, body); - if (htab_elements (name_copies) == 0 && htab_elements (reduction_list)==0) + if (htab_elements (name_copies) == 0 && htab_elements (reduction_list) == 0) { /* It may happen that there is nothing to copy (if there are only loop carried and external variables in the loop). */ -- cgit v1.2.1 From 88ee9bf1aea38fe5824cfab799f0da9ebd633c02 Mon Sep 17 00:00:00 2001 From: hjl Date: Thu, 3 Sep 2009 13:19:01 +0000 Subject: 2009-09-03 H.J. Lu * tree-parloops.c (parallelize_loops): Cast to HOST_WIDE_INT when comparing against estimated_loop_iterations_int return. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151378 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-parloops.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gcc/tree-parloops.c') diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c index 0053ad28c96..12b4ac0171a 100644 --- a/gcc/tree-parloops.c +++ b/gcc/tree-parloops.c @@ -1908,7 +1908,8 @@ parallelize_loops (void) /* FIXME: Bypass this check as graphite doesn't update the count and frequency correctly now. */ if (!flag_loop_parallelize_all - && (estimated_loop_iterations_int (loop, false)<= n_threads * MIN_PER_THREAD + && ((estimated_loop_iterations_int (loop, false) + <= (HOST_WIDE_INT) n_threads * MIN_PER_THREAD) /* Do not bother with loops in cold areas. */ || optimize_loop_nest_for_size_p (loop))) continue; -- cgit v1.2.1 From 9e3c86739dfd97a43961793d23c045b8c74d9dab Mon Sep 17 00:00:00 2001 From: jakub Date: Wed, 14 Oct 2009 17:05:45 +0000 Subject: * tree-parloops.c (separate_decls_in_region_debug_bind): Drop debug stmts setting DEBUG_EXPR_DECLs. * cfgexpand.c (expand_debug_expr): Ignore zero-length bitfields. Don't crash if mode1 is VOIDmode. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152772 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-parloops.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gcc/tree-parloops.c') diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c index 12b4ac0171a..681e04612e4 100644 --- a/gcc/tree-parloops.c +++ b/gcc/tree-parloops.c @@ -715,6 +715,8 @@ separate_decls_in_region_debug_bind (gimple stmt, void **slot, **dslot; var = gimple_debug_bind_get_var (stmt); + if (TREE_CODE (var) == DEBUG_EXPR_DECL) + return true; gcc_assert (DECL_P (var) && SSA_VAR_P (var)); ielt.uid = DECL_UID (var); dslot = htab_find_slot_with_hash (decl_copies, &ielt, ielt.uid, NO_INSERT); -- cgit v1.2.1 From b0fb253ad976e0c1b193e35c1ecb74961ec1e491 Mon Sep 17 00:00:00 2001 From: razya Date: Thu, 22 Oct 2009 14:43:40 +0000 Subject: 2009-10-22 Razya Ladelsky * cfgloopmanip.c (duplicate_subloops): Export. * tree-parloops.c (loop_parallel_p): Dump if loop is innermost. (transform_to_exit_first_loop): Duplicate bbs starting from header up to loop->latch instead of exit->src. Initialize control variable to the correct number of iterations. (gather_scalar_reductions): Do not register double reductions. (parallelize_loops): Dump which loop is tested. Indicate whether the parallelized loop is inner or not. Remove the innermost-loop requirement. * cfgloop.h (duplicate_subloops): Export. * tree-cfg.c (add_phi_args_after_redirect): New function. (gimple_duplicate_sese_tail): Remove the no-subloops constraint. Call duplicate_subloops. Update number of iterations at the exit condition. Don't redirect nexits always to the loop exit. Redirect copied edges from latch to the loop exit. * testsuite/libgomp.graphite/force-parallel-2.c: Adjust scan. * testsuite/gcc.dg/autopar/outer-1.c: New testcase. * testsuite/gcc.dg/autopar/outer-2.c: New testcase. * testsuite/gcc.dg/autopar/outer-3.c: New testcase. * testsuite/gcc.dg/autopar/outer-4.c: New testcase. * testsuite/gcc.dg/autopar/outer-5.c: New testcase. * testsuite/gcc.dg/autopar/outer-6.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@153457 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-parloops.c | 66 ++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 50 insertions(+), 16 deletions(-) (limited to 'gcc/tree-parloops.c') diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c index 681e04612e4..61e372a54c3 100644 --- a/gcc/tree-parloops.c +++ b/gcc/tree-parloops.c @@ -255,7 +255,13 @@ loop_parallel_p (struct loop *loop) bool ret = false; if (dump_file && (dump_flags & TDF_DETAILS)) - fprintf (dump_file, "\nConsidering loop %d\n", loop->num); + { + fprintf (dump_file, "Considering loop %d\n", loop->num); + if (!loop->inner) + fprintf (dump_file, "loop is innermost\n"); + else + fprintf (dump_file, "loop NOT innermost\n"); + } /* Check for problems with dependences. If the loop can be reversed, the iterations are independent. */ @@ -1289,8 +1295,9 @@ transform_to_exit_first_loop (struct loop *loop, htab_t reduction_list, tree nit bool ok; edge exit = single_dom_exit (loop), hpred; tree control, control_name, res, t; - gimple phi, nphi, cond_stmt, stmt; + gimple phi, nphi, cond_stmt, stmt, cond_nit; gimple_stmt_iterator gsi; + tree nit_1; split_block_after_labels (loop->header); orig_header = single_succ (loop->header); @@ -1308,7 +1315,6 @@ transform_to_exit_first_loop (struct loop *loop, htab_t reduction_list, tree nit res = PHI_RESULT (phi); t = make_ssa_name (SSA_NAME_VAR (res), phi); SET_PHI_RESULT (phi, t); - nphi = create_phi_node (res, orig_header); SSA_NAME_DEF_STMT (res) = nphi; add_phi_arg (nphi, t, hpred, UNKNOWN_LOCATION); @@ -1320,10 +1326,11 @@ transform_to_exit_first_loop (struct loop *loop, htab_t reduction_list, tree nit control = t; } } - bbs = get_loop_body_in_dom_order (loop); - for (n = 0; bbs[n] != exit->src; n++) + + for (n = 0; bbs[n] != loop->latch; n++) continue; + n--; nbbs = XNEWVEC (basic_block, n); ok = gimple_duplicate_sese_tail (single_succ_edge (loop->header), exit, bbs + 1, n, nbbs); @@ -1358,7 +1365,6 @@ transform_to_exit_first_loop (struct loop *loop, htab_t reduction_list, tree nit struct reduction_info *red; tree val = PHI_ARG_DEF_FROM_EDGE (phi, exit); - red = reduction_phi (reduction_list, SSA_NAME_DEF_STMT (val)); if (red) { @@ -1374,12 +1380,15 @@ transform_to_exit_first_loop (struct loop *loop, htab_t reduction_list, tree nit } gcc_assert (control_name != NULL_TREE); - /* Initialize the control variable to NIT. */ + /* Initialize the control variable to number of iterations + according to the rhs of the exit condition. */ gsi = gsi_after_labels (ex_bb); - nit = force_gimple_operand_gsi (&gsi, - fold_convert (TREE_TYPE (control_name), nit), + cond_nit = last_stmt (exit->src); + nit_1 = gimple_cond_rhs (cond_nit); + nit_1 = force_gimple_operand_gsi (&gsi, + fold_convert (TREE_TYPE (control_name), nit_1), false, NULL_TREE, false, GSI_SAME_STMT); - stmt = gimple_build_assign (control_name, nit); + stmt = gimple_build_assign (control_name, nit_1); gsi_insert_before (&gsi, stmt, GSI_NEW_STMT); SSA_NAME_DEF_STMT (control_name) = stmt; } @@ -1740,7 +1749,7 @@ gather_scalar_reductions (loop_p loop, htab_t reduction_list) && simple_loop_info) { gimple reduc_stmt = vect_is_simple_reduction (simple_loop_info, phi, true, &double_reduc); - if (reduc_stmt) + if (reduc_stmt && !double_reduc) build_new_reduction (reduction_list, reduc_stmt, phi); } } @@ -1890,15 +1899,32 @@ parallelize_loops (void) FOR_EACH_LOOP (li, loop, 0) { htab_empty (reduction_list); - - /* If we use autopar in graphite pass, we use it's marked dependency + if (dump_file && (dump_flags & TDF_DETAILS)) + { + fprintf (dump_file, "Trying loop %d as candidate\n",loop->num); + if (loop->inner) + fprintf (dump_file, "loop %d is not innermost\n",loop->num); + else + fprintf (dump_file, "loop %d is innermost\n",loop->num); + } + + /* If we use autopar in graphite pass, we use its marked dependency checking results. */ if (flag_loop_parallelize_all && !loop->can_be_parallel) + { + if (dump_file && (dump_flags & TDF_DETAILS)) + fprintf (dump_file, "loop is not parallel according to graphite\n"); continue; + } - /* FIXME: Only consider innermost loops with just one exit. */ - if (loop->inner || !single_dom_exit (loop)) + if (!single_dom_exit (loop)) + { + + if (dump_file && (dump_flags & TDF_DETAILS)) + fprintf (dump_file, "loop is !single_dom_exit\n"); + continue; + } if (/* And of course, the loop must be parallelizable. */ !can_duplicate_loop_p (loop) @@ -1915,7 +1941,7 @@ parallelize_loops (void) /* Do not bother with loops in cold areas. */ || optimize_loop_nest_for_size_p (loop))) continue; - + if (!try_get_loop_niter (loop, &niter_desc)) continue; @@ -1926,6 +1952,14 @@ parallelize_loops (void) continue; changed = true; + if (dump_file && (dump_flags & TDF_DETAILS)) + { + fprintf (dump_file, "parallelizing "); + if (loop->inner) + fprintf (dump_file, "outer loop\n"); + else + fprintf (dump_file, "inner loop\n"); + } gen_parallel_loop (loop, reduction_list, n_threads, &niter_desc); verify_flow_info (); -- cgit v1.2.1 From 48e1416a24d50cacbb2a5e06a9ee61dd8cbee313 Mon Sep 17 00:00:00 2001 From: hjl Date: Wed, 25 Nov 2009 10:55:54 +0000 Subject: Remove trailing white spaces. 2009-11-25 H.J. Lu * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154645 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-parloops.c | 160 ++++++++++++++++++++++++++-------------------------- 1 file changed, 80 insertions(+), 80 deletions(-) (limited to 'gcc/tree-parloops.c') diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c index 61e372a54c3..56b88a89ad0 100644 --- a/gcc/tree-parloops.c +++ b/gcc/tree-parloops.c @@ -42,7 +42,7 @@ along with GCC; see the file COPYING3. If not see conditions regarding profitability and correctness are satisfied), we add GIMPLE_OMP_PARALLEL and GIMPLE_OMP_FOR codes and let omp expansion machinery do its job. - + The most of the complexity is in bringing the code into shape expected by the omp expanders: -- for GIMPLE_OMP_FOR, ensuring that the loop has only one induction @@ -61,12 +61,12 @@ along with GCC; see the file COPYING3. If not see -- handling of common scalar dependence patterns (accumulation, ...) -- handling of non-innermost loops */ -/* +/* Reduction handling: currently we use vect_is_simple_reduction() to detect reduction patterns. The code transformation will be introduced by an example. - - + + parloop { int sum=1; @@ -108,8 +108,8 @@ parloop # Storing the initial value given by the user. # .paral_data_store.32.sum.27 = 1; - - #pragma omp parallel num_threads(4) + + #pragma omp parallel num_threads(4) #pragma omp for schedule(static) @@ -126,23 +126,23 @@ parloop # Adding this reduction phi is done at create_phi_for_local_result() # # sum.27_56 = PHI GIMPLE_OMP_RETURN - - # Creating the atomic operation is done at + + # Creating the atomic operation is done at create_call_for_reduction_1() # #pragma omp atomic_load D.1839_59 = *&.paral_data_load.33_51->reduction.23; D.1840_60 = sum.27_56 + D.1839_59; #pragma omp atomic_store (D.1840_60); - + GIMPLE_OMP_RETURN - + # collecting the result after the join of the threads is done at create_loads_for_reductions(). The value computed by the threads is loaded from the shared struct. # - + .paral_data_load.33_52 = &.paral_data_store.32; sum_37 = .paral_data_load.33_52->sum.27; sum_43 = D.1795_41 + sum_37; @@ -161,19 +161,19 @@ parloop thread. */ #define MIN_PER_THREAD 100 -/* Element of the hashtable, representing a +/* Element of the hashtable, representing a reduction in the current loop. */ struct reduction_info { gimple reduc_stmt; /* reduction statement. */ gimple reduc_phi; /* The phi node defining the reduction. */ enum tree_code reduction_code;/* code for the reduction operation. */ - gimple keep_res; /* The PHI_RESULT of this phi is the resulting value + gimple keep_res; /* The PHI_RESULT of this phi is the resulting value of the reduction variable when existing the loop. */ tree initial_value; /* The initial value of the reduction var before entering the loop. */ tree field; /* the name of the field in the parloop data structure intended for reduction. */ tree init; /* reduction initialization value. */ - gimple new_phi; /* (helper field) Newly created phi node whose result + gimple new_phi; /* (helper field) Newly created phi node whose result will be passed to the atomic operation. Represents the local result each thread computed for the reduction operation. */ @@ -259,7 +259,7 @@ loop_parallel_p (struct loop *loop) fprintf (dump_file, "Considering loop %d\n", loop->num); if (!loop->inner) fprintf (dump_file, "loop is innermost\n"); - else + else fprintf (dump_file, "loop NOT innermost\n"); } @@ -376,7 +376,7 @@ take_address_of (tree obj, tree type, edge entry, htab_t decl_address) } /* Callback for htab_traverse. Create the initialization statement - for reduction described in SLOT, and place it at the preheader of + for reduction described in SLOT, and place it at the preheader of the loop described in DATA. */ static int @@ -389,10 +389,10 @@ initialize_reductions (void **slot, void *data) struct reduction_info *const reduc = (struct reduction_info *) *slot; struct loop *loop = (struct loop *) data; - /* Create initialization in preheader: + /* Create initialization in preheader: reduction_variable = initialization value of reduction. */ - /* In the phi node at the header, replace the argument coming + /* In the phi node at the header, replace the argument coming from the preheader with the reduction initialization value. */ /* Create a new variable to initialize the reduction. */ @@ -408,12 +408,12 @@ initialize_reductions (void **slot, void *data) 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 + /* 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. */ e = loop_preheader_edge (loop); @@ -526,10 +526,10 @@ eliminate_local_variables_stmt (edge entry, gimple stmt, /* Eliminates the references to local variables from the single entry single exit region between the ENTRY and EXIT edges. - + This includes: - 1) Taking address of a local variable -- these are moved out of the - region (and temporary variable is created to hold the address if + 1) Taking address of a local variable -- these are moved out of the + region (and temporary variable is created to hold the address if necessary). 2) Dereferencing a local variable -- these are replaced with indirect @@ -589,7 +589,7 @@ expr_invariant_in_region_p (edge entry, edge exit, tree expr) /* If COPY_NAME_P is true, creates and returns a duplicate of NAME. The copies are stored to NAME_COPIES, if NAME was already duplicated, its duplicate stored in NAME_COPIES is returned. - + Regardless of COPY_NAME_P, the decl used as a base of the ssa name is also duplicated, storing the copies in DECL_COPIES. */ @@ -757,7 +757,7 @@ separate_decls_in_region_debug_bind (gimple stmt, static int add_field_for_reduction (void **slot, void *data) { - + struct reduction_info *const red = (struct reduction_info *) *slot; tree const type = (tree) data; tree var = SSA_NAME_VAR (gimple_assign_lhs (red->reduc_stmt)); @@ -772,7 +772,7 @@ add_field_for_reduction (void **slot, void *data) } /* Callback for htab_traverse. Adds a field corresponding to a ssa name - described in SLOT. The type is passed in DATA. */ + described in SLOT. The type is passed in DATA. */ static int add_field_for_name (void **slot, void *data) @@ -790,12 +790,12 @@ add_field_for_name (void **slot, void *data) return 1; } -/* Callback for htab_traverse. A local result is the intermediate result - computed by a single +/* Callback for htab_traverse. A local result is the intermediate result + computed by a single thread, or the initial value in case no iteration was executed. - This function creates a phi node reflecting these values. - The phi's result will be stored in NEW_PHI field of the - reduction's data structure. */ + This function creates a phi node reflecting these values. + The phi's result will be stored in NEW_PHI field of the + reduction's data structure. */ static int create_phi_for_local_result (void **slot, void *data) @@ -808,16 +808,16 @@ create_phi_for_local_result (void **slot, void *data) tree local_res; source_location locus; - /* STORE_BB is the block where the phi - should be stored. It is the destination of the loop exit. + /* STORE_BB is the block where the phi + should be stored. It is the destination of the loop exit. (Find the fallthru edge from GIMPLE_OMP_CONTINUE). */ store_bb = FALLTHRU_EDGE (loop->latch)->dest; /* STORE_BB has two predecessors. One coming from the loop (the reduction's result is computed at the loop), - and another coming from a block preceding the loop, - when no iterations - are executed (the initial value should be taken). */ + and another coming from a block preceding the loop, + when no iterations + are executed (the initial value should be taken). */ if (EDGE_PRED (store_bb, 0) == FALLTHRU_EDGE (loop->latch)) e = EDGE_PRED (store_bb, 1); else @@ -846,7 +846,7 @@ struct clsn_data }; /* Callback for htab_traverse. Create an atomic instruction for the - reduction described in SLOT. + reduction described in SLOT. DATA annotates the place in memory the atomic operation relates to, and the basic block it needs to be generated in. */ @@ -901,12 +901,12 @@ create_call_for_reduction_1 (void **slot, void *data) return 1; } -/* Create the atomic operation at the join point of the threads. - REDUCTION_LIST describes the reductions in the LOOP. - LD_ST_DATA describes the shared data structure where +/* Create the atomic operation at the join point of the threads. + REDUCTION_LIST describes the reductions in the LOOP. + LD_ST_DATA describes the shared data structure where shared data is stored in and loaded from. */ static void -create_call_for_reduction (struct loop *loop, htab_t reduction_list, +create_call_for_reduction (struct loop *loop, htab_t reduction_list, struct clsn_data *ld_st_data) { htab_traverse (reduction_list, create_phi_for_local_result, loop); @@ -953,11 +953,11 @@ create_loads_for_reductions (void **slot, void *data) gcc_unreachable (); } -/* Load the reduction result that was stored in LD_ST_DATA. +/* Load the reduction result that was stored in LD_ST_DATA. REDUCTION_LIST describes the list of reductions that the loads should be generated for. */ static void -create_final_loads_for_reduction (htab_t reduction_list, +create_final_loads_for_reduction (htab_t reduction_list, struct clsn_data *ld_st_data) { gimple_stmt_iterator gsi; @@ -978,8 +978,8 @@ create_final_loads_for_reduction (htab_t reduction_list, /* 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. - The reduction is specified in SLOT. The store information is - passed in DATA. */ + The reduction is specified in SLOT. The store information is + passed in DATA. */ static int create_stores_for_reduction (void **slot, void *data) @@ -1035,7 +1035,7 @@ create_loads_and_stores_for_name (void **slot, void *data) /* Moves all the variables used in LOOP and defined outside of it (including the initial values of loop phi nodes, and *PER_THREAD if it is a ssa name) to a structure created for this purpose. The code - + while (1) { use (a); @@ -1061,14 +1061,14 @@ create_loads_and_stores_for_name (void **slot, void *data) pointer `new' is intentionally not initialized (the loop will be split to a separate function later, and `new' will be initialized from its arguments). LD_ST_DATA holds information about the shared data structure used to pass - information among the threads. It is initialized here, and - gen_parallel_loop will pass it to create_call_for_reduction that - needs this information. REDUCTION_LIST describes the reductions + information among the threads. It is initialized here, and + gen_parallel_loop will pass it to create_call_for_reduction that + needs this information. REDUCTION_LIST describes the reductions in LOOP. */ static void separate_decls_in_region (edge entry, edge exit, htab_t reduction_list, - tree *arg_struct, tree *new_arg_struct, + tree *arg_struct, tree *new_arg_struct, struct clsn_data *ld_st_data) { @@ -1093,7 +1093,7 @@ separate_decls_in_region (edge entry, edge exit, htab_t reduction_list, for (i = 0; VEC_iterate (basic_block, body, i, bb); i++) { - if (bb != entry_bb && bb != exit_bb) + if (bb != entry_bb && bb != exit_bb) { for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi)) separate_decls_in_region_stmt (entry, exit, gsi_stmt (gsi), @@ -1143,7 +1143,7 @@ separate_decls_in_region (edge entry, edge exit, htab_t reduction_list, VEC_free (basic_block, heap, body); - if (htab_elements (name_copies) == 0 && htab_elements (reduction_list) == 0) + if (htab_elements (name_copies) == 0 && htab_elements (reduction_list) == 0) { /* It may happen that there is nothing to copy (if there are only loop carried and external variables in the loop). */ @@ -1167,7 +1167,7 @@ separate_decls_in_region (edge entry, edge exit, htab_t reduction_list, type); } layout_type (type); - + /* Create the loads and stores. */ *arg_struct = create_tmp_var (type, ".paral_data_store"); add_referenced_var (*arg_struct); @@ -1188,7 +1188,7 @@ separate_decls_in_region (edge entry, edge exit, htab_t reduction_list, if (reduction_list && htab_elements (reduction_list) > 0) { htab_traverse (reduction_list, create_stores_for_reduction, - ld_st_data); + ld_st_data); clsn_data.load = make_ssa_name (nvar, NULL); clsn_data.load_bb = exit->dest; clsn_data.store = ld_st_data->store; @@ -1279,12 +1279,12 @@ create_loop_fn (void) duplicates the part of the last iteration that gets disabled to the exit of the loop. NIT is the number of iterations of the loop (used to initialize the variables in the duplicated part). - + TODO: the common case is that latch of the loop is empty and immediately follows the loop exit. In this case, it would be better not to copy the body of the loop, but only move the entry of the loop directly before the exit check and increase the number of iterations of the loop by one. - This may need some additional preconditioning in case NIT = ~0. + This may need some additional preconditioning in case NIT = ~0. REDUCTION_LIST describes the reductions in LOOP. */ static void @@ -1339,7 +1339,7 @@ transform_to_exit_first_loop (struct loop *loop, htab_t reduction_list, tree nit ex_bb = nbbs[0]; free (nbbs); - /* Other than reductions, the only gimple reg that should be copied + /* Other than reductions, the only gimple reg that should be copied out of the loop is the control variable. */ control_name = NULL_TREE; @@ -1354,13 +1354,13 @@ transform_to_exit_first_loop (struct loop *loop, htab_t reduction_list, tree nit } /* Check if it is a part of reduction. If it is, - keep the phi at the reduction's keep_res field. The - PHI_RESULT of this phi is the resulting value of the reduction + keep the phi at the reduction's keep_res field. The + PHI_RESULT of this phi is the resulting value of the reduction variable when exiting the loop. */ exit = single_dom_exit (loop); - if (htab_elements (reduction_list) > 0) + if (htab_elements (reduction_list) > 0) { struct reduction_info *red; @@ -1380,10 +1380,10 @@ transform_to_exit_first_loop (struct loop *loop, htab_t reduction_list, tree nit } gcc_assert (control_name != NULL_TREE); - /* Initialize the control variable to number of iterations + /* Initialize the control variable to number of iterations according to the rhs of the exit condition. */ gsi = gsi_after_labels (ex_bb); - cond_nit = last_stmt (exit->src); + cond_nit = last_stmt (exit->src); nit_1 = gimple_cond_rhs (cond_nit); nit_1 = force_gimple_operand_gsi (&gsi, fold_convert (TREE_TYPE (control_name), nit_1), @@ -1478,7 +1478,7 @@ create_parallel_loop (struct loop *loop, tree loop_fn, tree data, stmt = SSA_NAME_DEF_STMT (PHI_ARG_DEF_FROM_EDGE (phi, exit)); def = PHI_ARG_DEF_FROM_EDGE (stmt, loop_preheader_edge (loop)); - locus = gimple_phi_arg_location_from_edge (stmt, + locus = gimple_phi_arg_location_from_edge (stmt, loop_preheader_edge (loop)); add_phi_arg (phi, def, guard, locus); @@ -1636,7 +1636,7 @@ gen_parallel_loop (struct loop *loop, htab_t reduction_list, transform_to_exit_first_loop (loop, reduction_list, nit); /* Generate initializations for reductions. */ - if (htab_elements (reduction_list) > 0) + if (htab_elements (reduction_list) > 0) htab_traverse (reduction_list, initialize_reductions, loop); /* Eliminate the references to local variables from the loop. */ @@ -1647,13 +1647,13 @@ gen_parallel_loop (struct loop *loop, htab_t reduction_list, eliminate_local_variables (entry, exit); /* In the old loop, move all variables non-local to the loop to a structure and back, and create separate decls for the variables used in loop. */ - separate_decls_in_region (entry, exit, reduction_list, &arg_struct, + separate_decls_in_region (entry, exit, reduction_list, &arg_struct, &new_arg_struct, &clsn_data); /* Create the parallel constructs. */ parallel_head = create_parallel_loop (loop, create_loop_fn (), arg_struct, new_arg_struct, n_threads); - if (htab_elements (reduction_list) > 0) + if (htab_elements (reduction_list) > 0) create_call_for_reduction (loop, reduction_list, &clsn_data); scev_reset (); @@ -1706,7 +1706,7 @@ build_new_reduction (htab_t reduction_list, gimple reduc_stmt, gimple phi) struct reduction_info *new_reduction; gcc_assert (reduc_stmt); - + if (dump_file && (dump_flags & TDF_DETAILS)) { fprintf (dump_file, @@ -1714,9 +1714,9 @@ build_new_reduction (htab_t reduction_list, gimple reduc_stmt, gimple phi) print_gimple_stmt (dump_file, reduc_stmt, 0, 0); fprintf (dump_file, "\n"); } - + new_reduction = XCNEW (struct reduction_info); - + new_reduction->reduc_stmt = reduc_stmt; new_reduction->reduc_phi = phi; new_reduction->reduction_code = gimple_assign_rhs_code (reduc_stmt); @@ -1791,7 +1791,7 @@ try_create_reduction_list (loop_p loop, htab_t reduction_list) gather_scalar_reductions (loop, reduction_list); - + for (gsi = gsi_start_phis (exit->dest); !gsi_end_p (gsi); gsi_next (&gsi)) { gimple phi = gsi_stmt (gsi); @@ -1907,7 +1907,7 @@ parallelize_loops (void) else fprintf (dump_file, "loop %d is innermost\n",loop->num); } - + /* If we use autopar in graphite pass, we use its marked dependency checking results. */ if (flag_loop_parallelize_all && !loop->can_be_parallel) @@ -1919,10 +1919,10 @@ parallelize_loops (void) if (!single_dom_exit (loop)) { - + if (dump_file && (dump_flags & TDF_DETAILS)) fprintf (dump_file, "loop is !single_dom_exit\n"); - + continue; } @@ -1941,7 +1941,7 @@ parallelize_loops (void) /* Do not bother with loops in cold areas. */ || optimize_loop_nest_for_size_p (loop))) continue; - + if (!try_get_loop_niter (loop, &niter_desc)) continue; @@ -1959,8 +1959,8 @@ parallelize_loops (void) fprintf (dump_file, "outer loop\n"); else fprintf (dump_file, "inner loop\n"); - } - gen_parallel_loop (loop, reduction_list, + } + gen_parallel_loop (loop, reduction_list, n_threads, &niter_desc); verify_flow_info (); verify_dominators (CDI_DOMINATORS); -- cgit v1.2.1 From f018d957a72d418d69c6d2d8bc80c9415666a9f6 Mon Sep 17 00:00:00 2001 From: jakub Date: Sat, 28 Nov 2009 16:21:00 +0000 Subject: * matrix-reorg.c (analyze_matrix_allocation_site): Remove unused malloc_fname variable. (check_allocation_function): Remove unused gsi and bb_level_0 variables. (transform_access_sites): Remove unused d_type_size and d_type_size_k variables. * omega.c (resurrect_subs): Remove unused n variable. (omega_solve_geq): Remove unused neweqns variable. * lto-streamer-in.c (lto_read_tree): Remove unused end_marker variable. * tree-inline.c (declare_return_variable): Remove USE_P argument, return use instead of var. (remap_decl, remap_block): Remove unused fn variable. (expand_call_inline): Remove unused retvar variable, adjust declare_return_variable caller. (optimize_inline_calls): Remove unused prev_fn variable. * tree-vect-slp.c (vect_analyze_slp_instance): Remove unused ncopies variable. (vect_create_mask_and_perm): Remove unused group_size and dr_chain_size variables. * tree-ssa-loop-niter.c (split_to_var_and_offset): Handle MINUS_EXPR properly. * tree-vect-loop.c (vect_analyze_loop_form): Remove unused backedge variable. (vect_create_epilog_for_reduction): Remove unused bytesize variable. * omp-low.c (workshare_safe_to_combine_p): Remove par_entry_bb parameter. Remove unused par_stmt variable. (determine_parallel_type): Adjust workshare_safe_to_combine_p caller. (expand_omp_sections): Remove unused l1 variable. (lower_omp_for): Remove unused ilist variable. * tree-loop-distribution.c (mark_nodes_having_upstream_mem_writes): Remove unused has_upstream_mem_write_p variable. * recog.c (decode_asm_operands): Remove unused noperands variable. * tree-ssa-alias.c (refs_may_alias_p_1): Remove unused size1 and size2 variable. * libgcov.c (__gcov_merge_delta): Remove unused last variable. * tree-call-cdce.c (gen_conditions_for_pow_int_base): Remove unused base_nm variable. (gen_conditions_for_pow): Remove unused ec variable. * tree-ssa-sccvn.c (vn_reference_lookup_3): Remove unused size variable. * ipa-struct-reorg.c (program_redefines_malloc_p): Remove unused fndecl variable. * tree-ssa-sink.c (statement_sink_location): Remove unused code variable. * regmove.c (copy_src_to_dest): Remove unused insn_uid and move_uid variables. * tree-complex.c (create_one_component_var): Remove unused inner_type variable. * calls.c (emit_call_1): Don't GEN_INT (struct_value_size) unnecessarily when GEN_*CALL omits that argument. * regrename.c (regrename_optimize): Remove unused regs_seen variable. (build_def_use): Remove unused icode variable. * ipa-pure-const.c (check_call): Remove unused callee and avail variables. * tree-dfa.c (add_referenced_var): Remove unused v_ann variable. * tree-vect-patterns.c (vect_recog_pow_pattern): Remove unused type variable. (vect_pattern_recog): Remove unused stmt variable. * sel-sched-ir.c (make_regions_from_the_rest): Remove unused new_regions variable. * postreload.c (reload_cse_simplify_operands): Remove unused mode variable. * tree-parloops.c (create_call_for_reduction_1): Remove unused addr_type variable. (create_parallel_loop): Remove unused res variable. (gen_parallel_loop): Remove unused nloop variable. * tree-vect-loop-manip.c (vect_loop_versioning): Likewise. * value-prof.c (gimple_mod_subtract_transform, gimple_stringops_transform): Remove unused value variable. (gimple_stringops_values_to_profile): Remove unused fcode variable. * tree-vrp.c (register_new_assert_for): Remove unused found variable. (vrp_visit_switch_stmt): Remove unused n variable. * tree-vect-stmts.c (vectorizable_conversion): Remove unused expr variable. (vectorizable_operation): Remove unused shift_p variable. (vectorizable_store): Remove unused first_stmt_vinfo variable. * tree-ssa-operands.c (add_stmt_operand): Remove unused v_ann variable. * tree-vect-data-refs.c (vect_analyze_data_refs): Remove unused bb variable. (vect_permute_store_chain): Remove unused scalar_dest variable. (vect_supportable_dr_alignment): Remove unused invariant_in_outerloop variable. * tree-ssa-threadupdate.c (thread_single_edge): Remove unused local_info variable. * tree-optimize.c (tree_rest_of_compilation): Remove unused node variable. * optabs.c (expand_binop): Remove unused equiv_value variable. (emit_libcall_block): Remove unused prev variable. (init_optabs): Remove unused int_mode variable. * tree-ssa-structalias.c (scc_visit): Remove unused have_ref_node variable. (do_structure_copy): Remove unused lhsbase and rhsbase variables. (find_func_aliases): Remove unused rhstype variable. (ipa_pta_execute): Remove unused varid variable. gcc/objc/ * objc-act.c (generate_shared_structures): Remove unused sc_spec and decl_specs variables. (objc_build_message_expr): Remove unused loc variable. (objc_finish_message_expr): Remove unused saved_rtype variable. (encode_field_decl): Remove unused type variable. gcc/lto/ * lto-lang.c (handle_nonnull_attribute): Remove unused attr_arg_num variable. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154726 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-parloops.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'gcc/tree-parloops.c') diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c index 56b88a89ad0..cf019701225 100644 --- a/gcc/tree-parloops.c +++ b/gcc/tree-parloops.c @@ -862,13 +862,12 @@ create_call_for_reduction_1 (void **slot, void *data) basic_block bb; basic_block new_bb; edge e; - tree t, addr, addr_type, ref, x; + tree t, addr, ref, x; tree tmp_load, name; gimple load; load_struct = fold_build1 (INDIRECT_REF, struct_type, clsn_data->load); t = build3 (COMPONENT_REF, type, load_struct, reduc->field, NULL_TREE); - addr_type = build_pointer_type (type); addr = build_addr (t, current_function_decl); @@ -1405,7 +1404,7 @@ create_parallel_loop (struct loop *loop, tree loop_fn, tree data, { gimple_stmt_iterator gsi; basic_block bb, paral_bb, for_bb, ex_bb; - tree t, param, res; + tree t, param; gimple stmt, for_stmt, phi, cond_stmt; tree cvar, cvar_init, initvar, cvar_next, cvar_base, type; edge exit, nexit, guard, end, e; @@ -1474,7 +1473,6 @@ create_parallel_loop (struct loop *loop, tree loop_fn, tree data, source_location locus; tree def; phi = gsi_stmt (gsi); - res = PHI_RESULT (phi); stmt = SSA_NAME_DEF_STMT (PHI_ARG_DEF_FROM_EDGE (phi, exit)); def = PHI_ARG_DEF_FROM_EDGE (stmt, loop_preheader_edge (loop)); @@ -1531,7 +1529,6 @@ static void gen_parallel_loop (struct loop *loop, htab_t reduction_list, unsigned n_threads, struct tree_niter_desc *niter) { - struct loop *nloop; loop_iterator li; tree many_iterations_cond, type, nit; tree arg_struct, new_arg_struct; @@ -1624,8 +1621,8 @@ gen_parallel_loop (struct loop *loop, htab_t reduction_list, /* We assume that the loop usually iterates a lot. */ prob = 4 * REG_BR_PROB_BASE / 5; - nloop = loop_version (loop, many_iterations_cond, NULL, - prob, prob, REG_BR_PROB_BASE - prob, true); + loop_version (loop, many_iterations_cond, NULL, + prob, prob, REG_BR_PROB_BASE - prob, true); update_ssa (TODO_update_ssa); free_original_copy_tables (); -- cgit v1.2.1 From fbbe5b510bd02be85369bc1f943c900c30051221 Mon Sep 17 00:00:00 2001 From: razya Date: Thu, 28 Jan 2010 14:24:25 +0000 Subject: 28-01-2010 Razya Ladelsky * tree-parloops.c (transform_to_exit_first_loop): Update the basic block list passed to gimple_duplicate_sese_tail. (parallelize_loops): Avoid parallelization when the function has_nonlocal_label. Avoid parallelization when the preheader is IRREDUCIBLE. Try to optimize when estimated_loop_iterations_int is unresolved. Add the loop's location to the dump file. * tree-cfg.c(add_phi_args_after_redirect): Remove. (gimple_duplicate_sese_tail): Remove the check for the latch. Redirect nexits to the exit block. Remove handling of the incoming edges to the latch. Redirect the backedge from the copied latch to the exit bb. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@156321 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-parloops.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'gcc/tree-parloops.c') diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c index cf019701225..885a713c7ce 100644 --- a/gcc/tree-parloops.c +++ b/gcc/tree-parloops.c @@ -1329,7 +1329,6 @@ transform_to_exit_first_loop (struct loop *loop, htab_t reduction_list, tree nit for (n = 0; bbs[n] != loop->latch; n++) continue; - n--; nbbs = XNEWVEC (basic_block, n); ok = gimple_duplicate_sese_tail (single_succ_edge (loop->header), exit, bbs + 1, n, nbbs); @@ -1884,10 +1883,14 @@ parallelize_loops (void) struct tree_niter_desc niter_desc; loop_iterator li; htab_t reduction_list; - + HOST_WIDE_INT estimated; + LOC loop_loc; + /* Do not parallelize loops in the functions created by parallelization. */ if (parallelized_function_p (cfun->decl)) return false; + if (cfun->has_nonlocal_label) + return false; reduction_list = htab_create (10, reduction_info_hash, reduction_info_eq, free); @@ -1926,15 +1929,16 @@ parallelize_loops (void) if (/* And of course, the loop must be parallelizable. */ !can_duplicate_loop_p (loop) || loop_has_blocks_with_irreducible_flag (loop) + || (loop_preheader_edge (loop)->src->flags & BB_IRREDUCIBLE_LOOP) /* FIXME: the check for vector phi nodes could be removed. */ || loop_has_vector_phi_nodes (loop)) continue; - + estimated = estimated_loop_iterations_int (loop, false); /* FIXME: Bypass this check as graphite doesn't update the count and frequency correctly now. */ if (!flag_loop_parallelize_all - && ((estimated_loop_iterations_int (loop, false) - <= (HOST_WIDE_INT) n_threads * MIN_PER_THREAD) + && ((estimated !=-1 + && estimated <= (HOST_WIDE_INT) n_threads * MIN_PER_THREAD) /* Do not bother with loops in cold areas. */ || optimize_loop_nest_for_size_p (loop))) continue; @@ -1951,11 +1955,14 @@ parallelize_loops (void) changed = true; if (dump_file && (dump_flags & TDF_DETAILS)) { - fprintf (dump_file, "parallelizing "); if (loop->inner) - fprintf (dump_file, "outer loop\n"); + fprintf (dump_file, "parallelizing outer loop %d\n",loop->header->index); else - fprintf (dump_file, "inner loop\n"); + fprintf (dump_file, "parallelizing inner loop %d\n",loop->header->index); + loop_loc = find_loop_location (loop); + if (loop_loc != UNKNOWN_LOC) + fprintf (dump_file, "\nloop at %s:%d: ", + LOC_FILE (loop_loc), LOC_LINE (loop_loc)); } gen_parallel_loop (loop, reduction_list, n_threads, &niter_desc); -- cgit v1.2.1 From 0207206d3e2a17cd35d050b9197c575b531d29f4 Mon Sep 17 00:00:00 2001 From: spop Date: Wed, 31 Mar 2010 18:37:13 +0000 Subject: canonicalize_loop_ivs should add the IV bump in loop->header. 2010-03-16 Sebastian Pop * graphite-sese-to-poly.c (graphite_loop_normal_form): Add the IV bump in loop->header. * tree-flow.h (canonicalize_loop_ivs): Updated declaration. * tree-parloops.c (gen_parallel_loop): Add the IV bump in loop->latch. * tree-ssa-loop-manip.c (canonicalize_loop_ivs): Add a new parameter to switch between adding the IV bump in loop->latch or in loop->header. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157885 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-parloops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/tree-parloops.c') diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c index 885a713c7ce..35638315c9c 100644 --- a/gcc/tree-parloops.c +++ b/gcc/tree-parloops.c @@ -1626,7 +1626,7 @@ gen_parallel_loop (struct loop *loop, htab_t reduction_list, free_original_copy_tables (); /* Base all the induction variables in LOOP on a single control one. */ - canonicalize_loop_ivs (loop, &nit); + canonicalize_loop_ivs (loop, &nit, true); /* Ensure that the exit condition is the first statement in the loop. */ transform_to_exit_first_loop (loop, reduction_list, nit); -- cgit v1.2.1 From 7cf0dbf3e5eee1286c76c26a836622c9c9974736 Mon Sep 17 00:00:00 2001 From: steven Date: Fri, 2 Apr 2010 19:54:46 +0000 Subject: * ada/gcc-interface/Make-lang.in, alias.c, attribs.c, auto-inc-dec.c, basic-block.h, bb-reorder.c, calls.c, c-common.c, cgraph.h, collect2.h, config/alpha/alpha.c, config/alpha/alpha.md, config/alpha/predicates.md, config/arm/arm.md, config/arm/lib1funcs.asm, config/arm/neon-schedgen.ml, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin.c, config/darwin9.h, config/darwin.c, config/darwin.h, config/h8300/h8300.c, config/i386/cpuid.h, config/i386/cygming.h, config/i386/cygwin.h, config/i386/mingw32.h, config/i386/msformat-c.c, config/i386/sol2-10.h, config/i386/xopintrin.h, config/ia64/ia64.c, config/ia64/ia64.md, config/ia64/sync.md, config/mep/mep.c, config/mips/mips.md, config/mn10300/mn10300.c, config/mn10300/mn10300.h, config/pa/pa.c, config/pa/pa.md, config/rs6000/aix.h, config/rs6000/dfp.md, config/rs6000/rs6000-builtin.def, config/rs6000/rs6000-c.c, config/rs6000/vector.md, config/rtems.h, config/rx/rx.md, config/s390/s390.md, config/sol2-c.c, config/sparc/sol2-bi.h, config/sparc/sol2-gas.h, config/sparc/sparc.h, config/sparc/sparc.md, config/sparc/sparc-protos.h, config/spu/spu.c, config/spu/spu-c.c, config/t-darwin, convert.c, c.opt, c-opts.c, cp/Make-lang.in, c-pretty-print.c, c-typeck.c, df-core.c, df-scan.c, diagnostic.c, diagnostic.h, doc/cppopts.texi, doc/cpp.texi, doc/extend.texi, doc/gimple.texi, doc/languages.texi, doc/plugins.texi, doc/rtl.texi, doc/standards.texi, doc/tree-ssa.texi, doc/trouble.texi, dominance.c, fold-const.c, fortran/Make-lang.in, fwprop.c, gcc-plugin.h, gensupport.c, gimple.h, gimple-iterator.c, graphite.c, graphite-clast-to-gimple.c, graphite-clast-to-gimple.h, graphite-dependences.c, graphite-poly.c, graphite-poly.h, graphite-ppl.c, graphite-ppl.h, graphite-scop-detection.c, graphite-sese-to-poly.c, graphite-sese-to-poly.h, ifcvt.c, intl.c, intl.h, ipa.c, ipa-cp.c, ipa-inline.c, ipa-prop.c, ipa-prop.h, ipa-pure-const.c, ipa-reference.c, ipa-type-escape.c, ira-color.c, ira-conflicts.c, ira-lives.c, java/Make-lang.in, lambda-code.c, loop-invariant.c, lto/Make-lang.in, lto-streamer.h, lto-streamer-in.c, objc/Make-lang.in, objcp/Make-lang.in, omp-low.c, optc-gen.awk, opt-functions.awk, opth-gen.awk, params.def, passes.c, postreload-gcse.c, print-tree.c, recog.c, regrename.c, reload.h, rtl.def, sched-int.h, sched-rgn.c, sel-sched-dump.c, sese.c, sese.h, store-motion.c, stor-layout.c, tree-cfgcleanup.c, tree-chrec.c, tree-complex.c, tree-data-ref.c, tree.def, tree-eh.c, tree-flow.h, tree-flow-inline.h, tree.h, tree-loop-distribution.c, tree-outof-ssa.c, tree-parloops.c, tree-pass.h, tree-predcom.c, tree-profile.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-alias.c, tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-loop-im.c, tree-ssa-loop-ivcanon.c, tree-ssa-loop-manip.c, tree-ssa-math-opts.c, tree-ssa-operands.c, tree-ssa-pre.c, tree-ssa-sccvn.c, tree-ssa-structalias.c, tree-ssa-uncprop.c, tree-tailcall.c, tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.h, tree-vect-slp.c, tree-vrp.c, unwind-dw2-fde-darwin.c, varpool.c: Update copyright years. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157950 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-parloops.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gcc/tree-parloops.c') diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c index 35638315c9c..41cef89ac9e 100644 --- a/gcc/tree-parloops.c +++ b/gcc/tree-parloops.c @@ -1,5 +1,6 @@ /* Loop autoparallelization. - Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc. + Copyright (C) 2006, 2007, 2008, 2009, 2010 + Free Software Foundation, Inc. Contributed by Sebastian Pop and Zdenek Dvorak . -- cgit v1.2.1 From ca77c6ec2d25206fe9064d190e00b4abe1cf9fd9 Mon Sep 17 00:00:00 2001 From: spop Date: Tue, 6 Apr 2010 19:20:47 +0000 Subject: Avoid calling verify_ssa twice in verify_loop_closed_ssa. 2010-04-06 Sebastian Pop * graphite-clast-to-gimple.c (graphite_verify): Remove redundant call to verify_ssa. Invoke verify_loop_closed_ssa with an extra argument. * graphite-scop-detection.c (canonicalize_loop_closed_ssa_form): Same. * graphite-sese-to-poly.c (rewrite_reductions_out_of_ssa): Same. (rewrite_commutative_reductions_out_of_ssa): Same. * passes.c (execute_function_todo): Call verify_ssa for every pass in the LNO. Invoke verify_loop_closed_ssa with an extra argument. * tree-flow.h (verify_loop_closed_ssa): Update declaration. * tree-parloops.c (parallelize_loops): Invoke verify_loop_closed_ssa with an extra argument. * tree-ssa-loop-manip.c (check_loop_closed_ssa_stmt): Same. Call verify_ssa only when the extra argument is true. (gimple_duplicate_loop_to_header_edge): Invoke verify_loop_closed_ssa with an extra argument. (tree_transform_and_unroll_loop): Same. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158021 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-parloops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/tree-parloops.c') diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c index 41cef89ac9e..b8a883fb939 100644 --- a/gcc/tree-parloops.c +++ b/gcc/tree-parloops.c @@ -1970,7 +1970,7 @@ parallelize_loops (void) verify_flow_info (); verify_dominators (CDI_DOMINATORS); verify_loop_structure (); - verify_loop_closed_ssa (); + verify_loop_closed_ssa (true); } free_stmt_vec_info_vec (); -- cgit v1.2.1 From cb24521686308314fadcd96cdfd23858aa19aa95 Mon Sep 17 00:00:00 2001 From: rguenth Date: Mon, 12 Apr 2010 15:20:48 +0000 Subject: 2010-04-12 Richard Guenther * gsstruct.def (GSS_CALL): New. * gimple.def (GIMPLE_CALL): Change to GSS_CALL. * gimple.h: Include tree-ssa-alias.h. (struct gimple_statement_call): New. (union gimple_statement_struct_d): Add gimple_call member. (gimple_call_reset_alias_info): Declare. (gimple_call_use_set): New function. (gimple_call_clobber_set): Likewise. * Makefile.in (GIMPLE_H): Add tree-ssa-alias.h. * gimple.c (gimple_call_reset_alias_info): New function. (gimple_build_call_1): Call it. * lto-streamer-in.c (input_gimple_stmt): Likewise. * tree-inline.c (remap_gimple_stmt): Likewise. (expand_call_inline): Remove callused handling. * cfgexpand.c (update_alias_info_with_stack_vars): Likewise. * tree-dfa.c (dump_variable): Likewise. * tree-parloops.c (parallelize_loops): Likewise. * tree-ssa.c (init_tree_ssa): Likewise. (delete_tree_ssa): Likewise. * tree-flow-inline.h (is_call_used): Remove. * tree-flow.h (struct gimple_df): Remove callused member. * tree-nrv.c (dest_safe_for_nrv_p): Adjust predicate. * tree-ssa-alias.c (dump_alias_info): Remove callused handling. (ref_maybe_used_by_call_p_1): Simplify. (call_may_clobber_ref_p_1): Likewise. * tree-ssa-structalias.c (compute_points_to_sets): Set the call stmt used and clobbered sets. * tree-tailcall.c (suitable_for_tail_opt_p): Adjust predicate. (find_tail_calls): Verify the tail call. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158226 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-parloops.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'gcc/tree-parloops.c') diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c index b8a883fb939..c4ac89b001a 100644 --- a/gcc/tree-parloops.c +++ b/gcc/tree-parloops.c @@ -1977,13 +1977,10 @@ parallelize_loops (void) htab_delete (reduction_list); /* Parallelization will cause new function calls to be inserted through - which local variables will escape. Reset the points-to solutions - for ESCAPED and CALLUSED. */ + which local variables will escape. Reset the points-to solution + for ESCAPED. */ if (changed) - { - pt_solution_reset (&cfun->gimple_df->escaped); - pt_solution_reset (&cfun->gimple_df->callused); - } + pt_solution_reset (&cfun->gimple_df->escaped); return changed; } -- cgit v1.2.1 From 1e33ad50b5d37f30af9e92c75a3d30f5d5b2d312 Mon Sep 17 00:00:00 2001 From: lauras Date: Thu, 22 Apr 2010 12:42:15 +0000 Subject: 2010-04-22 Laurynas Biveinis * tree-parloops.c (loop_parallel_p): New argument parloop_obstack. Pass it down. (parallelize_loops): New variable parloop_obstack. Initialize it, pass it down, free it. * tree-loop-linear.c (linear_transform_loops): Pass down lambda_obstack. * tree-data-ref.h (lambda_compute_access_matrices): New argument of type struct obstack *. * tree-data-ref.c (analyze_subscript_affine_affine): New variable scratch_obstack. Initialize it, pass down, free it. * lambda.h (lambda_loop_new): Remove. (lambda_matrix_new, lambda_matrix_inverse) (lambda_trans_matrix_new, lambda_trans_matrix_inverse): New argument of type struct obstack *. * lambda-trans.c (lambda_trans_matrix_new): New argument lambda_obstack. Pass it down, use obstack allocation for ret. (lambda_trans_matrix_inverse): New argument lambda_obstack. Pass it down. * lambda-mat.c (lambda_matrix_get_column) (lambda_matrix_project_to_null): Remove. (lambda_matrix_new): New argument lambda_obstack. Use obstack allocation for mat. (lambda_matrix_inverse_hard, lambda_matrix_inverse): New argument lambda_obstack. * lambda-code.c (lambda_loop_new): New function. (lambda_lattice_new, compute_nest_using_fourier_motzkin) (lambda_compute_auxillary_space, lambda_compute_target_space) (lambda_loopnest_transform, gcc_loop_to_lambda_loop) (lambda_loopnest_to_gcc_loopnest): Pass down lambda_obstack. (build_access_matrix): New argument lambda_obstack. Use obstack allocation for am. (lambda_compute_step_signs, lambda_compute_access_matrices): New argument lambda_obstack. Pass it down. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158644 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-parloops.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'gcc/tree-parloops.c') diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c index c4ac89b001a..69a0b659616 100644 --- a/gcc/tree-parloops.c +++ b/gcc/tree-parloops.c @@ -248,7 +248,7 @@ name_to_copy_elt_hash (const void *aa) in parallel). */ static bool -loop_parallel_p (struct loop *loop) +loop_parallel_p (struct loop *loop, struct obstack * parloop_obstack) { VEC (ddr_p, heap) * dependence_relations; VEC (data_reference_p, heap) *datarefs; @@ -273,7 +273,7 @@ loop_parallel_p (struct loop *loop) if (dump_file && (dump_flags & TDF_DETAILS)) dump_data_dependence_relations (dump_file, dependence_relations); - trans = lambda_trans_matrix_new (1, 1); + trans = lambda_trans_matrix_new (1, 1, parloop_obstack); LTM_MATRIX (trans)[0][0] = -1; if (lambda_transform_legal_p (trans, 1, dependence_relations)) @@ -1884,15 +1884,17 @@ parallelize_loops (void) struct tree_niter_desc niter_desc; loop_iterator li; htab_t reduction_list; + struct obstack parloop_obstack; HOST_WIDE_INT estimated; LOC loop_loc; - + /* Do not parallelize loops in the functions created by parallelization. */ if (parallelized_function_p (cfun->decl)) return false; if (cfun->has_nonlocal_label) return false; + gcc_obstack_init (&parloop_obstack); reduction_list = htab_create (10, reduction_info_hash, reduction_info_eq, free); init_stmt_vec_info_vec (); @@ -1950,7 +1952,8 @@ parallelize_loops (void) if (!try_create_reduction_list (loop, reduction_list)) continue; - if (!flag_loop_parallelize_all && !loop_parallel_p (loop)) + if (!flag_loop_parallelize_all + && !loop_parallel_p (loop, &parloop_obstack)) continue; changed = true; @@ -1975,6 +1978,7 @@ parallelize_loops (void) free_stmt_vec_info_vec (); htab_delete (reduction_list); + obstack_free (&parloop_obstack, NULL); /* Parallelization will cause new function calls to be inserted through which local variables will escape. Reset the points-to solution -- cgit v1.2.1 From f4a50267b9196603596fb82bb914e9000848cc1a Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 10 May 2010 14:31:37 +0000 Subject: * tree-ssa-reassoc.c (undistribute_ops_list): Use create_tmp_reg. (can_reassociate_p): Use FLOAT_TYPE_P. * tree-vectorizer.h (vect_is_simple_reduction): Rename to ... (vect_force_simple_reduction): ... this. * tree-parloops.c (gather_scalar_reductions): Use vect_force_simple_reduction. * tree-vect-loop.c (vect_is_simple_reduction_1): Rename from vect_is_simple_reduction, add modify argument, if true rewrite "a-b" into "a+(-b)". (vect_is_simple_reduction, vect_force_simple_reduction): New functions. (vect_analyze_scalar_cycles_1): Use vect_force_simple_reduction. testsuite/ * gcc.dg/vect/fast-math-vect-reduc-8.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159226 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-parloops.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gcc/tree-parloops.c') diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c index 69a0b659616..52a6dc424f2 100644 --- a/gcc/tree-parloops.c +++ b/gcc/tree-parloops.c @@ -64,7 +64,7 @@ along with GCC; see the file COPYING3. If not see /* Reduction handling: - currently we use vect_is_simple_reduction() to detect reduction patterns. + currently we use vect_force_simple_reduction() to detect reduction patterns. The code transformation will be introduced by an example. @@ -1745,7 +1745,9 @@ gather_scalar_reductions (loop_p loop, htab_t reduction_list) if (!simple_iv (loop, loop, res, &iv, true) && simple_loop_info) { - gimple reduc_stmt = vect_is_simple_reduction (simple_loop_info, phi, true, &double_reduc); + gimple reduc_stmt = vect_force_simple_reduction (simple_loop_info, + phi, true, + &double_reduc); if (reduc_stmt && !double_reduc) build_new_reduction (reduction_list, reduc_stmt, phi); } -- cgit v1.2.1 From a7a4626828090600459358ca745c4482cf9551a1 Mon Sep 17 00:00:00 2001 From: steven Date: Fri, 21 May 2010 13:53:22 +0000 Subject: gcc/ChangeLog: * tree.h: Include real.h and fixed-value.h as basic datatypes. * dfp.c, convert.c, reload1.c, reginfo.c, tree-flow.h, tree-ssa-threadedge.c, tree-ssanames.c, tree-loop-linear.c, tree-into-ssa.c, tree-vect-generic.c, tree-ssa-structalias.c, tree-ssa-loop-im.c, tree-dump.c, tree-complex.c, tree-ssa-uninit.c, genrecog.c, tree-ssa-threadupdate.c, tree-ssa-loop-niter.c, tree-pretty-print.c, tree-loop-distribution.c, tree-ssa-loop-unswitch.c, c-lex.c, optabs.c, postreload-gcse.c, tree-ssa-loop-manip.c, postreload.c, tree-ssa-loop-ch.c, tree-tailcall.c, tree.c, reload.c, tree-scalar-evolution.c, rtlanal.c, tree-phinodes.c, builtins.c, final.c, genoutput.c, fold-const.c, tree-ssa-dse.c, genautomata.c, tree-ssa-uncprop.c, toplev.c, tree-chrec.c, genemit.c, c-cppbuiltin.c, tree-ssa-sccvn.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, mode-switching.c, tree-call-cdce.c, cse.c, genpeep.c, tree-ssa-math-opts.c, tree-ssa-dom.c, tree-nrv.c, tree-ssa-propagate.c, tree-ssa-alias.c, tree-ssa-sink.c, jump.c, ifcvt.c, dwarf2out.c, expr.c, genattrtab.c, genconditions.c, tree-ssa-loop-ivcanon.c, tree-ssa-loop.c, tree-parloops.c, recog.c, tree-ssa-address.c, lcm.c, tree-eh.c, gimple-pretty-print.c, c-pretty-print.c, print-rtl.c, gcse.c, tree-if-conv.c, tree-data-ref.c, tree-affine.c, gimplify.c, tree-ssa-phiopt.c, implicit-zee.c, expmed.c, tree-dfa.c, emit-rtl.c, store-motion.c, cselib.c, tree-cfgcleanup.c, simplify-rtx.c, tree-ssa-pre.c, genpreds.c, tree-mudflap.c, print-tree.c, tree-ssa-copy.c, tree-ssa-forwprop.c, tree-ssa-dce.c, varasm.c, tree-nested.c, tree-ssa.c, tree-ssa-loop-prefetch.c, rtl.c, tree-inline.c, integrate.c, tree-optimize.c, tree-ssa-phiprop.c, fixed-value.c, combine.c, tree-profile.c, c-common.c, sched-vis.c, tree-cfg.c, passes.c, tree-ssa-reassoc.c, config/alpha/alpha.c, config/frv/frv.c, config/s390/s390.c, config/m32c/m32c.c, config/spu/spu.c, config/sparc/sparc.c, config/mep/mep.c, config/m32r/m32r.c, config/rx/rx.c, config/i386/i386.c, config/sh/sh.c, config/pdp11/pdp11.c, config/avr/avr.c, config/crx/crx.c, config/xtensa/xtensa.c, config/stormy16/stormy16.c, config/fr30/fr30.c, config/lm32/lm32.c, config/moxie/moxie.c, config/m68hc11/m68hc11.c, config/cris/cris.c, config/iq2000/iq2000.c, config/mn10300/mn10300.c, config/ia64/ia64.c, config/m68k/m68k.c, config/rs6000/rs6000.c, config/picochip/picochip.c, config/darwin.c, config/arc/arc.c, config/mcore/mcore.c, config/score/score3.c, config/score/score7.c, config/score/score.c, config/arm/arm.c, config/pa/pa.c, config/mips/mips.c, config/vax/vax.c, config/h8300/h8300.c, config/v850/v850.c, config/mmix/mmix.c, config/bfin/bfin.c: Clean up redundant includes. * Makefile.in: Update accordingly. java/ChangeLog: * typeck.c, decl.c, jcf-parse.c, except.c, expr.c: cp/Changelog: * error.c, tree.c, typeck2.c, cxx-pretty-print.c, mangle.c: Clean up redundant includes. fortran/ChangeLog: * trans-const.c, trans-types.c, trans-intrinsic.c: Clean up redundant includes. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159663 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-parloops.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'gcc/tree-parloops.c') diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c index 52a6dc424f2..3c9a1d2826a 100644 --- a/gcc/tree-parloops.c +++ b/gcc/tree-parloops.c @@ -25,10 +25,8 @@ along with GCC; see the file COPYING3. If not see #include "coretypes.h" #include "tm.h" #include "tree.h" -#include "rtl.h" #include "tree-flow.h" #include "cfgloop.h" -#include "ggc.h" #include "tree-data-ref.h" #include "diagnostic.h" #include "tree-pass.h" -- cgit v1.2.1 From ce084dfc1cd60d867d38dbed86a914d82fa908d1 Mon Sep 17 00:00:00 2001 From: jsm28 Date: Fri, 21 May 2010 22:34:26 +0000 Subject: * diagnostic.c: Don't include tm.h, tree.h, tm_p.h, langhooks.h or langhooks-def.h. (diagnostic_initialize): Initialize x_data not last_function. (diagnostic_report_current_function): Move to tree-diagnostic.c. (default_diagnostic_starter): Call diagnostic_report_current_module not diagnostic_report_current_function. (diagnostic_report_diagnostic): Initialize x_data not abstract_origin. (verbatim): Likewise. * diagnostic.h (struct diagnostic_info): Change abstract_origin to x_data. (struct diagnostic_context): Change last_function to x_data. (diagnostic_auxiliary_data): Replace with diagnostic_context_auxiliary_data and diagnostic_info_auxiliary_data. (diagnostic_last_function_changed, diagnostic_set_last_function, diagnostic_report_current_function): Move to tree-diagnostic.h. (print_declaration, dump_generic_node, print_generic_stmt, print_generic_stmt_indented, print_generic_expr, print_generic_decl, debug_c_tree, dump_omp_clauses, print_call_name, debug_generic_expr, debug_generic_stmt, debug_tree_chain, default_tree_printer): Move to tree-pretty-print.h. (debug_gimple_stmt, debug_gimple_seq, print_gimple_seq, print_gimple_stmt, print_gimple_expr, dump_gimple_stmt): Move to gimple-pretty-print.h. * pretty-print.c: Don't include tree.h (pp_base_format): Don't handle %K here. (pp_base_tree_identifier): Move to tree-pretty-print.c. * pretty-print.h (text_info): Change abstract_origin to x_data. (pp_tree_identifier, pp_unsupported_tree, pp_base_tree_identifier): Move to tree-pretty-print.h. * gimple-pretty-print.h, tree-diagnostic.c, tree-diagnostic.h, tree-pretty-print.h: New files. * tree-pretty-print.c: Include tree-pretty-print.h. (percent_K_format): New. Moved from pretty-print.c. (pp_base_tree_identifier): Move from pretty-print.c. * c-objc-common.c: Include tree-pretty-print.h. (c_tree_printer): Handle %K here. * langhooks.c: Include tree-diagnostic.h. (lhd_print_error_function): Use diagnostic_abstract_origin macro. * toplev.c: Include tree-diagnostic.h and tree-pretty-print.h. (default_tree_printer): Handle %K using percent_K_format. (general_init): Use default_tree_diagnostic_starter. * tree.c: Include tree-diagnostic.h and tree-pretty-print.h. (free_lang_data): Use default_tree_diagnostic_starter. * c-pretty-print.c: Include tree-pretty-print.h. * cfgexpand.c: Include tree-pretty-print.h and gimple-pretty-print.h. * cgraphunit.c: Include tree-pretty-print.h and gimple-pretty-print.h. * dwarf2out.c: Include tree-pretty-print.h. * except.c: Include tree-pretty-print.h. * gimple-pretty-print.c: Include tree-pretty-print.h and gimple-pretty-print.h. * gimplify.c: Include tree-pretty-print.h. * graphite-poly.c: Include tree-pretty-print.h and gimple-pretty-print.h. * ipa-cp.c: Include tree-pretty-print.h. * ipa-inline.c: Include gimple-pretty-print.h. * ipa-prop.c: Include tree-pretty-print.h and gimple-pretty-print.h. * ipa-pure-const.c: Include gimple-pretty-print.h. * ipa-struct-reorg.c: Include tree-pretty-print.h and gimple-pretty-print.h. * ipa-type-escape.c: Include tree-pretty-print.h. * print-rtl.c: Include tree-pretty-print.h. * print-tree.c: Include gimple-pretty-print.h. * sese.c: Include tree-pretty-print.h. * tree-affine.c: Include tree-pretty-print.h. * tree-browser.c: Include tree-pretty-print.h. * tree-call-cdce.c: Include gimple-pretty-print.h. * tree-cfg.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-chrec.c: Include tree-pretty-print.h. * tree-data-ref.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-dfa.c: Include tree-pretty-print.h. * tree-if-conv.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-inline.c: Include tree-pretty-print.h. * tree-into-ssa.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-nrv.c: Include tree-pretty-print.h. * tree-object-size.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-outof-ssa.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-parloops.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-predcom.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-scalar-evolution.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-sra.c: Include tree-pretty-print.h. * tree-ssa-address.c: Include tree-pretty-print.h. * tree-ssa-alias.c: Include tree-pretty-print.h. * tree-ssa-ccp.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-coalesce.c: Include tree-pretty-print.h. * tree-ssa-copy.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-copyrename.c: Include tree-pretty-print.h. * tree-ssa-dce.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-dom.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-dse.c: Include gimple-pretty-print.h. * tree-ssa-forwprop.c: Include tree-pretty-print.h. * tree-ssa-ifcombine.c: Include tree-pretty-print.h. * tree-ssa-live.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-im.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-ivcanon.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-ivopts.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-niter.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-prefetch.c: Include tree-pretty-print.h. * tree-ssa-math-opts.c: Include gimple-pretty-print.h. * tree-ssa-operands.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-phiprop.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-pre.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-propagate.c: Include gimple-pretty-print.h. * tree-ssa-reassoc.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-sccvn.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-sink.c: Include gimple-pretty-print.h. * tree-ssa-ter.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-uninit.c: Include gimple-pretty-print.h. * tree-ssa.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-stdarg.c: Include gimple-pretty-print.h. * tree-switch-conversion.c: Include gimple-pretty-print.h. * tree-tailcall.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-data-refs.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-loop-manip.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-loop.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-patterns.c: Include gimple-pretty-print.h. * tree-vect-slp.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-stmts.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vectorizer.c: Include tree-pretty-print.h. * tree-vrp.c: Include tree-pretty-print.h and gimple-pretty-print.h. * value-prof.c: Include tree-pretty-print.h and gimple-pretty-print.h. * var-tracking.c: Include tree-pretty-print.h. * Makefile.in (OBJS-common): Add tree-diagnostic.o. (tree-diagnostic.o): New dependencies. (c-objc-common.o, c-pretty-print.o, langhooks.o, tree.o, tree-inline.o, print-tree.o, stor-layout.o, tree-ssa-uninit.o, tree-ssa.o, tree-into-ssa.o, tree-ssa-ter.o, tree-ssa-coalesce.o, tree-outof-ssa.o, tree-ssa-forwprop.o, tree-ssa-phiprop.o, tree-ssa-ifcombine.o, tree-nrv.o, tree-ssa-copy.o, tree-ssa-propagate.o, tree-ssa-dom.o, tree-ssa-uncprop.o, tree-ssa-live.o, tree-ssa-copyrename.o, tree-ssa-pre.o, tree-ssa-sccvn.o, tree-vrp.o, tree-cfg.o, tree-tailcall.o, tree-ssa-sink.o, tree-if-conv.o, tree-dfa.o, tree-ssa-operands.o, tree-ssa-address.o, tree-ssa-loop-niter.o, tree-ssa-loop-ivcanon.o, tree-ssa-loop-prefetch.o, tree-predcom.o, tree-ssa-loop-ivopts.o, tree-affine.o, tree-ssa-loop-im.o, tree-ssa-math-opts.o, tree-ssa-alias.o, tree-ssa-reassoc.o, gimplify.o, tree-browser.o, tree-chrec.o, tree-scalar-evolution.o, tree-data-ref.o, sese.o, graphite-poly.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-patterns.o, tree-vect-slp.o, tree-vect-stmts.o, tree-vect-data-refs.o, tree-vectorizer.o, tree-parloops.o, tree-stdarg.o, tree-object-size.o, gimple-pretty-print.o, tree-pretty-print.o, diagnostic.o, toplev.o, print-rtl.o, except.o, dwarf2out.o, cgraphunit.o, ipa-prop.o, ipa-cp.o, ipa-inline.o, ipa-pure-const.o, ipa-type-escape.o, ipa-struct-reorg.o, tree-ssa-dce.o, tree-call-cdce.o, tree-ssa-ccp.o, tree-sra.o, tree-switch-conversion.o, var-tracking.o, value-prof.o, cfgexpand.o, pretty-print.o): Update dependencies. cp: * error.c: Include tree-diagnostic.h and tree-pretty-print.h. (cp_print_error_function): Use diagnostic_abstract_origin macro. (cp_printer): Handle %K here using percent_K_format. * cxx-pretty-print.c: Include tree-pretty-print.h. * Make-lang.in (cp/error.o, cp/cxx-pretty-print.o): Update dependencies. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159685 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-parloops.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gcc/tree-parloops.c') diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c index 3c9a1d2826a..f38ae17d89a 100644 --- a/gcc/tree-parloops.c +++ b/gcc/tree-parloops.c @@ -29,6 +29,8 @@ along with GCC; see the file COPYING3. If not see #include "cfgloop.h" #include "tree-data-ref.h" #include "diagnostic.h" +#include "tree-pretty-print.h" +#include "gimple-pretty-print.h" #include "tree-pass.h" #include "tree-scalar-evolution.h" #include "hashtab.h" -- cgit v1.2.1 From 8e3cb73bc66100e137b20bcd98316bc415b6e53c Mon Sep 17 00:00:00 2001 From: steven Date: Tue, 1 Jun 2010 22:00:56 +0000 Subject: * gimplify.c: Do not include except.h and optabs.h. (gimplify_body): Do not initialize RTL profiling. * gimple-low.c: Do not include rtl.h, diagnostic.h, langhooks.h, langhooks-def.h, timevar.h, except.h, hashtab.h, and expr.h. * gimple-fold.c: Do not include rtl.h, tm_p.h, ggc.h, basic-block.h, output.h, expr.h, diagnostic.h, timevar.h, value-prof.h, and langhooks.h. * tree-pretty-print.h: Include pretty-print.h. * gimple-pretty-print.h: Include pretty-print.h. * tree-pretty-print.c: Do not include diagnostic.h. * tree-vrp.c: Likewise. * tree-tailcall.c: Likewise * tree-scalar-evolution.c: Likewise * tree-ssa-dse.c: Likewise * tree-chrec.c: Likewise * tree-ssa-sccvn.c: Likewise * tree-ssa-copyrename.c: Likewise * tree-nomudflap.c: Likewise * tree-call-cdce.c: Likewise * tree-stdarg.c: Likewise * tree-ssa-math-opts.c: Likewise * tree-nrv.c: Likewise * tree-ssa-sink.c: Likewise * tree-browser.c: Likewise * tree-ssa-loop-ivcanon.c: Likewise * tree-ssa-loop.c: Likewise * tree-parloops.c: Likewise * tree-ssa-address.c: Likewise * tree-ssa-ifcombine.c: Likewise * tree-if-conv.c: Likewise * tree-data-ref.c: Likewise * tree-affine.c: Likewise * tree-ssa-phiopt.c: Likewise * tree-ssa-coalesce.c: Likewise * tree-ssa-pre.c: Likewise * tree-ssa-live.c: Likewise * tree-predcom.c: Likewise * tree-ssa-forwprop.c: Likewise * tree-ssa-dce.c: Likewise * tree-ssa-ter.c: Likewise * tree-ssa-loop-prefetch.c: Likewise * tree-optimize.c: Likewise * tree-ssa-phiprop.c: Likewise * tree-object-size.c: Likewise * tree-outof-ssa.c: Likewise * tree-ssa-structalias.c: Likewise * tree-switch-conversion.c: Likewise * tree-ssa-reassoc.c: Likewise * tree-ssa-operands.c: Likewise * tree-vectorizer.c: Likewise * tree-vect-data-refs.c: Likewise * tree-vect-generic.c: Likewise * tree-vect-stmts.c: Likewise * tree-vect-patterns.c: Likewise * tree-vect-slp.c: Likewise * tree-vect-loop.c: Likewise * tree-ssa-loop-ivopts.c: Likewise * tree-ssa-loop-im.c: Likewise * tree-ssa-loop-niter.c: Likewise * tree-ssa-loop-unswitch.c: Likewise * tree-ssa-loop-manip.c: Likewise * tree-ssa-loop-ch.c: Likewise * tree-dump.c: Likewise * tree-complex.c: Likewise * tree-into-ssa.c: Do not include diagnostic.h and expr.h. * tree-ssa-uninit.c: Likewise * tree-ssa-threadupdate.c: Likewise * tree-ssa-uncprop.c: Likewise * tree-ssa-ccp.c: Likewise * tree-ssa-dom.c: Likewise * tree-ssa-propagate.c: Likewise * tree-ssa-alias.c: Likewise * tree-dfa.c: Likewise * tree-cfgcleanup.c: Likewise * tree-sra.c: Likewise * tree-ssa-copy.c: Likewise * tree-ssa.c: Likewise * tree-profile.c: Likewise * tree-cfg.c: Likewise * tree-ssa-threadedge.c: Likewise * tree-vect-loop-manip.c: Likewise * tree-inline.c: Do not include diagnostic.h and expr.h. Include rtl.h. (copy_decl_for_dup_finish): Do not use NULL_RTX. * tree-loop-linear.c: Do not include diagnostic.h, expr.h, and optabs.h. * tree-loop-distribution.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160125 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-parloops.c | 1 - 1 file changed, 1 deletion(-) (limited to 'gcc/tree-parloops.c') diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c index f38ae17d89a..a17655ed699 100644 --- a/gcc/tree-parloops.c +++ b/gcc/tree-parloops.c @@ -28,7 +28,6 @@ along with GCC; see the file COPYING3. If not see #include "tree-flow.h" #include "cfgloop.h" #include "tree-data-ref.h" -#include "diagnostic.h" #include "tree-pretty-print.h" #include "gimple-pretty-print.h" #include "tree-pass.h" -- cgit v1.2.1 From 182cf5a9a415f31df0f9a10e46faed1221484a35 Mon Sep 17 00:00:00 2001 From: rguenth Date: Thu, 1 Jul 2010 08:49:19 +0000 Subject: 2010-07-01 Richard Guenther PR middle-end/42834 PR middle-end/44468 * doc/gimple.texi (is_gimple_mem_ref_addr): Document. * doc/generic.texi (References to storage): Document MEM_REF. * tree-pretty-print.c (dump_generic_node): Handle MEM_REF. (print_call_name): Likewise. * tree.c (recompute_tree_invariant_for_addr_expr): Handle MEM_REF. (build_simple_mem_ref_loc): New function. (mem_ref_offset): Likewise. * tree.h (build_simple_mem_ref_loc): Declare. (build_simple_mem_ref): Define. (mem_ref_offset): Declare. * fold-const.c: Include tree-flow.h. (operand_equal_p): Handle MEM_REF. (build_fold_addr_expr_with_type_loc): Likewise. (fold_comparison): Likewise. (fold_unary_loc): Fold VIEW_CONVERT_EXPR > to MEM_REF . (fold_binary_loc): Fold MEM[&MEM[p, CST1], CST2] to MEM[p, CST1 + CST2], fold MEM[&a.b, CST2] to MEM[&a, offsetof (a, b) + CST2]. * tree-ssa-alias.c (ptr_deref_may_alias_decl_p): Handle MEM_REF. (ptr_deref_may_alias_ref_p_1): Likewise. (ao_ref_base_alias_set): Properly differentiate base object for offset and TBAA. (ao_ref_init_from_ptr_and_size): Use MEM_REF. (indirect_ref_may_alias_decl_p): Handle MEM_REFs properly. (indirect_refs_may_alias_p): Likewise. (refs_may_alias_p_1): Likewise. Remove pointer SSA name def chasing code. (ref_maybe_used_by_call_p_1): Handle MEM_REF. (call_may_clobber_ref_p_1): Likewise. * dwarf2out.c (loc_list_from_tree): Handle MEM_REF. * expr.c (expand_assignment): Handle MEM_REF. (store_expr): Handle MEM_REFs from STRING_CSTs. (store_field): If expanding a MEM_REF of a non-addressable decl use bitfield operations. (get_inner_reference): Handle MEM_REF. (expand_expr_addr_expr_1): Likewise. (expand_expr_real_1): Likewise. * tree-eh.c (tree_could_trap_p): Handle MEM_REF. * alias.c (ao_ref_from_mem): Handle MEM_REF. (get_alias_set): Likewise. Properly handle VIEW_CONVERT_EXPRs. * tree-data-ref.c (dr_analyze_innermost): Handle MEM_REF. (dr_analyze_indices): Likewise. (dr_analyze_alias): Likewise. (object_address_invariant_in_loop_p): Likewise. * gimplify.c (mark_addressable): Handle MEM_REF. (gimplify_cond_expr): Build MEM_REFs. (gimplify_modify_expr_to_memcpy): Likewise. (gimplify_init_ctor_preeval_1): Handle MEM_REF. (gimple_fold_indirect_ref): Adjust. (gimplify_expr): Handle MEM_REF. Gimplify INDIRECT_REF to MEM_REF. * tree.def (MEM_REF): New tree code. * tree-dfa.c: Include toplev.h. (get_ref_base_and_extent): Handle MEM_REF. (get_addr_base_and_unit_offset): New function. * emit-rtl.c (set_mem_attributes_minus_bitpos): Handle MEM_REF. * gimple-fold.c (may_propagate_address_into_dereference): Handle MEM_REF. (maybe_fold_offset_to_array_ref): Allow possibly out-of bounds accesses if the array has just one dimension. Remove always true parameter. Do not require type compatibility here. (maybe_fold_offset_to_component_ref): Remove. (maybe_fold_stmt_indirect): Remove. (maybe_fold_reference): Remove INDIRECT_REF handling. Fold back to non-MEM_REF. (maybe_fold_offset_to_address): Simplify. Deal with type mismatches here. (maybe_fold_reference): Likewise. (maybe_fold_stmt_addition): Likewise. Also handle &ARRAY + I in addition to &ARRAY[0] + I. (fold_gimple_assign): Handle ADDR_EXPR of MEM_REFs. (gimple_get_relevant_ref_binfo): Handle MEM_REF. * cfgexpand.c (expand_debug_expr): Handle MEM_REF. * tree-ssa.c (useless_type_conversion_p): Make most pointer conversions useless. (warn_uninitialized_var): Handle MEM_REF. (maybe_rewrite_mem_ref_base): New function. (execute_update_addresses_taken): Implement re-writing of MEM_REFs to SSA form. * tree-inline.c (remap_gimple_op_r): Handle MEM_REF, remove INDIRECT_REF handling. (copy_tree_body_r): Handle MEM_REF. * gimple.c (is_gimple_addressable): Adjust. (is_gimple_address): Likewise. (is_gimple_invariant_address): ADDR_EXPRs of MEM_REFs with invariant base are invariant. (is_gimple_min_lval): Adjust. (is_gimple_mem_ref_addr): New function. (get_base_address): Handle MEM_REF. (count_ptr_derefs): Likewise. (get_base_loadstore): Likewise. * gimple.h (is_gimple_mem_ref_addr): Declare. (gimple_call_fndecl): Handle invariant MEM_REF addresses. * tree-cfg.c (verify_address): New function, split out from ... (verify_expr): ... here. Use for verifying ADDR_EXPRs and the address operand of MEM_REFs. Verify MEM_REFs. Reject INDIRECT_REFs. (verify_types_in_gimple_min_lval): Handle MEM_REF. Disallow INDIRECT_REF. Allow conversions. (verify_types_in_gimple_reference): Verify VIEW_CONVERT_EXPR of a register does not change its size. (verify_types_in_gimple_reference): Verify MEM_REF. (verify_gimple_assign_single): Disallow INDIRECT_REF. Handle MEM_REF. * tree-ssa-operands.c (opf_non_addressable, opf_not_non_addressable): New. (mark_address_taken): Handle MEM_REF. (get_indirect_ref_operands): Pass through opf_not_non_addressable. (get_asm_expr_operands): Pass opf_not_non_addressable. (get_expr_operands): Handle opf_[not_]non_addressable. Handle MEM_REF. Remove INDIRECT_REF handling. * tree-vrp.c: (check_array_ref): Handle MEM_REF. (search_for_addr_array): Likewise. (check_array_bounds): Likewise. (vrp_stmt_computes_nonzero): Adjust for MEM_REF. * tree-ssa-loop-im.c (for_each_index): Handle MEM_REF. (ref_always_accessed_p): Likewise. (gen_lsm_tmp_name): Likewise. Handle ADDR_EXPR. * tree-complex.c (extract_component): Do not handle INDIRECT_REF. Handle MEM_REF. * cgraphbuild.c (mark_load): Properly check for NULL result from get_base_address. (mark_store): Likewise. * tree-ssa-loop-niter.c (array_at_struct_end_p): Handle MEM_REF. * tree-loop-distribution.c (generate_builtin): Exchange INDIRECT_REF handling for MEM_REF. * tree-scalar-evolution.c (follow_ssa_edge_expr): Handle &MEM[ptr + CST] similar to POINTER_PLUS_EXPR. * builtins.c (stabilize_va_list_loc): Use the function ABI valist type if we couldn't canonicalize the argument type. Always dereference with the canonical va-list type. (maybe_emit_free_warning): Handle MEM_REF. (fold_builtin_memory_op): Simplify and handle MEM_REFs in folding memmove to memcpy. * builtins.c (fold_builtin_memory_op): Use ref-all types for all memcpy foldings. * omp-low.c (build_receiver_ref): Adjust for MEM_REF. (build_outer_var_ref): Likewise. (scan_omp_1_op): Likewise. (lower_rec_input_clauses): Likewise. (lower_lastprivate_clauses): Likewise. (lower_reduction_clauses): Likewise. (lower_copyprivate_clauses): Likewise. (expand_omp_atomic_pipeline): Likewise. (expand_omp_atomic_mutex): Likewise. (create_task_copyfn): Likewise. * tree-ssa-sccvn.c (copy_reference_ops_from_ref): Handle MEM_REF. Remove old union trick. Initialize constant offsets. (ao_ref_init_from_vn_reference): Likewise. Do not handle INDIRECT_REF. Init base_alias_set properly. (vn_reference_lookup_3): Replace INDIRECT_REF handling with MEM_REF. (vn_reference_fold_indirect): Adjust for MEM_REFs. (valueize_refs): Fold MEM_REFs. Re-evaluate constant offset for ARRAY_REFs. (may_insert): Remove. (visit_reference_op_load): Do not test may_insert. (run_scc_vn): Remove parameter, do not fiddle with may_insert. * tree-ssa-sccvn.h (struct vn_reference_op_struct): Add a field to store the constant offset this op applies. (run_scc_vn): Adjust prototype. * cgraphunit.c (thunk_adjust): Adjust for MEM_REF. * tree-ssa-ccp.c (ccp_fold): Replace INDIRECT_REF folding with MEM_REF. Propagate &foo + CST as &MEM[&foo, CST]. Do not bother about volatile qualifiers on pointers. (fold_const_aggregate_ref): Handle MEM_REF, do not handle INDIRECT_REF. * tree-ssa-loop-ivopts.c * tree-ssa-loop-ivopts.c (determine_base_object): Adjust for MEM_REF. (strip_offset_1): Likewise. (find_interesting_uses_address): Replace INDIRECT_REF handling with MEM_REF handling. (get_computation_cost_at): Likewise. * ipa-pure-const.c (check_op): Handle MEM_REF. * tree-stdarg.c (check_all_va_list_escapes): Adjust for MEM_REF. * tree-ssa-sink.c (is_hidden_global_store): Handle MEM_REF and constants. * ipa-inline.c (likely_eliminated_by_inlining_p): Handle MEM_REF. * tree-parloops.c (take_address_of): Adjust for MEM_REF. (eliminate_local_variables_1): Likewise. (create_call_for_reduction_1): Likewise. (create_loads_for_reductions): Likewise. (create_loads_and_stores_for_name): Likewise. * matrix-reorg.c (may_flatten_matrices_1): Sanitize. (ssa_accessed_in_tree): Handle MEM_REF. (ssa_accessed_in_assign_rhs): Likewise. (update_type_size): Likewise. (analyze_accesses_for_call_stmt): Likewise. (analyze_accesses_for_assign_stmt): Likewise. (transform_access_sites): Likewise. (transform_allocation_sites): Likewise. * tree-affine.c (tree_to_aff_combination): Handle MEM_REF. * tree-vect-data-refs.c (vect_create_addr_base_for_vector_ref): Do not handle INDIRECT_REF. * tree-ssa-phiopt.c (add_or_mark_expr): Handle MEM_REF. (cond_store_replacement): Likewise. * tree-ssa-pre.c (create_component_ref_by_pieces_1): Handle MEM_REF, no not handle INDIRECT_REFs. (insert_into_preds_of_block): Properly initialize avail. (phi_translate_1): Fold MEM_REFs. Re-evaluate constant offset for ARRAY_REFs. Properly handle reference lookups that require a bit re-interpretation. (can_PRE_operation): Do not handle INDIRECT_REF. Handle MEM_REF. * tree-sra.c * tree-sra.c (build_access_from_expr_1): Handle MEM_REF. (build_ref_for_offset_1): Remove. (build_ref_for_offset): Build MEM_REFs. (gate_intra_sra): Disable for now. (sra_ipa_modify_expr): Handle MEM_REF. (ipa_early_sra_gate): Disable for now. * tree-sra.c (create_access): Swap INDIRECT_REF handling for MEM_REF handling. (disqualify_base_of_expr): Likewise. (ptr_parm_has_direct_uses): Swap INDIRECT_REF handling for MEM_REF handling. (sra_ipa_modify_expr): Remove INDIRECT_REF handling. Use mem_ref_offset. Remove bogus folding. (build_access_from_expr_1): Properly handle MEM_REF for non IPA-SRA. (make_fancy_name_1): Add support for MEM_REF. * tree-predcom.c (ref_at_iteration): Handle MEM_REFs. * tree-mudflap.c (mf_xform_derefs_1): Adjust for MEM_REF. * ipa-prop.c (compute_complex_assign_jump_func): Handle MEM_REF. (compute_complex_ancestor_jump_func): Likewise. (ipa_analyze_virtual_call_uses): Likewise. * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Replace INDIRECT_REF folding with more generalized MEM_REF folding. (tree_ssa_forward_propagate_single_use_vars): Adjust accordingly. (forward_propagate_addr_into_variable_array_index): Also handle &ARRAY + I in addition to &ARRAY[0] + I. * tree-ssa-dce.c (ref_may_be_aliased): Handle MEM_REF. * tree-ssa-ter.c (find_replaceable_in_bb): Avoid TER if that creates assignments with overlap. * tree-nested.c (get_static_chain): Adjust for MEM_REF. (get_frame_field): Likewise. (get_nonlocal_debug_decl): Likewise. (convert_nonlocal_reference_op): Likewise. (struct nesting_info): Add mem_refs pointer-set. (create_nesting_tree): Allocate it. (convert_local_reference_op): Insert to be folded mem-refs. (fold_mem_refs): New function. (finalize_nesting_tree_1): Perform defered folding of mem-refs (free_nesting_tree): Free the pointer-set. * tree-vect-stmts.c (vectorizable_store): Adjust for MEM_REF. (vectorizable_load): Likewise. * tree-ssa-phiprop.c (phiprop_insert_phi): Adjust for MEM_REF. (propagate_with_phi): Likewise. * tree-object-size.c (addr_object_size): Handle MEM_REFs instead of INDIRECT_REFs. (compute_object_offset): Handle MEM_REF. (plus_stmt_object_size): Handle MEM_REF. (collect_object_sizes_for): Dispatch to plus_stmt_object_size for &MEM_REF. * tree-flow.h (get_addr_base_and_unit_offset): Declare. (symbol_marked_for_renaming): Likewise. * Makefile.in (tree-dfa.o): Add $(TOPLEV_H). (fold-const.o): Add $(TREE_FLOW_H). * tree-ssa-structalias.c (get_constraint_for_1): Handle MEM_REF. (find_func_clobbers): Likewise. * ipa-struct-reorg.c (decompose_indirect_ref_acc): Handle MEM_REF. (decompose_access): Likewise. (replace_field_acc): Likewise. (replace_field_access_stmt): Likewise. (insert_new_var_in_stmt): Likewise. (get_stmt_accesses): Likewise. (reorg_structs_drive): Disable. * config/i386/i386.c (ix86_va_start): Adjust for MEM_REF. (ix86_canonical_va_list_type): Likewise. cp/ * cp-gimplify.c (cp_gimplify_expr): Open-code the rhs predicate we are looking for, allow non-gimplified INDIRECT_REFs. testsuite/ * gcc.c-torture/execute/20100316-1.c: New testcase. * gcc.c-torture/execute/pr44468.c: Likewise. * gcc.c-torture/compile/20100609-1.c: Likewise. * gcc.dg/volatile2.c: Adjust. * gcc.dg/plugin/selfassign.c: Likewise. * gcc.dg/pr36902.c: Likewise. * gcc.dg/tree-ssa/foldaddr-2.c: Remove. * gcc.dg/tree-ssa/foldaddr-3.c: Likewise. * gcc.dg/tree-ssa/forwprop-8.c: Adjust. * gcc.dg/tree-ssa/pr17141-1.c: Likewise. * gcc.dg/tree-ssa/ssa-fre-13.c: Likewise. * gcc.dg/tree-ssa/ssa-fre-14.c: Likewise. * gcc.dg/tree-ssa/ssa-ccp-21.c: Likewise. * gcc.dg/tree-ssa/pta-ptrarith-1.c: Likewise. * gcc.dg/tree-ssa/20030807-7.c: Likewise. * gcc.dg/tree-ssa/forwprop-10.c: Likewise. * gcc.dg/tree-ssa/ssa-fre-1.c: Likewise. * gcc.dg/tree-ssa/pta-ptrarith-2.c: Likewise. * gcc.dg/tree-ssa/ssa-ccp-23.c: Likewise. * gcc.dg/tree-ssa/forwprop-1.c: Likewise. * gcc.dg/tree-ssa/forwprop-2.c: Likewise. * gcc.dg/tree-ssa/struct-aliasing-1.c: Likewise. * gcc.dg/tree-ssa/ssa-ccp-25.c: Likewise. * gcc.dg/tree-ssa/ssa-pre-26.c: Likewise. * gcc.dg/tree-ssa/struct-aliasing-2.c: Likewise. * gcc.dg/tree-ssa/ssa-ccp-26.c: Likewise. * gcc.dg/tree-ssa/ssa-sccvn-4.c: Likewise. * gcc.dg/tree-ssa/ssa-pre-7.c: Likewise. * gcc.dg/tree-ssa/forwprop-5.c: Likewise. * gcc.dg/struct/w_prof_two_strs.c: XFAIL. * gcc.dg/struct/wo_prof_escape_arg_to_local.c: Likewise. * gcc.dg/struct/wo_prof_global_var.c: Likewise. * gcc.dg/struct/wo_prof_malloc_size_var.c: Likewise. * gcc.dg/struct/w_prof_local_array.c: Likewise. * gcc.dg/struct/w_prof_single_str_global.c: Likewise. * gcc.dg/struct/wo_prof_escape_str_init.c: Likewise. * gcc.dg/struct/wo_prof_array_through_pointer.c: Likewise. * gcc.dg/struct/w_prof_global_array.c: Likewise. * gcc.dg/struct/wo_prof_array_field.c: Likewise. * gcc.dg/struct/wo_prof_single_str_local.c: Likewise. * gcc.dg/struct/w_prof_local_var.c: Likewise. * gcc.dg/struct/wo_prof_two_strs.c: Likewise. * gcc.dg/struct/wo_prof_empty_str.c: Likewise. * gcc.dg/struct/wo_prof_local_array.c: Likewise. * gcc.dg/struct/w_prof_global_var.c: Likewise. * gcc.dg/struct/wo_prof_single_str_global.c: Likewise. * gcc.dg/struct/wo_prof_escape_substr_value.c: Likewise. * gcc.dg/struct/wo_prof_global_array.c: Likewise. * gcc.dg/struct/wo_prof_escape_return.c: Likewise. * gcc.dg/struct/wo_prof_escape_substr_array.c: Likewise. * gcc.dg/struct/wo_prof_double_malloc.c: Likewise. * gcc.dg/struct/w_ratio_cold_str.c: Likewise. * gcc.dg/struct/wo_prof_escape_substr_pointer.c: Likewise. * gcc.dg/struct/wo_prof_local_var.c: Likewise. * gcc.dg/tree-prof/stringop-1.c: Adjust. * g++.dg/tree-ssa/pr31146.C: Likewise. * g++.dg/tree-ssa/copyprop-1.C: Likewise. * g++.dg/tree-ssa/pr33604.C: Likewise. * g++.dg/plugin/selfassign.c: Likewise. * gfortran.dg/array_memcpy_3.f90: Likewise. * gfortran.dg/array_memcpy_4.f90: Likewise. * c-c++-common/torture/pr42834.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161655 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-parloops.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'gcc/tree-parloops.c') diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c index a17655ed699..af2708667d2 100644 --- a/gcc/tree-parloops.c +++ b/gcc/tree-parloops.c @@ -357,7 +357,7 @@ take_address_of (tree obj, tree type, edge entry, htab_t decl_address) if (var_p != &obj) { - *var_p = build1 (INDIRECT_REF, TREE_TYPE (*var_p), name); + *var_p = build_simple_mem_ref (name); name = force_gimple_operand (build_addr (obj, current_function_decl), &stmts, true, NULL_TREE); if (!gimple_seq_empty_p (stmts)) @@ -456,7 +456,7 @@ eliminate_local_variables_1 (tree *tp, int *walk_subtrees, void *data) type = TREE_TYPE (t); addr_type = build_pointer_type (type); addr = take_address_of (t, addr_type, dta->entry, dta->decl_address); - *tp = build1 (INDIRECT_REF, TREE_TYPE (*tp), addr); + *tp = build_simple_mem_ref (addr); dta->changed = true; return NULL_TREE; @@ -857,7 +857,6 @@ create_call_for_reduction_1 (void **slot, void *data) struct clsn_data *const clsn_data = (struct clsn_data *) data; gimple_stmt_iterator gsi; tree type = TREE_TYPE (PHI_RESULT (reduc->reduc_phi)); - tree struct_type = TREE_TYPE (TREE_TYPE (clsn_data->load)); tree load_struct; basic_block bb; basic_block new_bb; @@ -866,7 +865,7 @@ create_call_for_reduction_1 (void **slot, void *data) tree tmp_load, name; gimple load; - load_struct = fold_build1 (INDIRECT_REF, struct_type, clsn_data->load); + load_struct = build_simple_mem_ref (clsn_data->load); t = build3 (COMPONENT_REF, type, load_struct, reduc->field, NULL_TREE); addr = build_addr (t, current_function_decl); @@ -925,13 +924,12 @@ create_loads_for_reductions (void **slot, void *data) gimple stmt; gimple_stmt_iterator gsi; tree type = TREE_TYPE (gimple_assign_lhs (red->reduc_stmt)); - tree struct_type = TREE_TYPE (TREE_TYPE (clsn_data->load)); tree load_struct; tree name; tree x; gsi = gsi_after_labels (clsn_data->load_bb); - load_struct = fold_build1 (INDIRECT_REF, struct_type, clsn_data->load); + load_struct = build_simple_mem_ref (clsn_data->load); load_struct = build3 (COMPONENT_REF, type, load_struct, red->field, NULL_TREE); @@ -1012,7 +1010,6 @@ create_loads_and_stores_for_name (void **slot, void *data) gimple stmt; gimple_stmt_iterator gsi; tree type = TREE_TYPE (elt->new_name); - tree struct_type = TREE_TYPE (TREE_TYPE (clsn_data->load)); tree load_struct; gsi = gsi_last_bb (clsn_data->store_bb); @@ -1022,7 +1019,7 @@ create_loads_and_stores_for_name (void **slot, void *data) gsi_insert_after (&gsi, stmt, GSI_NEW_STMT); gsi = gsi_last_bb (clsn_data->load_bb); - load_struct = fold_build1 (INDIRECT_REF, struct_type, clsn_data->load); + load_struct = build_simple_mem_ref (clsn_data->load); t = build3 (COMPONENT_REF, type, load_struct, elt->field, NULL_TREE); stmt = gimple_build_assign (elt->new_name, t); SSA_NAME_DEF_STMT (elt->new_name) = stmt; -- cgit v1.2.1