2004-05-28 Zdenek Dvorak * tree-ssa-loop-niter.c (number_of_iterations_cond): Record correct assumptions. 2004-05-28 Dale Johannesen * loop-invariant.c (check_maybe_invariant): Disallow hoisting CALLs. 2004-05-27 Sebastian Pop Merge from mainline (lno-merge-20040526). * tree-scalar-evolution.c (draw_tree_cfg): Removed. * tree-into-ssa.c: Didn't merged http://gcc.gnu.org/ml/gcc-patches/2004-05/msg01231.html 2004-05-25 Sebastian Pop Dorit Naishlos * tree-scalar-evolution.c (first_iteration_non_satisfying_1): Include the evolution of the non varying chrec in other_evs. (number_of_iterations_in_loop): Don't instantiate the chrecs before the computation of loop counts. 2004-05-25 Olga Golovanevsky Dorit Naishlos * tree-vectorizer.c (vect_transform_loop_bound): Advance IVs by correct amount. (vect_transform_loop, vect_build_symbl_bound): Use shifts instead of division/multiplication to advance IVs. 2004-05-25 Zdenek Dvorak * tree-scalar-evolution.c (number_of_iterations_in_loop): Do not produce COND_EXPRs. 2004-05-25 Zdenek Dvorak * tree-scalar-evolution.c (resolve_mixers): New function. (already_instantiated): Type changed to bitmap. (scev_initialize, scev_finalize): Reflect the change. (analyze_scalar_evolution_in_loop): Use resolve_mixers. (instantiate_parameters_1): Add possibility to just resolve mixers. Fold the results. (number_of_iterations_in_loop): Use number_of_iterations_exit. * tree-ssa-loop-niter.c (simplify_using_outer_evolutions): New function. (number_of_iterations_exit): Use it. 2004-05-24 Dale Johannesen * loop-invariant.c (find_defs): Add DF_EQUIV_NOTES. 2004-05-21 Zdenek Dvorak * Makefile.in (tree-ssa-loop-manip.o): Add cfglayout.h dependency. * tree-flow.h (collect_defs, rename_variables_in_bb, rename_op, allocate_new_names, free_new_names): Declaration removed. (tree_duplicate_loop_to_exit): Declare. * tree-ssa-loop-manip.c: Include cfglayout.h. (collect_defs, rename_variables_in_bb, rename_op, allocate_new_names, free_new_names): Made static. (tdlte_rename_variables_in_loop, tdlte_copy_phi_nodes, tree_duplicate_loop_to_exit_cfg, tree_duplicate_loop_to_exit): Moved from tree-vectorizer.c. * tree-vectorizer.c (vect_duplicate_loopm vect_copy_phi_nodes, vect_rename_variables_in_loop, vect_tree_duplicate_loop): Moved to tree-ssa-loop-manip.c and renamed. 2004-05-20 Olga Golovanevsky Dorit Naishlos * tree-vectorizer.c (vect_transform_loop): New parameter; if bound is unknown, duplicates loop before vectorizing. (vect_transfrom_loop_bound): New parameter; now deal with symbolic loop bound. (vect_analyze_loop_with_symbolic_num_of_iters) (vect_duplicate_loop, vect_copy_phi_nodes) (vect_rename_variables_in_loop, vect_tree_split_edge) (vect_update_initial_conditions_of_duplicated_loop): (vect_tree_duplicate_loop, vect_build_symbl_bound): New functions. (new_loop_vec_info): Initialize the new field loop_vec_info: symb_numb_of_iters. * tree-vectorizer.h (loop_vec_info: symb_numb_of_iters): Added. (LOOP_VINFO_SYMB_NUM_OF_ITERS): Added. * cfgloopmanip.c (duplicate_loop): Made non-static. * tree-ssa-loop-manip.c (collect_defs): Made non-static. (allocate_new_names): Made non-static. Added option to allocate for original loop or not. (rename_op): Made non-static. Added input check. (rename_variables_in_bb): Made mpm-static. original loop were also renamed. (free_new_names): release_ssa_name only if defs of original loop were also renamed. * cfgloop.h (duplicate_loop): Declare. * tree-flow.h (collect_defs, allocate_new_names, rename_op) (rename_variables_in_bb, free_new_names): Declare. 2004-05-20 Zdenek Dvorak * tree-scalar-evolution.c (first_iteration_non_satisfying_noev_ev, first_iteration_non_satisfying_ev_noev, first_iteration_non_satisfying_ev_ev): Check the assumptions returned by number_of_iterations_cond. 2004-05-13 Devang Patel * cfgloop.c (get_loop_body_in_bfs_order): New. (flow_loop_exit_edges_find): Set EDGE_LOOP_EXIT. * cfgloop.h (get_loop_body_in_bfs_order): New. 2004-05-13 Zdenek Dvorak * expr.c (expand_expr_real_1): Use REF_ORIGINAL information from INDIRECT_REFS. * tree-flow.h (force_gimple_operand, rewrite_address_base): Declare. * tree-ssa-loop-ivopts.c (force_gimple_operand): Expand. (add_address_candidates): Add candidates with constant offset stripped. (idx_remove_ssa_names, unshare_and_remove_ssa_names, rewrite_address_base): New. (rewrite_use_address): Use rewrite_address_base. * tree-into-ssa.c (register_new_def): Remove unused code. * tree-scalar-evolution.c (chrec_contains_symbols_defined_in_loop): Handle invariants correctly. * tree-cfg.c (tree_split_block): Do not modify the statements. * tree.h (REF_ORIGINAL): New macro. 2004-05-12 Sebastian Pop * tree-chrec.c (chrec_evaluate): Use the type of the chrec instead of integer_type_node when folding operations. (chrec_apply): Factor chrec_type calls. (chrec_eval_next_init_cond): Removed. (chrec_convert): Don't propagate overflows introduced by convert. * tree-chrec.h (chrec_eval_next_init_cond): Removed. * tree-scalar-evolution.c (first_iteration_non_satisfying_noev_ev, first_iteration_non_satisfying_ev_noev, first_iteration_non_satisfying_ev_ev): Use number_of_iterations_cond instead of computing the loop counts. 2004-05-10 Zdenek Dvorak * loop-invariant.c (find_invariant_insn): Handle trapping insns correctly. 2004-05-10 Sebastian Pop * tree-chrec.h (build_chrec_top_type): Disabled, return chrec_top. * tree-scalar-evolution.c (first_iteration_non_satisfying_noev_ev, first_iteration_non_satisfying_ev_noev): Use the type of the chrec instead of integer_type_node when folding operations. (number_of_iterations_to_overflow): New. (first_iteration_non_satisfying_ev_ev): Implement some cases. (set_nb_iterations_in_loop): Return chrec_top on overflow. (follow_ssa_edge_in_rhs): Handle type conversions "a = (type) rhs". * tree-ssa-loop-ivcanon.c (canonicalize_loop_induction_variables): Convert the result of find_loop_niter_by_eval to the same type as niter before comparing. 2004-05-09 Zdenek Dvorak * loop-iv.c (determine_max_iter, shorten_into_mode, iv_number_of_iterations): Handle constants correctly. * rtl.h (get_mode_bounds): Declaration changed. Duplicate declaration removed. * stor-layout.c (get_mode_bounds): Return a constant suitable for a target mode. 2004-05-06 Sebastian Pop * tree-chrec.h (build_chrec_top_type): Check that the type has min and max values before taking their values. 2004-05-06 Sebastian Pop * tree-chrec.h (build_chrec_top_type): New. * tree-chrec.c (chrec_fold_multiply_ival_cst, chrec_fold_multiply_ival_ival, chrec_fold_plus_1): Use build_chrec_top_type instead of returning chrec_top. * tree-data-ref.c (dump_data_dependence_relation): Don't dump direction per subscript. (analyze_array): Use an extra boolean parameter for the access mode: read or write. (analyze_array_top, finalize_ddr_dependent): New. (compute_direction_vector, set_all_subscripts_to): Removed. (initialize_data_dependence_relation): The dependence relation is unknown when one of the references base name is NULL_TREE. (subscript_dependence_tester, build_classic_dist_vector, build_classic_dir_vector, compute_affine_dependence): Use finalize_ddr_dependent. (build_classic_dir_vector): When one of the directions is dir_star, the subscript coupling cannot deduce independence. (compute_all_dependences): Renamed compute_rw_wr_ww_dependences. (compute_rw_wr_ww_dependences): Don't compute read-read relations. Don't compute the reversed dependence relation. (find_data_references_in_loop): Use analyze_array_top when the MODIFY_EXPR contains a VUSE/VDEF that is not an ARRAY_REF. * tree-data-ref.h (data_reference): Add a field is_read. (DR_IS_READ): New. (DDR_SUBSCRIPTS_VECTOR_FINALIZE): Removed. (analyze_array): Change declaration. * tree-vectorizer.c (vect_analyze_data_refs): Adapt the use of analyze_array to the new prototype. Pass in the read or write mode. 2004-04-30 Zdenek Dvorak * tree-ssa-loop-niter.c: New file. * Makefile.in (tree-ssa-loop-niter.o): New. * cfgloop.h (struct loop): Add bounds field. * df.c (df_reg_clobber_gen): Removed. (df_bb_rd_local_compute, df_insn_refs_record, df_rd_local_compute): Make more effective for hard regs. * loop-invariant.c (check_maybe_invariant, find_defs, find_invariant_insn): Handle hard regs. * tree-chrec.c (chrec_fold_plus_poly_poly, chrec_fold_multiply, chrec_fold_multiply, chrec_merge): Handle types correctly. (chrec_convert): Use count_ev_in_wider_type. * tree-chrec.h (count_ev_in_wider_type): Declare. * tree-flow.h (struct tree_niter_desc): Moved from tree-ssa-loop-ivopts.c. (number_of_iterations_cond, number_of_iterations_exit, loop_niter_by_eval, find_loop_niter_by_eval, estimate_numbers_of_iterations, can_count_iv_in_wider_type, free_numbers_of_iterations_estimates): Declare. * tree-scalar-evolution.c (count_ev_in_wider_type, scev_reset, simple_iv): New. (number_of_iterations_in_loop): Check that the exit condition is tested in every iteration. * tree-scalar-evolution.h (scev_reset, simple_iv): Declare. * tree-ssa-loop-ivcanon.c (MAX_ITERATIONS_TO_TRACK, chain_of_csts_start, get_base_for, get_val_for, loop_niter_by_eval, find_loop_niter_by_eval): Moved to tree-ssa-loop-niter.c. * tree-ssa-loop-ivopts.c (struct tree_niter_desc): Moved to tree-flow.h. (force_gimple_operand): Accept a variable for the target of the assignment. (create_iv, rewrite_use_nonlinear_expr, rewrite_use_address, rewrite_use_compare, rewrite_use_outer): Changed due to this. (tree_ssa_iv_optimize_init): Call estimate_numbers_of_iterations. (get_var_def): Removed. (find_givs_in_stmt_scev): Use simple_iv. (inverse, number_of_iterations_cond): Moved to tree-ssa-loop-niter.c. (determine_number_of_iterations): Use number_of_iterations_exit. (idx_find_step, find_interesting_uses_address): Use can_count_iv_in_wider_type. (force_var_cost): Determine the costs more precisely. (tree_ssa_iv_optimize_finalize): Call free_numbers_of_iterations_estimates. (tree_ssa_iv_optimize_loop): Call scev_reset. * varasm.c (force_const_mem): Set MEM_NOTRAP_P flag. * config/rs6000/rs6000.c (rs6000_emit_move): Set MEM_NOTRAP_P flag. 2004-04-27 Sebastian Pop * lambda-code.c (build_int_cst): Moved... * tree-data-ref.c (int_cst_value): Moved... * tree-ssa-loop-ivopts.c (int_cst_value, build_int_cst): Moved... * tree.c (int_cst_value, build_int_cst): ...here. * tree.h (int_cst_value, build_int_cst): Declare. * tree-chrec.h (is_chrec, symbolic_parameter_expr_p): Removed. * tree-chrec.c (evolution_function_is_affine_multivariat): Check that the left part is a polynomial before taking its variable. * tree-elim-check.c (prove_truth_value): Update the use of tree_is_* functions. * tree-fold-const.h (tree_is_ge, tree_is_gt, tree_is_le, tree_is_lt, tree_is_eq, tree_is_ne): Return true when decidable, and use a parameter for returning the result. * tree-scalar-evolution.c (types_forbid_solutions_p): Removed. (first_iteration_non_satisfying_noev_noev, first_iteration_non_satisfying_noev_ev, first_iteration_non_satisfying_ev_noev): Update the use of tree_is_* functions. Use no_evolution_in_loop_p instead of evolution_function_is_constant_p. Extends the analyzer to symbolic loop counts. (first_iteration_non_satisfying): Factorize code. 2004-04-26 Zdenek Dvorak * config/rs6000/altivec.md: Fix merge problem. 2004-04-25 Zdenek Dvorak Merge from tree-ssa branch (lno-merge-20040425). 2004-04-25 Zdenek Dvorak * tree-ssa-loop-ivopts.c (force_gimple_operand): Strip useless type conversions. (number_of_iterations_cond): Fix typo. (rewrite_use_address): Fix. 2004-04-23 Daniel Berlin * tree-loop-linear.c (linear_transform_loops): Add invariants array. * lambda-code.c (gcc_tree_to_linear_expression): Change arguments to include invariants array, and an int, instead of a bool. Handle invariants. (invariant_in_loop): New function. (gcc_loop_to_lambda_loop): Add support for invariants as bounds, and NE_EXPR tests. (gcc_loopnest_to_lambda_loopnest): Add invariants argument, init the invariants array, and pass it along to gcc_loop_to_lambda_loop. (lle_to_gcc_expression): Handle invariants and simple linear offsets. (lambda_loopnest_to_gcc_loopnest): Ditto. Also use the right test if the step is negative. 2004-04-23 Zdenek Dvorak * tree-scalar-evolution.c (instantiate_parameters_1): Handle changed semantics of analyze_scalar_evolution. Split off from ... (instantiate_parameters): ... here. 2004-04-23 Zdenek Dvorak * tree-scalar-evolution.c (analyze_scalar_evolution_1): Keep loop invariants in symbolic form. Use compute_scalar_evolution_in_loop for expressions defined in subloops. (chrec_contains_symbols_defined_in_loop): Check for non-strict nestedness. (compute_scalar_evolution_after_loop): Renamed back to compute_overall_effect_of_inner_loop. (follow_ssa_edge_inner_loop_phi, interpret_loop_phi): Changed due to the renaming. (get_scalar_evolution): Return chrec_not_analyzed_yet for complicated expressions. (compute_scalar_evolution_in_loop): Compute the evolution of the expression returned by compute_overall_effect_of_inner_loop. 2004-04-22 Sebastian Pop * tree-elim-check.c (prove_truth_value_gt, prove_truth_value_lt, prove_truth_value_le, prove_truth_value_ge, prove_truth_value_eq, prove_truth_value_ne): Resurrect. (prove_truth_value_symbolic): New. Disabled for the moment. (prove_truth_value): Use it when this function fails on unknown. (try_eliminate_check): Factorize the code. * tree-scalar-evolution.c (compute_scalar_evolution_after_loop): Fix the description comment. 2004-04-21 Zdenek Dvorak * tree-flow.h (linear_transform_loops): Prototype changed. * tree-vectorizer.h (vectorize_loops): Ditto. * tree-loop-linear.c (linear_transform_loops): Remove unused argument. * tree-vectorizer.c (vectorize_loops): Ditto. * tree-scalar-evolution.c (scalar_evolution_info): Type changed to hash table. (new_scev_info_str): Use xmalloc instead of ggc_alloc. (hash_scev_info, eq_scev_info, del_scev_info, gather_stats_on_scev_database_1): New functions. (find_var_scev_info, dump_chrecs_stats, gather_stats_on_scev_database, scev_initialize, scev_finalize): Work with hash table instead of a list. (scev_elim_checks, scev_vectorize): Do not pass unused arguments to functions. 2004-04-21 Sebastian Pop * tree-chrec.c (chrec_apply): Fail on chrec_top when the chrec contains symbols defined in the inner loop. Otherwise perform the computation with symbols. (no_evolution_in_loop_p): Same. Moved from here... * tree-chrec.h (no_evolution_in_loop_p): ...there. Define it inline. (chrec_contains_symbols_defined_in_loop): Declare. * tree-scalar-evolution.c (nb_set_scev, nb_get_scev): New counters. (set_scalar_evolution, get_scalar_evolution): Count the number of calls. (chrec_contains_symbols_defined_in_loop): Defined. (compute_scalar_evolution_after_loop, first_iteration_non_satisfying_1, analyze_scalar_evolution_in_loop): Initialize boolean values. (dump_chrecs_stats): Dump the get/set counters. 2004-04-21 Sebastian Pop Zdenek Dvorak * tree-scalar-evolution.c (compute_scalar_evolution_in_loop): Use superloop_at_depth. (analyze_scalar_evolution): Keep a symbolic form instead of chrec_top. 2004-04-21 Zdenek Dvorak * tree-scalar-evolution.c (instantiate_parameters): Handle casts correctly. * tree-ssa-loop-manip.c (add_exit_phis_edge): Do not add unnecessary phi nodes. * tree-ssa-loop.c (tree_ssa_loop_opt): Do not call create_preheaders. 2004-04-20 Sebastian Pop * tree-scalar-evolution.c (scev_info_str, new_scev_info_str, find_var_scev_info, set_scalar_evolution, get_scalar_evolution): Store a single scalar evolution per definition. (compute_overall_effect_of_inner_loop): Renamed compute_scalar_evolution_after_loop. (compute_scalar_evolution_in_loop): New. (analyze_scalar_evolution): Use the helper function. (analyze_scalar_evolution_1): Helper recursive function. Avoid multiple set/get in the scev database when recursively called. 2004-04-20 Dorit Naishlos * tree-vectorizer.c (vect_create_index_for_array_ref): Use create_iv instead of creating iv's from scratch. (vect_transform_loop_bound): Likewise. 2004-04-20 Sebastian Pop * tree-chrec.c (chrec_fold_multiply_ival_cst, chrec_fold_multiply_ival_ival, chrec_fold_plus_1): When the fold resulted in an overflow, conservatively answer chrec_top. 2004-04-20 Sebastian Pop * tree-chrec.c (chrec_fold_multiply_ival_cst): Compute the min and max on the multiplication result. (chrec_fold_negate): Removed. * tree-chrec.h (chrec_fold_negate): Removed. * tree-scalar-evolution.c (interpret_rhs_modify_expr): Use chrec_fold_minus instead of chrec_fold_negate. 2004-04-20 Sebastian Pop * tree-chrec.h (evolution_function_is_constant_p): Be careful. * tree-data-ref.c (analyze_siv_subscript_affine_affine): Renamed analyze_subscript_affine_affine. Exchange the CHREC_VARIABLEs for overlaps. (analyze_miv_subscript): Use directly analyze_subscript_affine_affine, and avoid the call to evolution_function_is_constant_p. 2004-04-20 Sebastian Pop * tree-chrec.c (chrec_apply): Fail on chrec_top for symbolic chrecs. (no_evolution_in_loop_p): Return false when non decidable, use a parameter for returning the result. * tree-chrec.h (no_evolution_in_loop_p): Modify its declaration. * tree-scalar-evolution.c (add_to_evolution, multiply_evolution): Avoid the use of no_evolution_in_loop_p. (add_to_evolution_1, multiply_evolution_1): New. (multiply_by_expr_the_loop_evolution, add_expr_to_loop_evolution, build_exponential_evolution_in_loop, build_polynomial_evolution_in_loop): Removed. (first_iteration_non_satisfying_1, analyze_scalar_evolution_in_loop): Modify the use of no_evolution_in_loop_p. * tree-ssa-loop-ivopts.c (find_givs_in_stmt_scev, find_givs_in_stmt_scev): Check that the result of scev analysis does not contain symbols. 2004-04-19 Zdenek Dvorak * tree-ssa-loop-ivopts.c (idx_contains_abnormal_ssa_name_p, contains_abnormal_ssa_name_p): New functions. (find_bivs, find_bivs, find_givs_in_stmt_scev): Handle ssa names occuring in abnormal phis. * tree-ssa-loop-im.c (movement_possibility): Ditto. 2004-04-18 Dorit Naishlos * tree-vectorizer.c (create_index_for_array_ref): Remove code under #ifdef POINTER_ARITHMETIC. (vect_create_data_ref): Likewise. Support array addressing instead of pointer arithmetic in vectorized code. 2004-04-16 Zdenek Dvorak Merge from tree-ssa branch: 2004-03-25 Diego Novillo * tree-ssa-alias.c (struct alias_info): Change type of field 'num_references' to varray_type. Update all users. 2004-04-15 Zdenek Dvorak * tree-into-ssa.c (struct mark_def_sites_global_data): Change type of names_to_rename to sbitmap. (insert_phi_nodes_for, insert_phi_nodes_1, insert_phi_nodes): Allocate worklist globally. (ssa_mark_def_sites_initialize_block, ssa_mark_phi_uses, ssa_mark_def_sites, ssa_rewrite_initialize_block, ssa_rewrite_phi_arguments, ssa_rewrite_stmt, rewrite_ssa_into_ssa): Use sbitmaps instead of bitmaps. 2004-04-15 Sebastian Pop * tree-scalar-evolution.c (instantiate_parameters): Don't keep symbols after instantiation. Fully instantiate parameters, or fail on chrec_top. 2004-04-15 Sebastian Pop * tree-fold-const.h (chrec_merge_types): Move it... * tree-chrec.c (multiply_int, divide_int, add_int, substract_int, integer_divides_p, lcm, gcd, update_initial_condition_to_origin, remove_initial_condition, ): Removed. (evolution_function_in_loop_num): Renamed into hide_evolution_in_other_loops_than_loop. (hide_evolution_in_loop, hide_evolution_in_other_loops_than_loop): New. (chrec_merge_types): ... here. (chrec_merge): Answer chrec_top on EXPONENTIAL_CHREC. (ziv_subscript_p, siv_subscript_p, analyze_ziv_subscript, analyze_siv_subscript, analyze_siv_subscript_cst_affine, analyze_siv_subscript_affine_cst, analyze_siv_subscript_affine_affine, chrec_steps_divide_constant_p, analyze_miv_subscript, analyze_overlapping_iterations): Moved from here... * tree-chrec.h (evolution_function_in_loop_num): Rename declaration. (hide_evolution_in_other_loops_than_loop, hide_evolution_in_loop): New. (analyze_overlapping_iterations): No longer extern. * tree-data-ref.c (ziv_subscript_p, siv_subscript_p, analyze_ziv_subscript, analyze_siv_subscript, analyze_siv_subscript_cst_affine, analyze_siv_subscript_affine_cst, analyze_siv_subscript_affine_affine, chrec_steps_divide_constant_p, analyze_miv_subscript, analyze_overlapping_iterations): ... there. (initialize_data_dependence_relation, access_functions_are_affine_or_constant_p): Moved down. (compute_all_dependences): Moved down. Now is static. (build_classic_dir_vector): New. (build_classic_dist_vector): (find_data_references): Renamed find_data_references_in_loop. Now is static. (compute_data_dependences_for_loop): New. (analyze_all_data_dependences): Use compute_data_dependences_for_loop. * tree-data-ref.h (dd_info_available): Don't declare it extern. * tree-scalar-evolution.c (dd_info_available): Declare static. (select_outer_and_current_evolutions): Removed. (stats_*): Move the static variables in the chrec_stats structure. (chrec_stats): New structure. (first_iteration_non_satisfying_1): In the multivariate case, don't forget that the outer loops can change the number of iterations. (cannot_analyze_loop_nb_iterations_yet): Removed. (follow_ssa_edge_inner_loop_phi): Refine the case where the evolution of the inner loop is symbolic. (number_of_iterations_in_loop): Factor the end of the cases. * tree-dg.c (classic_dist, classic_dir): Declared static. (dg_delete_graph): Delete the classic_dist and classic_dir. (dg_create_graph): Adapt to use compute_data_dependences_for_loop. (gate_ddg, gate_delete_ddg, pass_ddg, pass_delete_ddg): Moved in tree-scalar-evolution.c. * tree-dg.h (dg_create_graph): Pass in struct loops. 2004-04-15 Dorit Naishlos * tree-data-ref.h (struct data_reference): New field "aux". * tree-vectorizer.h (aligned_access_p, unknown_alignment_for_access_p): New functions. (DR_MISLAIGNMENT): New macro, for accessing the new 'aux' field in data_reference. * tree-vectorizer.c: (vect_analyze_data_refs_alignment): New function. (vect_compute_data_refs_alignment): New function. (vect_compute_data_ref_alignment): New function. (vect_enhance_data_refs_alignment): New function. (vect_force_dr_alignment_p): New function. (vect_align_data_ref): Use new functions aligned_access_p and vect_force_dr_alignment_p. (vect_analyze_data_ref_access): Alignment related checks moved to new functions that deal with alignment. (vect_analyze_data_refs): Likewise. (vect_analyze_loop): Call vect_analyze_data_refs_alignment. 2004-04-15 Zdenek Dvorak * loop-invariant.c (may_assign_reg_p): Prevent unused parameter warning. * tree-ssa-loop-manip.c (find_use_block, find_use_blocks, defined_inside_loop_p): Removed. (add_exit_phis_var, add_exit_phis, rewrite_into_loop_closed_ssa): Make more efficient. (find_uses_to_rename_use, find_uses_to_rename_stmt, find_uses_to_rename): New functions. 2004-04-15 Zdenek Dvorak * tree-flow.h (compute_global_livein): Declare. * tree-into-ssa.c (struct def_blocks_d): New field phi_blocks. (compute_global_livein): Export. (set_def_block): Record phi_blocks. (get_def_blocks_for): Allocate phi_blocks. (mark_def_sites): Changed due to set_def_block change. (ssa_mark_def_sites_initialize_block, ssa_mark_def_sites): Make virtual defs be kills. (insert_phi_nodes_for): Handle old phi nodes more efficiently. (def_blocks_free): XFREE the bitmaps. * tree-ssa-loop-manip.c (add_exit_phis_use, add_exit_phis_stmt): Removed. (get_loops_exits): Return bitmap. (add_exit_phis_var, find_use_block, find_use_blocks, defined_inside_loop_p): New functions. (add_exit_phis): Use add_exit_phis_var. (rewrite_into_loop_closed_ssa): Reorganize. * tree-ssa-loop.c (pass_loop): Add garbage collection. 2004-04-14 Zdenek Dvorak * tree-chrec.c (chrec_convert): Handle extending correctly. * tree-scalar-evolution.c (set_scev_keep_symbolic): Removed. (set_scalar_evolution): Do not use it. (get_scalar_evolution): Only handle ssa names and constants. (interpret_loop_phi): When interpreting subloop, compute the evolution in outer loop afterwards. (analyze_scalar_evolution_in_loop): New. * tree-scalar-evolution.h (analyze_scalar_evolution_in_loop): Declare. * tree-ssa-loop-ivopts.c: Include tree-fold-const.h, tree-chrec.h and tree-scalar-evolution.h. (tree_ssa_iv_optimize_init): Call scev_initialize. (determine_biv_step, find_bivs, mark_bivs, find_givs_in_stmt): Use scev analyzer. (find_givs_in_stmt_scev): New function. (find_induction_variables): Remove TODO comment. (force_var_cost): Test for TREE_INVARIANT, not for is_gimple_min_invariant. (find_optimal_iv_set): Update comment. (tree_ssa_iv_optimize_finalize): Call scev_finalize. 2004-04-13 Zdenek Dvorak * tree-ssa.c (raise_value): Removed. (get_eq_name, check_phi_redundancy): New. (kill_redundant_phi_nodes): Use standard algorithm. 2004-04-12 Zdenek Dvorak * tree-ssa-loop-manip.c (allocate_new_names): Use duplicate_ssa_name. Preserve SSA_NAME_OCCURS_IN_ABNORMAL_PHI flag. 2004-04-10 Daniel Berlin * lambda-code.c (lambda_loopnest_transform): Add comments. 2004-04-09 David Edelsohn Backport from mainline: * config/rs6000/t-linux64 (bispecs): Don't add -mlong-double-128 for 32-bit builds when defaulting to 32-bit. 2004-04-09 Zdenek Dvorak * loop-iv.c (iv_number_of_iterations): Sign extend the constant value appropriately for the target mode. * tree-fold-const.c (tree_fold_gcd): Make more efficient. * tree-ssa-loop-manip.c (add_exit_phis_use): Do not add unnecessary phis. (rewrite_into_loop_closed_ssa): Fix comment. 2004-04-09 Zdenek Dvorak * cfgrtl.c (purge_dead_edges): Clean the EDGE_ABNORMAL_CALL flags. * loop-iv.c (iv_number_of_iterations): Handle the case when we prove that the loop does not roll. * opts.c (decode_options): Enable -floop-optimize2 and -ftree-loop-optimize by default. * tree-cfg.c (factored_computed_goto_label, factored_computed_goto): Removed. (factor_computed_gotos): Do not record them. (disband_implicit_edges): Do not unfactor computed jumps. * tree-ssa-loop-ivopts.c (force_gimple_operand): Give correct types to temporary variables. (idx_force_simple, create_iv, rewrite_use_nonlinear_expr, rewrite_use_address, rewrite_use_compare, rewrite_use_outer): Changed due to force_gimple_operand change. (find_bivs): Handle ill-typed assignments correctly. 2004-04-04 Zdenek Dvorak * passes.c (rest_of_compilation): Enable rest_of_handle_loop2 by flag_loop_optimize2. * tree-scalar-evolution.c (scev_initialize): Find loop exits. 2004-04-02 Zdenek Dvorak * tree-ssa-loop-ivopts.c (rewrite_use_outer): Do not remove ssa names prematurely. 2004-04-01 Mostafa Hagog Dorit Naishlos * config/rs6000/rs6000.md ("*ctrsi_internal1", "*ctrsi_internal2", "*ctrdi_internal1", "*ctrdi_internal2", "*ctrsi_internal3", "*ctrsi_internal4", "*ctrdi_internal3", "*ctrdi_internal4", "*ctrsi_internal5", "*ctrsi_internal6", "*ctrdi_internal5", "*ctrdi_internal6"): Replace register_operand with nonimmediate_operand 2004-03-31 Zdenek Dvorak * tree-into-ssa.c (ssa_rewrite_initialize_block): Update SSA_NAME_OCCURS_IN_ABNORMAL_PHI. (ssa_rewrite_phi_arguments): Ditto. * tree-ssa.c (kill_redundant_phi_nodes): Prevent replacing ssa names that occur in abnormal phi nodes. * tree-ssa-loop-ivopts.c (get_var_def): Handle non-invariant non-ssa name operands. * java/decl.c (java_init_decl_processing): Initialize long_integer_type_node. 2004-03-31 Zdenek Dvorak * tree-ssa-loop-ivopts.c (idx_find_step): Prevent misscompilation in case the index overflows. 2004-03-31 Zdenek Dvorak , Dorit Naishlos * tree-scalar-evolution.c (dump_chrecs_stats): Prevent format warning. 2004-03-30 Zdenek Dvorak * lambda-code.c (gcc_loop_to_lambda_loop): Changed due to changes in scev. * tree-data-ref.c (analyze_array_indexes, analyze_array): Ditto. * tree-elim-check.c (try_eliminate_check): Ditto. * tree-vectorizer.c (vect_analyze_scalar_cycles): Ditto. * tree-chrec.c (chrec_fold_plus_1): Handle exponential + peeled chrec correctly. Use correct types. (chrec_fold_negate): New. (chrec_merge): Short-circuit the case when the merged values are identical. (no_evolution_in_loop_p): Handle chrec_top correctly. (chrec_convert): Handle polynomial and exponential chrecs corectly. (chrec_type): Use TREE_TYPE. * tree-chrec.h (chrec_fold_negate): Declare. * tree-phinodes.c (create_phi_node): Do not initialize PHI_MARKED. * tree-scalar-evolution.c: Handle evolutions analysed from different loops correctly. Do not use PHI_MARKED. Use correct types. * tree-scalar-evolution.h (analyze_scalar_evolution, instantiate_parameters): Declaration changed. (struct scev_info_str): Moved to tree-scalar-evolution.c. (MI_VAR, MI_INNER_LOOPS_CHREC, MI_OUTER_LOOPS_CHREC): Removed. (new_scev_info_str): Moved to tree-scalar-evolution.c. * tree-ssa-loop-manip.c (add_exit_phis_use): Just add exit phis for superloops of the loop containing the definition. * tree.h (PHI_MARKED): Removed. (tree_phi_node): Field 'marked' removed. 2004-03-30 Sebastian Pop * tree-chrec.c (chrec_contains_symbols): Factorize conditions, chrec_not_analyzed_yet is a NULL_TREE. * tree-chrec.h (prove_truth_value_{lt, le, ge, ne, gt, eq}.c): Removed. (evolution_function_is_multivariate, evolution_function_is_peeled_affine_p): New. * tree-data-ref.c (analyze_all_data_dependences): Dump some statistics on the data dependences. * tree-elim-check.c (not_code, prove_truth_value): New. (try_eliminate_check): Use prove_truth_value. * tree-fold-const.h (tree_is_ne): New. * tree-scalar-evolution.c (types_forbid_solutions_p, first_iteration_non_satisfying_noev_noev, first_iteration_non_satisfying_noev_ev, first_iteration_non_satisfying_ev_noev, first_iteration_non_satisfying_ev_ev, first_iteration_non_satisfying_1, first_iteration_non_satisfying, gather_stats_on_scev_database): New functions. (nb_iterations_less, nb_iterations_eq, nb_iterations_ne): Removed. (set_nb_iterations_in_loop): Be more careful on overflow. (number_of_iterations_in_loop): Use first_iteration_non_satisfying. * tree-scalar-evolution.h (first_iteration_non_satisfying, gather_stats_on_scev_database): Declared. 2004-03-30 Zdenek Dvorak * tree-ssa-loop-ivopts.c (iv_value): Use correct type. (may_eliminate_iv): Add a fixme comment. 2004-03-29 Devang Patel * tree-flow.h (tree_ssa_loop_version): Add new parameter, basic_block *. (update_lv_condition): New. * tree-ssa-loop-manip.c (copy_phi_nodes): nreverse copied phi nodes list to ensure that phi nodes remain in same order. (lv_update_pending_stmts): Do not nreverse pending list. (lv_adjust_loop_header_phi): Walk two phi nodes list in parallel. (tree_ssa_loop_version): Now condition_bb is input parameter. (update_lv_condition): New. (test_loop_versioning): Use update_lv_condition. * tree-ssa-loop-unswitch.c (tree_unswitch_loop): Update function tree_ssa_loop_version () call by adding 4th parameter. 2004-03-29 Richard Guenther * tree-ssa-loop-ivcanon.c (canonicalize_loop_induction_variables): Fix unused vars warning with -disable-checking. * df.c (df_reg_def_chain_create, df_reg_use_chain_create): Ditto. 2004-03-27 Zdenek Dvorak * cfghooks.c (split_edge): Update IRREDUCIBLE_LOOP flags. * tree-flow-inline.h (bsi_after_labels): New. * tree-flow.h (struct ssa_name_ann_d): Add need_phi_state field. (bsi_after_labels, rewrite_ssa_into_ssa, duplicate_ssa_name, tree_ssa_dce_no_cfg_changes, rewrite_into_loop_closed_ssa, verify_loop_closed_ssa, compute_phi_arg_on_exit): Declare. (tree_loop_optimizer_init): Declaration changed. * tree-into-ssa.c (struct mark_def_sites_global_data): Add names_to_rename and ssa_names fields. (insert_phi_nodes, get_value_for, set_value_for, set_def_block, set_livein_block, insert_phi_nodes_1, insert_phi_nodes_for, register_new_def, get_reaching_def, rewrite_into_ssa): Handle rewriting of ssa names. (get_phi_state, set_phi_state, ssa_mark_def_sites_initialize_block, ssa_mark_phi_uses, ssa_mark_def_sites, duplicate_ssa_name, ssa_rewrite_initialize_block, ssa_rewrite_phi_arguments, ssa_rewrite_finalize_block, ssa_rewrite_stmt, rewrite_ssa_into_ssa): New functions. * tree-scalar-evolution.c (scev_initialize): Changed due to tree_loop_optimizer_init change. * tree-ssa-dce.c (perform_tree_ssa_dce, perform_tree_ssa_dce, tree_ssa_cd_dce): Handle no cfg changes mode. (tree_ssa_dce_no_cfg_changes): Resurrect. * tree-ssa-loop-im.c (move_computations): Preserve loop closed ssa. * tree-ssa-loop-ivopts.c (struct version_info): Field outermost_usage removed. (update_outermost_usage, find_outermost_usage): Removed. (ip_normal_pos): Fix. (tree_ssa_iv_optimize_init): Do not call find_outermost_usage. (find_interesting_uses_stmt): Use loop closed ssa form. (find_interesting_uses_outside): New. (find_interesting_uses): Use it. (determine_iv_cost): Prefer IP_NORMAL to IP_END. (split_loop_exit_edge, protect_loop_closed_ssa_form_use, protect_loop_closed_ssa_form, compute_phi_arg_on_exit): New functions. (rewrite_use_outer): Preserve loop closed ssa form. (tree_ssa_iv_optimize): Verify loop closed ssa form. * tree-ssa-loop-manip.c (mfb_redirect_exit_edges): Removed. (free_new_names): Free old ssa names. (extend_exit_phi_nodes, add_exit_phis_edge, add_exit_phis_use, add_exit_phis_stmt, add_exit_phis, get_loops_exits, rewrite_into_loop_closed_ssa, check_loop_closed_ssa_use, check_loop_closed_ssa_stmt, verify_loop_closed_ssa): New functions. (tree_duplicate_loop_to_header_edge): Use loop closed ssa form. (tree_ssa_loop_version): Handle irreducible loops correctly. * tree-ssa-loop.c (tree_loop_optimizer_init): Create loop closed ssa form. (tree_ssa_loop_opt, copy_loop_headers): Changed due to tree_loop_optimizer_init change. 2004-03-25 Sebastian Pop * tree-data-ref.c (subscript_dependence_tester): Removed. (build_classic_dist_vector): Implement the subscript tester: test for different distances carried by the same loop. 2004-03-23 Sebastian Pop * tree-cfg.c (print_loop): Modify dump formatting. (debug_loop_ir): Renamed tree_debug_loops. (tree_debug_loop): New. * tree-chrec.c: Restructure for handling more carefully types. * tree-chre.h: Same. * tree-fold-const.h: Same. * tree-fold-const.c: Same. * tree-scalar-evolution.c: Same. * tree-scalar-evolution.h: Same. * tree-data-ref.c (dump_data_dependence_relation): Remove the dump of the base_name because it produces too many conflicts in the diffs of the testsuite. (compute_all_dependences): Use pointers to the dependence_relations varray. (int_cst_value, build_classic_dist_vector): New. (find_data_references): Use pointers to datarefs varray. (analyze_all_data_dependences): Compute the classic distances. * tree-data-ref.h: Declare functions. * tree-dg.c (dg_create_graph): Update the uses of the data-ref functions. * tree-flow.h (debug_loop_ir): Renamed to tree_debug_loops. (tree_debug_loop): Declare. 2004-03-23 Zdenek Dvorak * tree-flow.h (tree_ssa_dce_no_cfg_changes): Declaration removed. * tree-ssa-dce.c (remove_dead_stmt): Invalidate dominators if we thread the edge. (tree_ssa_dce_no_cfg_changes): Removed. (perform_tree_ssa_dce, tree_ssa_dce, perform_tree_ssa_dce): Remove no cfg changes mode. * tree-ssa-loop-ivopts.c (force_gimple_operand): Handle overflowed constants. (find_interesting_uses_outer_or_nonlin): New. (find_interesting_uses_op, find_interesting_uses_outer): Use it. (find_interesting_uses_cond, idx_record_use, find_interesting_uses_stmt): Changed due to find_interesting_uses_op change. (create_new_iv, remove_statement, rewrite_use_nonlinear_expr, rewrite_use_outer, tree_ssa_iv_optimize): Handle direct removal of unused ivs. (remove_unused_ivs): New. (tree_ssa_iv_optimize_loop): Call it. 2004-03-23 Zdenek Dvorak * Makefile.in (SCEV_H): New. (tree-ssa-loop-ivcanon.o, tree-ssa-loop-ivopts.o, tree-scalar-evolution.o, tree-data-ref.o, tree-dg.o, tree-elim-check.o, tree-vectorizer.o, tree-loop-linear.o, lambda-code.o): Use it. * tree-chrec.h (build_interval_chrec, build_polynomial_chrec, build_exponential_chrec, build_peeled_chrec): Give a type to the chrec node. * tree-scalar-evolution.c (follow_ssa_edge_in_rhs): Preserve correct type. (analyze_evolution_in_loop): Fix test for edges from inside the loop. (scev_initialize): New. (scev_init): Use it. (scev_finalize): New. (scev_done): Use it. * tree-flow-inline.h (loop_of_stmt): Handle initialization statements without crash. * tree-scalar-evolution.h (scev_initialize, scev_finalize): Declare. 2004-03-23 Dorit Naishlos * tree-vectorizer.c: (vect_align_data_ref): Check for DECL_ALIGN instead of TYPE_ALIGN. Check for DECL_EXTERNAL. (vect_analyze_data_refs): Check for DECL_EXTERNAL. Add documentation for functions. 2004-03-22 Dale Johannesen * Makefile.in (OBJS-common): Remove duplicate loop-iv.o. 2004-03-22 Zdenek Dvorak * tree-ssa-loop-ivopts.c: Avoid usage of global variables. 2004-03-21 Zdenek Dvorak * tree-ssa-loop-unswitch.o: New file. * Makefile.in (tree-ssa-loop-unswitch.o): Add. (tree-ssa-loop-im.o): Add flags.h dependency. * flags.h (flag_unswitch_loops): Declaration moved from ... * toplev.h (flag_unswitch_loops): ... here. * tree-flow.h (tree_ssa_loop_version): Declaration changed. (tree_ssa_unswitch_loops, estimate_loop_size): Declare. * tree-ssa-loop-im.c: Include flags.h. (movement_possibility, stmt_cost, move_computations_stmt): Handle unswitchable conditions. * tree-ssa-loop-ivcanon.c (estimate_loop_size): Export. * tree-ssa-loop-ivopts.c (find_interesting_uses_cond): Handle if (0) and if (1). * tree-ssa-loop-manip.c (tree_ssa_loop_version): Return the newly created loop. * tree-ssa-loop.c (tree_ssa_loop_opt): Call tree_ssa_unswitch_loops. 2004-03-20 Zdenek Dvorak Merge from tree-ssa branch (lno-merge-20040321). 2004-03-20 Dorit Naishlos * tree-vectorizer.c: (vect_init_vector): New function. (vect_get_vec_def_for_operand): Support loop invariant uses. (vect_is_simple_use): Likewise. (vect_mark_stmts_to_be_vectorized): Likewise. (vect_analyze_scalar_cycles): Redundant check removed. (vect_analyze_operations): Don't fail for vdefs that have uses outside the loop. (vect_stmt_relevant_p): A call to get_stmt_operands removed (already performed at new_loop_vec_info). (vect_mark_stmts_to_be_vectorized): Likewise. (need_imm_uses_for): New Function. (vectorize_loops): Add call to compute_immediate_uses and free_df. 2004-03-20 Zdenek Dvorak * tree-chrec.c (chrec_fold_multiply_ival_cst): Handle negative constants correctly. * tree-ssa-loop-ivcanon.c (canonicalize_loop_induction_variables): Enable use of scev. 2004-03-20 Zdenek Dvorak PR optimization/14658 * loop-invariant.c (move_invariant_reg): Handle assignments with nontrivial lhs correctly. 2004-03-18 Zdenek Dvorak * df.c (df_reg_def_chain_create, df_reg_use_chain_create): Do not clean up the old information here. (df_reg_def_chain_clean, df_reg_use_chain_clean): New. (df_analyse_subcfg): Call them. 2003-03-18 Zdenek Dvorak * tree-flow.h (loop_commit_inserts): Declare. * tree-ssa-loop-im.c (commit_inserts): Rename to... (loop_commit_inserts): ... this. * move_computations (move_computations, determine_lsm): Use loop_commit_inserts. * tree-ssa-loop-ivopts.c (AVG_LOOP_NITER): New macro. (struct iv): New field use_id. (struct version_info): New field preserve_biv. (alloc_iv, record_use, free_loop_data): Initialize new fields. (enum use_type): Add USE_OUTER. (dump_use, find_interesting_uses_op, add_derived_ivs_candidates, determine_use_iv_cost, rewrite_use): Handle USE_OUTER. (dump_cand, find_interesting_uses_stmt, add_candidate_1, determine_use_iv_cost_condition, determine_iv_cost, set_cost, create_new_iv, rewrite_use_nonlinear_expr): Handle final value replacement. (find_interesting_uses_outer, add_iv_outer_candidates, may_replace_final_value, determine_use_iv_cost_outer, remove_statement, rewrite_use_outer): New functions. (var_at_use): Replaced by ... (var_at_stmt): ... this. (get_computation_at): Split from ... (get_computation): ... here. (get_computation_cost_at): Split from ... (get_computation_cost): ... here. (iv_value): Split from ... (cand_value_at): ... here. (may_eliminate_iv, rewrite_use_compare): Reflect these changes. (tree_ssa_iv_optimize_loop): Call loop_commit_inserts. * tree-ssanames.c (make_ssa_name): Handle NULL argument. 2003-03-18 Devang Patel * tree-ssa-live.c (new_tree_live_info): Set num_blocks to last_basic_block instead of n_basic_blocks. (calculate_live_on_entry): Use last_basic_block instead of n_basic_blocks. (calculate_live_on_exit): Same. 2004-03-17 Zdenek Dvorak * tree-cfg.c (thread_jumps): Don't thread jumps over loop headers. * tree-flow.h (rewrite_into_ssa): Declaration changed. (kill_redundant_phi_nodes, tree_loop_optimizer_init): Declare. * tree-optimize.c (execute_todo): Do not free vars_to_rename. (execute_one_pass): Do not allocate vars_to_rename. (tree_rest_of_compilation): Allocate vars_to_rename. * tree-scalar-evolution.c (number_of_iterations_in_loop): Handle loops exited when condition is true. (initialize_scalar_evolutions_analyzer): Use tree_loop_optimizer_init. * tree-ssa-chrec.c (how_far_to_positive): Handle chrec_top correctly. * tree-ssa-dom.c (tree_ssa_dominator_optimize): Changed due to rewrite_into_ssa change. * tree-ssa-loop-im.c (move_computations, determine_lsm): Ditto. * tree-ssa-loop-ivcanon.c (canonicalize_loop_induction_variables): Use scev analyser. * tree-ssa-loop-manip.c (allocate_new_names): Update name memory tags. * tree-ssa-loop.c (tree_loop_optimizer_init): New. (tree_ssa_loop_opt, copy_loop_headers): Use it. * tree-ssa.c (rewrite_into_ssa): Use argument to decide whether to rename all variables. (rewrite_all_into_ssa): New. (pass_build_ssa): Use it. (kill_redundant_phi_nodes): Export. 2004-03-15 Andrew Pinski * tree-ssa-return.c (tree_ssa_return): Move check for NULL return value above check for a modify expr. 2004-03-13 Zdenek Dvorak * tree-scalar-evolution.c (gate_scev_iv_canon): Do not check rtl level flags here. * tree-ssa-loop-ivcanon.c (get_base_for): Verfify that the argument of the phi node is a constant. (loop_niter_by_eval, create_canonical_iv, try_unroll_loop_completely, canonicalize_loop_induction_variables): Handle loops with more than one exit. (find_loop_niter_by_eval): New. (canonicalize_induction_variables): Check rtl level flags here. 2004-03-12 Andrew Pinski * tree-ssa-return.c (tree_ssa_return): Only do it when we have a modify expr. * tree-ssa-return.c (tree_ssa_return): Add new comments and fix some old ones. 2004-03-12 Falk Hueffner * tree-pass.h: Declare pass_return. 2004-03-11 Andrew Pinski PR optimization/14135 * tree-ssa-return.c: New file. * Makefile.in (tree-ssa-return.o): Add. * tree-optimize.c (init_tree_optimization_passes): Add pass_return. * timevar.def (TV_TREE_RETURN): New. 2004-03-12 Zdenek Dvorak * tree-ssa-loop-ivcanon.o: New file. * Makefile.in (tree-ssa-loop-ivcanon.o): Add. * flags.h (flag_unroll_loops): Declare. * loop-invariant.c (record_use): Fix. * params.def (PARAM_MAX_COMPLETELY_PEELED_INSNS): Increment. * timevar.def (TV_TREE_LOOP_IVCANON): New. * toplev.h (flag_unroll_loops): Declaration moved to flags.h. * tree-flow.h (enum tree_ann_type): Remove MISC_ANN. (struct tree_ann_common_d): Add aux field. (struct misc_ann_d): Removed. (struct stmt_ann_d): Removed aux field. (union tree_ann_d): Removed misc field. (canonicalize_induction_variables): Declare. * tree-optimize.c (init_tree_optimization_passes): Add pass_scev_iv_canon. * tree-pass.h (pass_scev_iv_canon): Declare. * tree-scalar-evolution.c (scev_iv_canon, gate_scev_iv_canon, pass_scev_iv_canon): New. (scev_done): Run cfg cleanup. * tree-ssa-loop-im.c (LIM_DATA, determine_invariantness_stmt, move_computations_stmt, schedule_sm): Use aux field in common part of annotations. * tree-ssa-loop-manip.c (allocate_new_names, rename_op, free_new_names): Use common aux field. (tree_duplicate_loop_to_header_edge): Fix memory leak. * tree-ssa.c (mark_def_sites): Fix. * tree-vectorizer.h (set_stmt_info, vinfo_for_stmt): Use aux field in common part of annotations. * gcc.dg/tree-ssa/ivcanon-1.c: New test. 2004-03-11 Zdenek Dvorak * Makefile.in (lambda-mat.o, lambda-trans.o, lambda-code.o): Add TM_H dependency. 2004-03-09 Olga Golovonevsky Dorit Naishlos * tree-vectorizer.c: (vect_transform_binop): Removed. (vect_transform_op): New function instead of vect_transform_binop, to support both unary and binary operations. (vect_is_supportable_binop): Removed. (vect_is_supportable_op): New function instead of vect_is_supportable_binop to support additional codes. * tree-vectorizer.h: (operation_type): New enum type declared. * config/rs6000/altivec.md: (andvv16qi3, andv8hi3, one_cmplv16qi2, one_cmplv8hi2, one_cmplv4si2, iorv16qi3, iorv8hi3,): New modelling. (*movv4si_internal): Relax condition. (*movv8hi_internal1): Likewise. (*movv16qi_internal1): Likewise. (*movv4sf_internal1): Likewise. 2004-03-09 Zdenek Dvorak * Makefile.in (df.o): Remove FIBHEAP_H dependency. (invariant.o): Add df.h dependency. * df.c: Do not include fibheap.h. (df_bb_table_realloc, df_analyse_subcfg, free_reg_ref_chain, prune_to_subcfg, df_bb_modify, df_find_def, dataflow_set_a_op_b, dataflow_set_copy): New functions. (df_bitmaps_alloc, df_reg_def_chain_create, df_reg_use_chain_create, df_refs_update, df_reg_table_realloc, df_ref_create, df_bb_reg_def_chain_create, df_bb_reg_use_chain_create, df_bb_rd_local_compute, df_bb_ru_local_compute, df_bb_lr_local_compute, df_analyse_1, df_insn_modify): Support analysing only a part of the cfg. (df_rd_transfer_function, df_ru_transfer_function, df_lr_transfer_function): Type of bitmaps changed to void *. (hybrid_search_bitmap, hybrid_search_sbitmap): Merge into ... (hybrid_search): ... new function. (iterative_dataflow_bitmap, iterative_dataflow_sbitmap): Merge into ... (iterative_dataflow): ... new function. Avoid use of fibheaps for a worklist. Do not process basic blocks unnecessarily. * df.h (struct ref): Add data field. (DF_REF_DATA): New macro. (df_analyse_subcfg, df_find_def): Declare. (transfer_function_sbitmap, transfer_function_bitmap): Replaced by ... (transfer_function): ... declare. (iterative_dataflow_sbitmap, iterative_dataflow_bitmap): Replaced by ... (iterative_dataflow): ... declare. (enum set_representation, struct dataflow): New. * loop-invariant.c: Include df.h. (struct loop_data): Remove modified_regs field. (struct def): Remove redundant fields. (struct use): Add insn field. (defs, adef, last_def, m_reg_info, reg_info): Removed. (struct reg): Removed. (record_def, note_insn_stores, find_defs_insn, find_defs_bb, get_current_def, record_dependencies_fer, record_dependencies, move_actual_defs): Removed. (find_defs, find_invariants_insn, create_new_invariant, find_invariants_bb, find_invariants_body, find_invariants, find_invariants_to_move, move_invariant_reg, move_invariants, move_single_loop_invariants, move_loop_invariants): Use df.c. (init_inv_motion_data): Do not initialize removed structures. (free_inv_motion_data, free_loop_data): Do not cleanup removed structures. (check_dependencies, find_invariant_insn, record_uses): New. (record_use): Record the insn. (get_inv_cost): Update comments. 2004-03-09 Andreas Jaeger * common.opt: Put tree-loop-linear at right place. 2004-03-09 Daniel Berlin * Makefile.in: Add lambda-mat.o, lambda-code.o, and tree-loop-linear.o. * common.opt: Add -ftree-loop-linear. * flags.h: Add flag_tree_loop_linear. * opts.c: Handle tree-loop-linear option. * timevar.def (TV_TREE_LINEAR_TRANSFORM): New. * tree-flow.h (linear_transform_loops): New prototype. * tree-optimize.c (pass_scev_linear_transform): New. * tree-pass.h (pass_scev_linear_transform): Ditto. * tree-scalar-evolution.c (scev_linear_transform): Ditto. (gate_scev): Add check for flag_tree_loop_linear. (gate_scev_linear_transform): New. * lambda-code.c: New file. * lambda-mat.c: New file. * lambda-trans.c: New file. * lambda.h: New file. * tree-loop-linear.c: New file. 2004-03-09 Andrew Pinski * tree-ssa-phiopt.c (conditional_replacement): Initialize new_var to NULL to prevent the uninitialized warning. * tree-ssa-phiopt.c (conditional_replacement): Disable the making a new variable for different types. * tree-ssa-phiopt.c (conditional_replacement): Disable the use of non-gimple of invert_truthvalue. 2004-03-08 Andrew Pinski * tree-ssa-phiopt.c (make_temp): New function. (tree_ssa_phiopt): Use absolute_replacement and value_replacement. (conditional_replacement): Handle the case the conditional is not a variable and the types do not match. Handle the case where invert_truthvalue would create non-gimple. (absolute_replacement): New function. (value_replacement): New function. 2004-03-08 Sebastian Pop * tree-scalar-evolution.c (set_scalar_evolution, set_scalar_evolution_outer_value): Compute the loop number instead of passing it as a parameter. 2004-03-04 Zdenek Dvorak * tree-ssa-loop-live.c (coalesce_tpa_members): Update the root variable of the partition. 2004-03-03 Zdenek Dvorak * tree-ssa-loop-ivopts.c (enum iv_position): Add IP_ORIGINAL. (struct iv_cand): Add incremented_at. (dump_cand, add_candidate_1, add_candidate, add_old_iv_candidates, var_at_use, get_computation, get_computation_cost, cand_value_at, determine_iv_cost, find_best_candidate, create_new_iv): Handle IP_ORIGINAL. (stmt_after_ip_original_pos, stmt_after_increment): New functions. (find_givs_in_stmt): Cast the values to the result type. (record_invariant): Do not record virtual operands. 2004-03-03 Daniel Berlin * tree-scalar-evolution.c: Use pointers to varray instead of varrays for functions that insert in the scev database. 2004-03-03 Sebastian Pop * Makefile.in (OBJS-common): Add tree-elim-check.o. (tree-chrec.o): Add dependence on tree-pass.h. (tree-elim-check.o): New rule. * tree-elim-check.c: New file. * basic-block.h (edge_source, edge_destination): New inlined functions. * cfgloop.h (loop_nb_iterations): Added a comment on the use of this accessor. * common.opt (ftree-elim-checks): New flag. * flags.h (flag_tree_elim_checks): Declared here. * opts.c (decode_options): Set flag_tree_elim_checks to zero. (common_handle_option): Add case OPT_ftree_elim_checks. * timevar.def (TV_TREE_ELIM_CHECKS): Defined. * toplev.c (flag_tree_elim_checks): Defined. * tree-cfg.c (print_pred_bbs, print_succ_bbs, print_loop): Modify the dumping style. Print nb_iterations. * tree-chrec.c, tree-chrec.h, tree-scalar-evolution.c, tree-scalar-evolution.h, tree-data-ref.c: New version of the scalar evolution algorithm. Don't use a schedule for analyzing the scalar variables. * tree-fold-const.c (tree_fold_bezout): Define. * tree-fold-const.h (tree_fold_int_round_div, tree_fold_int_trunc_mod, tree_fold_int_ceil_mod, tree_fold_int_floor_mod, tree_fold_int_round_mod): Removed, because not used for the moment. (chrec_merge_types): New function. * tree-optimize.c (pass_scev_elim_checks): Register the pass. * tree-pass.h (pass_scev_elim_checks): Declare the pass. * tree-pretty-print.c (dump_generic_node): Print PEELED_CHREC. Remove PERIODIC_CHREC. * tree-vectorizer.c: Modify the use of analyze_scalar_evolution. * tree.def (POLYNOMIAL_CHREC, EXPONENTIAL_CHREC): Store the evolution loop in a third leaf instead of in TREE_TYPE. TREE_TYPE is then used in storing the type of the chrec. (PERIODIC_CHREC): Removed since it is not used for the moment. (PEELED_CHREC): New node. * doc/invoke.texi (fdump-tree-scev, fdump-tree-ddall): Correct the name of these flags. (ftree-elim-checks, fdump-tree-elck): Document. 2004-03-02 Zdenek Dvorak * tree-ssa-loop-ivopts.c (number_of_iterations_cond, cand_value_at): Cast the constants. 2004-03-01 Zdenek Dvorak * Makefile.in (tree-ssa-loop-ivopts.o): Add HASHTAB_H dependency. * tree-ssa-loop-ivopts.c: Include hashtab.h. (old_highest_ssa_version): Rename to version_info_size. (struct tree_niter_desc): Split from ... (struct loop_data): ... here. (relevant): New variable. (tree_ssa_iv_optimize_init, set_iv, find_induction_variables, record_invariant, find_interesting_uses, add_old_ivs_candidates, determine_set_costs, free_loop_data, tree_ssa_iv_optimize_finalize): Use bitmap of relevant ssa names. (var_at_use): New function. (get_computation): Use it. (multiply_by_cost): Cache all results. (mbc_entry_hash, mbc_entry_eq): New functions. (number_of_iterations_cond): Split from ... (determine_number_of_iterations): ... here. (cand_value_at, may_eliminate_iv): New functions. (determine_use_iv_cost_condition, rewrite_use_compare): Implement iv elimination. 2004-03-01 Devang Patel * tree-dg.c (dg_delete_graph): Reset varrays. (gate_ddg) : Check current loops. 2004-02-27 Zdenek Dvorak * tree-cfg.c (cleanup_control_expr_graph): Prevent probability from overflowing. * loop-invariant.c (get_current_def): Fix. * tree-ssa-loop-im.c (move_computations): Only call rewrite_into_ssa if vars_to_rename is nonempty. * tree-ssa-loop-ivopts.c (outermost_usage, ivs): Removed. (struct version_info): New. (version_info, max_inv_id): New variables. (struct cost_pair): Added depends_on field. (struct iv_use): Removed fields choices, n_choices, min_cost and min_cost_cand. (enum iv_position, dump_cand, ip_end_pos, add_candidate_1, determine_iv_cost, create_new_iv): IP_START position disabled. (find_optimal_iv_set_1, min_remaining_cost, undo_changes, execute_removal, add_forbidden_ivs, try_candidate): Removed. (dump_use): Do not dump removed fields. (ver_info, name_info, update_outermost_usage, record_invariant, find_invariants_stmt, find_depends, try_improve_iv_set): New functions. (find_outermost_usage): Handle uses in phis. (divide): Update comment. (tree_ssa_iv_optimize_init): Initialize version_info instead of ivs and outermost_usage. (set_iv, get_iv, find_induction_variables, add_old_ivs_candidates): Use version_info instead of ivs. (record_use): Do not initialize removed fields. (find_interesting_uses_op): Call record_use. (find_interesting_uses_stmt): Call find_invariants_stmt. (find_interesting_uses): Scan just the current loop. (set_use_iv_cost): Initialize depends_on field. (get_use_iv_cost): Return depends_on field. (get_computation): Handle special cases. (force_var_cost, split_address_cost, ptr_difference_cost, difference_cost, get_computation_cost, determine_use_iv_cost_generic, determine_use_iv_cost_address, determine_use_iv_cost_condition): Determine depends_on bitmap. (determine_use_iv_costs): Dump depends_on bitmap. (init_set_costs): Use information about invariants. (find_best_candidate, set_cost, get_initial_solution, find_optimal_iv_set): Take depends_on into account. (rewrite_uses): Use use->selected to select candidate. (free_loop_data, tree_ssa_iv_optimize_finalize): Cleanup version_info instead of ivs. Free depends_on bitmaps. (tree_ssa_iv_optimize_loop): Do not pass iv_set to rewrite_uses. 2004-02-27 Zdenek Dvorak * cfgloopmanip.c (loopify): Fix comment. * loop-iv.c (lowpart_byte, lowpart_subreg_p): Removed. (lowpart_subreg, simple_reg_p, iv_get_reaching_def, get_biv_step_1, iv_analyse_op, iv_analyse, get_iv_value): Use standard subreg manipulation functions. (simplify_using_assignment): Handle hardregs correctly. (canon_condition): Use swap_commutative_operands_p. (iv_number_of_iterations): Avoid overflow. * loop-unroll.c (unroll_loop_runtime_iterations): Pass additional argument to compare_and_jump_seq. * loop-unswitch.c (unswitch_loop, may_unswitch_on, unswitch_single_loop, compare_and_jump_seq): Handle comparisons of ccmode registers. * rtl.h (compare_and_jump_seq): Declaration changed. 2004-02-25 Dorit Naishlos * tree-vectorizer.h (assignment_vec_info_type): New enum value for stmt_vec_info_type. * tree-vectorizer.c (vect_transform_assignment): New function. Support vectorization of assignment stmts. (vect_transform_stmt): Call vect_transform_assignment. (vect_is_supportable_assignment): New function. (vect_analyze_operations): Call vect_is_supportable_assignment. (vect_create_index_for_array_ref): Replace unsigned_intSI_type_node with size_type_node. (vect_transform_loop_bound): Likewise. (get_vectype_for_scalar_type): Avoid division by 0. (vect_analyze_operations): Apply check for no-out-of-loop-uses also to stmts that are marked irrelevant. 2004-02-25 Zdenek Dvorak * tree-flow.h (for_each_index): Declare. * tree-ssa-loop-im.c (struct lim_aux_data): Add always_executed_in and sm_done fields. (struct use): New. (max_uid): New static variable. (outermost_invariant_loop, commit_inserts, may_move_till, force_move_till, record_use, free_uses, single_reachable_address, rewrite_uses, schedule_sm, determine_lsm_reg, loop_suitable_for_sm, determine_lsm_loop, determine_lsm): New functions. (add_dependency): Use outermost_invariant_loop. (set_level): Add sanity checking. (determine_invariantness_stmt): Set always_executed_in field. (move_computations_stmt): Modified. (move_computations): Use commit_inserts. (fill_always_executed_in): Take possibility of an infinite loop into account. (tree_ssa_lim): Call determine_lsm. * tree-ssa-loop-ivopts.c (for_each_index): Export. (rewrite_use_address): Improve handling of memory tags. * tree-ssa-loop.c (do_while_loop_p): Readd. (copy_loop_headers): Readd check for do_while_loop_p. * tree-ssa-operands.c (add_stmt_operand): Modified. 2004-02-21 Zdenek Dvorak Merge from tree-ssa branch (lno-merge-20040221). 2004-02-20 Devang Patel * tree-vectorizer.c (vect_analyze_data_ref_dependence): Use ddg_direction_between_stmts (). 2004-02-20 Devang Patel * tree-data-ref.h (data_dependence_direction): Add new member dir_independent. * tree-dg.h (tree-data-ref.h): Include. (ddg_direction_between_stmts, ddg_distance_between_stmts): New decls. * tree-dg.c (find_ddr_between_stmts, ddg_direction_between_stmts, ddg_distance_between_stmts): New functions. 2004-02-19 Devang Patel * tree-dg.c (dg_delete_edges, dg_delete_node, dg_delete_graph, dg_delete_edge, gate_delete_ddg): New functions. (pass_delete_ddg): New. * tree-dg.h (dg_delete_graph, dg_delete_edge): New extern decls. * tree-optimize.c (init_tree_optimization_passes): Add new pass pass_delete_ddg. * tree-pass.h (pass_delete_ddg): New extern. 2004-02-19 Zdenek Dvorak * tree-flow.h (create_iv): Declare. * tree-ssa-loop-ivopts.c (create_iv): New function. (create_new_iv): Use create_iv. 2004-02-19 Zdenek Dvorak * tree-ssa-loop.c (do_while_loop_p): New function. (copy_loop_headers): Do not peel do-while loops. 2004-02-19 Zdenek Dvorak * loop-invariant.c: New file. * Makefile.in (loop-invariant.o): New. * cfgloop.h (init_set_costs, global_cost_for_size, move_loop_invariants): Declare. * toplev.c (rest_of_handle_loop2): Call move_loop_invariants. (lang_dependent_init): Call init_set_costs. * tree-ssa-loop-ivopts.c (avail_regs, res_regs, small_cost, pres_cost, spill_cost): Made static. (global_cost_for_size): Export. (ivopts_global_cost_for_size, init_set_costs): New functions. (determine_set_costs): Do not initialize set cost constants. Use ivopts_global_cost_for_size. (try_candidate, find_optimal_iv_set_1, set_cost): Use ivopts_global_cost_for_size. * cfgloop.c (fill_sons_in_loop): Fix typo in comment. 2004-02-17 Devang Patel * tree-vectorize.c (vect_create_data_ref): Set TREE_ADDRESSABLE bit. (vectorize_loops): Reset loop->aux. 2004-02-16 Devang Patel * Makefile.in (TREE_FLOW_H): Add tree-dg.h (OBJS-common): Add tree-dg.o (gtype-desc.o): Depend on tree-dg.h (tree-dg.o): New rule. (GTFILES): Add tree-data-ref.h, tree-data-ref.h * common.opt (ftree-ddg): Add new option. * flags.h (flag_ddg): New extern. * gengtype.c (open_base_files): Add tree-dg.h and tree-data-ref.h in the list. * opts.c (decode_option): Set flag_ddg to zero. (common_handle_option): Handle OPT_ftree_ddg. * timevar.def (TV_DEP_GRAPH): New. * toplev.c (flag_ddg): New flag. (lang_independent_options): Add entry for -ftree-ddg. * tree-data-ref.c (compute_all_dependences): Make externally visible. * tree-data-ref.h (data_reference, subscript, data_dependence_relation) Add GTY markers. (compute_all_dependences): Make externally visible. * tree-dg.c: New file. * tree-dg.h: New file. * tree-flow-inline.h (dg_node_for_stmt): New function. * tree-flow.h (tree-dg.h): Include. (stmt_ann_d): New member, dg_node. * tree-optimize.c (init_tree_optimization_passes): Add pass_ddg. * tree-pass.h (PROP_scev): Define. (tree_opt_pass pass_ddg): Extern decl. * tree-scalar-evolution.c (pass_scev_anal): Provide PROP_scev property. * varray.c (element[NUM_VARRAY_DATA]): Add new member for dependence graph. * varray.h (varray_data_enum): New member VARRAY_DATA_DG. (varray_data_tag): New member dg. (VARRAY_DG_INIT): New #define. (VARRAY_DG): New #define. (VARRAY_PUSH_DG): New #define. 2004-02-12 Zdenek Dvorak * tree-optimize.c (init_tree_optimization_passes): Move ch after the first dominator optimization pass. * tree-ssa-loop.c (should_duplicate_loop_header_p, copy_loop_headers): Work over ssa. (pass_ch): Require and update ssa form. (mark_defs_for_rewrite, duplicate_blocks): New. 2004-02-10 Zdenek Dvorak * tree-ssa-loop-ivopts.c (for_each_index, prepare_decl_rtl, peel_address): Handle RESULT_DECL. 2004-02-10 Zdenek Dvorak * loop-doloop.c (doloop_optimize): Use get_simple_loop_desc. * loop-init.c (loop_optimizer_finalize): Free the simple loop descriptions. * loop-unroll.c (unroll_and_peel_loops): Do not free the simple loop descriptions. (decide_peel_once_rolling, decide_peel_completely, decide_unroll_stupid): Test assumptions. decide_unroll_constant_iterations, decide_unroll_runtime_iterations, decide_peel_simple, peel_loop_simple, unroll_loop_stupid): Update number of iterations info. (unroll_loop_constant_iterations, unroll_loop_runtime_iterations, (loop_exit_at_end_p): Use get_simple_loop_desc. 2004-02-08 Zdenek Dvorak * cfgloop.h (struct niter_desc): Add first_special, extend, extend_mode, delta and mult fields. (get_iv_value): Declare. * expr.c (force_operand): Handle subregs of expressions. * loop-doloop.c (doloop_valid_p): Test desc->infinite properly. * loop-iv.c (dump_iv_info): Dump new fields. (lowpart_byte, lowpart_subreg_p, lowpart_subreg, iv_constant, iv_subreg, iv_extend, iv_neg, iv_add, iv_mult, get_biv_step_1, get_biv_step, shorten_into_mode, canonicalize_iv_subregs): New functions. (simple_reg_p, simple_set_p, iv_get_reaching_def, iv_analyse_biv, iv_analyse_op, iv_analyse, iv_number_of_iterations): Handle subregs. * loop-unswitch.c (may_unswitch_on): Handle subregs. 2004-02-04 Zdenek Dvorak * Makefile.in (tree-ssa-loop-ivopts.o): Add RECOG_H and insn-config.h dependency. * loop-iv.c (iv_analysis_loop_init): Ensure we only care about increments that are done just once each iteration. * timevar.def (TV_TREE_LOOP_IVOPTS, TV_TREE_CH): New. * tree-ssa-loop-ivopts.c: Include insn-config.h and recog.h. (INFTY): Increase. (struct iv_use): Add choices, n_choices, min_cost_cand and selected fields. Rename field best_cost to min_cost. (CONSIDER_ALL_CANDIDATES_BOUND): Decrease. (dump_use): Dump new fields. (dump_uses, cst_and_fits_in_hwi, int_cst_value, build_int_cst, divide, strip_offset, add_cost, multiply_by_cost, get_address_cost, force_var_cost, peel_address, ptr_difference_const, split_address_cost, ptr_difference_cost, difference_cost, get_computation_cost): New functions. (find_induction_variables): Formating changes. (record_use): Initialize new fields. (add_old_ivs_candidates): Do not add invariants. (set_use_iv_cost): Set min_cost. (get_use_iv_cost): Fix. (get_computation): Use less memory. (determine_use_iv_cost_generic, determine_use_iv_cost_address, determine_use_iv_cost_condition, determine_iv_cost): Use new cost estimation functions. (compute_iv_set_cost): Removed. (struct undo_record): New. (use_with_min_choices, min_remaining_cost, undo_changes, execute_removal, add_forbidden_ivs, try_candidate, set_cost, get_initial_solution): New functions. (find_optimal_iv_set_1, find_optimal_iv_set): Made more effective. (create_new_ivs, rewrite_use_nonlinear_expr, rewrite_use_address): Unshare created expressions. (free_loop_data): Free new structures. (tree_ssa_iv_optimize_loop): Remove garbage collection. (tree_ssa_iv_optimize): Use TV_TREE_LOOP_IVOPTS timevar. * tree-ssa-loop.c (pass_ch): Use TV_TREE_CH timevar. 2004-02-02 Steven Bosscher * common.opt: Re-order some options in ASCII collating order. 2004-01-30 Devang Patel * cfgloopmanip.c (loopify): Always redirect switch_bb's BRANCH_EDGE, however redirect FALLTHRU_EDGE only if asked. * tree-ssa-loop-manip.c (tree_ssa_loop_version): Update FALLTHRU_EDGE pending stmts. 2004-01-29 Zdenek Dvorak * tree-ssa-loop-ivopts.c (find_optimal_iv_set_1, compute_iv_set_cost): Fix memory leak, speed up. (tree_ssa_iv_optimize_finalize): Move reseting of DECL_RTL... (free_loop_data): ... here. 2004-01-29 Zdenek Dvorak * basic-block.h (FOR_BB_INSNS, FOR_BB_INSNS_REVERSE): New macros. * cfgloop.c (num_loop_branches): New function. * cfgloop.h (struct loop_desc): Add field strange. (struct loop): Remove fields simple, desc, has_desc. (num_loop_branches, get_simple_loop_desc, free_simple_loop_desc): Declare. (simple_loop_desc): New inline function. * cfgloopanal.c (count_loop_iterations): Set field strange. (simple_loop_exit_p): Initialize postincr properly. * loop-iv.c (assign_luids, mark_sets, simplify_using_initial_values): Use FOR_BB_INSNS/FOR_BB_INSNS_REVERSE. (iv_number_of_iterations): Restrict the number of iterations to the actual mode. (find_simple_exit): Check results with the old simple loop analyser. (get_simple_loop_desc, free_simple_loop_desc): New functions. * loop-unroll.c (loop_exit_at_end_p): New function. (unroll_and_peel_loops, peel_loops_completely, decide_unrolling_and_peeling, decide_peel_once_rolling, decide_peel_completely, peel_loop_completely, decide_unroll_constant_iterations, unroll_loop_constant_iterations, decide_unroll_runtime_iterations, unroll_loop_runtime_iterations, decide_peel_simple, decide_unroll_stupid): Use new iv analysis. * predict.c (predict_loops): Use new iv analysis. * tree-ssa-loop.c (copy_loop_headers): Predict entry edge from copied loop header to be taken. * tree-cfg.c (tree_find_edge_insert_loc, bsi_insert_on_edge_immediate): Return the newly created block. (bsi_commit_edge_inserts_1): Add parameter to tree_find_edge_insert_loc call. * tree-flow.h (bsi_insert_on_edge_immediate): Declaration changed. * tree-ssa-loop-ivopts.c (create_new_iv): Update loop for newly created block. * cfg.c (unlink_block): Clean prev_bb and next_bb fields. 2004-01-29 Devang Patel * cfglayout.h (loopify): Add new bool parameter. * cfgloopmanip.c (loopify): Support new bool argument. * loop-unswitch.c (unswitch_loop): Supply additional argument 'true' to loopify. * tree-cfg.c (tree_block_label): Make externally visible. * tree-flow.h (tree_block_label, test_loop_versioning, tree_ssa_loop_version): New extern decls. * tree-ssa-loop-manip.c (lv_adjust_loop_entry_edge, lv_udate_pending_stmts, lv_adjust_loop_header_phi, tree_ssa_loop_version): New functions. * tree-ssa-loop.c (tree_ssa_loop_opt): Test loop versioning. 2004-01-29 Zdenek Dvorak * tree-scalar-evolution.c (scev_analyze_inner_loop_phi): Add ;. 2004-01-29 Sebastian Pop * Makefile.in (tree-ssa-dom.o): Depends on cfgloop.h. * tree-flow-inline.h (loop_of_stmt): New function. * tree-ssa-dom.c: Include cfgloop.h. (tree_ssa_dominator_optimize): Detect and finalize the natural loops structure. (simplify_rhs_and_lookup_avail_expr): Verify that the folded operations belong to the same loop. * cfgloop.h (loop): Rewrite comments for the nb_iterations field. * tree-data-ref.c (analyze_all_data_dependences): Increase the size of the dependence graph when computing all the dependences. * tree-optimize.c (init_tree_optimization_passes): Move the pass_scev after the pass_pre. * tree-scalar-evolution.h: Update comments. * tree-scalar-evolution.c (symbolically_analyze, scev_follow_ssa_edge_same_loop, scev_follow_ssa_edge_inner_loop, loop_is_strictly_included_in, scev_analyze_inner_loop_phi, draw_tree_cfg): New functions. (compute_value_on_exit_of_loop): Removed. (analyze_evolution): Mark phi nodes instead of looking into the already_visited array. (analyze_evolution_in_loop): Use scev_follow_ssa_edge_same_loop, scev_follow_ssa_edge_inner_loop. (scev_analyze_modify_expr): Refine the wrap-around case. (scev_follow_ssa_edge): Handle edges to the current and inner loops separately calling scev_follow_ssa_edge_same_loop or scev_follow_ssa_edge_inner_loop. (merge_branches_of_condition_phi_node): Restructure. (set_nb_iterations_in_loop): Add one to the number of iterations. When the loop copy headers is on, we always exit the loop after having executed once its body. (record_dependences_for_opnd): Do not record dependences on variables that are not in the current loop. (pass_scev_depend): Rename the pass from alldd to ddall. * tree-ssa-loop.c (gate_ch): New function. (pass_ch): Use gate_ch. * doc/invoke.texi (-ftree-ch, -fdump-tree-ch): Document flags. (fdump-tree-scev, fdump-tree-ddall): Update names, and comments. * common.opt (ftree-ch): Document. * flags.h (flag_tree_ch): Declare. * opts.c (flag_tree_ch): Set it on by default. (flag_scalar_evolutions, flag_all_data_deps): Turn off by default. (OPT_ftree_ch): Handle this case. * toplev.c (lang_independent_options): Register flag_tree_ch. 2004-01-28 Zdenek Dvorak * cfghooks.c (split_block): Update probabilities. * cfgloopmanip.c (loopify): Always redirect branch edge to the new loop. * loop-iv.c (canon_condition, simplify_using_condition): Export. (check_simple_exit): Do not allow cc mode registers. * loop-unroll.c (unroll_loop_runtime_iterations): Use compare_and_jump_seq. * loop-unswitch.c (may_unswitch_on_p): Renamed to may_unswitch_on, returns the condition, use iv_analyse. (compare_and_jump_seq): New function. (unswitch_loops): Call iv_analysis_done. (unswitch_single_loop, unswitch_loop): Handle nontrivial invariants. * rtl.h (compare_and_jump_seq, canon_condition, simplify_using_condition): Declare. 2004-01-28 Zdenek Dvorak * loop-iv.c: New. * loop-doloop.c: New. * Makefile.in (loop-doloop.o, loop-iv.o): Add. * alias.c (init_alias_analysis): Test flag_unroll_loops instead of flag_old_unroll_loops. * cfgloop.h (struct rtx_iv, struct niter_desc): New. (get_loop_level, iv_analysis_loop_init, iv_get_reaching_def, iv_analyse, find_simple_exit, iv_number_of_iterations, iv_analysis_done, doloop_optimize_loops): Declare. * cfgloopanal.c (get_loop_level): New. * common.opt (floop-optimize2): New. (fold-unroll-loops, fold-unroll-all-loops): Remove. * doloop.c (doloop_condition_get): Export. * flags.h (flag_old_unroll_loops, flag_old_unroll_all_loops): Declaration removed. * loop-unswitch.c (reversed_condition): Export. * loop.c (loop_invariant_p): Use flag_unroll_loops instead of flag_old_unroll_loops. * opts.c (common_handle_option): Handle -floop-optimize2, do not handle -fold-unroll-loops and -fold-unroll-all-loops. * params.def (PARAM_MAX_DOLOOP_INSNS): New. * rtl.h (get_mode_bounds, doloop_condition_get, reversed_condition): Declare. * stor-layout.c (get_mode_bounds): New function. * toplev.c (flag_old_unroll_loops, flag_old_unroll_all_loops): Remove. (flag_loop_optimize2): New. (rest_of_handle_loop_optimize): Use flag_unroll_loops instead of flag_old_unroll_loops. (rest_of_handle_loop2): Call doloop_optimize_loops. (rest_of_compilation): Use flag_loop_optimize2. (process_options): Remove flag_old_unroll_loops handling, add flag_loop_optimize2 handling. * toplev.h (flag_loop_optimize2): Declare. * unroll.c (unroll_loop): Use flag_unroll_all_loops instead of flag_old_unroll_all_loops. 2004-01-26 Dorit Naishlos * Makefile.in: (tree-vectorizer.o): Remove dependency on real.h. * tree-vectorizer.c: (real.h): Remove included file. (vect_get_vec_def_for_operand): No need to explicitly use build_int_2 and build_real. (vect_transform_loop_bound): Create loop IV update at loop exit block, following changes in loop control. (vectorize_loops): Remove debug printout. * config/rs6000/altivec.md: (*movv4si_internal): More complex condition. (*movv8hi_internal1): Likewise. (*movv16qi_internal1): Likewise. (*movv4sf_internal1): Likewise. 2004-01-25 Zdenek Dvorak * tree-ssa-loop-ivopts.c (determine_set_costs): Do not use GENERAL_REGNO_P. 2004-01-25 Zdenek Dvorak * tree-ssa-loop-ivopts.c: New file. * Makefile.in (tree-ssa-loop-ivopts.o): Add. * expr.c (expand_expr_1): Handle expand_expr_1. * fold-const.c (invert_tree_comparison, invert_tree_comparison): Export. * tree-cfg.c (stmt_bsi): New function. * tree-flow.h (stmt_bsi, tree_ssa_dce_no_cfg_changes, tree_ssa_iv_optimize): Declare. * tree-simple.c (get_base_symbol): Handle INDIRECT_REF. * tree-ssa-dce.c (tree_ssa_dce_no_cfg_changes): Split from ... (tree_ssa_dce): ... here. * tree-ssa-loop.c (tree_ssa_loop_opt): Call tree_ssa_iv_optimize. * tree-ssanames.c (make_ssa_name): Allow creating ssa name without statement. * tree.h (invert_tree_comparison, swap_tree_comparison): Declare. 2004-01-25 Zdenek Dvorak * doloop.c (doloop_optimize): Test for loop->top instead of loop->scan_start. 2004-01-22 Zdenek Dvorak * tree-alias-common.c (HAVE_BANSHEE): Do not define it. (create_alias_vars): Do not test HAVE_BANSHEE value. 2004-01-22 Zdenek Dvorak * tree-ssa-loop-manip.c: New file. * Makefile.in (tree-ssa-loop-manip.o): Add. * basic-block.h (struct reorder_block_def): New field copy_number. * cfghooks.c (split_block, make_forwarder_block): Update irreducible loop information. * cfgloopmanip.c (duplicate_loop_to_header_edge): Set copy_number. * tree-cfg.c (tree_duplicate_bb): Duplicate also virtual operands. * tree-flow.h (enum tree_ann_type): Add MISC_ANN. (struct misc_ann_d): New. (union tree_ann_d): Add misc field. (test_unrolling_and_peeling, tree_duplicate_loop_to_header_edge): Declare. * tree-ssa-loop.c (tree_ssa_loop_opt): Call test_unrolling_and_peeling. * tree-ssa-operands.c (copy_virtual_operands): New. * tree-ssa-operands.h (copy_virtual_operands): Declare. * dominance.c: Fix comment. * cfgloopanal.c (mark_irreducible_loops): Rewriten. (struct edge, struct vertex, struct graph): New. (dump_graph, new_graph, add_edge, dfs, check_irred, for_each_edge, free_graph): New functions. 2004-01-21 Sebastian Pop * tree-scalar-evolution.c (pass_scev): Don't use a name. (pass_scev_anal): Named this pass "scev". 2004-01-21 Dorit Naishlos * Makefile.in: (tree-vectorizer.o): Add dependency on real.h. * tree-vectorizer.c: (vect_is_simple_use): Allow constants. (real.h): Included to support constants vectorization. (vect_get_vec_def_for_operand): New function. (vect_transform_binop): Use above new function. (vect_transform_store): Likewise. (vect_transform_load): Likewise. (vect_get_new_vect_var): Allow more flexibility in naming scheme. (vect_create_index_for_array_ref): Call vect_get_new_vect_var with a name prefix instead of a variable. (vect_create_data_ref): Likewise. (vect_create_destination_var): Likewise. (vect_analyze_data_refs): Temporarily restrict vectorizable data refs to ARRYA_RES which base is a VAR_DECL. (vect_create_data_ref): Support only VAR_DECL array base. Mark all vops for renaming. (vect_get_array_first_index): New function. (vect_create_index_for_array_ref): Consider array_first_index. (vect_analyze_data_ref_access): Likewise. (vect_get_loop_niters): Use number_of_iterations_in_loop. (vect_analyze_loop_form): Don't attempt to vectorize if number_of_iterations == 0. (vect_analyze_operations): Fix vectype analysis. (vect_create_index_for_array_ref): Fix code insertion in loop prolog. (vect_transform_loop_bound): Likewise. 2004-01-21 Zdenek Dvorak , Devang Patel * basic-block.h (struct reorder_block_def): Moved from cfglayout.h. (alloc_rbi_pool, initialize_bb_rbi, free_rbi_pool): Declare. * bb-reorder.c (copy_bb, copy_bb_p): Use duplicate_block hooks. * loop-unswitch.c (unswitch_loop): Ditto. * tracer.c (tail_duplicate): Ditto. * tree-ssa-loop.c (copy_loop_headers): Ditto. * cfg.c (rbi_pool): New. (alloc_rbi_pool, free_rbi_pool, initialize_bb_rbi): New functions. * cfghooks.c (can_duplicate_block_p, duplicate_block): New functions. * cfghooks.h (struct cfg_hooks): Add can_duplicate_block_p and duplicate_block hooks. (can_duplicate_block_p, duplicate_block): Declare. * cfglayout.c (cfg_layout_pool): Removed. (cfg_layout_initialize_rbi): Removed. (fixup_reorder_chain): Use initialize_bb_rbi. (cfg_layout_can_duplicate_bb_p, cfg_layout_duplicate_bb): Ir-independent parts moved to cfghooks.c. (cfg_layout_initialize): Use alloc_rbi_pool and initialize_bb_rbi. (cfg_layout_finalize): Use free_rbi_pool. (can_copy_bbs_p): Use can_duplicate_block_p. (copy_bbs): Use duplicate_block. * cfglayout.h (struct reorder_block_def): Moved to basic-block.h (cfg_layout_can_duplicate_bb_p, cfg_layout_duplicate_bb, cfg_layout_initialize_rbi): Declaration removed. * cfgrtl.c (cfg_layout_create_basic_block): Use initialize_bb_rbi. (cfg_layout_rtl_cfg_hooks): Add cfg_layout_can_duplicate_bb_p and cfg_layout_duplicate_bb. * tree-cfg.c (build_tree_cfg): Call alloc_rbi_pool. (create_bb): Call initialize_bb_rbi. (delete_tree_cfg): Call free_rbi_pool. (tree_duplicate_bb): Ir independent parts moved to cfghooks.c. (tree_cfg_hooks): Add tree_can_duplicate_bb_p and tree_duplicate_bb. * tree-flow.h (tree_duplicate_bb): Declaration removed. 2004-01-21 Zdenek Dvorak * tree-alias-common.c (create_alias_vars): Don't use andersen_alias_ops when we don't HAVE_BANSHEE. * tree-ssa-loop.c (pass_ch): Remove TODO_verify_ssa. 2004-01-20 Zdenek Dvorak Merge from tree-ssa branch (lno-merge-20040120). 2004-01-18 Dorit Naishlos * tree-scalar-evolution.c: (get_loop_exit_condition): Exposed to external usage. * tree-scalar-evolution.h: (get_loop_exit_condition): Exposed to external usage. * tree-vectorizer.c: (vect_is_simple_iv_evolution): Additional argument to control how strict this function would be. (vect_create_index_for_array_ref): Invoke vect_is_simple_iv_evolution with "strict" set to true. (vect_transform_loop_bound): More general loop bound transformation scheme, independent of the loop exit condition form. (vect_analyze_scalar_cycles): Invoke vect_is_simple_iv_evolution with "strict" set to false. (vect_get_loop_niters): Use monev utilities/precomputed info - loop->nb_iterations and get_loop_exit_condition. 2004-01-17 Dorit Naishlos * tree-vectorizer.c: (vect_get_name_for_new_var): Removed. (vect_get_new_vect_var): New function. Replaces above function. (vect_create_index_for_array_ref): Call vect_get_new_vect_var instead of vect_get_name_for_new_var. (vect_create_data_ref): Likewise. (vect_create_destination_var): Likewise. * tree-vectorizer.h: (vect_var_kind): New enum type. 2004-01-15 Sebastian Pop * tree-chrec.c (remove_initial_condition, add_expr_to_loop_evolution_1, add_expr_to_loop_evolution_2): New functions. (add_expr_to_loop_evolution): Use these functions. (build_polynomial_evolution_in_loop, build_exponential_evolution_in_loop): Move from here... * tree-chrec.h (build_polynomial_evolution_in_loop, build_exponential_evolution_in_loop): Remove declarations. * tree-scalar-evolution.c (build_polynomial_evolution_in_loop, build_exponential_evolution_in_loop): ... to here. Declare these functions static. (select_outer_and_current_evolutions): New function. (matched_an_increment, scev_analyze_modify_expr, compute_overall_effect_of_inner_loop, analyze_scalar_evolution): Use this function. (add_to_evolution, multiply_evolution): Construct canonical chains of recurrences. 2004-01-14 Dorit Naishlos Sebastian Pop * tree-vectorizer.c: (vect_is_simple_iv_evolution): Correctly use APIs of the new monev analyzer. Additional argument (loop_num). (vect_transform_loop_bound): Additional argument to vect_is_simple_iv_evolution. (vect_analyze_scalar_cycles): Likewise. (vect_analyze_data_ref_access): Likewise. (vect_get_loop_niters): Likewise. 2004-01-14 Dorit Naishlos * tree-optimize.c: (optimize_function_tree): Cleanup. * tree-vectorizer.h: (DBG_VECT, DBG_VECT2): Removed. (vec_array_base_name_differ_p): Removed. (vec_analyze_array): Removed. (struct _stmt_vec_info): New field: loop. (STMT_VINFO_LOOP): New access function to above new field. (new_stmt_vec_info): Additional argument. * tree-vectorizer.c: (vect_is_simple_use): New function. (vect_is_supportable_binop): Added call to vect_is_simple_use(). (vect_is_supportable_store): Added call to vect_is_simple_use(). (vect_is_supportable_load): Added call to vect_is_simple_use(). (vect_create_index_for_array_ref): Correct handling of accesses with an offset (e.g, a[i+OFF]). (vect_create_data_ref): Pass STMT as an argument to vect_create_index_for_array_ref, instead of an operand. (vect_transform_store): Handle accesses with an offset. (vect_transform_load): Handle accesses with an offset. (vect_create_data_ref): Set the mem_tag of the pointer used for the vector data-access to reflect correct may-alias info. (get_address_calculation_operands): Removed. (exist_non_indexing_operands_for_use_p): New function, in place of get_address_calculation_operands() to correctly handle induction (for now this means to detect and not attempt to vectorize computations like a[i]=i). (vect_analyze_scalar_cycles): call above new function instead of get_address_calculation_operands(). (vect_mark_stmts_to_be_vectorized): Likewise. (get_vectype_for_scalar_type): Added test of VECTOR_MODE_SUPPORTED_P. (new_stmt_vec_info): Takes also LOOP as an argument and initializes new field STMT_VINFO_LOOP. (new_loop_vec_info): Pass additional argument to new_stmt_vec_info. (vect_stmt_relevant_p): Use flow_bb_inside_loop_p instead of comparing loop->depth's. (vect_analyze_operations): Likewise. (vect_align_data_ref): Removed stderr debug printouts, some of which replaced with code dumping dependending on TDF_DETAILS to dump_file. (vect_create_index_for_array_ref): Likewise. (vect_create_destination_var): Likewise. (vect_create_data_ref): Likewise. (vect_transform_binop): Likewise. (vect_transform_store): Likewise. (vect_transform_load): Likewise. (vect_transform_stmt): Likewise. (vect_transform_loop_bound): Likewise. (vect_transform_loop): Likewise. (vect_analyze_operations): Likewise. (vect_is_simple_iv_evolution): Likewise. (vect_analyze_scalar_cycles): Likewise. (vect_analyze_data_ref_dependences): Likewise. (vect_analyze_data_refs): Likewise. (vect_mark_relevant): Likewise. (vect_stmt_relevant_p): Likewise. (vect_mark_stmts_to_be_vectorized): Likewise. (vect_get_loop_niters): Likewise. (vectorize_loops): Likewise. 2004-01-13 Sebastian Pop Daniel Berlin * tree-fold-const.h (tree_fold_int_plus, tree_fold_int_minus, tree_fold_int_multiply): Remove NON_LVALUE_EXPR from the answers of the folder. Fixes bootstraps for powerpc. 2004-01-12 Sebastian Pop * tree-chrec.c (chrec_fold_plus, chrec_fold_multiply): Verify that there is no chrecs nested in the operands before calling the folder. (evolution_function_in_loop_num): When there is no evolution in the loop, return the initial condition. (evolution_part_in_loop_num): When there is no evolution in the loop, return NULL_TREE. (chrec_eval_next_init_cond): Adapt the function for the multivariate case. (tree_contains_chrecs): Avoid the use of double negation. * tree-chrec.h (chrec_eval_next_init_cond): Add a parameter for the dimension in which to evaluate the variation. * tree-scalar-evolution.c (is_ssa_name_a_version_of_variable, expression_contains_variable_p, remove_variable_from_expression, analyze_non_gimple_initial_condition, matched_an_increment, matched_an_exponentiation, matched_a_wrap_around, matched_an_arithmetic_wrap_around, evolution_of_phi_already_analyzed_p): New static functions. (scev_analyze_modify_expr): Use these functions. Refine the cases detected as wrap-around variables. (analyze_initial_condition): Don't erase the evolution in the previous dimensions when computing the initial condition for a new loop. (analyze_evolution_in_loop): Call the scev_analyze_modify_expr on the tree node, not on its evolution. (scev_follow_ssa_edge): In the case of an inner loop-phi-node, when the outer edge is a phi-node follow up the edge. (scev_follow_ssa_edge): Avoid the analysis of the inner loop when it has already been analyzed. (merge_evolutions): Refine the operation for zero, one, and more branches of evolutions. 2004-01-09 Sebastian Pop * tree-scalar-evolution.c: New version of the analyzer. * tree-scalar-evolution.h: Same. * tree-chrec.c: Same. * tree-data-ref.c: Same. * tree-chrec.h: Same. * tree-data-ref.h: Same. * tree-fold-const.h: Same. * tree-vectorizer.c (vect_transform_loop_bound, vect_analyze_scalar_cycles, vect_analyze_data_ref_access, vect_analyze_data_refs, vect_get_loop_niters): Use the new interface of the analyzer. * tree-optimize.c (optimize_function_tree): Same. 2004-01-08 Zdenek Dvorak * cfgloop.h (loop_is_included_in): Declaration removed. * tree-scalar-evolution.c (stmt_is_in_loop, stmt_is_not_in_loop, loop_is_included_in): Use existing functions to implement them. 2004-01-06 Sebastian Pop * cfgloop.h (loop_is_included_in, outer_loop, inner_loop, next_loop, loop_num, loop_depth, loop_header, loop_nb_iterations, loop_num_exits, loop_exit_edges, loop_exit_edge): New inline functions. (loop_is_included_in): Declare here. * tree-flow-inline.h (loop_of_stmt): New inline function. * tree-scalar-evolution.c (loop_is_included_in): Remove declaration. (stmt_is_in_loop, stmt_is_not_in_loop): New functions. (loop_is_included_in, loop_is_included_in_rec): Moved up in the same file. 2004-01-06 Dorit Naishlos * tree-vectorizer.c: Fix typos. 2004-01-05 Andreas Jaeger * tree-vectorizer.h: Follow coding standards, remove extra whitespace. * tree-vectorizer.c: Likewise. * tree-vectorizer.c (vectorize_loops): Output statistics to dump_file, fix printf string. (vect_transform_loop): Replace DBG_VECT code with code dumping dependend on TDF_DETAILS to dump_file. (vect_is_supportable_binop): Likewise. (vect_analyze_operations): Likewise. (get_address_calculation_operands): Likewise. (vect_analyze_scalar_cycles): Likewise. (vect_analyze_data_ref_dependence): Likewise. (vect_analyze_data_ref_access): Likewise. (vect_analyze_data_ref_accesses): Likewise. (vect_analyze_data_refs): Likewise. (vect_mark_relevant): Likewise. (vect_get_loop_niters): Likewise. (vect_mark_stmts_to_be_vectorized): Likewise. (vect_analyze_loop_form): Likewise. (vectorize_loops): Likewise. * tree-vectorizer.h (DBG_VEC): Remove. 2004-01-04 Zdenek Dvorak * doloop.c (doloop_optimize): Update number of iterations for the loops entered at bottom. 2004-01-04 Andreas Jaeger * common.opt: Re-order some options in ASCII collating orders. 2004-01-03 Zdenek Dvorak * cfghooks.h (struct cfg_hooks): New fields split_block_after_labels and move_block_after, type of cfgh_make_forwarder_block field changed. (HEADER_BLOCK, LATCH_EDGE): Moved to cfgloop.c. (split_block_after_labels, move_block_after): New macros. (make_forwarder_block): Changed. * cfgloop.c (HEADER_BLOCK, LATCH_EDGE): Moved from cfghooks.h. (update_latch_info, mfb_keep_just, mfb_keep_nonlatch, fill_sons_in_loop): New functions. (canonicalize_loop_headers): Changed due to changes in make_forwarder_block. * cfgloopmanip.c (split_loop_bb): Don't update dominators. (create_preheader): Use make_forwarder_block. (mfb_keep_just, mfb_update_loops): New. * cfgrtl.c (rtl_split_block_after_labels): New. (redirect_edge_with_latch_update): Removed. (rtl_make_forwarder_block): New sematics. (rtl_split_block): Update dominators. (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks): Add rtl_split_block_after_labels. * tree-cfg.c (tree_make_forwarder_block): Changed semantics. (create_blocks_annotations): Removed. (build_tree_cfg): Don't call create_blocks_annotations. (create_bb): Create annotations for a new block. (tree_split_edge): Don't call create_block_annotation. Update irreducible loop information. (tree_loop_optimizer_finalize): Add loop structure check. (tree_redirect_edge_and_branch_1): Return the original edge if no redirecting is neccessary. (tree_split_block): Make the semantics same as for rtl_split_block. (tree_split_block_after_labels, tree_move_block_after): New. (tree_cfg_hooks): Add tree_split_block_after_labels and tree_move_block_after. * cfgloopanal.c (mark_irreducible_loops): Fix. * loop-unswitch.c (unswitch_loop): Fix. * Makefile.in (tree-ssa-loop.o): Add cfgloop.h and tree-inline.h dependency. * jump.c (next_nonnote_insn_in_loop, duplicate_loop_exit_test, copy_loop_headers): Removed. * rtl.h (copy_loop_headers): Declaration removed. * toplev.c (rest_of_compilation): Do not call loop header copying. * tree-dump.c (dump_files): Add .ch dump. * tree-flow.h (tree_duplicate_bb, copy_loop_headers): Declare. * tree-optimize.c (optimize_function_tree): Add loop header copying pass. * tree-ssa-loop.c: Include cfgloop.h and tree-inline.h. (dump_file, dump_flags): Renamed to loop_dump_file and loop_dump_flags. (call_expr_p, should_duplicate_loop_header_p, copy_loop_headers): New. * tree.h (enum tree_dump_index): Add ch dump. * doc/invoke.texi (-fdump-tree-copy-headers): Document. * testsuite/gcc.dg/tree-ssa/20030711-1.c: Update test outcome. * testsuite/gcc.dg/tree-ssa/20030714-2.c: Ditto. * testsuite/gcc.dg/tree-ssa/copy-headers.c: New test. * tree-cfg.c (tree_duplicate_bb): New function. * tree-ssa-loop-im.c: New file. * Makefile.in (tree-ssa-loop-im.o): Add. * params.def (PARAM_LIM_EXPENSIVE): New parameter. * tree-dump.c (dump_files): Move .loop dump. * cfgloop.h (superloop_at_depth, get_loop_body_in_dom_order): Declare. (loop_dump_file, loop_dump_flags): Declare variables. * cfgloop.c (superloop_at_depth, get_loop_body_in_dom_order): New functions. * tree-flow.h (struct stmt_ann_d): Add aux field. (bsi_commit_edge_inserts): Declaration changed. (tree_ssa_lim): Declare. * tree-mudflap.c (mf_xform_derefs_1): Use in_array_bounds_p. * tree-optimize.c (optimize_function_tree): Move loop optimization pass. * tree-sra.c (scalarize_structures): Modified due to bsi_commit_edge_inserts change. * tree-ssa-loop.c (tree_ssa_loop_opt): Call tree_ssa_lim. * tree-ssa.c (rewrite_trees, rewrite_vars_out_of_ssa): Modified due to bsi_commit_edge_inserts change. * tree.c (in_array_bounds_p): New function. * tree.h (in_array_bounds_p): Declare. (enum tree_dump_index): Move loop dump. * tree-cfg.c (bsi_commit_edge_inserts): Don't take update_annotations argument. * tree-ssa.c (rewrite_into_ssa, rewrite_out_of_ssa): Ensure that the closed files are not used. * tree-tailcall.c (find_tail_calls, eliminate_tail_call): Update phi nodes for vdefs of the eliminated call. 2004-01-03 Sebastian Pop * tree-optimize.c (optimize_function_tree): Move the closing brace of DCE2 to the right place. 2004-01-03 Sebastian Pop * tree-vectorizer.c (vect_analyze_operations): Test vectorization_factor before computing modulo. 2004-01-02 Sebastian Pop * tree-vectorizer.c (vect_is_supportable_binop): Returns false instead of NULL. 2004-01-02 Richard Henderson * config/i386/i386.h (UNITS_PER_SIMD_WORD): New. 2004-01-02 Sebastian Pop * tree-data-ref.c (vec_analyze_array, vec_array_base_name_differ_p, array_base_name_differ_p): Removed for fixing the previous patch. 2004-01-02 Richard Henderson * target.h (struct gcc_target): Remove vectype_for_scalar_type. * target-def.h (TARGET_VECTYPE_FOR_SCALAR_TYPE): Remove. * config/rs6000/rs6000.c (rs6000_vectype_for_scalar_type): Remove. (TARGET_VECTYPE_FOR_SCALAR_TYPE): Remove. * tree.c (build_vector_type_with_mode): Rename from make_vector, remove unsignedp argument, update callers. (build_vector_type): New. * tree.h (build_vector_type): Declare it. * tree-vectorizer.c (get_vectype_for_scalar_type): Use it. 2004-01-02 Richard Henderson * tree-scalar-evolution.c (finalize_scalar_evolutions_analyzer): Clear dump_file. 2004-01-02 Sebastian Pop * tree-data-ref.c (vec_analyze_array): Renamed to analyze_array. (analyze_array): Removed. (find_data_references): Adapted to use the new analyze_array function. (array_base_name_differ_p): Moved to tree-data-ref.h. (vec_array_base_name_differ_p): Removed. * tree-data-ref.h (array_base_name_differ_p): Moved here. * tree-vectorizer.c (vect_analyze_data_ref_dependence): Use array_base_name_differ_p instead of vec_array_base_name_differ_p. (vect_analyze_data_refs): Use analyze_array instead of vec_analyze_array. (vectorize_loops): Remove the initializers and finalizers of the scalar evolution analyzer. 2004-01-01 Dorit Naishlos * tree-vectorizer.c: New file. Implements loop vectorization pass. * tree-vectorizer.h: New file. * Makefile.in: (tree-vectorizer.c,tree-vectorizer.h): New files. * tree-dump.c: (dump_files): New dump file for the new vectorization pass. * tree.h: (TDI_vect): New dump index for the new vectorization pass. * timevar.def (TV_TREE_VECTORIZATION): Support new vectorization pass. * opts.c: (flag_tree_vetorize): New flag to enable/disable the new vectorization pass. * flags.h: Same. * toplev.c: Same. * common.opt: (ftree-vectorize): Same. * doc/invoke.texi: Document above new options. * tree-optimize.c: (optimize_function_tree): Invoke the new vetorization pass. * tree-flow.h: (struct stmt_ann_d): New field (aux) to allow recording information per stmt. * tree-data-ref.c (vec_analyze_array): New function, exposing API to the vectorizer. (vec_array_base_name_differ_p): New function, exposing API to the vectorizer. * tree-data-ref.h: Same. * defaults.h: (UNITS_PER_SIMD_WORD): Define. * config/rs6000/rs6000.h: (UNITS_PER_SIMD_WORD): Same. * target-def.h (TARGET_VECTYPE_FOR_SCALAR_TYPE): Declare a new target hook for vectorization. * target.h (vectype_for_scalar_type): Same. * config/rs6000/rs6000.c: (rs6000_vectype_for_scalar_type): Implement the above new target hook. 2003-12-31 Sebastian Pop * version.c (version_string): Change the identifier for the sub-branch. 2003-12-31 Sebastian Pop Daniel Berlin * tree-phinodes.c (create_phi_node): Initialise PHI_MARKED to 0. * tree-scalar-evolution.c (already_visited, node_already_visited_by_ssa_path): Removed. (analyze_evolution): Remove initialisation of already_visited. (construct_schedule): idem. (monev_follow_ssa_edge): use PHI_MARKED for deciding whether to analyze the phi-node. (follow_ssa_edge_and_record_dependences_rec): idem. * tree.h (PHI_MARKED): New macro. (tree_phi_node): Add a field marked. 2003-12-27 Sebastian Pop * Makefile.in (OBJS-common): Added tree-chrec.o tree-scalar-evolution.o, tree-data-ref.o, tree-fold-const.o. (tree-optimize.o): Add dependencies on tree-fold-const.h tree-chrec.h tree-scalar-evolution.h tree-data-ref.h (tree-chrec.o, tree-scalar-evolution.o, tree-data-ref.o, tree-fold-const.o): New rules. * cfgloop.h (loop): New field nb_iterations. (loop_from_num): New function. * common.opt (fscalar-evolutions, fall-data-deps): Added. * flags.h (flag_scalar_evolutions, flag_all_data_deps): Declared. * opts.c (decode_options, common_handle_option): Initialize flag_scalar_evolutions and flag_all_data_deps. * timevar.def (TV_SCALAR_EVOLUTIONS, TV_ALL_DATA_DEPS): New. * toplev.c (flag_scalar_evolutions, flag_all_data_deps): Defined. (lang_independent_options): Add flag_scalar_evolutions and flag_all_data_deps. * tree-dump.c (scev, alldd): New extensions. * tree.h (tree_dump_index): Added TDI_scev and TDI_alldd. * tree-optimize.c (tree-fold-const.h, tree-chrec.h, tree-scalar-evolution.h, tree-data-ref.h): Included. (optimize_function_tree): Added the entry point for the analysis of scalar evolutions and data dependences. * tree-pretty-print.c (tree-fold-const.h, tree-chrec.h): Included. (dump_generic_node): Added code for dumping POLYNOMIAL_CHREC, EXPONENTIAL_CHREC, PERIODIC_CHREC, and INTERVAL_CHREC. * tree.def (INTERVAL_CHREC, POLYNOMIAL_CHREC, EXPONENTIAL_CHREC, PERIODIC_CHREC): New tree nodes. * varray.h (index_in_varray_tree, tree_is_in_varray_tree_p, index_in_varray_int, int_is_in_varray_int_p): New inlined functions. * tree-chrec.c, tree-chrec.h, tree-data-ref.c, tree-data-ref.h, tree-fold-const.c, tree-fold-const.h, tree-scalar-evolution.c, tree-scalar-evolution.h: New files. * doc/invoke.texi (-fdump-scalar-evolutions, -fdump-all-data-deps): Documented. * testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-[01..50].c : New testcases. * testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-[01..50].c.scev: Expected outputs for the scalar evolution analyzer. * testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-{10, 30, 31, 32, 33, 34, 35, 36}.c.alldd: Expected outputs for the data dependence analyzer. * testsuite/gcc.dg/tree-ssa-chrec/tree-ssa-scev.exp: New file. * testsuite/lib/scantree.exp (diff-tree-dumps): New procedure. * ChangeLog.lno: New file.