aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2005-04-01Merge mainline->tcb as of 2005-03-29.tree-cleanup-branchDiego Novillo
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@97408 138bc75d-0d04-0410-961f-82ee72b054a4
2005-04-01This commit was manufactured by cvs2svn to create branchno-author
'tree-cleanup-branch'. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@97371 138bc75d-0d04-0410-961f-82ee72b054a4
2005-03-26 * tree-into-ssa.c (prepare_def_sites): If a new name has beenDiego Novillo
marked to be released, remove it from NEW_SSA_NAMES. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@97080 138bc75d-0d04-0410-961f-82ee72b054a4
2005-03-26 * domwalk.c (walk_dominator_tree): Fix typo.Diego Novillo
* tree-dfa.c (mark_new_vars_to_rename): Remove second argument. Update all callers. (mark_call_clobbered_vars_to_rename): Remove. Update all callers. * tree-flow.h (remove_all_phi_nodes_for): Remove. (find_phi_node_for): Declare. (rewrite_into_ssa): Remove external declaration. Update users to call update_ssa instead. (rewrite_def_def_chains): Remove. (mark_sym_for_renaming): Declare. (mark_set_for_renaming): Declare. * tree-into-ssa.c (syms_to_rename): New local variable. (names_to_release): New local variable. (need_to_replace_names_p): New local variable. (enum rewrite_mode): Remove REWRITE_FIX_DEF_DEF_CHAINS. (symbol_marked_for_renaming): Only accept DECL nodes. (is_old_name): New function. Update every user of OLD_SSA_NAMES. (is_new_name): New function. Update every user of NEW_SSA_NAMES. (add_new_name_mapping): If NEW is a virtual, just mark its symbol for renaming. (prepare_use_operand_for_rename): Remove. Update all users. (prepare_def_operand_for_rename): Remove. Update all users. (mark_def_sites): Initialize REGISTER_DEFS_IN_THIS_STMT flag. (insert_phi_nodes_for): Add more documentation. (insert_phi_nodes_1): Move body ... (insert_phi_nodes): ... here. Remove second argument. Do not check for 'names_to_rename' nor 'vars_to_rename'. (rewrite_operand): Remove. Update all users. (rewrite_stmt): Do nothing if REGISTER_DEFS_IN_THIS_STMT is not set. Assert that all operands are DECL nodes. (rewrite_virtual_phi_arguments): Remove. (replace_use): New local function. (rewrite_update_stmt): Call it. (rewrite_update_phi_arguments): Handle NULL arguments separately. (mark_def_site_blocks): Move call to calculate_dominance_info... (rewrite_into_ssa): ... here. Remove argument. Make static. Re-organize for clarity. (rewrite_all_into_ssa): Remove. Update all users. (pass_build_ssa): Call rewrite_into_ssa instead of rewrite_all_into_ssa. (rewrite_def_def_chains): Remove. Update all users. (prepare_phi_args_for_update): Remove unreachable code. Add more documentation. (prepare_block_for_update): Add more documentation. (remove_name_from_mappings): Remove. (prepare_def_site_for): Do not call remove_name_from_mappings. Assert that NAME is not in the free list. (prepare_def_sites): If any symbol in SYMS_TO_RENAME is a virtual, set NEED_TO_UPDATE_VOPS_P to true. (dump_names_replaced_by): Do not test for removed names. (dump_repl_tbl): Re-arrange output. Dump names that are marked to be released after update_ssa. (init_update_ssa): Initialize NEED_TO_REPLACE_NAMES_P, SYMS_TO_RENAME and NAMES_TO_RELEASE. (delete_update_ssa): Release all the names in NAMES_TO_RELEASE. (mark_sym_for_renaming): New function. Update every function that used to test and set VARS_TO_RENAME. (mark_set_for_renaming): New function. (need_ssa_update_p): Return true if any of SYMS_TO_RENAME, OLD_SSA_NAMES or NEW_SSA_NAMES are not NULL. (release_ssa_name_after_update_ssa): New function. (insert_updated_phi_nodes_for): Do not prune IDF if inserting PHI nodes for a symbol in SYMS_TO_RENAME. If VAR is in SYMS_TO_RENAME, remove any existing PHI nodes from blocks not in PRUNED_IDF. (update_ssa): Only call insert_updated_phi_nodes_for if OLD_SSA_NAMES is not empty. * tree-optimize.c (vars_to_rename): Remove. Update all users. (execute_todo): Call update_ssa instead of rewrite_into_ssa and rewrite_def_def_chains. * tree-pass.h (vars_to_rename): Remove. * tree-phinodes.c (find_phi_node_for): New function. (remove_all_phi_nodes_for): Remove. * tree-sra.c (decide_instantiations): Mark all symbols in SRA_CANDIDATES for renaming. (mark_all_v_defs_1): Rename from mark_all_v_defs. (mark_all_v_defs): New function. Update all users to call it with the whole list of scalarized statements, not just the first one. * tree-ssa-alias.c (add_type_alias): Also mark TAG's aliases for renaming. If VAR has aliases of its own, mark them for renaming as well. * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): Call update_ssa. * tree-ssa-loop-manip.c (find_uses_to_rename_use): Ignore virtual operands. (tree_duplicate_loop_to_header_edge): Do not call update_ssa. Update callers. Update documentation. (lv_adjust_loop_header_phi): Assert that both blocks have the same number of PHI nodes. (tree_ssa_loop_version): Call update_ssa. * tree-ssa.c (verify_ssa): Assert that we don't need to call update_ssa. (delete_tree_ssa): Likewise. * tree-ssanames.c (release_ssa_name): Call release_ssa_name_after_update_ssa if VAR was registered to be updated. * tree-vect-transform.c (vect_create_data_ref_ptr): Call add_type_alias if TAG has a different alias set number than the type pointed-to by VECT_PTR. Add documentation. (vect_transform_loop): Call update_ssa. * tree.h (PHI_REWRITTEN): Remove. (struct tree_phi_node): Remove field 'rewritten'. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@97078 138bc75d-0d04-0410-961f-82ee72b054a4
2005-03-23mainline->tcb merge as of 2005-03-22.Diego Novillo
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@96950 138bc75d-0d04-0410-961f-82ee72b054a4
2005-03-23This commit was manufactured by cvs2svn to create branchno-author
'tree-cleanup-branch'. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@96949 138bc75d-0d04-0410-961f-82ee72b054a4
2005-03-18 * tree-ssa-copy.c (may_propagate_copy): Disable code toDiego Novillo
prevent copies being pulled from deeper nested loops. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@96702 138bc75d-0d04-0410-961f-82ee72b054a4
2005-03-18 * tree-into-ssa.c (ssa_rewrite_finalize_block): Remove.Diego Novillo
(ssa_register_new_def): Remove. (ssa_rewrite_stmt): Remove. (ssa_rewrite_phi_arguments): Remove. (ssa_rewrite_initialize_block): Remove. (ssa_mark_def_sites): Remove. (ssa_mark_def_sites_initialize_block): Remove. (ssa_mark_phi_uses): Remove. (rewrite_ssa_into_ssa): Remove. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@96688 138bc75d-0d04-0410-961f-82ee72b054a4
2005-03-182005-03-18 Diego Novillo <dnovillo@redhat.com>Diego Novillo
* Makefile.in (tree-into-ssa.o): Remove dependency on pointer-set.h. (tree-cfg.o): Add dependency on vec.h. * lambda-code.c (perfect_nestify): Mark for SSA updating any virtual operands in the moved statement. * tree-flow.h (rewrite_to_new_ssa_names_bb, rewrite_to_new_ssa_names, allocate_ssa_names, rewrite_ssa_into_ssa): Remove. (update_ssa, register_new_name_mapping, create_new_def_for, need_ssa_update_p, name_registered_for_update_p, dump_repl_tbl, debug_repl_tbl, dump_names_replaced_by, debug_names_replaced_by): Declare. (loop_depth_of_name): Declare. * tree-into-ssa.c: Don't include pointer-set.h. (old_ssa_names, new_ssa_names): Convert to sbitmap. (NAME_SETS_GROWTH_FACTOR): Declare. (struct new_to_old_d): Remove. Update all users. (new_to_old): Remove. Update all users. (struct repl_map_d): Declare. (repl_tbl): Declare. (need_to_initialize_update_ssa_p): Declare. (need_to_update_vops_p): Declare. (REGISTER_DEFS_IN_THIS_STMT): Use tree_common.unsigned_flag instead of TREE_ADDRESSABLE. (set_def_block): Remove argument 'is_update'. Update all callers. (symbol_marked_for_renaming): New function. (repl_map_hash): Rename from new_to_old_hash. (repl_map_eq): Rename from new_to_old_eq. (repl_map_free): New function. (names_replaced_by): New function. (mark_sym_for_renaming): New function. (add_to_repl_tbl): New function. (name_replaced_by): Remove. (add_new_name_mapping): Resize OLD_SSA_NAMES and NEW_SSA_NAMES if needed. If NEW is a virtual variable, call mark_sym_for_renaming. Call add_to_repl_tbl. (prepare_def_operand_for_rename): Only accept _DECL nodes. (mark_def_sites): Fix call to prepare_def_operand_for_rename. Do not rewrite def operands. (find_idf): Ignore NULL blocks pulled from the work list. (get_default_def_for): New function. (get_reaching_def): Call it. (insert_phi_nodes_for): Check that find_def_blocks_for returns non-NULL. Fix assignment to SYM. Only call add_new_name_mapping and add arguments if UPDATE_P is true. Mark PHI for renaming. (register_new_update_single): Rename from register_new_update. (register_new_update_set): New function. (rewrite_update_init_block): Update comments. Add support for renaming virtual operands. (rewrite_update_stmt): Likewise. (rewrite_update_phi_arguments): Likewise. (rewrite_def_def_chains): Do not call calculate_dominance_info. (mark_def_interesting): New function. (mark_use_interesting): New function. (prepare_phi_args_for_update): (prepare_block_for_update): Add support for virtual operands. Call mark_def_interesting, mark_use_interesting and prepare_phi_args_for_update. (remove_name_from_mappings): New function. (prepare_def_site_for): New function. (prepare_def_sites): New function. (dump_names_replaced_by): New function. (debug_names_replaced_by): New function. (dump_repl_tbl): New function. (debug_repl_tbl): New function. (remove_non_dominated): Remove. (init_update_ssa): New function. (delete_update_ssa): New function. (create_new_def_for): New function. (register_new_name_mapping): New function. (need_ssa_update_p): New function. (name_registered_for_update_p): New function. (insert_updated_phi_nodes_for): New function. (update_ssa): Update documentation. Do nothing if there is no need to update the SSA web. Call prepare_def_sites. Call prepare_block_for_update with the nearest common dominator of all new and old definition sites and on all the blocks in the dominance frontier of that block. Call insert_updated_phi_nodes_for with old SSA names and symbols marked for renaming. * tree-loop-linear.c (linear_transform_loops): Remove call to rewrite_into_ssa. * tree-ssa-ccp.c (get_default_value): Set VAL.MEM_REF to SYM when getting DECL_INITIAL from a const global variable. * tree-ssa-copy.c (may_propagate_copy): Do not allow propagations that pull a copy out of a deeper nested loop. * tree-ssa-dom.c (loop_depth_of_name): Declare extern. * tree-ssa-loop-im.c (move_computations): Clear VARS_TO_RENAME before calling rewrite_into_loop_closed_ssa. * tree-ssa-operands.c (copy_virtual_operands): Remove. * tree-ssa-operands.h (copy_virtual_operands): Remove. * tree-vectorizer.c (allocate_new_names, rename_use_op, rename_def_op, rename_variables_in_bb, free_new_names, rename_variables_in_loop): Remove. (slpeel_update_phis_for_duplicate_loop): Remove variables new_name_ptr, new_ssa_name and new_loop_exit_e. Do not try to update PHIs for duplicate loop. (slpeel_update_phi_nodes_for_guard): Do nothing if UPDATE_BB is the same as ORIG_BB. (slpeel_can_duplicate_loop_p): Call need_ssa_update_p instead of any_marked_for_rewrite_p. (slpeel_tree_peel_loop_to_edge): Call update_ssa. * tree.h: * testsuite/gcc.c-torture/execute/20030216-1.x: 2005-03-18 Zdenek Dvorak <dvorakz@suse.cz> Diego Novillo <dnovillo@redhat.com> * Makefile.in: (tree-cfg.o): Add dependency on vec.h. * tree-cfg.c: Include vec.h. (tree_duplicate_bb): Call create_new_def_for for newly created PHI nodes. Remove call to copy_virtual_operands. Mark any newly exposed virtual symbol for renaming. (struct ssa_name_map_entry): Remove. (ssa_name_map_entry_hash): Remove. (ssa_name_map_entry_eq): Remove. (allocate_ssa_names): Remove. (rewrite_to_new_ssa_names_def): Remove. (rewrite_to_new_ssa_names_use): Remove. (rewrite_to_new_ssa_names_bb): Remove. (rewrite_to_new_ssa_names): Remove. (tree_duplicate_sese_region): Remove variables ver, definitions, phi, ssa_name_map and bi. Call need_ssa_update_p instead of any_marked_for_rewrite_p. Call update_ssa. * tree-ssa-dom.c (tree_ssa_dominator_optimize): Call update_ssa instead of rewrite_ssa_into_ssa. * tree-ssa-loop-manip.c (add_exit_phis_edge): Call create_new_def_for. (find_uses_to_rename_use): Add argument 'need_phis'. (find_uses_to_rename_stmt): Do not scan virtual operands. (find_uses_to_rename): Only scan PHI nodes for non-virtual names. (rewrite_into_loop_closed_ssa): Call update_ssa. (check_loop_closed_ssa_use): Ignore virtual operands. (check_loop_closed_ssa_stmt): Likewise. (verify_loop_closed_ssa): Do nothing if CURRENT_LOOPS is NULL. (rename_variables, set_phi_def_stmts): Remove. (tree_duplicate_loop_to_header_edge): Reformat comment. Remove variables bb, i and definitions. Call need_ssa_update_p. Call update_ssa. (lv_adjust_loop_header_phi): Reformat comment. * tree-ssanames.c (ssa_names_to_rewrite): Remove. (marked_for_rewrite_p, any_marked_for_rewrite_p, mark_for_rewrite, unmark_all_for_rewrite, marked_ssa_names): Remove. Update all users. (release_ssa_name): If VAR has been registered for SSA updating, do nothing. * tree-vrp.c (new_ssa_names, old_ssa_names): Remove. (build_assert_expr_for): Call register_new_name_mapping. (insert_range_assertions): Update call to update_ssa. * tree.h (mark_for_rewrite, unmark_all_for_rewrite, marked_for_rewrite_p, any_marked_for_rewrite_p, marked_ssa_names): Remove. testsuite/ChangeLog.tcb 2005-03-18 Diego Novillo <dnovillo@redhat.com> * gcc.c-torture/execute/20030216-1.x: New file. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@96687 138bc75d-0d04-0410-961f-82ee72b054a4
2005-02-27 Merge from mainlineDiego Novillo
* tree-into-ssa.c (insert_phi_nodes_for): Do not use REWRITE_THIS_STMT markers on PHI nodes. (rewrite_initialize_block): Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@95623 138bc75d-0d04-0410-961f-82ee72b054a4
2005-02-24 Merge from mainline (tree-cleanup-merge-20050223)Diego Novillo
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@95478 138bc75d-0d04-0410-961f-82ee72b054a4
2005-02-24This commit was manufactured by cvs2svn to create branchno-author
'tree-cleanup-branch'. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@95477 138bc75d-0d04-0410-961f-82ee72b054a4
2005-02-22 * domwalk.c (walk_dominator_tree): If block BB is not in theDiego Novillo
set of interesting blocks, do not traverse its statements. * domwalk.h (struct dom_walk_data): Add field INTERESTING_BLOCKS. * tree-flow.h (update_ssa): Add new bool argument. * tree-into-ssa.c (struct mark_def_sites_global_data): Fix comment. Add field interesting_blocks. (compute_global_livein): Use last_basic_block to initialize work lists. (find_idf): Likewise. (mark_def_sites): If the statement is going to be rewritten, add the block to GD->INTERESTING_BLOCKS. (rewrite_blocks): Add argument BLOCKS. Initialize WALK_DATA.INTERESTING_BLOCKS with it. Update all callers. Move debug dumping code from rewrite_into_ssa. Only delete DEF_BLOCKS if it had been allocated. (mark_def_site_blocks): Add argument INTERESTING_BLOCKS. Initialize MARK_DEF_SITES_GLOBAL_DATA.INTERESTING_BLOCKS with it. Update all callers. (prepare_block_for_update): Add arguments INSERT_PHI_P and INTERESTING_BLOCKS. Only call set_def_block/set_livein_block if INSERT_PHI_P is true. Update all callers. If the block contains at least one interesting statement, add the block to INTERESTING_BLOCKS. (update_ssa): Add argument INSERT_PHI_P. Only add new PHI nodes if INSERT_PHI_P is true. Update all callers. Initialize INTERESTING_BLOCKS. * tree-ssa-dom.c (tree_ssa_dominator_optimize): Initialize WALK_DATA.INTERESTING_BLOCKS to NULL. * tree-ssa-dse.c (tree_ssa_dse): Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@95394 138bc75d-0d04-0410-961f-82ee72b054a4
2005-02-18 PR tree-optimization/18178Diego Novillo
* Makefile.in (tree-vrp.o): Depend on CFGLOOP_H, tree-scalar-evolution.h and tree-chrec.h. * tree-into-ssa.c (prepare_block_for_update): Also rewrite operands of statements that define new names. * tree-vrp.c: Include cfgloop.h, tree-scalar-evolution.h and tree-chrec.h. (cfg_loops): New local variable. (compare_values): Forward declare. (copy_value_range): Remove. (set_value_range): Add range integrity checks. Decay to VR_VARYING ranges that take all possible values in the type domain. (compare_values): Do some symbolic comparisons. (value_inside_range): Move earlier in the file. (value_ranges_intersect_p): Likewise. (extract_range_from_assert): If the ASSERT_EXPR conditional and the variable have intersecting ranges, use the intersection to derive a narrower range. (extract_range_from_ssa_name): New function. (extract_range_from_binary_expr): Re-arrange to always call set_value_range to set the newly computed range. (extract_range_from_unary_expr): Likewise. Do not special case ABS_EXPR. If a type cast operation changes to a type of different size, set the resulting range to VR_VARYING. If the new range has the limits swapped around, set the result to VR_VARYING. (extract_range_from_expr): Call extract_range_from_ssa_name. (compare_ranges): Allow symbolic ranges. Fix calls to compare_values to always check for specific return values. (compare_range_with_value): Likewise. (adjust_range_with_scev): New function. (vrp_visit_assignment): Call it if the statement is inside a loop. (vrp_meet): Always call set_value_range to set the newly computed range. (vrp_visit_phi_node): Remove FIXME regarding derivation. (execute_vrp): Call loop_optimizer_init, scev_initialize, scev_finalize and loop_optimizer_finalize. testsuite/ChangeLog.tcb: * testsuite/gcc.dg/tree-ssa/ssa-pre-2.c: Adjust expected pattern. * testsuite/gcc.dg/tree-ssa/ssa-pre-3.c: Likewise. * testsuite/gcc.dg/tree-ssa/ssa-pre-4.c: Likewise. * testsuite/gcc.dg/tree-ssa/ssa-pre-5.c: Likewise. * testsuite/gcc.dg/tree-ssa/ssa-pre-6.c: Likewise. PR tree-optimization/18178 * testsuite/g++.dg/tree-ssa/pr18178.C: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@95236 138bc75d-0d04-0410-961f-82ee72b054a4
2005-02-17mainline->tcb merge as of 2005-02-16.Diego Novillo
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@95170 138bc75d-0d04-0410-961f-82ee72b054a4
2005-02-17This commit was manufactured by cvs2svn to create branchno-author
'tree-cleanup-branch'. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@95169 138bc75d-0d04-0410-961f-82ee72b054a4
2005-02-14 * tree-into-ssa.c (REGISTER_DEFS_IN_STMT): Define.Diego Novillo
(insert_phi_nodes_for): Mark with REGISTER_DEFS_IN_STMT. (rewrite_update_init_block): Only register the LHS of PHI nodes marked with REGISTER_DEFS_IN_STMT. (rewrite_update_stmt): Likewise. Do not update use operands of statements that are not marked with REWRITE_THIS_STMT. (prepare_block_for_update): Mark with REGISTER_DEFS_IN_STMT statements that define new names. Only mark statements with REWRITE_THIS_STMT if they reference old names and do not define new names. * tree-ssa-copy.c (get_last_copy_of): Limit the amount of copy-of traversal. (copy_prop_visit_assignment): Get the copy-of value from the RHS to avoid creating long copy-of chains. (copy_prop_visit_phi_node): Do the opposite. Use the arguments themselves as the initial link in the copy-of chain. (fini_copy_prop): Fix comment. * tree-ssa-dom.c (tree_ssa_dominator_optimize): Add getenv hackery to allow disabling DOM at compile time. (propagate_to_outgoing_edges): Likewise. (simplify_cond_and_lookup_avail_expr): Guard for NULL low and high. * tree-ssa-pre.c (phi_translate): Handle tcc_comparison. (valid_in_set): Likewise. (find_or_generate_expression): Likewise. (create_expression_by_pieces): Likewise. (insert_into_preds_of_block): Likewise. (insert_aux): Likewise. (create_value_expr_from): Likewise. (compute_avail): Likewise. Handle TREE_INVARIANT values. Re-order checks to check for expressions first. (execute_pre): Change formatting of stats messages. * tree-vn.c (set_value_handle): Handle TREE_INVARIANT. (get_value_handle): Likewise. * tree-vrp.c (expr_computes_nonnull): Recognize address of references. (extract_range_from_assert): Don't build unnecessary constants. (extract_range_from_binary_expr): Pointer arithmetic may include operations other than + or -. (extract_range_from_unary_expr): Set cast operations of anti-ranges to VARYING. (build_assert_expr_for): Fix comments. (maybe_add_assert_expr): When a predicate involves more than one name, only add assertions for the first one. (vrp_finalize): Support TDF_STATS. testsuite/ChangeLog.tcb: * gcc.dg/tree-ssa/20031022-1.c: Adjust dump file to scan. * gcc.dg/tree-ssa/ssa-pre-1.c: Adjust expected pattern. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@95011 138bc75d-0d04-0410-961f-82ee72b054a4
2005-02-06 Value Range PropagationDiego Novillo
* Makefile.in (tree-vrp.o): Depend on tree-ssa-propagate.h, $(FLAGS_H) and $(TREE_DUMP_H). * common.opt (ftree-vrp): Define. * opts.c (decode_options): Set flag_tree_vrp at -O2. * timevar.def (TV_TREE_INSERT_ASSERT): Remove. (TV_TREE_VRP): Define. * tree-flow.h (enum value_range_type): Define. (struct value_range_def): Define. (count_uses_and_derefs): Declare. (get_value_range): Declare. (dump_value_range): Declare. (debug_value_range): Declare. (dump_all_value_ranges): Declare. (debug_all_value_ranges): Declare. * tree-optimize.c (init_tree_optimization_passes): Remove pass_insert_range_assertions and pass_remove_range_assertions. Add pass_vrp. * tree-pass.h (pass_insert_range_assertions): Remove. (pass_remove_range_assertions): Remove. (pass_vrp): Define. * tree-ssa-alias.c (count_ptr_derefs): Make extern. * tree.h (SSA_NAME_VALUE_RANGE): Define. (struct value_range_def): Forward declare. (struct tree_ssa_name): Add field value_range. * tree-vrp.c: Include flags.h, tree-dump.h and tree-ssa-propagate.h. (new_ssa_names): Declare. (old_ssa_names): Declare. (found): Declare. (get_opposite_operand): New. (opposite_comparison): New. (copy_value_range): New. (set_value_range): New. (update_value_range): New. (get_value_range): New. (symbolic_range_p): New. (expr_computes_nonnull): New. (range_is_nonnull): New. (range_is_null): New. (set_value_range_to_nonnull): New. (set_value_range_to_null): New. (compare_values): New. (extract_range_from_assert): New. (extract_range_from_binary_expr): New. (extract_range_from_unary_expr): New. (extract_range_from_expr): New. (compare_ranges): New. (compare_range_with_value): New. (value_inside_range): New. (value_ranges_intersect_p): New. (dump_value_range): New. (debug_value_range): New. (dump_all_value_ranges): New. (debug_all_value_ranges): New. (build_assert_expr_for): Create a new SSA name for every assertion. If the conditional is an equality, create a regular assignment. Push the new name into NEW_SSA_NAMES. Push the operand into OLD_SSA_NAMES. (infer_value_range): New. (has_assert_expr): New. (maybe_add_assert_expr): Add ASSERT_EXPR after pointer dereferences. Handle cases that require inserting after the last statement of a block. Call has_assert_expr and infer_value_range. (insert_range_assertions): Rename from execute_insert_range_assertions. Initialize new_ssa_names and old_ssa_names. Do not use BB_VISITED to mark visited blocks. (pass_insert_range_assertions): Remove. (remove_range_assertions): Rename from execute_remove_range_assertions. (pass_remove_range_assertions): Remove. (stmt_interesting_for_vrp): New. (need_imm_uses_for): New. (vrp_initialize): New. (vrp_visit_assignment): New. (vrp_evaluate_conditional): New. (vrp_visit_cond_stmt): New. (vrp_visit_stmt): New. (vrp_meet): New. (vrp_visit_phi_node): New. (vrp_finalize): New. (execute_vrp): New. (gate_vrp): New. (pass_vrp): Declare. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@94676 138bc75d-0d04-0410-961f-82ee72b054a4
2005-02-06 * Makefile.in (tree-into-ssa.o): Depend on pointer-set.hDiego Novillo
* timevar.def (TV_TREE_SSA_INCREMENTAL): Define. * tree-flow.h (update_ssa): Declare. * tree-into-ssa.c: Include pointer-set.h. (old_ssa_names): Declare. (new_ssa_names): Declare. (struct new_to_old_d): Declare. (new_to_old): Declare. (enum rewrite_mode): Declare. (new_to_old_hash): New. (new_to_old_eq): New. (add_new_name_mapping): New. (name_replaced_by): New. (insert_phi_nodes_for): Add argument 'update_p'. If update_p is true, add a new mapping from the LHS of the PHI node to the name given in 'var'. (insert_phi_nodes_1): Update call to insert_phi_nodes_for. (register_new_update): New. (rewrite_update_init_block): New. (rewrite_update_fini_block): New. (rewrite_update_stmt): New. (rewrite_update_phi_arguments): New. (rewrite_blocks): Remove argument 'fix_virtual_phis'. Add arguments 'entry' and 'what'. Use 'what' to register the call-backs used for REWRITE_UPDATE, REWRITE_ALL and REWRITE_DEF_DEF_CHAINS. Start re-writing at block 'entry'. (rewrite_into_ssa): Call rewrite_blocks with ENTRY_BLOCK_PTR and REWRITE_ALL. (rewrite_def_def_chains): Call rewrite_blocks with ENTRY_BLOCK_PTR and REWRITE_FIX_DEF_DEF_CHAINS. (prepare_block_for_update): New. (remove_non_dominated): New. (update_ssa): New. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@94675 138bc75d-0d04-0410-961f-82ee72b054a4
2005-02-06 * basic-block.h (nearest_common_dominator): Declare.Diego Novillo
* dominance.c (nearest_common_dominator): New. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@94674 138bc75d-0d04-0410-961f-82ee72b054a4
2005-02-06 * tree.h (ASSERT_EXPR_VAR): Define.Diego Novillo
(ASSERT_EXPR_COND): Define. * tree-cfg.c (verify_expr): Use * tree-pretty-print.c (dump_generic_node): Use. * tree-scalar-evolution.c (follow_ssa_edge_in_rhs): Use. (interpret_rhs_modify_expr): Use. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@94673 138bc75d-0d04-0410-961f-82ee72b054a4
2005-02-02 * tree-into-ssa.c: Reorganize internal functions.Diego Novillo
(find_idf): Extract from ... (insert_phi_nodes): ... here. (insert_phi_nodes_1): Call find_idf. * tree-phinodes.c (ideal_phi_node_len): Fix comment. * tree-ssa.c (verify_use): Fix error message. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@94596 138bc75d-0d04-0410-961f-82ee72b054a4
2005-02-02mainline->tcb merge as of 2005-02-01.Diego Novillo
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@94585 138bc75d-0d04-0410-961f-82ee72b054a4
2005-02-02This commit was manufactured by cvs2svn to create branchno-author
'tree-cleanup-branch'. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@94584 138bc75d-0d04-0410-961f-82ee72b054a4
2005-01-14mainline -> tcb merge as of 2005-01-14.Diego Novillo
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@93656 138bc75d-0d04-0410-961f-82ee72b054a4
2005-01-14This commit was manufactured by cvs2svn to create branchno-author
'tree-cleanup-branch'. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@93655 138bc75d-0d04-0410-961f-82ee72b054a4
2005-01-10mainline -> tcb merge as of 2005-01-08.Diego Novillo
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@93129 138bc75d-0d04-0410-961f-82ee72b054a4
2005-01-10This commit was manufactured by cvs2svn to create branchno-author
'tree-cleanup-branch'. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@93128 138bc75d-0d04-0410-961f-82ee72b054a4
2005-01-06 * Makefile.in (collect2.o-warn): Remove.Diego Novillo
* tree-optimize.c (init_tree_optimization_passes): Schedule pass_insert_range_assertions after pass_referenced_vars. * tree-vrp.c (opposite_comparison): Remove. (build_assert_exprs): Remove. (negate_assert_exprs): Remove. (build_assert_expr_for): New function. (maybe_add_assert_expr_on_edges): New function. (execute_insert_range_assertions): Change linear traversal of basic blocks to a recursive call maybe_add_assert_expr_on_edges for the edges going out of ENTRY_BLOCK_PTR. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@93007 138bc75d-0d04-0410-961f-82ee72b054a4
2004-12-29mainline -> tcb merge as of 2004-12-29.Diego Novillo
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@92713 138bc75d-0d04-0410-961f-82ee72b054a4
2004-12-29This commit was manufactured by cvs2svn to create branchno-author
'tree-cleanup-branch'. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@92712 138bc75d-0d04-0410-961f-82ee72b054a4
2004-12-15 Add expression assertions to GIMPLE.Diego Novillo
* tree-vrp.c: New file. * tree.def (ASSERT_EXPR): Define. * Makefile.in (collect2.o): Compile with -Wno-error. (tree-vrp.o): New rule. (OBJS-common): Add tree-vrp.o. * timevar.def (TV_TREE_INSERT_ASSERT): Define. * fold-const.c (fold): Handle ASSERT_EXPR. * tree-cfg.c (verify_expr): Likewise. * tree-gimple.c (is_gimple_formal_tmp_rhs): Likewise. * tree-inline.c (estimate_num_insns_): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. * tree-scalar-evolution.c (follow_ssa_edge_in_rhs): Likewise. (interpret_rhs_modify_expr): Likewise. * tree-ssa-dom.c (record_equivalences_from_stmt): Likewise. * tree-ssa-operands.c (get_expr_operands): Likewise. * tree-ssa-ccp.c (likely_value): Likewise. (pass_ccp): Add TODO_cleanup_cfg to todo_flags_finish. * tree-optimize.c (init_tree_optimization_passes): Schedule pass_insert_range_assertions and pass_remove_range_assertions. * tree-pass.h (pass_insert_range_assertions): Declare. (pass_remove_range_assertions): Declare. * tree-ssa-copy.c (stmt_may_generate_copy): Remove unnecessary checks for aliased loads and aliased stores. testsuite/ChangeLog.tcb * gcc.dg/tree-ssa/cfgcleanup-1.c: Expect output at DCE2. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@92175 138bc75d-0d04-0410-961f-82ee72b054a4
2004-12-11 * tree-flow-inline.h (clear_call_clobbered): New function.Diego Novillo
* tree-ssa-alias.c (init_alias_info): Call it. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@92028 138bc75d-0d04-0410-961f-82ee72b054a4
2004-12-11mainline -> tcb merge as of 2004-12-10.Diego Novillo
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@92026 138bc75d-0d04-0410-961f-82ee72b054a4
2004-12-11This commit was manufactured by cvs2svn to create branchno-author
'tree-cleanup-branch'. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@92025 138bc75d-0d04-0410-961f-82ee72b054a4
2004-12-10 * tree-into-ssa.c (REWRITE_THIS_STMT): Define.Diego Novillo
(mark_def_sites): Clear REWRITE_THIS_STMT for statements that don't need any operands rewritten. (rewrite_stmt): Ignore statements that don't need to be rewritten. (rewrite_operand): Validate that an existing SSA_NAME is identical to the current reaching definition of the operand. * tree-sra.c (mark_all_v_defs): Also mark VUSEs for renaming. * tree-vectorizer.c (vectorizable_load): Mark call-clobbered variables for renaming if we just introduced a CALL_EXPR. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@92001 138bc75d-0d04-0410-961f-82ee72b054a4
2004-12-08 * tree-if-conv.c (find_phi_replacement_condition): New parameter, loop.Devang Patel
While selecting replacement condition pay attention to loop header. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@91908 138bc75d-0d04-0410-961f-82ee72b054a4
2004-12-06*** empty log message ***Diego Novillo
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@91767 138bc75d-0d04-0410-961f-82ee72b054a4
2004-12-06This commit was manufactured by cvs2svn to create branchno-author
'tree-cleanup-branch'. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@91766 138bc75d-0d04-0410-961f-82ee72b054a4
2004-11-292004-11-22 Daniel Berlin <dberlin@dberlin.org>Daniel Berlin
Patch by Zdenek Dvorak (dvorakz@suse.cz) * Makefile.in (tree-optimize.o): Add $(CFGLOOP_H). * cfgloop.c (flow_loop_nodes_find): Make non-static. * cfgloop.h (fix_loop_structure): New prototype. * cfgloopmanip.c (fix_loop_structure): New function. * tree-cfg.c (cleanup_tree_cfg_loop): New function. (tree_can_merge_blocks_p): Protect loop latches when current_loops is non-NULL. (remove_bb): Handle updating of loop structure when current_loops is non-NULL. (tree_forwarder_block_p): Protect loop latches, headers, and preheaders when current_loops is non-NULL. * tree-flow.h (cleanup_tree_cfg_loop): New prototype. * tree-loop-linear (linear_transform_loops): The loop array may have nulls in it. * tree-optimize.c (init_tree_optimization_passes): Add CCP and copy-prop after loop-init. (execute_todo): Run cleanup_tree_cfg_loop when current_loops is non-NULL. * tree-ssa-copy.c (fini_copy_prop): Remove call to cleanup_tree_cfg. (pass_copy_prop): Add TODO_cleanup_cfg. * tree-ssa-loop-ivcanon.c (cnaonicalize_induction_variables): Remove call to cleanup_tree_cfg_loop. (tree_unroll_loops_completely): Ditto. * tree-ssa-loop-unswitch.c (tree_ssa_unswitch_loops): Ditto. * tree-ssa-loop.c (pass_unswitch): Add TODO_cleanup_cfg. (pass_iv_canon): Ditto. (pass_complete_unroll): Ditto. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@91497 138bc75d-0d04-0410-961f-82ee72b054a4
2004-11-18Mainline merge as of 2004-11-17.Diego Novillo
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@90848 138bc75d-0d04-0410-961f-82ee72b054a4
2004-11-18This commit was manufactured by cvs2svn to create branchno-author
'tree-cleanup-branch'. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@90847 138bc75d-0d04-0410-961f-82ee72b054a4
2004-11-05Mainline merge as of 2004-11-04.Diego Novillo
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@90132 138bc75d-0d04-0410-961f-82ee72b054a4
2004-11-05This commit was manufactured by cvs2svn to create branchno-author
'tree-cleanup-branch'. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@90131 138bc75d-0d04-0410-961f-82ee72b054a4
2004-10-24Mainline merge as of 2004-10-24.Diego Novillo
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@89510 138bc75d-0d04-0410-961f-82ee72b054a4
2004-10-24This commit was manufactured by cvs2svn to create branchno-author
'tree-cleanup-branch'. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@89509 138bc75d-0d04-0410-961f-82ee72b054a4
2004-10-20 * tree-ssa-copy.c (copy_prop_visit_phi_node): AlwaysDiego Novillo
start with a nil copy-of value. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@89315 138bc75d-0d04-0410-961f-82ee72b054a4
2004-10-19 * tree-ssa-ccp.c (replace_vuses_in): Revert inadvertentDiego Novillo
early return. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@89302 138bc75d-0d04-0410-961f-82ee72b054a4
2004-10-19 * common.opt (-ftree-store-copy-prop): New flag.Diego Novillo
* opts.c (decode_options): Enable STORE-COPY-PROP at O2. * timevar.def (TV_TREE_STORE_COPY_PROP): Define. * tree-flow.h (execute_copy_prop): Add boolean argument. * tree-optimize.c (init_tree_optimization_passes): Schedule STORE-COPY-PROP after SRA. * tree-pass.h (pass_store_copy_prop): Declare. * tree-ssa-ccp.c (set_lattice_value): Fix typo in comment. (replace_uses_in): Call may_propagate_copy before doing the final propagation. (replace_vuses_in): Call get_value_loaded_by. (ccp_lattice_meet): Do not test for memory reference equality if DO_STORE_CCP is false. (ccp_fold): Call get_value_loaded_by. (visit_assignment): Likewise. Set all the virtual definitions in the statement to the newly computed value. (ccp_visit_stmt): Reformat dump output. (do_ssa_store_ccp): If STORE-CCP is not enabled, run standard CCP. (gate_store_ccp): Return true if either CCP or STORE-CCP are enabled. (pass_store_ccp): Rename dump suffix. * tree-ssa-copy.c (cached_last_copy_of): Declare. (stmt_may_generate_copy): Return false if the name occurs in an abnormal PHI. (copy_chains): Remove. Update all functions to use COPY_OF instead. (get_copy_of_val): Rename from get_first_copy. Return a pointer to the COPY_OF slot for VAR. (set_copy_of_val): Rename from set_first_copy_of. Used CACHED_LAST_COPY_OF to determine whether the copy-of chain has changed. (copy_prop_visit_assignment): Do not call may_propagate_copy. In the case of STORE-COPY-PROP set the copy-of value for all the virtual definitions. (copy_prop_visit_stmt): Reformat dump output. (copy_prop_visit_phi_node): Support STORE-COPY-PROP by checking memory references for each argument. Do not allow copies to flow through abnormal edges. (init_copy_prop): Allocate cached_last_copy_of. (fini_copy_prop): Free cached_last_copy_of (execute_copy_prop): Add new boolean argument to determine whether to enable STORE-COPY-PROP. (do_copy_prop): New function. (pass_copy_prop): Call do_copy_prop. (gate_store_copy_prop): New function. (store_copy_prop): New function. (pass_store_copy_prop): Define. * tree-ssa-propagate.c (first_vuse): Remove. (get_value_loaded_by): New function. * tree-ssa-propagate.h (first_vuse): Remove. (get_value_loaded_by): Declare. * doc/invoke.texi (-ftree-store-copy-prop): Document. (-fdump-tree-store_copyprop): Document. testsuite/ChangeLog.tcb * gcc.c-torture/execute/20041019-1.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@89295 138bc75d-0d04-0410-961f-82ee72b054a4
2004-10-15 * tree-ssa-ccp.c: Document SSA-CCP and STORE-CCP.Diego Novillo
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-cleanup-branch@89099 138bc75d-0d04-0410-961f-82ee72b054a4