gcc/gcc/tree-ssa-coalesce.c

1366 lines
35 KiB
C
Raw Normal View History

New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
/* Coalesce SSA_NAMES together for the out-of-ssa pass.
Copyright (C) 2004-2015 Free Software Foundation, Inc.
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
Contributed by Andrew MacLeod <amacleod@redhat.com>
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
any later version.
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
genattrtab.c (write_header): Include hash-set.h... 2015-01-09 Michael Collison <michael.collison@linaro.org> * genattrtab.c (write_header): Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating insn-attrtab.c. * genautomata.c (main) : Include hash-set.h, macInclude hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating insn-automata.c. * genemit.c (main): Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating insn-emit.c. * gengtype.c (open_base_files): Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating gtype-desc.c. * genopinit.c (main): Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating insn-opinit.c. * genoutput.c (output_prologue): Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating insn-output.c. * genpeep.c (main): Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating insn-peep.c. * genpreds.c (write_insn_preds_c): Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating insn-preds.c. * optc-save-gen-awk: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating options-save.c. * opth-gen.awk: Change include guard from GCC_C_COMMON_H to GCC_C_COMMON_C when generating options.h. * ada/gcc-interface/cuintp.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ada/gcc-interface/decl.c: ditto. * ada/gcc-interface/misc.c: ditto. * ada/gcc-interface/targtyps.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ada/gcc-interface/trans.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, real.h, fold-const.h, wide-int.h, inchash.h due to flattening of tree.h. * ada/gcc-interface/utils.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ada/gcc-interface/utils2.c: ditto. * alias.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * asan.c: ditto. * attribs.c: ditto. * auto-inc-dec.c: ditto. * auto-profile.c: ditto * bb-reorder.c: ditto. * bt-load.c: Include symtab.h due to flattening of tree.h. * builtins.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * c/c-array-notation.c: ditto. * c/c-aux-info.c: ditto. * c/c-convert.c: ditto. * c/c-decl.c: ditto. * c/c-errors.c: ditto. * c/c-lang.c: dittoxs. * c/c-objc-common.c: ditto. * c/c-parser.c: ditto. * c/c-typeck.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, inchash.h, real.h and fixed-value.h due to flattening of tree.h. * calls.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ccmp.c: ditto. * c-family/array-notation-common.c: ditto. * c-family/c-ada-spec.c: ditto. * c-family/c-cilkplus.c: ditto. * c-family/c-common.c: Include input.h due to flattening of tree.h. Define macro GCC_C_COMMON_C. * c-family/c-common.h: Flatten tree.h header files into c-common.h. Remove include of tree-core.h. * c-family/c-cppbuiltin.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * c-family/c-dump.c: ditto. * c-family/c-format.c: Flatten tree.h header files into c-common.h. * c-family/c-cppbuiltin.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * c-family/c-dump.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * c-family/c-format.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * c-family/c-gimplify.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * c-family/cilk.c: ditto. * c-family/c-lex.c: ditto. * c-family/c-omp.c: ditto. * c-family/c-opts.c: ditto. * c-family/c-pch.c: ditto. * c-family/c-ppoutput.c: ditto. * c-family/c-pragma.c: ditto. * c-family/c-pretty-print.c: ditto. * c-family/c-semantics.c: ditto. * c-family/c-ubsan.c: ditto. * c-family/stub-objc.c: ditto. * cfgbuild.c: ditto. * cfg.c: ditto. * cfgcleanup.c: ditto. * cfgexpand.c: ditto. * cfghooks.c: ditto. * cfgloop.c: Include symtab.h, fold-const.h, and inchash.h due to flattening of tree.h. * cfgloopmanip.c: ditto. * cfgrtl.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * cgraphbuild.c: ditto. * cgraph.c: ditto. * cgraphclones.c: ditto. * cgraphunit.c: ditto. * cilk-common.c: ditto. * combine.c: ditto. * combine-stack-adj.c: Include symbol.h due to flattening of tree.h. * config/aarch64/aarch64-builtins.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/aarch64/aarch64.c: ditto. * config/alpha/alpha.c: ditto. * config/arc/arc.c: ditto. * config/arm/aarch-common.c: ditto. * config/arm/arm-builtins.c: ditto. * config/arm/arm.c: ditto. * config/arm/arm-c.c: ditto. * config/avr/avr.c: ditto. * config/avr/avr-c.c: ditto. * config/avr/avr-log.c: ditto. * config/bfin/bfin.c: ditto. * config/c6x/c6x.c: ditto. * config/cr16/cr16.c: ditto. * config/cris/cris.c: ditto. * config/darwin.c: ditto. * config/darwin-c.c: ditto. * config/default-c.c: ditto. * config/epiphany/epiphany.c: ditto. * config/fr30/fr30.c: ditto. * config/frv/frv.c: ditto. * config/glibc-c.c: ditto. * config/h8300/h8300.c: ditto. * config/i386/i386.c: ditto. * config/i386/i386-c.c: ditto. * config/i386/msformat.c: ditto. * config/i386/winnt.c: ditto. * config/i386/winnt-cxx.c: ditto. * config/i386/winnt-stubs.c: ditto. * config/ia64/ia64.c: ditto. * config/ia64/ia64-c.c: ditto. * config/iq2000/iq2000.c: ditto. * config/lm32/lm32.c: Include symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/m32c/m32c.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/m32c/m32c-pragma.c: ditto. * config/m32c/m32cr.c: ditto. * config/m68/m68k.c: ditto. * config/mcore/mcore.c: ditto. * config/mep/mep.c: ditto. * config/mep/mep-pragma.c: ditto. * config/microblaze/microblaze.c: ditto. * config/microblaze/microblaze-c.c: ditto. * config/mips/mips.c: ditto. * config/mmix/mmix.c: Include symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/mn10300/mn10300.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/moxie/moxie.c: ditto. * config/msp430/msp430.c: ditto. * config/msp430/msp430-c.c: ditto. * config/nds32/nds32.c: ditto. * config/nds32/nds32-cost.c: ditto. * config/nds32/nds32-fp-as-gp.c: ditto. * config/nds32/nds32-intrinsic.c: ditto. * config/nds32/nds32-isr.c: ditto. * config/nds32/nds32-md-auxillary.c: ditto. * config/nds32/nds32-memory-manipulationx.c: ditto. * config/nds32/nds32-pipelines-auxillary.c: ditto. * config/nds32/nds32-predicates.c: ditto. * config/nios2/nios2.c: ditto. * config/nvptx/nvptx.c: ditto. * config/pa/pa.c: ditto. * config/pdp11/pdp11x.c: Include symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/rl78/rl78.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/rl78/rl78-cx.c: ditto. * config/rs6000/rs6000.c: ditto. * config/rs6000/rs6000-c.c: ditto. * config/rx/rx.c: ditto. * config/s390/s390.c: ditto. * config/sh/sh.c: ditto. * config/sh/sc.c: ditto. * config/sh/sh-mem.cc: ditto. * config/sh/sh_treg_combine.cc: Include symtab.h, inchash.h and tree.h due to flattening of tree.h. Remove include of tree-core.h. * config/sol2.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/sol2-c.c: ditto. * config/sol2-cxx.c: ditto. * config/sol2-stubs.c: ditto. * config/sparc/sparc.c: ditto. * config/sparc/sparc-cx.c: ditto. * config/spu/spu.c: ditto. * config/spu/spu-c.c: ditto * config/storym16/stormy16.c: ditto. * config/tilegx/tilegx.c: Include symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/tilepro/gen-mul-tables.cc: Include symtab.h in generated file. * config/tilegx/tilegx-c.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/tilepro/tilepro.c: Include symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/tilepro/tilepro-c.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/v850/v850.c: ditto. * config/v850/v850-c.c: ditto. * config/vax/vax.c: ditto. * config/vms/vms.c: ditto. * config/vms/vms-c.c: ditto. * config/vxworks.c: ditto. * config/winnt-c.c: ditto. * config/xtensa/xtensa.c: Include symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * convert.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * coverage.c: ditto. * cp/call.c: ditto. * cp/class.c: ditto. * cp/constexpr.c: ditto. * cp/cp-array-notation.c: ditto. * cp/cp-gimplify.c: ditto. * cp/cp-lang.c: ditto. * cp/cp-objcp-common.c: ditto. * cp/cvt.c: ditto. * cp/decl2.c: ditto. * cp/decl.c: ditto. * cp/dump.c: ditto. * cp/error.c: ditto. * cp/except.c: ditto. * cp/expr.c: ditto. * cp/friend.c: ditto. * cp/init.c: ditto. * cp/lambda.c: ditto. * cp/lex.c: ditto. * cp/mangle.c: ditto. * cp/name-lookup.c: ditto. * cp/optimize.c: ditto. * cp/parser.c: ditto. * cp/pt.c: ditto. * cp/ptree.c: ditto. * cp/repo.c: ditto. * cp/rtti.c: ditto. * cp/search.c: ditto. * cp/semantics.c: ditto. * cp/tree.c: ditto. * cp/typeck2.c: ditto. * cp/typeck.c: ditto. * cppbuiltin.c: ditto. * cprop.c: ditto. * cse.c: Add include of symtab.h due to flattening of tree.h. * cselib.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * data-streamer.c: ditto. * data-streamer-in.c: ditto. * data-streamer-out.c: ditto. * dbxout.c: ditto. * dce.c: ditto. * ddg.c: Add include of symtab.h due to flattening of tree.h. * debug.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * dfp.c: ditto. * df-scan.c: ditto. * dojump.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * double-int.c: ditto. * dse.c: ditto. * dumpfile.c: ditto. * dwarf2asm.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * dwarf2cfi.c: ditto. * dwarf2out.c: ditto. * emit-rtl.c: ditto. * except.c: ditto. * explow.c: ditto. * expmed.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * expr.c: ditto. * final.c: ditto. * fixed-value.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and fixed-value.h due to flattening of tree.h. * fold-const.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. Relocate inline function convert_to_ptrofftype_loc from tree.h. Relocate inline function fold_build_pointer_plus_loc from tree.h. Relocate inline function fold_build_pointer_plus_hwi_loc from tree.h. * fold-const.h: Relocate macro convert_to_ptrofftype from tree.h. Relocate macro fold_build_pointer_plus to relocate from tree.h.h. Relocate macro fold_build_pointer_plus_hwi from tree.h. Add prototype for convert_to_ptrofftype_loc relocated from tree.h. Add prototype for fold_build_pointer_plus_loc relocated from tree.h. Add prototype for fold_build_pointer_plus_hwi_loc relocated from tree.h. * fortran/convert.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/cpp.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/decl.c: ditto. * fortran/f95.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/iresolve.c: ditto. * fortran/match.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/module.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/options.c: ditto. * fortran/target-memory.c: Include hash-set.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/trans-array.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/trans.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/trans-common.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/trans-const.c: ditto. * fortran/trans-decl.c: ditto. * fortran/trans-expr.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/trans-intrinsic.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * fortran/trans-io.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/trans-openmp.c: ditto. * fortran/trans-stmt.c: ditto. * fortran/trans-types.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * function.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * gcc-plugin.h: Include statistics.h, double-int.h, real.h, fixed-value.h, alias.h, flags.h, and symtab.h due to flattening of tree.h * gcse.c: ditto. * generic-match-head.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ggc-page.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * gimple-builder.c: ditto. * gimple.c: ditto. * gimple-expr.c: ditto. * gimple-fold.c: ditto. * gimple-iterator.c: ditto. * gimple-low.c: ditto. * gimple-match-head.c: ditto. * gimple-pretty-print.c: ditto. * generic-ssa-isolate-paths.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * gimple-ssa-strength-reduction.c: ditto. * gimple-streamer-in.c: ditto. * gimple-streamer-out.c: ditto. * gimple-walk.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * gimplify.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * gimplify-me.c: ditto. * go/go-gcc.cc: ditto. * go/go-lang.c: ditto. * go/gdump.c: ditto. * graphite-blocking.c: ditto. * graphite.c: ditto. * graphite-dependencies.c: ditto. * graphite-interchange.c: ditto. * graphite-isl-ast-to-gimple.c: ditto. * graphite-optimize-isl.c: ditto. * graphite-poly.c: ditto. * graphite-scop-detection.c: ditto. * graphite-sese-to-poly.c: ditto. * hw-doloop.c: Include symtab.h due to flattening of tree.h. * ifcvt.c: ditto. * init-regs.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * internal-fc.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h,options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa.c: ditto. * ipa-chkp.c: ditto. * ipa-comdats.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-cp.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h,options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-devirt.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-icf.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h,options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-icf-gimple.c: ditto. * ipa-inline-analysis.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-inline.c: ditto. * ipa-inline-transform.c: ditto. * ipa-polymorhpic-call.c: ditto. * ipa-profile.c: ditto. * ipa-prop.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-pure-const.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-ref.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-reference.c: ditto. * ipa-split.c: ditto. * ipa-utils.c: ditto. * ipa-visbility.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ira.c: ditto. * ira-color.c: Include hash-set.h due to flattening of tree.h. * ira-costs.c: ditto. * ira-emit.c: ditto. * java/boehm.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * java/builtins.c: ditto. * java/class.c: ditto. * java/constants.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * java/decl.c: ditto. * java/except.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * java/expr.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h,inchash.h and real.h due to flattening of tree.h. * java/gimplify.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * java/jcf-dump.c: ditto. * java/jcf-io.c: ditto. * java/jcf-parse.c: ditto. * java/jvgenmain.c: ditto. * java/lang.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * java/mangle.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * java/mangle_name.c: ditto. * java/resource.c: ditto. * java/typeck.c: ditto. * java/verify-glue.c: ditto. * java/verify-impl.c: ditto. * jump.c: Include symtab.h due to flattening of tree.h. * langhooks.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * loop-doloop.c: Include symtab.h due to flattening of tree.h. * loop-init.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * loop-invariant.c: Include symtab.h due to flattening of tree.h. * loop-iv.c: ditto. * loop-unroll.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * lower-subreg.c: ditto. * lra-assigns.c: Include symtab.h due to flattening of tree.h. * lra.c: Include symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * lra-coalesce.c: Include symtab.h due to flattening of tree.h. * lra-constraints.c: ditto. * lra-eliminations.c: ditto. * lra-livesc: ditto. * lra-remat.c: ditto. * lra-spills.c: ditto. * lto/lto.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * lto/lto-lang.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * lto/lto-object.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * lto/lto-partition.c: ditto. * lto/lto-symtab.c: ditto. * lto-cgraph.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * lto-compress.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * lto-opts.c: ditto. * lto-section-in.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * lto-section-out.c: ditto. * lto-streamer.c: ditto. * lto-streamer-in.c: ditto. * lto-streamer-out.c: ditto. * modulo-sched.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * objc/objc-act.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * objc/objc-encoding.c: ditto. * objc/objc-gnu-runtime-abi-01.c: ditto. * objc/objc-lang.c: ditto. * objc/objc-map.c: ditto. * objc/objc-next-runtime-abi-01.c: ditto. * objc/objc-next-runtime-abi-02.c: ditto. * objc/objc-runtime-shared-support.c: ditto. * objcp/objcp-decl.c: ditto. * objcp/objcp-lang.c: ditto. * omega.c: ditto. * omega-low.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * optabs.c: ditto. * opts-global.c: ditto. * passes.c: ditto. * plugin.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * postreload.c: Include symtab.h due to flattening of tree.h. * postreload-gcse.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * predict.c: ditto. * print-rtl.c: ditto. * print-tree.c: ditto. * profile.c: Include symtab.h, fold-const.h and inchash.h due to flattening of tree.h. * real.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * realmpfr.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * recog.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ree.c: ditto. * reginfo.c: ditto. * reg-stack.c: ditto. * reload1.c: Include symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * reload.c: Include symtab.h due to flattening of tree.h. * reorg.c: ditto. * rtlanal.c: Include symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * rtl-chkp.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * rtlhooks.c: Include symtab.h due to flattening of tree.h. * sanopt.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * sched-deps.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * sched-vis.c: ditto. * sdbout.c: ditto. * sel-sched.c: Include symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * sel-sched-ir.c: ditto. * sese.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * shrink-wrap.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * simplify-rtx.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * stack-ptr-mod.c: ditto. * stmt.c: ditto. * store-motion.c: ditto. * store-layout.c: ditto. * stringpool.c: ditto. * symtab.c: ditto. * target-globals.c: ditto. * targhooks.c: ditto. * toplev.c: ditto. * tracer.c: ditto. * trans-mem.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-affine.c: ditto. * tree-browser.c: ditto. * tree.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-call-cdce.c: Include symtab.h, alias.h, double-int.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * tree-cfg.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-cfgcleanup.c: ditto. * tree-chkp.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-chkp-opt.c: ditto. * tree-chrec.c: ditto. * tree-chkp-opt.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * tree-core.h: Flatten header file by removing all #include statements. * tree-data-ref.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-dfa.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * tree-diagnostic.c: ditto. * tree-dump.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h, real.h and fixed-value.h due to flattening of tree.h. * tree-dfa.c: ditto. * tree-eh.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * tree-emutls.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree.h: Flatten header files by removing all includes except tree-core.h. Remove inline function convert_to_ptrofftype_loc to relocate to fold-const.c. Remove macro convert_to_ptrofftype to relocate to fold-const.h. Remove inline function fold_build_pointer_plus_loc to relocate to fold-const.c. Remove macro fold_build_pointer_plus to relocate to fold-const.h. Remove inline function fold_build_pointer_plus_hwi_loc to relocate to fold-const.c. Remove macro fold_build_pointer_plus_hwi to relocate to fold-const.h. * tree-if-conv.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h, real.h and fixed-value.h due to flattening of tree.h. * tree-inline.c: ditto. * tree-into-ssa.c: ditto. * tree-iterator.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-loop-distribution.c: ditto. * tree-nested.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-nrv.c: ditto. * tree-object-size.c: ditto. * tree-outof-ssa.c: ditto. * tree-parloops.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-phinodes.c: ditto. * tree-predcom.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-pretty-print.c: ditto. * tree-profile.c: double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-scalar-evolution.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-sra.c: Include vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-ssa-alias.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa.c: ditto. * tree-ssa-ccp.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * tree-ssa-coalesce.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa-copy.c: ditto. * tree-ssa-copyrename.c: ditto. * tree-ssa-dce.c: ditto. * tree-ssa-dom.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * tree-ssa-dse.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa-forwprop.c: ditto. * tree-ssa-ifcombine.c: ditto. * tree-ssa-live.c: ditto. * tree-ssa-loop.c: ditto. * tree-ssa-loop-ch.c: ditto. * tree-ssa-loop-im.c: ditto. * tree-ssa-loop-ivcanon.c: ditto. * tree-ssa-loop-ivopts.c: ditto. * tree-ssa-loop-manip.c: ditto. * tree-ssa-loop-niter.c: ditto. * tree-ssa-loop-prefetch.c: ditto. * tree-ssa-loop-unswitch.c: ditto. * tree-ssa-loop-math-opts.c: ditto. * tree-ssanames.c: ditto. * tree-ssa-operands.c: ditto. * tree-ssa-phiopt.c: ditto. * tree-ssa-phiprop.c: ditto. * tree-ssa-pre.c: ditto. * tree-ssa-propagate.c: ditto. * tree-ssa-reassoc.c: ditto. * tree-ssa-sccvn.c: ditto. * tree-ssa-sink.c: ditto. * tree-ssa-strlen.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa-structalias.c: double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa-tail-merge.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa-ter.c: ditto. * tree-ssa-threadedge.c: ditto. * tree-ssa-threadupdate.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa-uncprop.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa-uninit.c: ditto. * tree-stdarg.c: Include vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-streamer.c: Include vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-streamer-in.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, inchash.h, real.h and fixed-value.h due to flattening of tree.h. * tree-streamer-out.c: dittoo. * tree-switch-conversion.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-tailcall.c: ditto. * tree-vect-data-refs.c: ditto. * tree-vect-generic.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-vect-loop.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-vect-loop-manip.c: ditto. * tree-vectorizer.c: ditto. * tree-vect-patterns.c: ditto. * tree-vect-slp.c: ditto. * tree-vect-stmts.c: ditto. * tree-vrp.c: ditto. * tsan.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * ubsan.c: ditto. * value-prof.c.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * varasm.c: ditto. * varpool.c: ditto. * var-tracking.c: ditto. * vmsdbgout.c: ditto. * vtable-verify.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * wide-int.cc: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * xcoffout.c: ditto. * libcc1/plugin.cc: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. From-SVN: r219402
2015-01-09 21:18:42 +01:00
#include "alias.h"
#include "symtab.h"
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
#include "tree.h"
genattrtab.c (write_header): Include hash-set.h... 2015-01-09 Michael Collison <michael.collison@linaro.org> * genattrtab.c (write_header): Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating insn-attrtab.c. * genautomata.c (main) : Include hash-set.h, macInclude hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating insn-automata.c. * genemit.c (main): Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating insn-emit.c. * gengtype.c (open_base_files): Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating gtype-desc.c. * genopinit.c (main): Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating insn-opinit.c. * genoutput.c (output_prologue): Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating insn-output.c. * genpeep.c (main): Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating insn-peep.c. * genpreds.c (write_insn_preds_c): Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating insn-preds.c. * optc-save-gen-awk: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating options-save.c. * opth-gen.awk: Change include guard from GCC_C_COMMON_H to GCC_C_COMMON_C when generating options.h. * ada/gcc-interface/cuintp.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ada/gcc-interface/decl.c: ditto. * ada/gcc-interface/misc.c: ditto. * ada/gcc-interface/targtyps.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ada/gcc-interface/trans.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, real.h, fold-const.h, wide-int.h, inchash.h due to flattening of tree.h. * ada/gcc-interface/utils.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ada/gcc-interface/utils2.c: ditto. * alias.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * asan.c: ditto. * attribs.c: ditto. * auto-inc-dec.c: ditto. * auto-profile.c: ditto * bb-reorder.c: ditto. * bt-load.c: Include symtab.h due to flattening of tree.h. * builtins.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * c/c-array-notation.c: ditto. * c/c-aux-info.c: ditto. * c/c-convert.c: ditto. * c/c-decl.c: ditto. * c/c-errors.c: ditto. * c/c-lang.c: dittoxs. * c/c-objc-common.c: ditto. * c/c-parser.c: ditto. * c/c-typeck.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, inchash.h, real.h and fixed-value.h due to flattening of tree.h. * calls.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ccmp.c: ditto. * c-family/array-notation-common.c: ditto. * c-family/c-ada-spec.c: ditto. * c-family/c-cilkplus.c: ditto. * c-family/c-common.c: Include input.h due to flattening of tree.h. Define macro GCC_C_COMMON_C. * c-family/c-common.h: Flatten tree.h header files into c-common.h. Remove include of tree-core.h. * c-family/c-cppbuiltin.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * c-family/c-dump.c: ditto. * c-family/c-format.c: Flatten tree.h header files into c-common.h. * c-family/c-cppbuiltin.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * c-family/c-dump.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * c-family/c-format.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * c-family/c-gimplify.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * c-family/cilk.c: ditto. * c-family/c-lex.c: ditto. * c-family/c-omp.c: ditto. * c-family/c-opts.c: ditto. * c-family/c-pch.c: ditto. * c-family/c-ppoutput.c: ditto. * c-family/c-pragma.c: ditto. * c-family/c-pretty-print.c: ditto. * c-family/c-semantics.c: ditto. * c-family/c-ubsan.c: ditto. * c-family/stub-objc.c: ditto. * cfgbuild.c: ditto. * cfg.c: ditto. * cfgcleanup.c: ditto. * cfgexpand.c: ditto. * cfghooks.c: ditto. * cfgloop.c: Include symtab.h, fold-const.h, and inchash.h due to flattening of tree.h. * cfgloopmanip.c: ditto. * cfgrtl.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * cgraphbuild.c: ditto. * cgraph.c: ditto. * cgraphclones.c: ditto. * cgraphunit.c: ditto. * cilk-common.c: ditto. * combine.c: ditto. * combine-stack-adj.c: Include symbol.h due to flattening of tree.h. * config/aarch64/aarch64-builtins.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/aarch64/aarch64.c: ditto. * config/alpha/alpha.c: ditto. * config/arc/arc.c: ditto. * config/arm/aarch-common.c: ditto. * config/arm/arm-builtins.c: ditto. * config/arm/arm.c: ditto. * config/arm/arm-c.c: ditto. * config/avr/avr.c: ditto. * config/avr/avr-c.c: ditto. * config/avr/avr-log.c: ditto. * config/bfin/bfin.c: ditto. * config/c6x/c6x.c: ditto. * config/cr16/cr16.c: ditto. * config/cris/cris.c: ditto. * config/darwin.c: ditto. * config/darwin-c.c: ditto. * config/default-c.c: ditto. * config/epiphany/epiphany.c: ditto. * config/fr30/fr30.c: ditto. * config/frv/frv.c: ditto. * config/glibc-c.c: ditto. * config/h8300/h8300.c: ditto. * config/i386/i386.c: ditto. * config/i386/i386-c.c: ditto. * config/i386/msformat.c: ditto. * config/i386/winnt.c: ditto. * config/i386/winnt-cxx.c: ditto. * config/i386/winnt-stubs.c: ditto. * config/ia64/ia64.c: ditto. * config/ia64/ia64-c.c: ditto. * config/iq2000/iq2000.c: ditto. * config/lm32/lm32.c: Include symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/m32c/m32c.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/m32c/m32c-pragma.c: ditto. * config/m32c/m32cr.c: ditto. * config/m68/m68k.c: ditto. * config/mcore/mcore.c: ditto. * config/mep/mep.c: ditto. * config/mep/mep-pragma.c: ditto. * config/microblaze/microblaze.c: ditto. * config/microblaze/microblaze-c.c: ditto. * config/mips/mips.c: ditto. * config/mmix/mmix.c: Include symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/mn10300/mn10300.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/moxie/moxie.c: ditto. * config/msp430/msp430.c: ditto. * config/msp430/msp430-c.c: ditto. * config/nds32/nds32.c: ditto. * config/nds32/nds32-cost.c: ditto. * config/nds32/nds32-fp-as-gp.c: ditto. * config/nds32/nds32-intrinsic.c: ditto. * config/nds32/nds32-isr.c: ditto. * config/nds32/nds32-md-auxillary.c: ditto. * config/nds32/nds32-memory-manipulationx.c: ditto. * config/nds32/nds32-pipelines-auxillary.c: ditto. * config/nds32/nds32-predicates.c: ditto. * config/nios2/nios2.c: ditto. * config/nvptx/nvptx.c: ditto. * config/pa/pa.c: ditto. * config/pdp11/pdp11x.c: Include symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/rl78/rl78.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/rl78/rl78-cx.c: ditto. * config/rs6000/rs6000.c: ditto. * config/rs6000/rs6000-c.c: ditto. * config/rx/rx.c: ditto. * config/s390/s390.c: ditto. * config/sh/sh.c: ditto. * config/sh/sc.c: ditto. * config/sh/sh-mem.cc: ditto. * config/sh/sh_treg_combine.cc: Include symtab.h, inchash.h and tree.h due to flattening of tree.h. Remove include of tree-core.h. * config/sol2.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/sol2-c.c: ditto. * config/sol2-cxx.c: ditto. * config/sol2-stubs.c: ditto. * config/sparc/sparc.c: ditto. * config/sparc/sparc-cx.c: ditto. * config/spu/spu.c: ditto. * config/spu/spu-c.c: ditto * config/storym16/stormy16.c: ditto. * config/tilegx/tilegx.c: Include symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/tilepro/gen-mul-tables.cc: Include symtab.h in generated file. * config/tilegx/tilegx-c.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/tilepro/tilepro.c: Include symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/tilepro/tilepro-c.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/v850/v850.c: ditto. * config/v850/v850-c.c: ditto. * config/vax/vax.c: ditto. * config/vms/vms.c: ditto. * config/vms/vms-c.c: ditto. * config/vxworks.c: ditto. * config/winnt-c.c: ditto. * config/xtensa/xtensa.c: Include symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * convert.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * coverage.c: ditto. * cp/call.c: ditto. * cp/class.c: ditto. * cp/constexpr.c: ditto. * cp/cp-array-notation.c: ditto. * cp/cp-gimplify.c: ditto. * cp/cp-lang.c: ditto. * cp/cp-objcp-common.c: ditto. * cp/cvt.c: ditto. * cp/decl2.c: ditto. * cp/decl.c: ditto. * cp/dump.c: ditto. * cp/error.c: ditto. * cp/except.c: ditto. * cp/expr.c: ditto. * cp/friend.c: ditto. * cp/init.c: ditto. * cp/lambda.c: ditto. * cp/lex.c: ditto. * cp/mangle.c: ditto. * cp/name-lookup.c: ditto. * cp/optimize.c: ditto. * cp/parser.c: ditto. * cp/pt.c: ditto. * cp/ptree.c: ditto. * cp/repo.c: ditto. * cp/rtti.c: ditto. * cp/search.c: ditto. * cp/semantics.c: ditto. * cp/tree.c: ditto. * cp/typeck2.c: ditto. * cp/typeck.c: ditto. * cppbuiltin.c: ditto. * cprop.c: ditto. * cse.c: Add include of symtab.h due to flattening of tree.h. * cselib.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * data-streamer.c: ditto. * data-streamer-in.c: ditto. * data-streamer-out.c: ditto. * dbxout.c: ditto. * dce.c: ditto. * ddg.c: Add include of symtab.h due to flattening of tree.h. * debug.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * dfp.c: ditto. * df-scan.c: ditto. * dojump.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * double-int.c: ditto. * dse.c: ditto. * dumpfile.c: ditto. * dwarf2asm.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * dwarf2cfi.c: ditto. * dwarf2out.c: ditto. * emit-rtl.c: ditto. * except.c: ditto. * explow.c: ditto. * expmed.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * expr.c: ditto. * final.c: ditto. * fixed-value.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and fixed-value.h due to flattening of tree.h. * fold-const.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. Relocate inline function convert_to_ptrofftype_loc from tree.h. Relocate inline function fold_build_pointer_plus_loc from tree.h. Relocate inline function fold_build_pointer_plus_hwi_loc from tree.h. * fold-const.h: Relocate macro convert_to_ptrofftype from tree.h. Relocate macro fold_build_pointer_plus to relocate from tree.h.h. Relocate macro fold_build_pointer_plus_hwi from tree.h. Add prototype for convert_to_ptrofftype_loc relocated from tree.h. Add prototype for fold_build_pointer_plus_loc relocated from tree.h. Add prototype for fold_build_pointer_plus_hwi_loc relocated from tree.h. * fortran/convert.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/cpp.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/decl.c: ditto. * fortran/f95.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/iresolve.c: ditto. * fortran/match.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/module.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/options.c: ditto. * fortran/target-memory.c: Include hash-set.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/trans-array.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/trans.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/trans-common.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/trans-const.c: ditto. * fortran/trans-decl.c: ditto. * fortran/trans-expr.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/trans-intrinsic.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * fortran/trans-io.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/trans-openmp.c: ditto. * fortran/trans-stmt.c: ditto. * fortran/trans-types.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * function.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * gcc-plugin.h: Include statistics.h, double-int.h, real.h, fixed-value.h, alias.h, flags.h, and symtab.h due to flattening of tree.h * gcse.c: ditto. * generic-match-head.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ggc-page.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * gimple-builder.c: ditto. * gimple.c: ditto. * gimple-expr.c: ditto. * gimple-fold.c: ditto. * gimple-iterator.c: ditto. * gimple-low.c: ditto. * gimple-match-head.c: ditto. * gimple-pretty-print.c: ditto. * generic-ssa-isolate-paths.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * gimple-ssa-strength-reduction.c: ditto. * gimple-streamer-in.c: ditto. * gimple-streamer-out.c: ditto. * gimple-walk.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * gimplify.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * gimplify-me.c: ditto. * go/go-gcc.cc: ditto. * go/go-lang.c: ditto. * go/gdump.c: ditto. * graphite-blocking.c: ditto. * graphite.c: ditto. * graphite-dependencies.c: ditto. * graphite-interchange.c: ditto. * graphite-isl-ast-to-gimple.c: ditto. * graphite-optimize-isl.c: ditto. * graphite-poly.c: ditto. * graphite-scop-detection.c: ditto. * graphite-sese-to-poly.c: ditto. * hw-doloop.c: Include symtab.h due to flattening of tree.h. * ifcvt.c: ditto. * init-regs.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * internal-fc.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h,options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa.c: ditto. * ipa-chkp.c: ditto. * ipa-comdats.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-cp.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h,options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-devirt.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-icf.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h,options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-icf-gimple.c: ditto. * ipa-inline-analysis.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-inline.c: ditto. * ipa-inline-transform.c: ditto. * ipa-polymorhpic-call.c: ditto. * ipa-profile.c: ditto. * ipa-prop.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-pure-const.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-ref.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-reference.c: ditto. * ipa-split.c: ditto. * ipa-utils.c: ditto. * ipa-visbility.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ira.c: ditto. * ira-color.c: Include hash-set.h due to flattening of tree.h. * ira-costs.c: ditto. * ira-emit.c: ditto. * java/boehm.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * java/builtins.c: ditto. * java/class.c: ditto. * java/constants.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * java/decl.c: ditto. * java/except.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * java/expr.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h,inchash.h and real.h due to flattening of tree.h. * java/gimplify.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * java/jcf-dump.c: ditto. * java/jcf-io.c: ditto. * java/jcf-parse.c: ditto. * java/jvgenmain.c: ditto. * java/lang.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * java/mangle.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * java/mangle_name.c: ditto. * java/resource.c: ditto. * java/typeck.c: ditto. * java/verify-glue.c: ditto. * java/verify-impl.c: ditto. * jump.c: Include symtab.h due to flattening of tree.h. * langhooks.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * loop-doloop.c: Include symtab.h due to flattening of tree.h. * loop-init.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * loop-invariant.c: Include symtab.h due to flattening of tree.h. * loop-iv.c: ditto. * loop-unroll.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * lower-subreg.c: ditto. * lra-assigns.c: Include symtab.h due to flattening of tree.h. * lra.c: Include symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * lra-coalesce.c: Include symtab.h due to flattening of tree.h. * lra-constraints.c: ditto. * lra-eliminations.c: ditto. * lra-livesc: ditto. * lra-remat.c: ditto. * lra-spills.c: ditto. * lto/lto.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * lto/lto-lang.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * lto/lto-object.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * lto/lto-partition.c: ditto. * lto/lto-symtab.c: ditto. * lto-cgraph.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * lto-compress.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * lto-opts.c: ditto. * lto-section-in.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * lto-section-out.c: ditto. * lto-streamer.c: ditto. * lto-streamer-in.c: ditto. * lto-streamer-out.c: ditto. * modulo-sched.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * objc/objc-act.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * objc/objc-encoding.c: ditto. * objc/objc-gnu-runtime-abi-01.c: ditto. * objc/objc-lang.c: ditto. * objc/objc-map.c: ditto. * objc/objc-next-runtime-abi-01.c: ditto. * objc/objc-next-runtime-abi-02.c: ditto. * objc/objc-runtime-shared-support.c: ditto. * objcp/objcp-decl.c: ditto. * objcp/objcp-lang.c: ditto. * omega.c: ditto. * omega-low.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * optabs.c: ditto. * opts-global.c: ditto. * passes.c: ditto. * plugin.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * postreload.c: Include symtab.h due to flattening of tree.h. * postreload-gcse.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * predict.c: ditto. * print-rtl.c: ditto. * print-tree.c: ditto. * profile.c: Include symtab.h, fold-const.h and inchash.h due to flattening of tree.h. * real.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * realmpfr.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * recog.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ree.c: ditto. * reginfo.c: ditto. * reg-stack.c: ditto. * reload1.c: Include symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * reload.c: Include symtab.h due to flattening of tree.h. * reorg.c: ditto. * rtlanal.c: Include symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * rtl-chkp.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * rtlhooks.c: Include symtab.h due to flattening of tree.h. * sanopt.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * sched-deps.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * sched-vis.c: ditto. * sdbout.c: ditto. * sel-sched.c: Include symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * sel-sched-ir.c: ditto. * sese.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * shrink-wrap.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * simplify-rtx.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * stack-ptr-mod.c: ditto. * stmt.c: ditto. * store-motion.c: ditto. * store-layout.c: ditto. * stringpool.c: ditto. * symtab.c: ditto. * target-globals.c: ditto. * targhooks.c: ditto. * toplev.c: ditto. * tracer.c: ditto. * trans-mem.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-affine.c: ditto. * tree-browser.c: ditto. * tree.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-call-cdce.c: Include symtab.h, alias.h, double-int.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * tree-cfg.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-cfgcleanup.c: ditto. * tree-chkp.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-chkp-opt.c: ditto. * tree-chrec.c: ditto. * tree-chkp-opt.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * tree-core.h: Flatten header file by removing all #include statements. * tree-data-ref.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-dfa.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * tree-diagnostic.c: ditto. * tree-dump.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h, real.h and fixed-value.h due to flattening of tree.h. * tree-dfa.c: ditto. * tree-eh.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * tree-emutls.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree.h: Flatten header files by removing all includes except tree-core.h. Remove inline function convert_to_ptrofftype_loc to relocate to fold-const.c. Remove macro convert_to_ptrofftype to relocate to fold-const.h. Remove inline function fold_build_pointer_plus_loc to relocate to fold-const.c. Remove macro fold_build_pointer_plus to relocate to fold-const.h. Remove inline function fold_build_pointer_plus_hwi_loc to relocate to fold-const.c. Remove macro fold_build_pointer_plus_hwi to relocate to fold-const.h. * tree-if-conv.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h, real.h and fixed-value.h due to flattening of tree.h. * tree-inline.c: ditto. * tree-into-ssa.c: ditto. * tree-iterator.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-loop-distribution.c: ditto. * tree-nested.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-nrv.c: ditto. * tree-object-size.c: ditto. * tree-outof-ssa.c: ditto. * tree-parloops.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-phinodes.c: ditto. * tree-predcom.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-pretty-print.c: ditto. * tree-profile.c: double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-scalar-evolution.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-sra.c: Include vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-ssa-alias.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa.c: ditto. * tree-ssa-ccp.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * tree-ssa-coalesce.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa-copy.c: ditto. * tree-ssa-copyrename.c: ditto. * tree-ssa-dce.c: ditto. * tree-ssa-dom.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * tree-ssa-dse.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa-forwprop.c: ditto. * tree-ssa-ifcombine.c: ditto. * tree-ssa-live.c: ditto. * tree-ssa-loop.c: ditto. * tree-ssa-loop-ch.c: ditto. * tree-ssa-loop-im.c: ditto. * tree-ssa-loop-ivcanon.c: ditto. * tree-ssa-loop-ivopts.c: ditto. * tree-ssa-loop-manip.c: ditto. * tree-ssa-loop-niter.c: ditto. * tree-ssa-loop-prefetch.c: ditto. * tree-ssa-loop-unswitch.c: ditto. * tree-ssa-loop-math-opts.c: ditto. * tree-ssanames.c: ditto. * tree-ssa-operands.c: ditto. * tree-ssa-phiopt.c: ditto. * tree-ssa-phiprop.c: ditto. * tree-ssa-pre.c: ditto. * tree-ssa-propagate.c: ditto. * tree-ssa-reassoc.c: ditto. * tree-ssa-sccvn.c: ditto. * tree-ssa-sink.c: ditto. * tree-ssa-strlen.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa-structalias.c: double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa-tail-merge.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa-ter.c: ditto. * tree-ssa-threadedge.c: ditto. * tree-ssa-threadupdate.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa-uncprop.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa-uninit.c: ditto. * tree-stdarg.c: Include vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-streamer.c: Include vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-streamer-in.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, inchash.h, real.h and fixed-value.h due to flattening of tree.h. * tree-streamer-out.c: dittoo. * tree-switch-conversion.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-tailcall.c: ditto. * tree-vect-data-refs.c: ditto. * tree-vect-generic.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-vect-loop.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-vect-loop-manip.c: ditto. * tree-vectorizer.c: ditto. * tree-vect-patterns.c: ditto. * tree-vect-slp.c: ditto. * tree-vect-stmts.c: ditto. * tree-vrp.c: ditto. * tsan.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * ubsan.c: ditto. * value-prof.c.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * varasm.c: ditto. * varpool.c: ditto. * var-tracking.c: ditto. * vmsdbgout.c: ditto. * vtable-verify.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * wide-int.cc: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * xcoffout.c: ditto. * libcc1/plugin.cc: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. From-SVN: r219402
2015-01-09 21:18:42 +01:00
#include "fold-const.h"
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
#include "flags.h"
diagnostic.c: Don't include tm.h, tree.h, tm_p.h, langhooks.h or langhooks-def.h. * diagnostic.c: Don't include tm.h, tree.h, tm_p.h, langhooks.h or langhooks-def.h. (diagnostic_initialize): Initialize x_data not last_function. (diagnostic_report_current_function): Move to tree-diagnostic.c. (default_diagnostic_starter): Call diagnostic_report_current_module not diagnostic_report_current_function. (diagnostic_report_diagnostic): Initialize x_data not abstract_origin. (verbatim): Likewise. * diagnostic.h (struct diagnostic_info): Change abstract_origin to x_data. (struct diagnostic_context): Change last_function to x_data. (diagnostic_auxiliary_data): Replace with diagnostic_context_auxiliary_data and diagnostic_info_auxiliary_data. (diagnostic_last_function_changed, diagnostic_set_last_function, diagnostic_report_current_function): Move to tree-diagnostic.h. (print_declaration, dump_generic_node, print_generic_stmt, print_generic_stmt_indented, print_generic_expr, print_generic_decl, debug_c_tree, dump_omp_clauses, print_call_name, debug_generic_expr, debug_generic_stmt, debug_tree_chain, default_tree_printer): Move to tree-pretty-print.h. (debug_gimple_stmt, debug_gimple_seq, print_gimple_seq, print_gimple_stmt, print_gimple_expr, dump_gimple_stmt): Move to gimple-pretty-print.h. * pretty-print.c: Don't include tree.h (pp_base_format): Don't handle %K here. (pp_base_tree_identifier): Move to tree-pretty-print.c. * pretty-print.h (text_info): Change abstract_origin to x_data. (pp_tree_identifier, pp_unsupported_tree, pp_base_tree_identifier): Move to tree-pretty-print.h. * gimple-pretty-print.h, tree-diagnostic.c, tree-diagnostic.h, tree-pretty-print.h: New files. * tree-pretty-print.c: Include tree-pretty-print.h. (percent_K_format): New. Moved from pretty-print.c. (pp_base_tree_identifier): Move from pretty-print.c. * c-objc-common.c: Include tree-pretty-print.h. (c_tree_printer): Handle %K here. * langhooks.c: Include tree-diagnostic.h. (lhd_print_error_function): Use diagnostic_abstract_origin macro. * toplev.c: Include tree-diagnostic.h and tree-pretty-print.h. (default_tree_printer): Handle %K using percent_K_format. (general_init): Use default_tree_diagnostic_starter. * tree.c: Include tree-diagnostic.h and tree-pretty-print.h. (free_lang_data): Use default_tree_diagnostic_starter. * c-pretty-print.c: Include tree-pretty-print.h. * cfgexpand.c: Include tree-pretty-print.h and gimple-pretty-print.h. * cgraphunit.c: Include tree-pretty-print.h and gimple-pretty-print.h. * dwarf2out.c: Include tree-pretty-print.h. * except.c: Include tree-pretty-print.h. * gimple-pretty-print.c: Include tree-pretty-print.h and gimple-pretty-print.h. * gimplify.c: Include tree-pretty-print.h. * graphite-poly.c: Include tree-pretty-print.h and gimple-pretty-print.h. * ipa-cp.c: Include tree-pretty-print.h. * ipa-inline.c: Include gimple-pretty-print.h. * ipa-prop.c: Include tree-pretty-print.h and gimple-pretty-print.h. * ipa-pure-const.c: Include gimple-pretty-print.h. * ipa-struct-reorg.c: Include tree-pretty-print.h and gimple-pretty-print.h. * ipa-type-escape.c: Include tree-pretty-print.h. * print-rtl.c: Include tree-pretty-print.h. * print-tree.c: Include gimple-pretty-print.h. * sese.c: Include tree-pretty-print.h. * tree-affine.c: Include tree-pretty-print.h. * tree-browser.c: Include tree-pretty-print.h. * tree-call-cdce.c: Include gimple-pretty-print.h. * tree-cfg.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-chrec.c: Include tree-pretty-print.h. * tree-data-ref.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-dfa.c: Include tree-pretty-print.h. * tree-if-conv.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-inline.c: Include tree-pretty-print.h. * tree-into-ssa.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-nrv.c: Include tree-pretty-print.h. * tree-object-size.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-outof-ssa.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-parloops.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-predcom.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-scalar-evolution.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-sra.c: Include tree-pretty-print.h. * tree-ssa-address.c: Include tree-pretty-print.h. * tree-ssa-alias.c: Include tree-pretty-print.h. * tree-ssa-ccp.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-coalesce.c: Include tree-pretty-print.h. * tree-ssa-copy.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-copyrename.c: Include tree-pretty-print.h. * tree-ssa-dce.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-dom.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-dse.c: Include gimple-pretty-print.h. * tree-ssa-forwprop.c: Include tree-pretty-print.h. * tree-ssa-ifcombine.c: Include tree-pretty-print.h. * tree-ssa-live.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-im.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-ivcanon.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-ivopts.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-niter.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-loop-prefetch.c: Include tree-pretty-print.h. * tree-ssa-math-opts.c: Include gimple-pretty-print.h. * tree-ssa-operands.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-phiprop.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-pre.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-propagate.c: Include gimple-pretty-print.h. * tree-ssa-reassoc.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-sccvn.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-sink.c: Include gimple-pretty-print.h. * tree-ssa-ter.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-ssa-uninit.c: Include gimple-pretty-print.h. * tree-ssa.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-stdarg.c: Include gimple-pretty-print.h. * tree-switch-conversion.c: Include gimple-pretty-print.h. * tree-tailcall.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-data-refs.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-loop-manip.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-loop.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-patterns.c: Include gimple-pretty-print.h. * tree-vect-slp.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vect-stmts.c: Include tree-pretty-print.h and gimple-pretty-print.h. * tree-vectorizer.c: Include tree-pretty-print.h. * tree-vrp.c: Include tree-pretty-print.h and gimple-pretty-print.h. * value-prof.c: Include tree-pretty-print.h and gimple-pretty-print.h. * var-tracking.c: Include tree-pretty-print.h. * Makefile.in (OBJS-common): Add tree-diagnostic.o. (tree-diagnostic.o): New dependencies. (c-objc-common.o, c-pretty-print.o, langhooks.o, tree.o, tree-inline.o, print-tree.o, stor-layout.o, tree-ssa-uninit.o, tree-ssa.o, tree-into-ssa.o, tree-ssa-ter.o, tree-ssa-coalesce.o, tree-outof-ssa.o, tree-ssa-forwprop.o, tree-ssa-phiprop.o, tree-ssa-ifcombine.o, tree-nrv.o, tree-ssa-copy.o, tree-ssa-propagate.o, tree-ssa-dom.o, tree-ssa-uncprop.o, tree-ssa-live.o, tree-ssa-copyrename.o, tree-ssa-pre.o, tree-ssa-sccvn.o, tree-vrp.o, tree-cfg.o, tree-tailcall.o, tree-ssa-sink.o, tree-if-conv.o, tree-dfa.o, tree-ssa-operands.o, tree-ssa-address.o, tree-ssa-loop-niter.o, tree-ssa-loop-ivcanon.o, tree-ssa-loop-prefetch.o, tree-predcom.o, tree-ssa-loop-ivopts.o, tree-affine.o, tree-ssa-loop-im.o, tree-ssa-math-opts.o, tree-ssa-alias.o, tree-ssa-reassoc.o, gimplify.o, tree-browser.o, tree-chrec.o, tree-scalar-evolution.o, tree-data-ref.o, sese.o, graphite-poly.o, tree-vect-loop.o, tree-vect-loop-manip.o, tree-vect-patterns.o, tree-vect-slp.o, tree-vect-stmts.o, tree-vect-data-refs.o, tree-vectorizer.o, tree-parloops.o, tree-stdarg.o, tree-object-size.o, gimple-pretty-print.o, tree-pretty-print.o, diagnostic.o, toplev.o, print-rtl.o, except.o, dwarf2out.o, cgraphunit.o, ipa-prop.o, ipa-cp.o, ipa-inline.o, ipa-pure-const.o, ipa-type-escape.o, ipa-struct-reorg.o, tree-ssa-dce.o, tree-call-cdce.o, tree-ssa-ccp.o, tree-sra.o, tree-switch-conversion.o, var-tracking.o, value-prof.o, cfgexpand.o, pretty-print.o): Update dependencies. cp: * error.c: Include tree-diagnostic.h and tree-pretty-print.h. (cp_print_error_function): Use diagnostic_abstract_origin macro. (cp_printer): Handle %K here using percent_K_format. * cxx-pretty-print.c: Include tree-pretty-print.h. * Make-lang.in (cp/error.o, cp/cxx-pretty-print.o): Update dependencies. From-SVN: r159685
2010-05-22 00:34:26 +02:00
#include "tree-pretty-print.h"
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
#include "bitmap.h"
system.h (dump_file): Do not define. gcc/ * system.h (dump_file): Do not define. * tree-pass.h: Include dumpfile.h, which is a new file containing... (enum tree_dump_index, TDF_*, get_dump_file_name, dump_enabled_p, dump_initialized_p, dump_begin, dump_end, dump_node, dump_switch_p, dump_flag_name, dump_file, dump_flags, dump_file_name, get_dump_file_info, struct dump_file_info): all of this, moved to... * dumpfile.h: Here, new file. * tree-dump.h: Include dumpfile.h, but not tree-pass.h. (dump_stmt): Remove prototype for C++ specific function. (dump_enumerated_decls): Move prototype from here... * tree-flow.h (dump_enumerated_decls): ... to here. (get_ref_base_and_extent) Move prototype from here ... * tree.h (get_ref_base_and_extent) ... to here. * tree-ssa-live.c: Do not inclde tree-pretty-print.h, because gimple-pretty-print.h is enough. Do not include tree-dump.h, include timevar.h and dumpfile.h instead. (struct numbered_tree_d, compare_decls_by_uid, dump_enumerated_decls_push, dump_enumerated_decls): Move from here ... * tree-dfa.c:(struct numbered_tree_d, compare_decls_by_uid, dump_enumerated_decls_push, dump_enumerated_decls):... to here. Do not include timevar.h. * tree.c: Do not include timevar.h. * tree-cfg.c: Do not include langhooks.h, tree-pretty-print.h, and timevar.h. (dump_cfg_stats): Use current_function_name. (gimple_cfg2vcg): Likewise. (dump_function_to_file): Likewise. * df-scan.c: Do not include tree-pass.h and timevar.h. Include dumpfile.h. (df_entry_block_bitmap_verify, df_exit_block_bitmap_verify): Do not use print_current_pass. * df-problems.c: Include dumpfile.h. Always define REG_DEAD_DEBUGGING, avoid #ifdef code, because it leads to errors in the code not selected. (df_note_compute): Do not print_rtl_with_bb here. Fix compilation bug if REG_DEAD_DEBUGGING is not 0, get_insns is not available here. * lcm.c: Include dumpfile.h. Remove obsolete include of insn-attr.h. * dojump.c (do_compare_rtx_and_jump): Remove failure printing for missing probability notes. * stmt.c: Include dumpfile.h. (emit_case_decision_tree): Re-enable printing expand details only if TDF_DETAILS. * alias.c, auto-inc-dec.c, bb-reorder.c, caller-save.c, cfg.c, cfgcleanup.c, cfgexpand.c, cfgloop.c, cfgloopmanip.c, cgraph.c, cgraphclones.c, cgraphunit.c, combine.c, combine-stack-adj.c, coverage.c, cprop.c, cse.c, cselib.c, dbgcnt.c, dce.c, df-core.c, dse.c, dwarf2out.c, emit-rtl.c, except.c, expr.c, final.c, function.c, fwprop.c, gcse.c, gimple-fold.c, gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimplify.c, graphite-blocking.c, graphite-clast-to-gimple.c, graphite-dependences.c, graphite-interchange.c, graphite-optimize-isl.c, graphite-poly.c, graphite-sese-to-poly.c, haifa-sched.c, hw-doloop.c, ifcvt.c, ipa.c, ipa-cp.c, ipa-inline-analysis.c, ipa-inline.c, ipa-inline-transform.c, ipa-prop.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c, ipa-utils.c, ira.c, ira-emit.c, jump.c, loop-doloop.c, loop-init.c, loop-invariant.c, loop-iv.c, loop-unroll.c, loop-unswitch.c, lower-subreg.c, lto-section-out.c, lto-streamer-in.c, matrix-reorg.c, mcf.c, mode-switching.c, modulo-sched.c, omega.c, omp-low.c, passes.c, plugin.c, postreload.c, postreload-gcse.c, predict.c, print-rtl.c, print-tree.c, profile.c, recog.c, ree.c, regcprop.c, reginfo.c, regmove.c, regrename.c, reg-stack.c, reload1.c, reorg.c, sched-rgn.c, sched-vis.c, sel-sched.c, sel-sched-ir.c, store-motion.c, tracer.c, trans-mem.c, tree-affine.c, tree-call-cdce.c, tree-cfgcleanup.c, tree-chrec.c, tree-data-ref.c, tree-diagnostic.c, tree-dump.c, tree-eh.c, tree-flow-inline.h, tree-if-conv.c, tree-into-ssa.c, tree-mudflap.c, tree-nrv.c, tree-object-size.c, tree-optimize.c, tree-outof-ssa.c, tree-predcom.c, tree-pretty-print.c, tree-profile.c, tree-scalar-evolution.c, tree-sra.c, tree-ssa-address.c, tree-ssa-alias.c, tree-ssa.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c,, tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-ifcombine.c, tree-ssa-loop.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c, tree-ssa-loop-ivcanon.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-manip.c, tree-ssa-loop-niter.c, tree-ssa-loop-prefetch.c, tree-ssa-loop-unswitch.c, tree-ssa-math-opts.c, tree-ssa-operands.c, tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c, tree-ssa-propagate.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-sink.c, tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-ter.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-switch-conversion.c, tree-tailcall.c, tree-vect-data-refs.c, tree-vect-loop.c, tree-vect-loop-manip.c, tree-vectorizer.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, value-prof.c, var-tracking.c, web.c: Include tree-pass.h only if needed. If tree-pass.h is included, do not include timevar.h and dumpfile.h. If tree-pass.h is not included but dump_file, or dump_flags, or the TDF_* flags are used, include dumpfile.h. If gimple-pretty-print.h is included, don't include tree-pretty-print.h. Remove assorted unnecessary includes. * config/mn10300/mn10300.c, config/c6x/c6x.c, config/ia64/ia64.c, config/arm/arm.c, config/bfin/bfin.c, config/frv/frv.c, config/spu/spu.c, config/mep/mep.c, config/i386/i386.c: Include dumpfile.h. * config/rl78/rl78.c: Include dumpfile.h instead of tree-pass.h. * arm/t-arm, avr/t-avr, i386/t-i386, ia64/t-ia64, mep/t-mep, spu/t-spu-elf: Fix dependencies. c-family/ * c-gimplify.c: Include dumpfile.h instead of tree-dump.h. * c-ada-spec.c: Likewise. * c-dump.c (dump_stmt): Move to cp/dump.c, the only user. c/ * c-decl.c: Include dumpfile.h instead of tree-dump.h. * Make-lang.in: Fix dependencies. cp/ * dump.c (dump_stmt): Moved here from c-dump.c. * optimize.c: Include dumpfile.h instead of tree-dump.h. * class.c: Likewise. * decl2.c: Likewise. * Make-lang.in: Fix dependencies. fortran/ * f95-lang.c: Include dumpfile.h instead of tree-dump.h. * Make-lang.in: Fix dependencies. java/ * java-gimplify.c Include dumpfile.h instead of tree-dump.h * Make-lang.in: Fix dependencies. lto/ * lto.c: Do not include timevar.h. * Make-lang.in: Fix dependencies. ada/ * gcc-interface/utils.c: Include timevar.h. * Make-lang.in: Fix dependencies. From-SVN: r189519
2012-07-16 13:32:42 +02:00
#include "dumpfile.h"
ggcplug.c: Shuffle includes to include gcc-plugin.h earlier. 2014-10-27 Andrew MacLeod <amacleod@redhat.com> * testsuite/gcc.dg/plugin/ggcplug.c: Shuffle includes to include gcc-plugin.h earlier. 2014-10-27 Andrew MacLeod <amacleod@redhat.com> * c/c-typeck.c: Adjust include files. 2014-10-27 Andrew MacLeod <amacleod@redhat.com> * c-family/c-gimplify.c: Adjust include files. 2014-10-27 Andrew MacLeod <amacleod@redhat.com> * cp/cp-gimplify.c: Adjust include files. 2014-10-27 Andrew MacLeod <amacleod@redhat.com> * go/go-gcc.cc: Adjust include files. * go/go-lang.c: Ditto. 2014-10-27 Andrew MacLeod <amacleod@redhat.com> * java/java-gimplify.c: Adjust include files. 2014-10-27 Andrew MacLeod <amacleod@redhat.com> * lto/lto-lang.c: Adjust include files. * lto/lto-object.c: Ditto. * lto/lto-partition.c: Ditto. * lto/lto-symtab.c: Ditto. * lto/lto.c: Ditto. 2014-10-27 Andrew MacLeod <amacleod@redhat.com> * basic-block.h: Remove all includes. (enum profile_status_d, struct control_flow_graph): Move to cfg.h * cfg.h (profile_status_d, struct control_flow_graph): Relocate here. * Makefile.in (GTFILES): Add cfg.h to list. * cgraph.h (symbol_table::create_empty): Move to cgraph.c. * cgraph.c (symbol_table::create_empty): Relocate from cgraph.h. * genconditions.c (write_header): Add predict.h and basic-block.h to lits of includes. * genemit.c (main): Ditto. * genpreds.c (write_insn_preds_c): Ditto. * genrecog.c (write_header): Ditto. * gengtype.c (open_base_files): Add predict.h, basic-block.h, and cfg.h to list of includes. * alias.c: Adjust include files. * asan.c: Ditto. * auto-inc-dec.c: Ditto. * auto-profile.c: Ditto. * bb-reorder.c: Ditto. * bt-load.c: Ditto. * builtins.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfganal.c: Ditto. * cfgbuild.c: Ditto. * cfgcleanup.c: Ditto. * cfgexpand.c: Ditto. * cfghooks.c: Ditto. * cfgloop.c: Ditto. * cfgloopanal.c: Ditto. * cfgloopmanip.c: Ditto. * cfgrtl.c: Ditto. * cgraphbuild.c: Ditto. * cgraphclones.c: Ditto. * cgraphunit.c: Ditto. * combine-stack-adj.c: Ditto. * combine.c: Ditto. * compare-elim.c: Ditto. * coverage.c: Ditto. * cprop.c: Ditto. * cse.c: Ditto. * cselib.c: Ditto. * data-streamer-in.c: Ditto. * data-streamer-out.c: Ditto. * data-streamer.c: Ditto. * dce.c: Ditto. * ddg.c: Ditto. * ddg.h: Ditto. * df-core.c: Ditto. * df-problems.c: Ditto. * df-scan.c: Ditto. * df.h: Ditto. * dojump.c: Ditto. * dominance.c: Ditto. * domwalk.c: Ditto. * dse.c: Ditto. * dwarf2cfi.c: Ditto. * emit-rtl.c: Ditto. * et-forest.c: Ditto. * except.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * fwprop.c: Ditto. * gcc-plugin.h: Ditto. * gcse.c: Ditto. * generic-match-head.c: Ditto. * ggc-page.c: Ditto. * gimple-builder.c: Ditto. * gimple-expr.c: Ditto. * gimple-fold.c: Ditto. * gimple-iterator.c: Ditto. * gimple-low.c: Ditto. * gimple-match-head.c: Ditto. * gimple-pretty-print.c: Ditto. * gimple-ssa-isolate-paths.c: Ditto. * gimple-ssa-strength-reduction.c: Ditto. * gimple-streamer-in.c: Ditto. * gimple-streamer-out.c: Ditto. * gimple-streamer.h: Ditto. * gimple-walk.c: Ditto. * gimple.c: Ditto. * gimplify-me.c: Ditto. * gimplify.c: Ditto. * graph.c: Ditto. * graphite-blocking.c: Ditto. * graphite-clast-to-gimple.c: Ditto. * graphite-dependences.c: Ditto. * graphite-interchange.c: Ditto. * graphite-isl-ast-to-gimple.c: Ditto. * graphite-optimize-isl.c: Ditto. * graphite-poly.c: Ditto. * graphite-scop-detection.c: Ditto. * graphite-sese-to-poly.c: Ditto. * graphite.c: Ditto. * haifa-sched.c: Ditto. * hw-doloop.c: Ditto. * ifcvt.c: Ditto. * init-regs.c: Ditto. * internal-fn.c: Ditto. * ipa-cp.c: Ditto. * ipa-devirt.c: Ditto. * ipa-icf-gimple.c: Ditto. * ipa-icf.c: Ditto. * ipa-inline-analysis.c: Ditto. * ipa-inline.c: Ditto. * ipa-polymorphic-call.c: Ditto. * ipa-profile.c: Ditto. * ipa-prop.c: Ditto. * ipa-pure-const.c: Ditto. * ipa-reference.c: Ditto. * ipa-split.c: Ditto. * ipa-utils.c: Ditto. * ipa.c: Ditto. * ira-build.c: Ditto. * ira-color.c: Ditto. * ira-conflicts.c: Ditto. * ira-costs.c: Ditto. * ira-emit.c: Ditto. * ira-lives.c: Ditto. * ira.c: Ditto. * jump.c: Ditto. * lcm.c: Ditto. * loop-doloop.c: Ditto. * loop-init.c: Ditto. * loop-invariant.c: Ditto. * loop-iv.c: Ditto. * loop-unroll.c: Ditto. * lower-subreg.c: Ditto. * lra-assigns.c: Ditto. * lra-coalesce.c: Ditto. * lra-constraints.c: Ditto. * lra-eliminations.c: Ditto. * lra-lives.c: Ditto. * lra-spills.c: Ditto. * lra.c: Ditto. * lto-cgraph.c: Ditto. * lto-compress.c: Ditto. * lto-opts.c: Ditto. * lto-section-in.c: Ditto. * lto-section-out.c: Ditto. * lto-streamer-in.c: Ditto. * lto-streamer-out.c: Ditto. * lto-streamer.c: Ditto. * mcf.c: Ditto. * mode-switching.c: Ditto. * modulo-sched.c: Ditto. * omp-low.c: Ditto. * optabs.c: Ditto. * opts-global.c: Ditto. * passes.c: Ditto. * postreload-gcse.c: Ditto. * postreload.c: Ditto. * predict.c: Ditto. * print-rtl.c: Ditto. * profile.c: Ditto. * recog.c: Ditto. * ree.c: Ditto. * reg-stack.c: Ditto. * regcprop.c: Ditto. * regcprop.h: Ditto. * reginfo.c: Ditto. * regrename.c: Ditto. * regstat.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtlanal.c: Ditto. * sched-deps.c: Ditto. * sched-ebb.c: Ditto. * sched-int.h: Ditto. * sched-rgn.c: Ditto. * sched-vis.c: Ditto. * sel-sched-dump.c: Ditto. * sel-sched-ir.c: Ditto. * sel-sched-ir.h: Ditto. * sel-sched.c: Ditto. * sese.c: Ditto. * shrink-wrap.c: Ditto. * stack-ptr-mod.c: Ditto. * stmt.c: Ditto. * store-motion.c: Ditto. * symtab.c: Ditto. * toplev.c: Ditto. * tracer.c: Ditto. * trans-mem.c: Ditto. * tree-affine.c: Ditto. * tree-call-cdce.c: Ditto. * tree-cfg.c: Ditto. * tree-cfgcleanup.c: Ditto. * tree-chrec.c: Ditto. * tree-complex.c: Ditto. * tree-data-ref.c: Ditto. * tree-dfa.c: Ditto. * tree-eh.c: Ditto. * tree-emutls.c: Ditto. * tree-if-conv.c: Ditto. * tree-inline.c: Ditto. * tree-into-ssa.c: Ditto. * tree-loop-distribution.c: Ditto. * tree-nested.c: Ditto. * tree-nrv.c: Ditto. * tree-object-size.c: Ditto. * tree-outof-ssa.c: Ditto. * tree-parloops.c: Ditto. * tree-phinodes.c: Ditto. * tree-predcom.c: Ditto. * tree-pretty-print.c: Ditto. * tree-profile.c: Ditto. * tree-scalar-evolution.c: Ditto. * tree-sra.c: Ditto. * tree-ssa-address.c: Ditto. * tree-ssa-alias.c: Ditto. * tree-ssa-ccp.c: Ditto. * tree-ssa-coalesce.c: Ditto. * tree-ssa-copy.c: Ditto. * tree-ssa-copyrename.c: Ditto. * tree-ssa-dce.c: Ditto. * tree-ssa-dom.c: Ditto. * tree-ssa-dse.c: Ditto. * tree-ssa-forwprop.c: Ditto. * tree-ssa-ifcombine.c: Ditto. * tree-ssa-live.c: Ditto. * tree-ssa-loop-ch.c: Ditto. * tree-ssa-loop-im.c: Ditto. * tree-ssa-loop-ivcanon.c: Ditto. * tree-ssa-loop-ivopts.c: Ditto. * tree-ssa-loop-manip.c: Ditto. * tree-ssa-loop-niter.c: Ditto. * tree-ssa-loop-prefetch.c: Ditto. * tree-ssa-loop-unswitch.c: Ditto. * tree-ssa-loop.c: Ditto. * tree-ssa-math-opts.c: Ditto. * tree-ssa-operands.c: Ditto. * tree-ssa-phiopt.c: Ditto. * tree-ssa-phiprop.c: Ditto. * tree-ssa-pre.c: Ditto. * tree-ssa-propagate.c: Ditto. * tree-ssa-reassoc.c: Ditto. * tree-ssa-sccvn.c: Ditto. * tree-ssa-sink.c: Ditto. * tree-ssa-strlen.c: Ditto. * tree-ssa-structalias.c: Ditto. * tree-ssa-tail-merge.c: Ditto. * tree-ssa-ter.c: Ditto. * tree-ssa-threadedge.c: Ditto. * tree-ssa-threadupdate.c: Ditto. * tree-ssa-uncprop.c: Ditto. * tree-ssa-uninit.c: Ditto. * tree-ssa.c: Ditto. * tree-ssanames.c: Ditto. * tree-stdarg.c: Ditto. * tree-streamer-in.c: Ditto. * tree-streamer-out.c: Ditto. * tree-streamer.c: Ditto. * tree-switch-conversion.c: Ditto. * tree-tailcall.c: Ditto. * tree-vect-data-refs.c: Ditto. * tree-vect-generic.c: Ditto. * tree-vect-loop-manip.c: Ditto. * tree-vect-loop.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vectorizer.c: Ditto. * tree-vrp.c: Ditto. * tree.c: Ditto. * tsan.c: Ditto. * ubsan.c: Ditto. * valtrack.c: Ditto. * valtrack.h: Ditto. * value-prof.c: Ditto. * var-tracking.c: Ditto. * varasm.c: Ditto. * varpool.c: Ditto. * vtable-verify.c: Ditto. * web.c: Ditto. * config/aarch64/aarch64-builtins.c: Ditto. * config/aarch64/aarch64.c: Ditto. * config/alpha/alpha.c: Ditto. * config/arc/arc.c: Ditto. * config/arm/arm.c: Ditto. * config/avr/avr.c: Ditto. * config/bfin/bfin.c: Ditto. * config/c6x/c6x.c: Ditto. * config/cr16/cr16.c: Ditto. * config/cris/cris.c: Ditto. * config/darwin-c.c: Ditto. * config/darwin.c: Ditto. * config/epiphany/epiphany.c: Ditto. * config/epiphany/mode-switch-use.c: Ditto. * config/epiphany/resolve-sw-modes.c: Ditto. * config/fr30/fr30.c: Ditto. * config/frv/frv.c: Ditto. * config/h8300/h8300.c: Ditto. * config/i386/i386.c: Ditto. * config/i386/winnt.c: Ditto. * config/ia64/ia64.c: Ditto. * config/iq2000/iq2000.c: Ditto. * config/lm32/lm32.c: Ditto. * config/m32c/m32c.c: Ditto. * config/m32r/m32r.c: Ditto. * config/m68k/m68k.c: Ditto. * config/mcore/mcore.c: Ditto. * config/mep/mep.c: Ditto. * config/microblaze/microblaze.c: Ditto. * config/mips/mips.c: Ditto. * config/mmix/mmix.c: Ditto. * config/mn10300/mn10300.c: Ditto. * config/moxie/moxie.c: Ditto. * config/msp430/msp430.c: Ditto. * config/nds32/nds32-cost.c: Ditto. * config/nds32/nds32-fp-as-gp.c: Ditto. * config/nds32/nds32-intrinsic.c: Ditto. * config/nds32/nds32-isr.c: Ditto. * config/nds32/nds32-md-auxiliary.c: Ditto. * config/nds32/nds32-memory-manipulation.c: Ditto. * config/nds32/nds32-pipelines-auxiliary.c: Ditto. * config/nds32/nds32-predicates.c: Ditto. * config/nds32/nds32.c: Ditto. * config/nios2/nios2.c: Ditto. * config/pa/pa.c: Ditto. * config/pdp11/pdp11.c: Ditto. * config/rl78/rl78.c: Ditto. * config/rs6000/rs6000.c: Ditto. * config/rx/rx.c: Ditto. * config/s390/s390.c: Ditto. * config/sh/sh-mem.cc: Ditto. * config/sh/sh.c: Ditto. * config/sh/sh_optimize_sett_clrt.cc: Ditto. * config/sh/sh_treg_combine.cc: Ditto. * config/sparc/sparc.c: Ditto. * config/spu/spu.c: Ditto. * config/stormy16/stormy16.c: Ditto. * config/tilegx/tilegx.c: Ditto. * config/tilepro/tilepro.c: Ditto. * config/v850/v850.c: Ditto. * config/vax/vax.c: Ditto. * config/xtensa/xtensa.c: Ditto. From-SVN: r216735
2014-10-27 13:41:01 +01:00
#include "predict.h"
#include "hard-reg-set.h"
#include "function.h"
#include "dominance.h"
#include "cfg.h"
gimple.h: Remove all includes. * gimple.h: Remove all includes. (recalculate_side_effects): Move prototype to gimplify.h. * Makefile.in (PLUGIN_HEADERS): Add flattened gimple.h includes. * gengtype.c (open_base_files): Add gimple.h include list. * gimplify.h (recalculate_side_effects): Relocate prototype here. * gimple.c: Adjust include list. (recalculate_side_effects): Move to gimplify.c. * gimplify.c: Adjust include list. (recalculate_side_effects): Relocate from gimple.c. * alias.c: Add required include files removed from gimple.h. * asan.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopmanip.c: Likewise. * cgraphbuild.c: Likewise. * cgraph.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * cilk-common.c: Likewise. * data-streamer.c: Likewise. * data-streamer-in.c: Likewise. * data-streamer-out.c: Likewise. * dse.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * expr.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * gimple-builder.c: Likewise. * gimple-expr.c: Likewise. * gimple-fold.c: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimple-walk.c: Likewise. * gimplify-me.c: Likewise. * graphite-blocking.c: Likewise. * graphite.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * internal-fn.c: Likewise. * ipa.c: Likewise. * ipa-cp.c: Likewise. * ipa-devirt.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline.c: Likewise. * ipa-profile.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * langhooks.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * omp-low.c: Likewise. * opts-global.c: Likewise. * passes.c: Likewise. * predict.c: Likewise. * profile.c: Likewise. * sese.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * symtab.c: Likewise. * targhooks.c: Likewise. * toplev.c: Likewise. * tracer.c: Likewise. * trans-mem.c: Likewise. * tree-affine.c: Likewise. * tree.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-nested.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vrp.c: Likewise. * tsan.c: Likewise. * ubsan.c: Likewise. * value-prof.c: Likewise. * varpool.c: Likewise. * var-tracking.c: Likewise. * vtable-verify.c: Likewise. * ada/gcc-interface/trans.c: Add required include files from gimple.h. * c/c-typeck.c: Add required include files from gimple.h. * c-family/c-common.c: Add required include files from gimple.h. * c-family/c-gimplify.c: Likewise * c-family/cilk.c: Likewise * cp/class.c: Add required include files from gimple.h. * cp/cp-gimplify.c: Likewise * cp/decl2.c: Likewise * cp/init.c: Likewise * cp/optimize.c: Likewise * cp/pt.c: Likewise * cp/semantics.c: Likewise * cp/tree.c: Likewise * cp/typeck.c: Likewise * cp/vtable-class-hierarchy.c: Likewise * fortran/trans.c: Add required include files from gimple.h. * fortran/trans-expr.c: Likewise * fortran/trans-openmp.c: Likewise * go/gofrontend/expressions.cc: Add required include files from gimple.h. * go/gofrontend/gogo-tree.cc: Likewise * go/gofrontend/types.cc: Likewise * go/go-gcc.cc: Likewise * go/go-lang.c: Likewise * java/java-gimplify.c: Add required include files from gimple.h. * lto/lto.c: Add required include files from gimple.h. * lto/lto-lang.c: Likewise * lto/lto-object.c: Likewise * lto/lto-partition.c: Likewise * lto/lto-symtab.c: Likewise * objc/objc-act.c: Add required include files from gimple.h. * config/darwin.c: Add required include files removed from gimple.h. * config/aarch64/aarch64-builtins.c: Likewise. * config/aarch64/aarch64.c: Likewise. * config/alpha/alpha.c: Likewise. * config/i386/i386.c: Likewise. * config/i386/winnt.c: Likewise. * config/ia64/ia64.c: Likewise. * config/m32c/m32c.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/s390/s390.c: Likewise. * config/sh/sh.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/tilegx/tilegx.c: Likewise. * config/tilepro/tilepro.c: Likewise. * config/xtensa/xtensa.c: Likewise. * testsuite/gcc.dg/plugin/finish_unit_plugin.c: Add required include files removed from gimple.h. * testsuite/gcc.dg/plugin/ggcplug.c: Likewise. * testsuite/gcc.dg/plugin/one_time_plugin.c: Likewise. * testsuite/gcc.dg/plugin/selfassign.c: Likewise. * testsuite/gcc.dg/plugin/start_unit_plugin.c: Likewise. * testsuite/g++.dg/plugin/selfassign.c: Likewise. From-SVN: r205272
2013-11-22 16:58:51 +01:00
#include "basic-block.h"
#include "tree-ssa-alias.h"
#include "internal-fn.h"
#include "gimple-expr.h"
tree-ssa.h: Remove all #include's * tree-ssa.h: Remove all #include's * gengtype.c (open_base_files): Adjust include list for gtype-desc.c. * alias.c: Move required includes from tree-ssa.h. * asan.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfgloop.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * dse.c: Likewise. * except.c: Likewise. * expr.c: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * ggc-page.c: Likewise. * gimple-builder.c: Likewise. * gimple-fold.c: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimplify.c: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * loop-init.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * omp-low.c: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * sese.c: Likewise. * targhooks.c: Likewise. * tracer.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tsan.c: Likewise. * value-prof.c: Likewise. * var-tracking.c: Likewise. * varpool.c: Likewise. * vtable-verify.c: Likewise. From-SVN: r203967
2013-10-23 14:16:58 +02:00
#include "gimple.h"
gimple-walk.h: New File. * gimple-walk.h: New File. Relocate prototypes from gimple.h. (struct walk_stmt_info): Relocate here from gimple.h. * gimple-iterator.h: New File. Relocate prototypes from gimple.h. (struct gimple_stmt_iterator_d): Relocate here from gimple.h. (gsi_start_1, gsi_none, gsi_start_bb, gsi_last_1, gsi_last_bb, gsi_end_p, gsi_one_before_end_p, gsi_next, gsi_prev, gsi_stmt, gsi_after_labels, gsi_next_nondebug, gsi_prev_nondebug, gsi_start_nondebug_bb, gsi_start_nondebug_after_labels_bb, gsi_last_nondebug_bb, gsi_bb, gsi_seq): Relocate here from gimple.h. * gimple.h (struct gimple_stmt_iterator_d): Move to gimple-iterator.h. (gsi_start_1, gsi_none, gsi_start_bb, gsi_last_1, gsi_last_bb, gsi_end_p, gsi_one_before_end_p, gsi_next, gsi_prev, gsi_stmt, gsi_after_labels, gsi_next_nondebug, gsi_prev_nondebug, gsi_start_nondebug_bb, gsi_start_nondebug_after_labels_bb, gsi_last_nondebug_bb, gsi_bb, gsi_seq): Move to gimple-iterator.h. (struct walk_stmt_info): Move to gimple-walk.h. (gimple_seq_set_location): Move to gimple.c * gimple-walk.c: New File. (walk_gimple_seq_mod, walk_gimple_seq, walk_gimple_asm, walk_gimple_op, walk_gimple_stmt, get_base_loadstore, walk_stmt_load_store_addr_ops, walk_stmt_load_store_ops): Relocate here from gimple.c. * gimple-iterator.c: Include gimple-iterator.h. * gimple.c (walk_gimple_seq_mod, walk_gimple_seq, walk_gimple_asm, walk_gimple_op, walk_gimple_stmt, get_base_loadstore, walk_stmt_load_store_addr_ops, walk_stmt_load_store_ops): Move to gimple-walk.c. (gimple_seq_set_location): Relocate from gimple.h. * tree-phinodes.h (set_phi_nodes): Move to tree-phinodes.c. * tree-phinodes.c (set_phi_nodes): Relocate from tree-phinodes.h. * gengtype.c (open_base_files): Add gimple-iterator.h to include list. * Makefile.in (OBJS): Add gimple-walk.o * asan.c: Update Include list as required for gimple-iterator.h and gimple-walk.h. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * gimple-fold.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimplify.c: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-profile.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-split.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * omp-low.c: Likewise. * predict.c: Likewise. * profile.c: Likewise. * sese.c: Likewise. * tracer.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-nested.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-predcom.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-stdarg.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tsan.c: Likewise. * value-prof.c: Likewise. * vtable-verify.c: Likewise. * config/aarch64/aarch64-builtins.c: Include gimple-iterator.h. * config/rs6000/rs6000.c: Include gimple-iterator.h and gimple-walk.h. * testsuite/g++.dg/plugin/selfassign.c: Include gimple-iterator.h. * testsuite/gcc.dg/plugin/selfassign.c: Likewise. From-SVN: r204763
2013-11-14 00:54:17 +01:00
#include "gimple-iterator.h"
tree-ssa.h: Remove all #include's * tree-ssa.h: Remove all #include's * gengtype.c (open_base_files): Adjust include list for gtype-desc.c. * alias.c: Move required includes from tree-ssa.h. * asan.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfgloop.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * dse.c: Likewise. * except.c: Likewise. * expr.c: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * ggc-page.c: Likewise. * gimple-builder.c: Likewise. * gimple-fold.c: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimplify.c: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * loop-init.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * omp-low.c: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * sese.c: Likewise. * targhooks.c: Likewise. * tracer.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tsan.c: Likewise. * value-prof.c: Likewise. * var-tracking.c: Likewise. * varpool.c: Likewise. * vtable-verify.c: Likewise. From-SVN: r203967
2013-10-23 14:16:58 +02:00
#include "gimple-ssa.h"
#include "tree-phinodes.h"
#include "ssa-iterators.h"
Factor unrelated declarations out of tree.h. This patch applies the rule that functions defined in FOO.c must be declared in FOO.h. One of the worst offenders in the code base is tree.h, unsurprisingly. The patch creates several new headers: attribs.h calls.h fold-const.h gcc-symtab.h print-rtl.h print-tree.h stmt.h stor-layout.h stringpool.h tree-nested.h tree-object-size.h varasm.h. Functions in each corresponding .c file got moved to those headers and others that already existed. I wanted to make this patch as mechanical as possible, so I made no attempt to fix problems like having build_addr defined in tree-inline.c. I left that for later. There were some declarations that I could not move out of tree.h because of header poisoning or the use of target macros. We forbid the inclusion of things like expr.h from FE files. While that's a reasonable idea, the FE file *still* manage to at expr.c functionality because the declarations they want to use were defined in tree.h. The affected files are builtins.h, emit-rtl.h and expr.h. If that functionality is allowed to be accessed from the FEs, then I will later move those functions out of expr.c into tree.c. I have moved these declarations to the bottom of tree.h so they are easy to identify later. There is a namespace collision with libcpp. The file gcc/symtab.c cannot use gcc/symtab.h because the #include command picks up libcpp/include/symtab.h first. So I named this file gcc-symtab.h for now. Finally, I added a new header to PLUGIN_HEADERS to account for the tree.h refactoring. I did not add all headers factored out of tree.h because it is unclear (and impossible to tell) what plugins need. This adds the one header used by the plugins in the testsuite. This will be changing quite dramatically as we progress with the header refactoring. This patch should offer some minimal incremental build advantages by reducing the size of tree.h. Changes that would otherwise affected tree.h, will now go to other headers which are less frequently included. * tree.h: Include fold-const.h. (aggregate_value_p): Moved to function.h. (alloca_call_p): Moved to calls.h. (allocate_struct_function): Moved to function.h. (apply_tm_attr): Moved to attribs.h. (array_at_struct_end_p): Moved to expr.h. (array_ref_element_size): Moved to tree-dfa.h. (array_ref_low_bound): Moved to tree-dfa.h. (array_ref_up_bound): Moved to tree.h. (assemble_alias): Moved to cgraph.h. (bit_from_pos): Moved to stor-layout.h. (build_addr): Moved to tree-nested.h. (build_duplicate_type): Moved to tree-inline.h. (build_fold_addr_expr): Moved to fold-const.h. (build_fold_addr_expr_with_type): Moved to fold-const.h. (build_fold_addr_expr_with_type_loc): Moved to fold-const.h. (build_fold_indirect_ref): Moved to fold-const.h. (build_fold_indirect_ref_loc): Moved to fold-const.h. (build_personality_function): Moved to tree.h. (build_range_check): Moved to fold-const.h. (build_simple_mem_ref): Moved to fold-const.h. (build_simple_mem_ref_loc): Moved to fold-const.h. (build_tm_abort_call): Moved to trans-mem.h. (byte_from_pos): Moved to stor-layout.h. (call_expr_flags): Moved to calls.h. (can_move_by_pieces): Moved to expr.h. (categorize_ctor_elements): Moved to expr.h. (change_decl_assembler_name): Moved to gcc-symtab.h. (combine_comparisons): Moved to fold-const.h. (complete_ctor_at_level_p): Moved to tree.h. (component_ref_field_offset): Moved to tree-dfa.h. (compute_builtin_object_size): Moved to tree-object-size.h. (compute_record_mode): Moved to stor-layout.h. (constant_boolean_node): Moved to fold-const.h. (constructor_static_from_elts_p): Moved to varasm.h. (cxx11_attribute_p): Moved to attribs.h. (debug_body): Moved to print-tree.h. (debug_find_tree): Moved to tree-inline.h. (debug_fold_checksum): Moved to fold-const.h. (debug_head): Moved to print-tree.h. (debug_head): Moved to print-tree.h. (debug_raw): Moved to print-tree.h. (debug_tree): Moved to print-tree.h. (debug_vec_tree): Moved to print-tree.h. (debug_verbose): Moved to print-tree.h. (debug_verbose): Moved to print-tree.h. (decl_attributes): Moved to attribs.h. (decl_binds_to_current_def_p): Moved to varasm.h. (decl_default_tls_model): Moved to varasm.h. (decl_replaceable_p): Moved to varasm.h. (div_if_zero_remainder): Moved to fold-const.h. (double_int mem_ref_offset): Moved to fold-const.h. (dump_addr): Moved to print-tree.h. (element_precision): Moved to machmode.h. (expand_dummy_function_end): Moved to function.h. (expand_function_end): Moved to function.h. (expand_function_start): Moved to function.h. (expand_label): Moved to stmt.h. (expr_first): Moved to tree-iterator.h. (expr_last): Moved to tree-iterator.h. (finalize_size_functions): Moved to stor-layout.h. (finish_builtin_struct): Moved to stor-layout.h. (finish_record_layout): Moved to stor-layout.h. (fixup_signed_type): Moved to stor-layout.h. (fixup_unsigned_type): Moved to stor-layout.h. (flags_from_decl_or_type): Moved to calls.h. (fold): Moved to fold-const.h. (fold_abs_const): Moved to fold-const.h. (fold_binary): Moved to fold-const.h. (fold_binary_loc): Moved to fold-const.h. (fold_binary_to_constant): Moved to fold-const.h. (fold_build1): Moved to fold-const.h. (fold_build1_initializer_loc): Moved to fold-const.h. (fold_build1_loc): Moved to fold-const.h. (fold_build1_stat_loc): Moved to fold-const.h. (fold_build2): Moved to fold-const.h. (fold_build2_initializer_loc): Moved to fold-const.h. (fold_build2_loc): Moved to fold-const.h. (fold_build2_stat_loc): Moved to fold-const.h. (fold_build3): Moved to fold-const.h. (fold_build3_loc): Moved to fold-const.h. (fold_build3_stat_loc): Moved to fold-const.h. (fold_build_call_array): Moved to fold-const.h. (fold_build_call_array_initializer): Moved to fold-const.h. (fold_build_call_array_initializer_loc): Moved to fold-const.h. (fold_build_call_array_loc): Moved to fold-const.h. (fold_build_cleanup_point_expr): Moved to fold-const.h. (fold_convert): Moved to fold-const.h. (fold_convert_loc): Moved to fold-const.h. (fold_convertible_p): Moved to fold-const.h. (fold_defer_overflow_warnings): Moved to fold-const.h. (fold_deferring_overflow_warnings_p): Moved to fold-const.h. (fold_fma): Moved to fold-const.h. (fold_ignored_result): Moved to fold-const.h. (fold_indirect_ref): Moved to fold-const.h. (fold_indirect_ref_1): Moved to fold-const.h. (fold_indirect_ref_loc): Moved to fold-const.h. (fold_read_from_constant_string): Moved to fold-const.h. (fold_real_zero_addition_p): Moved to fold-const.h. (fold_single_bit_test): Moved to fold-const.h. (fold_strip_sign_ops): Moved to fold-const.h. (fold_ternary): Moved to fold-const.h. (fold_ternary_loc): Moved to fold-const.h. (fold_unary): Moved to tree-data-ref.h. (fold_unary_ignore_overflow): Moved to fold-const.h. (fold_unary_ignore_overflow_loc): Moved to fold-const.h. (fold_unary_loc): Moved to fold-const.h. (fold_unary_to_constant): Moved to fold-const.h. (fold_undefer_and_ignore_overflow_warnings): Moved to fold-const.h. (fold_undefer_overflow_warnings): Moved to fold-const.h. (folding_initializer): Moved to fold-const.h. (free_temp_slots): Moved to function.h. (generate_setjmp_warnings): Moved to function.h. (get_attribute_name): Moved to attribs.h. (get_identifier): Moved to stringpool.h. (get_identifier_with_length): Moved to stringpool.h. (get_inner_reference): Moved to tree.h. (gimple_alloca_call_p): Moved to calls.h. (gimplify_parameters): Moved to function.h. (highest_pow2_factor): Moved to expr.h. (indent_to): Moved to print-tree.h. (init_attributes): Moved to attribs.h. (init_dummy_function_start): Moved to function.h. (init_function_start): Moved to function.h. (init_inline_once): Moved to tree-inline.h. (init_object_sizes): Moved to tree-object-size.h. (init_temp_slots): Moved to function.h. (init_tree_optimization_optabs): Moved to optabs.h. (initialize_sizetypes): Moved to stor-layout.h. (initializer_constant_valid_for_bitfield_p): Moved to varasm.h. (initializer_constant_valid_p): Moved to varasm.h. (int_const_binop): Moved to fold-const.h. (internal_reference_types): Moved to stor-layout.h. (invert_tree_comparison): Moved to fold-const.h. (invert_truthvalue): Moved to fold-const.h. (invert_truthvalue_loc): Moved to fold-const.h. (is_tm_ending_fndecl): Moved to trans-mem.h. (is_tm_may_cancel_outer): Moved to trans-mem.h. (is_tm_pure): Moved to trans-mem.h. (is_tm_safe): Moved to trans-mem.h. (layout_decl): Moved to stor-layout.h. (layout_type): Moved to stor-layout.h. (lookup_attribute_spec): Moved to attribs.h. (make_accum_type): Moved to stor-layout.h. (make_decl_one_only): Moved to varasm.h. (make_decl_rtl): Moved to tree.h. (make_decl_rtl_for_debug): Moved to varasm.h. (make_fract_type): Moved to stor-layout.h. (make_or_reuse_sat_signed_accum_type): Moved to stor-layout.h. (make_or_reuse_sat_signed_fract_type): Moved to stor-layout.h. (make_or_reuse_sat_unsigned_accum_type): Moved to stor-layout.h. (make_or_reuse_sat_unsigned_fract_type): Moved to stor-layout.h. (make_or_reuse_signed_accum_type): Moved to stor-layout.h. (make_or_reuse_signed_fract_type): Moved to stor-layout.h. (make_or_reuse_unsigned_accum_type): Moved to stor-layout.h. (make_or_reuse_unsigned_fract_type): Moved to stor-layout.h. (make_range): Moved to fold-const.h. (make_range_step): Moved to fold-const.h. (make_sat_signed_accum_type): Moved to stor-layout.h. (make_sat_signed_fract_type): Moved to stor-layout.h. (make_sat_unsigned_accum_type): Moved to stor-layout.h. (make_sat_unsigned_fract_type): Moved to stor-layout.h. (make_signed_accum_type): Moved to stor-layout.h. (make_signed_fract_type): Moved to stor-layout.h. (make_signed_type): Moved to stor-layout.h. (make_unsigned_accum_type): Moved to stor-layout.h. (make_unsigned_fract_type): Moved to stor-layout.h. (make_unsigned_type): Moved to stor-layout.h. (mark_decl_referenced): Moved to varasm.h. (mark_referenced): Moved to varasm.h. (may_negate_without_overflow_p): Moved to fold-const.h. (maybe_get_identifier): Moved to stringpool.h. (merge_ranges): Moved to fold-const.h. (merge_weak): Moved to varasm.h. (mode_for_size_tree): Moved to stor-layout.h. (multiple_of_p): Moved to fold-const.h. (must_pass_in_stack_var_size): Moved to calls.h. (must_pass_in_stack_var_size_or_pad): Moved to calls.h. (native_encode_expr): Moved to fold-const.h. (native_interpret_expr): Moved to fold-const.h. (non_lvalue): Moved to fold-const.h. (non_lvalue_loc): Moved to fold-const.h. (normalize_offset): Moved to stor-layout.h. (normalize_rli): Moved to stor-layout.h. (notice_global_symbol): Moved to varasm.h. (omit_one_operand): Moved to fold-const.h. (omit_one_operand_loc): Moved to fold-const.h. (omit_two_operands): Moved to fold-const.h. (omit_two_operands_loc): Moved to fold-const.h. (operand_equal_p): Moved to tree-data-ref.h. (parse_input_constraint): Moved to stmt.h. (parse_output_constraint): Moved to stmt.h. (place_field): Moved to stor-layout.h. (pop_function_context): Moved to function.h. (pop_temp_slots): Moved to function.h. (pos_from_bit): Moved to stor-layout.h. (preserve_temp_slots): Moved to function.h. (print_node): Moved to print-tree.h. (print_node_brief): Moved to print-tree.h. (print_rtl): Moved to rtl.h. (process_pending_assemble_externals): Moved to varasm.h. (ptr_difference_const): Moved to fold-const.h. (push_function_context): Moved to function.h. (push_struct_function): Moved to function.h. (push_temp_slots): Moved to function.h. (record_tm_replacement): Moved to trans-mem.h. (relayout_decl): Moved to stor-layout.h. (resolve_asm_operand_names): Moved to stmt.h. (resolve_unique_section): Moved to varasm.h. (rli_size_so_far): Moved to stor-layout.h. (rli_size_unit_so_far): Moved to stor-layout.h. (round_down): Moved to fold-const.h. (round_down_loc): Moved to fold-const.h. (round_up): Moved to fold-const.h. (round_up_loc): Moved to fold-const.h. (set_decl_incoming_rtl): Moved to emit-rtl.h. (set_decl_rtl): Moved to tree.h. (set_min_and_max_values_for_integral_type): Moved to stor-layout.h. (set_user_assembler_name): Moved to varasm.h. (setjmp_call_p): Moved to calls.h. (size_binop): Moved to fold-const.h. (size_binop_loc): Moved to fold-const.h. (size_diffop): Moved to fold-const.h. (size_diffop_loc): Moved to fold-const.h. (size_int_kind): Moved to fold-const.h. (stack_protect_epilogue): Moved to function.h. (start_record_layout): Moved to stor-layout.h. (supports_one_only): Moved to varasm.h. (swap_tree_comparison): Moved to fold-const.h. (tm_malloc_replacement): Moved to trans-mem.h. (tree build_fold_addr_expr_loc): Moved to fold-const.h. (tree build_invariant_address): Moved to fold-const.h. (tree_binary_nonnegative_warnv_p): Moved to fold-const.h. (tree_binary_nonzero_warnv_p): Moved to fold-const.h. (tree_call_nonnegative_warnv_p): Moved to fold-const.h. (tree_expr_nonnegative_p): Moved to fold-const.h. (tree_expr_nonnegative_warnv_p): Moved to fold-const.h. (tree_output_constant_def): Moved to varasm.h. (tree_overlaps_hard_reg_set): Moved to stmt.h. (tree_single_nonnegative_warnv_p): Moved to fold-const.h. (tree_single_nonzero_warnv_p): Moved to fold-const.h. (tree_swap_operands_p): Moved to fold-const.h. (tree_unary_nonnegative_warnv_p): Moved to fold-const.h. (tree_unary_nonzero_warnv_p): Moved to fold-const.h. (update_alignment_for_field): Moved to stor-layout.h. (use_register_for_decl): Moved to function.h. (variable_size): Moved to rtl.h. (vector_type_mode): Moved to stor-layout.h. * cgraph.h: Corresponding changes. * emit-rtl.h: Corresponding changes. * expr.h: Corresponding changes. * function.h: Corresponding changes. * optabs.h: Corresponding changes. * trans-mem.h: Corresponding changes. Protect against multiple inclusion. * tree-inline.h: Corresponding changes. * tree-iterator.h: Corresponding changes. * tree-dfa.h: Include expr.h. * tree-ssanames.h: Include stringpool.h. * attribs.h: New file. * calls.h: New file. * fold-const.h: New file. * gcc-symtab.h: New file. * print-rtl.h: New file. * print-tree.h: New file. * stmt.h: New file. * stor-layout.h: New file. * strinpool.h: New file. * tree-nested.h: New file * tree-object-size.h: New file. * varasm.h: New file. * Makefile.in (PLUGIN_HEADERS): Add stringpool.h. * alias.c: Include varasm.h. Include expr.h. * asan.c: Include calls.h. Include stor-layout.h. Include varasm.h. * attribs.c: Include stringpool.h. Include attribs.h. Include stor-layout.h. * builtins.c: Include stringpool.h. Include stor-layout.h. Include calls.h. Include varasm.h. Include tree-object-size.h. * calls.c: Include stor-layout.h. Include varasm.h. Include stringpool.h. Include attribs.h. * cfgexpand.c: Include stringpool.h. Include varasm.h. Include stor-layout.h. Include stmt.h. Include print-tree.h. * cgraph.c: Include varasm.h. Include calls.h. Include print-tree.h. * cgraphclones.c: Include stringpool.h. Include function.h. Include emit-rtl.h. Move inclusion of rtl.h earlier in the file. * cgraphunit.c: Include varasm.h. Include stor-layout.h. Include stringpool.h. * cilk-common.c: Include stringpool.h. Include stor-layout.h. * combine.c: Include stor-layout.h. * config/aarch64/aarch64-builtins.c: Include stor-layout.h. Include stringpool.h. Include calls.h. * config/aarch64/aarch64.c: Include stringpool.h. Include stor-layout.h. Include calls.h. Include varasm.h. * config/alpha/alpha.c: Include stor-layout.h. Include calls.h. Include varasm.h. * config/arc/arc.c: Include varasm.h. Include stor-layout.h. Include stringpool.h. Include calls.h. * config/arm/arm.c: Include stringpool.h. Include stor-layout.h. Include calls.h. Include varasm.h. * config/avr/avr-c.c: Include stor-layout.h. * config/avr/avr-log.c: Include print-tree.h. * config/avr/avr.c: Include print-tree.h. Include calls.h. Include stor-layout.h. Include stringpool.h. * config/bfin/bfin.c: Include varasm.h. Include calls.h. * config/c6x/c6x.c: Include stor-layout.h. Include varasm.h. Include calls.h. Include stringpool.h. * config/cr16/cr16.c: Include stor-layout.h. Include calls.h. * config/cris/cris.c: Include varasm.h. Include stor-layout.h. Include calls.h. Include stmt.h. * config/darwin.c: Include stringpool.h. Include varasm.h. Include stor-layout.h. * config/epiphany/epiphany.c: Include stor-layout.h. Include varasm.h. Include calls.h. Include stringpool.h. * config/fr30/fr30.c: Include stor-layout.h. Include varasm.h. * config/frv/frv.c: Include varasm.h. Include stor-layout.h. Include stringpool.h. * config/h8300/h8300.c: Include stor-layout.h. Include varasm.h. Include calls.h. Include stringpool.h. * config/i386/i386.c: Include stringpool.h. Include attribs.h. Include calls.h. Include stor-layout.h. Include varasm.h. * config/i386/winnt-cxx.c: Include stringpool.h. Include attribs.h. * config/i386/winnt.c: Include stringpool.h. Include varasm.h. * config/ia64/ia64-c.c: Include stringpool.h. * config/ia64/ia64.c: Include stringpool.h. Include stor-layout.h. Include calls.h. Include varasm.h. * config/iq2000/iq2000.c: Include stor-layout.h. Include calls.h. Include varasm.h. * config/lm32/lm32.c: Include calls.h. * config/m32c/m32c.c: Include stor-layout.h. Include varasm.h. Include calls.h. * config/m32r/m32r.c: Include stor-layout.h. Include varasm.h. Include stringpool.h. Include calls.h. * config/m68k/m68k.c: Include calls.h. Include stor-layout.h. Include varasm.h. * config/mcore/mcore.c: Include stor-layout.h. Include varasm.h. Include stringpool.h. Include calls.h. * config/mep/mep.c: Include varasm.h. Include calls.h. Include stringpool.h. Include stor-layout.h. * config/microblaze/microblaze.c: Include varasm.h. Include stor-layout.h. Include calls.h. * config/mips/mips.c: Include varasm.h. Include stringpool.h. Include stor-layout.h. Include calls.h. * config/mmix/mmix.c: Include varasm.h. Include stor-layout.h. Include calls.h. * config/mn10300/mn10300.c: Include stor-layout.h. Include varasm.h. Include calls.h. * config/moxie/moxie.c: Include stor-layout.h. Include varasm.h. Include calls.h. * config/msp430/msp430.c: Include stor-layout.h. Include calls.h. * config/nds32/nds32.c: Include stor-layout.h. Include varasm.h. Include calls.h. * config/pa/pa.c: Include stor-layout.h. Include stringpool.h. Include varasm.h. Include calls.h. * config/pdp11/pdp11.c: Include stor-layout.h. Include varasm.h. Include calls.h. * config/picochip/picochip.c: Include calls.h. Include stor-layout.h. Include stringpool.h. Include varasm.h. * config/rl78/rl78.c: Include varasm.h. Include stor-layout.h. Include calls.h. * config/rs6000/rs6000-c.c: Include stor-layout.h. Include stringpool.h. * config/rs6000/rs6000.c: Include stringpool.h. Include stor-layout.h. Include calls.h. Include print-tree.h. Include varasm.h. * config/rx/rx.c: Include varasm.h. Include stor-layout.h. Include calls.h. * config/s390/s390.c: Include print-tree.h. Include stringpool.h. Include stor-layout.h. Include varasm.h. Include calls.h. * config/score/score.c: Include stringpool.h. Include calls.h. Include varasm.h. Include stor-layout.h. * config/sh/sh-c.c: Include stringpool.h. Include attribs.h.h. * config/sh/sh.c: Include stringpool.h. Include stor-layout.h. Include calls.h. Include varasm.h. * config/sol2-c.c: Include stringpool.h. Include attribs.h. * config/sol2-cxx.c: Include stringpool.h. * config/sol2.c: Include stringpool.h. Include varasm.h. * config/sparc/sparc.c: Include stringpool.h. Include stor-layout.h. Include calls.h. Include varasm.h. * config/spu/spu-c.c: Include stringpool.h. * config/spu/spu.c: Include stringpool.h. Include stor-layout.h. Include calls.h. Include varasm.h. * config/stormy16/stormy16.c: Include stringpool.h. Include stor-layout.h. Include varasm.h. Include calls.h. * config/tilegx/tilegx.c: Include stringpool.h. Include stor-layout.h. Include varasm.h. Include calls.h. * config/tilepro/tilepro.c: Include stringpool.h. Include stor-layout.h. Include varasm.h. Include calls.h. * config/v850/v850-c.c: Include stringpool.h. Include attribs.h. * config/v850/v850.c: Include stringpool.h. Include stor-layout.h. Include varasm.h. Include calls.h. * config/vax/vax.c: Include calls.h. Include varasm.h. * config/vms/vms.c: Include stringpool.h. * config/vxworks.c: Include stringpool.h. * config/xtensa/xtensa.c: Include stringpool.h. Include stor-layout.h. Include calls.h. Include varasm.h. * convert.c: Include stor-layout.h. * coverage.c: Include stringpool.h. Include stor-layout.h. * dbxout.c: Include varasm.h. Include stor-layout.h. * dojump.c: Include stor-layout.h. * dse.c: Include stor-layout.h. * dwarf2asm.c: Include stringpool.h. Include varasm.h. * dwarf2cfi.c: Include stor-layout.h. * dwarf2out.c: Include rtl.h. Include stringpool.h. Include stor-layout.h. Include varasm.h. Include function.h. Include emit-rtl.h. Move inclusion of rtl.h earlier in the file. * emit-rtl.c: Include varasm.h. * except.c: Include stringpool.h. Include stor-layout.h. * explow.c: Include stor-layout.h. * expmed.c: Include stor-layout.h. * expr.c: Include stringpool.h. Include stor-layout.h. Include attribs.h. Include varasm.h. * final.c: Include varasm.h. * fold-const.c: Include stor-layout.h. Include calls.h. Include tree-iterator.h. * function.c: Include stor-layout.h. Include varasm.h. Include stringpool.h. * genattrtab.c (write_header): Emit includes for varasm.h, stor-layout.h and calls.h. * genautomata.c (main): Likewise. * genemit.c: Likewise. * genopinit.c: Likewise. * genoutput.c (output_prologue): Likewise. * genpeep.c: Likewise. * genpreds.c (write_insn_preds_c): Likewise. * gengtype.c (open_base_files): Add stringpool.h. * gimple-expr.c: Include stringpool.h. Include stor-layout.h. * gimple-fold.c: Include stringpool.h. Include expr.h. Include stmt.h. Include stor-layout.h. * gimple-low.c: Include tree-nested.h. Include calls.h. * gimple-pretty-print.c: Include stringpool.h. * gimple-ssa-strength-reduction.c: Include stor-layout.h. Include expr.h. * gimple-walk.c: Include stmt.h. * gimple.c: Include calls.h. Include stmt.h. Include stor-layout.h. * gimplify.c: Include stringpool.h. Include calls.h. Include varasm.h. Include stor-layout.h. Include stmt.h. Include print-tree.h. Include expr.h. * gimplify-me.c: Include stmt.h Include stor-layout.h * internal-fn.c: Include stor-layout.h. * ipa-devirt.c: Include print-tree.h. Include calls.h. * ipa-inline-analysis.c: Include stor-layout.h. Include stringpool.h. Include print-tree.h. * ipa-inline.c: Include trans-mem.h. Include calls.h. * ipa-prop.c: Include expr.h. Include stor-layout.h. Include print-tree.h. * ipa-pure-const.c: Include print-tree.h. Include calls.h. * ipa-reference.c: Include calls.h. * ipa-split.c: Include stringpool.h. Include expr.h. Include calls.h. * ipa.c: Include calls.h. Include stringpool.h. * langhooks.c: Include stringpool.h. Include attribs.h. * lto-cgraph.c: Include stringpool.h. * lto-streamer-in.c: Include stringpool.h. * lto-streamer-out.c: Include stor-layout.h. Include stringpool.h. * omp-low.c: Include stringpool.h. Include stor-layout.h. Include expr.h. * optabs.c: Include stor-layout.h. Include stringpool.h. Include varasm.h. * passes.c: Include varasm.h. * predict.c: Include calls.h. * print-rtl.c: Include print-tree.h. * print-tree.c: Include varasm.h. Include print-rtl.h. Include stor-layout.h. * realmpfr.c: Include stor-layout.h. * reg-stack.c: Include varasm.h. * sdbout.c: Include varasm.h. Include stor-layout.h. * simplify-rtx.c: Include varasm.h. * stmt.c: Include varasm.h. Include stor-layout.h. * stor-layout.c: Include stor-layout.h. Include stringpool.h. Include varasm.h. Include print-tree.h. * symtab.c: Include rtl.h. Include print-tree.h. Include varasm.h. Include function.h. Include emit-rtl.h. * targhooks.c: Include stor-layout.h. Include varasm.h. * toplev.c: Include varasm.h. Include tree-inline.h. * trans-mem.c: Include calls.h. Include function.h. Include rtl.h. Include emit-rtl.h. * tree-affine.c: Include expr.h. * tree-browser.c: Include print-tree.h. * tree-call-cdce.c: Include stor-layout.h. * tree-cfg.c: Include trans-mem.h. Include stor-layout.h. Include print-tree.h. * tree-complex.c: Include stor-layout.h. * tree-data-ref.c: Include expr.h. * tree-dfa.c: Include stor-layout.h. * tree-eh.c: Include expr.h. Include calls.h. * tree-emutls.c: Include stor-layout.h. Include varasm.h. * tree-if-conv.c: Include stor-layout.h. * tree-inline.c: Include stor-layout.h. Include calls.h. * tree-loop-distribution.c: Include stor-layout.h. * tree-nested.c: Include stringpool.h. Include stor-layout.h. * tree-object-size.c: Include tree-object-size.h. * tree-outof-ssa.c: Include stor-layout.h. * tree-parloops.c: Include stor-layout.h. Include tree-nested.h. * tree-pretty-print.c: Include stor-layout.h. Include expr.h. * tree-profile.c: Include varasm.h. Include tree-nested.h. * tree-scalar-evolution.c: Include expr.h. * tree-sra.c: Include stor-layout.h. * tree-ssa-address.c: Include stor-layout.h. * tree-ssa-ccp.c: Include stor-layout.h. * tree-ssa-dce.c: Include calls.h. * tree-ssa-dom.c: Include stor-layout.h. * tree-ssa-forwprop.c: Include stor-layout.h. * tree-ssa-ifcombine.c: Include stor-layout.h. * tree-ssa-loop-ivopts.c: Include stor-layout.h. * tree-ssa-loop-niter.c: Include calls.h. Include expr.h. * tree-ssa-loop-prefetch.c: Include stor-layout.h. * tree-ssa-math-opts.c: Include stor-layout.h. * tree-ssa-operands.c: Include stmt.h. Include print-tree.h. * tree-ssa-phiopt.c: Include stor-layout.h. * tree-ssa-reassoc.c: Include stor-layout.h. * tree-ssa-sccvn.c: Include stor-layout.h. * tree-ssa-sink.c: Include stor-layout.h. * tree-ssa-strlen.c: Include stor-layout.h. * tree-ssa-structalias.c: Include stor-layout.h. Include stmt.h. * tree-ssa-tail-merge.c: Include stor-layout.h. Include trans-mem.h. * tree-ssa-uncprop.c: Include stor-layout.h. * tree-ssa.c: Include stor-layout.h. * tree-ssanames.c: Include stor-layout.h. * tree-streamer-in.c: Include stringpool.h. * tree-streamer-out.c: Include stor-layout.h. * tree-switch-conversion.c: Include varasm.h. Include stor-layout.h. * tree-tailcall.c: Include stor-layout.h. * tree-vect-data-refs.c: Include stor-layout.h. * tree-vect-generic.c: Include stor-layout.h. * tree-vect-loop.c: Include stor-layout.h. * tree-vect-patterns.c: Include stor-layout.h. * tree-vect-slp.c: Include stor-layout.h. * tree-vect-stmts.c: Include stor-layout.h. * tree-vectorizer.c: Include stor-layout.h. * tree-vrp.c: Include stor-layout.h. Include calls.h. * tree.c: Include stor-layout.h. Include calls.h. Include attribs.h. Include varasm.h. * tsan.c: Include expr.h. * ubsan.c: Include stor-layout.h. Include stringpool.h. * value-prof.c: Include tree-nested.h. Include calls.h. * var-tracking.c: Include varasm.h. Include stor-layout.h. * varasm.c: Include stor-layout.h. Include stringpool.h. Include gcc-symtab.h. Include varasm.h. * varpool.c: Include varasm.h. * vmsdbgout.c: Include varasm.h. * xcoffout.c: Include varasm.h. ada/ChangeLog * gcc-interface/decl.c: Include stringpool.h Include stor-layout.h * gcc-interface/misc.c: Include stor-layout.h Include print-tree.h * gcc-interface/trans.c: Include stringpool.h Include stor-layout.h Include stmt.h Include varasm.h * gcc-interface/utils.c: Include stringpool.h Include stor-layout.h Include attribs.h Include varasm.h * gcc-interface/utils2.c: Include stringpool.h Include stor-layout.h Include attribs.h Include varasm.h c-family/ChangeLog * c-common.c: Include fold-const.h. Include stor-layout.h. Include calls.h. Include stringpool.h. Include attribs.h. Include varasm.h. Include trans-mem.h. * c-cppbuiltin.c: Include stor-layout.h. Include stringpool.h. * c-format.c: Include stringpool.h. * c-lex.c: Include stringpool.h. Include stor-layout.h. * c-pragma.c: Include stringpool.h. Include attribs.h. Include varasm.h. Include gcc-symtab.h. * c-pretty-print.c: Include stor-layout.h. Include attribs.h. * cilk.c: Include stringpool.h. Include calls.h. c/ChangeLog * c-decl.c: Include print-tree.h. Include stor-layout.h. Include varasm.h. Include attribs.h. Include stringpool.h. * c-lang.c: Include fold-const.h. * c-parser.c: Include stringpool.h. Include attribs.h. Include stor-layout.h. Include varasm.h. Include trans-mem.h. * c-typeck.c: Include stor-layout.h. Include trans-mem.h. Include varasm.h. Include stmt.h. cp/ChangeLog * call.c: Include stor-layout.h. Include trans-mem.h. Include stringpool.h. * class.c: Include stringpool.h. Include stor-layout.h. Include attribs.h. * cp-gimplify.c: Include stor-layout.h. * cvt.c: Include stor-layout.h. * decl.c: Include stringpool.h. Include stor-layout.h. Include varasm.h. Include attribs.h. Include calls.h. * decl2.c: Include stringpool.h. Include varasm.h. Include attribs.h. Include stor-layout.h. Include calls.h. * error.c: Include stringpool.h. * except.c: Include stringpool.h. Include trans-mem.h. Include attribs.h. * init.c: Include stringpool.h. Include varasm.h. * lambda.c: Include stringpool.h. * lex.c: Include stringpool.h. * mangle.c: Include stor-layout.h. Include stringpool.h. * method.c: Include stringpool.h. Include varasm.h. * name-lookup.c: Include stringpool.h. Include print-tree.h. Include attribs.h. * optimize.c: Include stringpool.h. * parser.c: Include print-tree.h. Include stringpool.h. Include attribs.h. Include trans-mem.h. * pt.c: Include stringpool.h. Include varasm.h. Include attribs.h. Include stor-layout.h. * ptree.c: Include print-tree.h. * repo.c: Include stringpool.h. * rtti.c: Include stringpool.h. Include stor-layout.h. * semantics.c: Include stmt.h. Include varasm.h. Include stor-layout.h. Include stringpool.h. * tree.c: Include stor-layout.h. Include print-tree.h. Include tree-iterator.h. * typeck.c: Include stor-layout.h. Include varasm.h. * typeck2.c: Include stor-layout.h. Include varasm.h. * vtable-class-hierarchy.c: Include stringpool.h. Include stor-layout.h. fortran/ChangeLog * decl.c: Include stringpool.h. * iresolve.c: Include stringpool.h. * match.c: Include stringpool.h. * module.c: Include stringpool.h. * target-memory.c: Include stor-layout.h. * trans-common.c: Include stringpool.h. Include stor-layout.h. Include varasm.h. * trans-const.c: Include stor-layout.h. * trans-decl.c: Include stringpool.h. Include stor-layout.h. Include varasm.h. Include attribs.h. * trans-expr.c: Include stringpool.h. * trans-intrinsic.c: Include stringpool.h. Include tree-nested.h. Include stor-layout.h. * trans-io.c: Include stringpool.h. Include stor-layout.h. * trans-openmp.c: Include stringpool.h. * trans-stmt.c: Include stringpool.h. * trans-types.c: Include stor-layout.h. Include stringpool.h. * trans.c: Include stringpool.h. go/ChangeLog * go-backend.c: Include stor-layout.h. * go-gcc.cc: Include stringpool.h. Include stor-layout.h. Include varasm.h. * go-lang.c: Include stor-layout.h. java/ChangeLog * builtins.c: Include stor-layout.h. Include stringpool.h. * class.c: Include stringpool.h. Include stor-layout.h. Include varasm.h. * constants.c: Include stringpool.h. Include stor-layout.h. * decl.c: Include stor-layout.h. Include stringpool.h. Include varasm.h. * except.c: Include stringpool.h. Include stor-layout.h. * expr.c: Include stringpool.h. Include stor-layout.h. * jcf-parse.c: Include stringpool.h. * mangle.c: Include stringpool.h. * resource.c: Include stringpool.h. Include stor-layout.h. * typeck.c: Include stor-layout.h. Include stringpool.h. * verify-glue.c: Include stringpool.h. lto/ChangeLog * lto-lang.c: Include stringpool.h. Include stor-layout.h. * lto-partition.c: Include gcc-symtab.h. * lto.c: Include stor-layout.h. objc/ChangeLog * objc-act.c: Include stringpool.h. Include stor-layout.h. Include attribs.h. * objc-encoding.c: Include stringpool.h. Include stor-layout.h. * objc-gnu-runtime-abi-01.c: Include stringpool.h. * objc-next-runtime-abi-01.c: Include stringpool.h. * objc-next-runtime-abi-02.c: Include stringpool.h. * objc-runtime-shared-support.c: Include stringpool.h. testsuite/ChangeLog * gcc.dg/plugin/selfassign.c: Include stringpool.h. * gcc.dg/plugin/start_unit_plugin.c: Likewise. From-SVN: r205023
2013-11-19 13:31:09 +01:00
#include "stringpool.h"
tree-ssa.h: Remove all #include's * tree-ssa.h: Remove all #include's * gengtype.c (open_base_files): Adjust include list for gtype-desc.c. * alias.c: Move required includes from tree-ssa.h. * asan.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfgloop.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * dse.c: Likewise. * except.c: Likewise. * expr.c: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * ggc-page.c: Likewise. * gimple-builder.c: Likewise. * gimple-fold.c: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimplify.c: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * loop-init.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * omp-low.c: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * sese.c: Likewise. * targhooks.c: Likewise. * tracer.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tsan.c: Likewise. * value-prof.c: Likewise. * var-tracking.c: Likewise. * varpool.c: Likewise. * vtable-verify.c: Likewise. From-SVN: r203967
2013-10-23 14:16:58 +02:00
#include "tree-ssanames.h"
#include "tree-ssa-live.h"
#include "tree-ssa-coalesce.h"
toplev.h: Do not include diagnostic-core.h. 2010-07-08 Manuel López-Ibáñez <manu@gcc.gnu.org> * toplev.h: Do not include diagnostic-core.h. Include diagnostic-core.h in every file that includes toplev.h. * c-tree.h: Do not include toplev.h. * pretty-print.h: Update comment. * Makefile.in: Update dependencies. * alias.c: Include diagnostic-core.h in every file that includes toplev.h. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgbuild.c: Likewise. * cfgcleanup.c: Likewise. * cfghooks.c: Likewise. * cfgloop.c: Likewise. * combine.c: Likewise. * config/alpha/alpha.c: Likewise. * config/arc/arc.c: Likewise. * config/arm/arm.c: Likewise. * config/arm/pe.c: Likewise. * config/avr/avr.c: Likewise. * config/bfin/bfin.c: Likewise. * config/cris/cris.c: Likewise. * config/crx/crx.c: Likewise. * config/darwin-c.c: Likewise. * config/darwin.c: Likewise. * config/fr30/fr30.c: Likewise. * config/frv/frv.c: Likewise. * config/h8300/h8300.c: Likewise. * config/host-darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/i386/netware.c: Likewise. * config/i386/nwld.c: Likewise. * config/i386/winnt-cxx.c: Likewise. * config/i386/winnt-stubs.c: Likewise. * config/i386/winnt.c: Likewise. * config/ia64/ia64-c.c: Likewise. * config/ia64/ia64.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/lm32/lm32.c: Likewise. * config/m32c/m32c-pragma.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32r/m32r.c: Likewise. * config/m68hc11/m68hc11.c: Likewise. * config/m68k/m68k.c: Likewise. * config/mcore/mcore.c: Likewise. * config/mep/mep-pragma.c: Likewise. * config/mep/mep.c: Likewise. * config/mmix/mmix.c: Likewise. * config/mn10300/mn10300.c: Likewise. * config/moxie/moxie.c: Likewise. * config/pa/pa.c: Likewise. * config/pdp11/pdp11.c: Likewise. * config/picochip/picochip.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/s390/s390.c: Likewise. * config/score/score.c: Likewise. * config/score/score3.c: Likewise. * config/score/score7.c: Likewise. * config/sh/sh.c: Likewise. * config/sh/symbian-base.c: Likewise. * config/sh/symbian-c.c: Likewise. * config/sh/symbian-cxx.c: Likewise. * config/sol2-c.c: Likewise. * config/sol2.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/v850/v850-c.c: Likewise. * config/v850/v850.c: Likewise. * config/vax/vax.c: Likewise. * config/vxworks.c: Likewise. * config/xtensa/xtensa.c: Likewise. * convert.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbxout.c: Likewise. * ddg.c: Likewise. * dominance.c: Likewise. * emit-rtl.c: Likewise. * explow.c: Likewise. * expmed.c: Likewise. * fixed-value.c: Likewise. * fold-const.c: Likewise. * fwprop.c: Likewise. * gcse.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * gimple-low.c: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * haifa-sched.c: Likewise. * ifcvt.c: Likewise. * implicit-zee.c: Likewise. * integrate.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-iv.c: Likewise. * lto-opts.c: Likewise. * lto-symtab.c: Likewise. * main.c: Likewise. * modulo-sched.c: Likewise. * optabs.c: Likewise. * params.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * profile.c: Likewise. * real.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * reorg.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtlanal.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-rgn.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * simplify-rtx.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * targhooks.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-inline.c: Likewise. * tree-nomudflap.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-phinodes.c: Likewise. * tree-profile.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vrp.c: Likewise. * varasm.c: Likewise. * vec.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. c-family/ * c-common.h: Include diagnostic-core.h. Error if already included. * c-semantics.c: Do not define GCC_DIAG_STYLE here. cp/ * cp-tree.h: Do not include toplev.h. java/ * boehm.c: Include diagnostic-core.h in every file that includes toplev.h. * class.c: Likewise. * constants.c: Likewise. * decl.c: Likewise. * except.c: Likewise. * expr.c: Likewise. * jcf-parse.c: Likewise. * mangle.c: Likewise. * mangle_name.c: Likewise. * resource.c: Likewise. * typeck.c: Likewise. * verify-glue.c: Likewise. ada/ * gcc-interface/utils.c: Include diagnostic-core.h in every file that includes toplev.h. lto/ * lto-coff.c: Include diagnostic-core.h in every file that includes toplev.h. * lto-elf.c: Likewise. * lto-lang.c: Likewise. * lto-macho.c: Likewise. From-SVN: r161943
2010-07-08 06:22:54 +02:00
#include "diagnostic-core.h"
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
/* This set of routines implements a coalesce_list. This is an object which
is used to track pairs of ssa_names which are desirable to coalesce
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
together to avoid copies. Costs are associated with each pair, and when
all desired information has been collected, the object can be used to
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
order the pairs for processing. */
/* This structure defines a pair entry. */
typedef struct coalesce_pair
{
int first_element;
int second_element;
int cost;
} * coalesce_pair_p;
c-common.c (fname_as_string, [...]): Constify. * c-common.c (fname_as_string, c_type_hash): Constify. * c-typeck.c (free_all_tagged_tu_seen_up_to): Likewise. * cgraph.c (edge_hash, edge_eq): Likewise. * dwarf2out.c (decl_die_table_eq, decl_loc_table_eq): Likewise. * emit-rtl.c (mem_attrs_htab_eq, reg_attrs_htab_hash, reg_attrs_htab_eq): Likewise. * except.c (t2r_eq, t2r_hash, ttypes_filter_eq, ehl_hash, ehl_eq): Likewise. * genautomata.c (const_reserv_sets_t, const_unit_decl_t, const_decl_t, const_state_t, const_automata_list_el_t): New. (first_out_arc, DECL_UNIT, DECL_BYPASS, DECL_AUTOMATON, DECL_EXCL, DECL_PRESENCE, DECL_ABSENCE, DECL_RESERV, DECL_INSN_RESERV, automaton_decl_hash, automaton_decl_eq_p, insn_decl_hash, insn_decl_eq_p, decl_hash, decl_eq_p, alt_state_cmp, reserv_sets_cmp, reserv_sets_eq, state_hash, state_eq_p, automata_list_hash, automata_list_eq_p, compare_states_for_equiv, compare_max_occ_cycle_nums, out_state_arcs_num, compare_transition_els_num, units_cmp, state_reservs_cmp): Constify. * genmodes.c (cmp_modes): Likewise. * ggc-common.c (saving_htab_hash, saving_htab_eq): Likewise. * gimplify.c (compare_case_labels): Likewise. * ipa-type-escape.c (get_name_of_type, type_brand_s): Likewise. * loop-unroll.c (si_info_hash, ve_info_hash): Likewise. * matrix-reorg.c (mtt_info_hash): Likewise. * postreload-gcse.c (hash_expr_for_htab, expr_equiv_p): Likewise. * rtl-factoring.c (const_p_hash_bucket, const_p_hash_elem): New. (htab_hash_bucket, htab_hash_elem): Constify. * tree-browser.c (TB_parent_eq): Likewise. * tree-scalar-evolution.c (hash_scev_info): Likewise. * tree-ssa-alias.c (sort_tags_by_id): Likewise. * tree-ssa-coalesce.c (const_coalesce_pair_p): New. (coalesce_pair_map_hash, coalesce_pair_map_eq, compare_pairs): Constify. * tree-ssa-dom.c (avail_expr_hash, avail_expr_eq): Likewise. * tree-ssa-pre.c (const_expr_pred_trans_t): New. (expr_pred_trans_hash, expr_pred_trans_eq): Constify. * tree-ssa-sccvn.c (const_vn_binary_op_t, const_vn_unary_op_t, const_vn_phi_t, const_vn_reference_op_t, const_vn_reference_t): New. (vn_reference_op_eq, vn_reference_hash, vn_reference_eq, vn_unary_op_hash, vn_unary_op_eq, vn_binary_op_hash, vn_binary_op_eq, vn_phi_hash, vn_phi_eq): Constify. * tree-ssa-threadupdate.c (redirection_data_hash, redirection_data_eq): Likewise. * tree-ssa-uncprop.c (equiv_hash, equiv_eq): Likewise. * tree-ssa.c (var_ann_eq): Likewise. * tree-vrp.c (compare_case_labels): Likewise. * tree.c (int_cst_hash_hash, int_cst_hash_eq, tree_map_base_marked_p, type_hash_marked_p, tree_check_failed, tree_not_check_failed, tree_class_check_failed, tree_range_check_failed, tree_not_class_check_failed, omp_clause_check_failed, omp_clause_range_check_failed, tree_contains_struct_check_failed, tree_operand_check_failed): Likewise. * tree.h (tree_contains_struct_check_failed, tree_check_failed, tree_not_check_failed, tree_class_check_failed, tree_range_check_failed, tree_not_class_check_failed, tree_operand_check_failed, omp_clause_operand_check_failed, tree_operand_length): Likewise. * var-tracking.c (const_variable): New. (variable_htab_hash, variable_htab_eq): Constify. * varasm.c (const_desc_hash): Likewise. cp: * decl.c (typename_hash, typename_compare): Constify. * mangle.c (hash_type, compare_type): Likewise. * pt.c (eq_local_specializations, hash_local_specialization): Likewise. * tree.c (cplus_array_hash, cplus_array_compare, list_hash_eq, list_hash): Likewise. * typeck2.c (pat_compare): Likewise. fortran: * gfortran.h (generate_isocbinding_symbol): Constify. * symbol.c (gen_special_c_interop_ptr, gen_cptr_param, generate_isocbinding_symbol): Likewise. java: * class.c (java_treetreehash_hash, java_treetreehash_compare): Constify. * expr.c (type_assertion_eq): Likewise. * jcf-io.c (compare_path): Likewise. * jcf-parse.c (cmpstringp): Likewise. * verify-impl.c (get_one_type, compute_argument_types, compute_return_type): Likewise. objc: * objc-act.c (volatilized_hash, volatilized_eq, string_hash, string_eq): Constify. From-SVN: r126925
2007-07-25 21:06:06 +02:00
typedef const struct coalesce_pair *const_coalesce_pair_p;
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
This patch extracts approved portions of the hash_table patches to the... This patch extracts approved portions of the hash_table patches to the cxx-conversion branch for files not under gcc/config. Update various hash tables from htab_t to hash_table. Modify types and calls to match. * tree-ssa-coalesce.c'coalesce_list_d.list from htab_t to hash_table. Fold coalesce_pair_map_hash and coalesce_pair_map_eq into new struct coalesce_pair_hasher. Removed struct coalesce_pair_iterator, as did not meet the hash_table iterator interface and it provided no significant code reduction. This leads to a change in the implementation of FOR_EACH_PARTITION_PAIR. * statistics.c'statistics_hashes Fold hash_statistics_eq into new struct stats_counter_hasher. * hash-table.h'hash_table Add documentation. Add nested class iterator and methods to hash_table. Add FOR_EACH_HASH_TABLE_ELEMENT implemented with those iterators. Change uses of FOR_EACH_HTAB_ELEMENT to FOR_EACH_HASH_TABLE_ELEMENT. * tree-ssa-sccvn.c'vn_tables_s.nary Fold vn_nary_op_hash, vn_nary_op_eq into new struct vn_nary_op_hasher. Add typedef vn_nary_op_table_type. Add typedef vn_nary_op_iterator_type. * tree-ssa-sccvn.c'vn_tables_s.phis Fold vn_phi_hash, free_phi into new struct vn_phi_hasher. Add typedef vn_phi_table_type. Add typedef vn_phi_iterator_type. * tree-ssa-sccvn.c'vn_tables_s.references Fold vn_reference_hash, vn_reference_op_eq, free_reference into new struct vn_reference_hasher. Add typedef vn_reference_table_type. Add typedef vn_reference_iterator_type. * tree-ssa-sccvn.c'constant_value_ids Fold vn_constant_hash, vn_constant_eq into new struct vn_constant_hasher. * tree-into-ssa.c'var_infos Fold var_info_hash, var_info_eq into new struct var_info_hasher. * tree-vectorizer.h'_loop_vec_info::peeling_htab * tree-vectorizer.h New struct peel_info_hasher. * tree-vect-loop.c Update dependent calls and types to match. * tree-vect-data-refs.c Fold vect_peeling_hash and vect_peeling_hash_eq into struct peel_info_hasher. * tree-ssa-reassoc.c'undistribute_ops_list::ctable Fold oecount_hash and oecount_eq into new struct oecount_hasher. * tree-ssa-loop-im.c'memory_accesses.refs Fold memref_hash and memref_eq into new struct mem_ref_hasher. Tested on x86_64. Index: gcc/ChangeLog 2013-04-23 Lawrence Crowl <crowl@google.com> * Makefile.in: Update as needed below. * hash-table.h (class hash_table): Correct many methods with parameter types compare_type to the correct value_type. (Correct code was unlikely to notice the change.) (hash_table::elements_with_deleted) New. (class hashtable::iterator): New. (hashtable::begin()): New. (hashtable::end()): New. (FOR_EACH_HASH_TABLE_ELEMENT): New. * statistics.c (statistics_hashes): Change type to hash_table. Update dependent calls and types. * tree-into-ssa.c (var_infos): Change type to hash_table. Update dependent calls and types. * tree-ssa-coalesce.c (struct coalesce_list_d.list): Change type to hash_table. Update dependent calls and types. * tree-ssa-loop-im.c (struct mem_ref.refs): Change type to hash_table. Update dependent calls and types. * tree-ssa-reassoc.c (undistribute_ops_list::ctable): Change type to hash_table. Update dependent calls and types. * tree-ssa-sccvn.c (vn_tables_s::nary): Change type to hash_table. Update dependent calls and types. (vn_tables_s::phis): Likewise. (vn_tables_s::references): Likewise. * tree-ssa-sccvn.h (vn_nary_op_eq): Update parameter and return types. (vn_reference_eq): Update parameter and return types. * tree-ssa-structalias.c (pointer_equiv_class_table): Change type to hash_table. Update dependent calls and types. (location_equiv_class_table): Likewise. * tree-vect-data-refs.c: Consequential changes for making peeling a hash_table. * tree-vect-loop.c (new_loop_vec_info): Dependent hash_table update. (destroy_loop_vec_info): Dependent hash_table update. * tree-vectorizer.h (peeling_htab): Change type to hash_table. Update dependent calls and types. From-SVN: r198213
2013-04-24 00:00:12 +02:00
/* Coalesce pair hashtable helpers. */
hash-table.h: Update comments. gcc/ * hash-table.h: Update comments. * hash-traits.h (pointer_hash): Don't inherit from typed_noop_remove. (nofree_ptr_hash): New class. * asan.c (asan_mem_ref_hasher): Inherit from nofree_ptr_hash rather than typed_noop_remove. Remove redudant typedefs. * attribs.c (attribute_hasher): Likewise. * cfg.c (bb_copy_hasher): Likewise. * cselib.c (cselib_hasher): Likewise. * dse.c (invariant_group_base_hasher): Likewise. * dwarf2cfi.c (trace_info_hasher): Likewise. * dwarf2out.c (macinfo_entry_hasher): Likewise. (comdat_type_hasher, loc_list_hasher): Likewise. * gcse.c (pre_ldst_expr_hasher): Likewise. * genmatch.c (id_base): Likewise. * genrecog.c (test_pattern_hasher): Likewise. * gimple-ssa-strength-reduction.c (cand_chain_hasher): Likewise. * haifa-sched.c (delay_i1_hasher): Likewise. * hard-reg-set.h (simplifiable_subregs_hasher): Likewise. * ipa-icf.h (congruence_class_group_hash): Likewise. * ipa-profile.c (histogram_hash): Likewise. * ira-color.c (allocno_hard_regs_hasher): Likewise. * lto-streamer.h (string_slot_hasher): Likewise. * lto-streamer.c (tree_entry_hasher): Likewise. * plugin.c (event_hasher): Likewise. * postreload-gcse.c (expr_hasher): Likewise. * store-motion.c (st_expr_hasher): Likewise. * tree-sra.c (uid_decl_hasher): Likewise. * tree-ssa-coalesce.c (coalesce_pair_hasher): Likewise. (ssa_name_var_hash): Likewise. * tree-ssa-live.c (tree_int_map_hasher): Likewise. * tree-ssa-loop-im.c (mem_ref_hasher): Likewise. * tree-ssa-pre.c (pre_expr_d): Likewise. * tree-ssa-sccvn.c (vn_nary_op_hasher): Likewise. * vtable-verify.h (registration_hasher): Likewise. * vtable-verify.c (vtbl_map_hasher): Likewise. * config/arm/arm.c (libcall_hasher): Likewise. * config/i386/winnt.c (wrapped_symbol_hasher): Likewise. * config/ia64/ia64.c (bundle_state_hasher): Likewise. * config/sol2.c (comdat_entry_hasher): Likewise. * fold-const.c (fold): Use nofree_ptr_hash instead of pointer_hash. (print_fold_checksum, fold_checksum_tree): Likewise. (debug_fold_checksum, fold_build1_stat_loc): Likewise. (fold_build2_stat_loc, fold_build3_stat_loc): Likewise. (fold_build_call_array_loc): Likewise. * tree-ssa-ccp.c (gimple_htab): Likewise. * tree-browser.c (tree_upper_hasher): Inherit from nofree_ptr_hash rather than pointer_type. gcc/c/ * c-decl.c (detect_field_duplicates_hash): Use nofree_ptr_hash instead of pointer_hash. (detect_field_duplicates): Likewise. gcc/cp/ * class.c (fixed_type_or_null_ref_ht): Inherit from nofree_ptr_hash rather than pointer_hash. (fixed_type_or_null): Use nofree_ptr_hash instead of pointer_hash. * semantics.c (nrv_data): Likewise. * tree.c (verify_stmt_tree_r, verify_stmt_tree): Likewise. gcc/java/ * jcf-io.c (charstar_hash): Inherit from nofree_ptr_hash rather than typed_noop_remove. Remove redudant typedefs. gcc/lto/ * lto.c (tree_scc_hasher): Inherit from nofree_ptr_hash rather than typed_noop_remove. Remove redudant typedefs. gcc/objc/ * objc-act.c (decl_name_hash): Inherit from nofree_ptr_hash rather than typed_noop_remove. Remove redudant typedefs. libcc1/ * plugin.cc (string_hasher): Inherit from nofree_ptr_hash rather than typed_noop_remove. Remove redudant typedefs. (plugin_context): Use nofree_ptr_hash rather than pointer_hash. (plugin_context::mark): Likewise. From-SVN: r224957
2015-06-25 19:06:13 +02:00
struct coalesce_pair_hasher : nofree_ptr_hash <coalesce_pair>
This patch extracts approved portions of the hash_table patches to the... This patch extracts approved portions of the hash_table patches to the cxx-conversion branch for files not under gcc/config. Update various hash tables from htab_t to hash_table. Modify types and calls to match. * tree-ssa-coalesce.c'coalesce_list_d.list from htab_t to hash_table. Fold coalesce_pair_map_hash and coalesce_pair_map_eq into new struct coalesce_pair_hasher. Removed struct coalesce_pair_iterator, as did not meet the hash_table iterator interface and it provided no significant code reduction. This leads to a change in the implementation of FOR_EACH_PARTITION_PAIR. * statistics.c'statistics_hashes Fold hash_statistics_eq into new struct stats_counter_hasher. * hash-table.h'hash_table Add documentation. Add nested class iterator and methods to hash_table. Add FOR_EACH_HASH_TABLE_ELEMENT implemented with those iterators. Change uses of FOR_EACH_HTAB_ELEMENT to FOR_EACH_HASH_TABLE_ELEMENT. * tree-ssa-sccvn.c'vn_tables_s.nary Fold vn_nary_op_hash, vn_nary_op_eq into new struct vn_nary_op_hasher. Add typedef vn_nary_op_table_type. Add typedef vn_nary_op_iterator_type. * tree-ssa-sccvn.c'vn_tables_s.phis Fold vn_phi_hash, free_phi into new struct vn_phi_hasher. Add typedef vn_phi_table_type. Add typedef vn_phi_iterator_type. * tree-ssa-sccvn.c'vn_tables_s.references Fold vn_reference_hash, vn_reference_op_eq, free_reference into new struct vn_reference_hasher. Add typedef vn_reference_table_type. Add typedef vn_reference_iterator_type. * tree-ssa-sccvn.c'constant_value_ids Fold vn_constant_hash, vn_constant_eq into new struct vn_constant_hasher. * tree-into-ssa.c'var_infos Fold var_info_hash, var_info_eq into new struct var_info_hasher. * tree-vectorizer.h'_loop_vec_info::peeling_htab * tree-vectorizer.h New struct peel_info_hasher. * tree-vect-loop.c Update dependent calls and types to match. * tree-vect-data-refs.c Fold vect_peeling_hash and vect_peeling_hash_eq into struct peel_info_hasher. * tree-ssa-reassoc.c'undistribute_ops_list::ctable Fold oecount_hash and oecount_eq into new struct oecount_hasher. * tree-ssa-loop-im.c'memory_accesses.refs Fold memref_hash and memref_eq into new struct mem_ref_hasher. Tested on x86_64. Index: gcc/ChangeLog 2013-04-23 Lawrence Crowl <crowl@google.com> * Makefile.in: Update as needed below. * hash-table.h (class hash_table): Correct many methods with parameter types compare_type to the correct value_type. (Correct code was unlikely to notice the change.) (hash_table::elements_with_deleted) New. (class hashtable::iterator): New. (hashtable::begin()): New. (hashtable::end()): New. (FOR_EACH_HASH_TABLE_ELEMENT): New. * statistics.c (statistics_hashes): Change type to hash_table. Update dependent calls and types. * tree-into-ssa.c (var_infos): Change type to hash_table. Update dependent calls and types. * tree-ssa-coalesce.c (struct coalesce_list_d.list): Change type to hash_table. Update dependent calls and types. * tree-ssa-loop-im.c (struct mem_ref.refs): Change type to hash_table. Update dependent calls and types. * tree-ssa-reassoc.c (undistribute_ops_list::ctable): Change type to hash_table. Update dependent calls and types. * tree-ssa-sccvn.c (vn_tables_s::nary): Change type to hash_table. Update dependent calls and types. (vn_tables_s::phis): Likewise. (vn_tables_s::references): Likewise. * tree-ssa-sccvn.h (vn_nary_op_eq): Update parameter and return types. (vn_reference_eq): Update parameter and return types. * tree-ssa-structalias.c (pointer_equiv_class_table): Change type to hash_table. Update dependent calls and types. (location_equiv_class_table): Likewise. * tree-vect-data-refs.c: Consequential changes for making peeling a hash_table. * tree-vect-loop.c (new_loop_vec_info): Dependent hash_table update. (destroy_loop_vec_info): Dependent hash_table update. * tree-vectorizer.h (peeling_htab): Change type to hash_table. Update dependent calls and types. From-SVN: r198213
2013-04-24 00:00:12 +02:00
{
remove need for store_values_directly This switches all hash_table users to use the layout that stores elements of type value_type in the hash table instead of the one storing value_type *. Since it becomes unused support for the value_type * layout is removed. gcc/ * hash-table.h: Remove version of hash_table that stored value_type *. * asan.c, attribs.c, bitmap.c, cfg.c, cgraph.h, config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c, config/mips/mips.c, config/sol2.c, coverage.c, cselib.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c, gcse.c, genmatch.c, ggc-common.c, gimple-ssa-strength-reduction.c, gimplify.c, haifa-sched.c, hard-reg-set.h, hash-map.h, hash-set.h, ipa-devirt.c, ipa-icf.h, ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lto-streamer.h, plugin.c, postreload-gcse.c, reginfo.c, statistics.c, store-motion.c, trans-mem.c, tree-cfg.c, tree-eh.c, tree-hasher.h, tree-into-ssa.c, tree-parloops.c, tree-sra.c, tree-ssa-coalesce.c, tree-ssa-dom.c, tree-ssa-live.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-threadupdate.c, tree-vectorizer.c, tree-vectorizer.h, valtrack.h, var-tracking.c, vtable-verify.c, vtable-verify.h: Adjust. libcc1/ * plugin.cc: Adjust for hash_table changes. gcc/java/ * jcf-io.c: Adjust for hash_table changes. gcc/lto/ * lto.c: Adjust for hash_table changes. gcc/objc/ * objc-act.c: Adjust for hash_table changes. From-SVN: r222213
2015-04-18 20:13:18 +02:00
static inline hashval_t hash (const coalesce_pair *);
static inline bool equal (const coalesce_pair *, const coalesce_pair *);
This patch extracts approved portions of the hash_table patches to the... This patch extracts approved portions of the hash_table patches to the cxx-conversion branch for files not under gcc/config. Update various hash tables from htab_t to hash_table. Modify types and calls to match. * tree-ssa-coalesce.c'coalesce_list_d.list from htab_t to hash_table. Fold coalesce_pair_map_hash and coalesce_pair_map_eq into new struct coalesce_pair_hasher. Removed struct coalesce_pair_iterator, as did not meet the hash_table iterator interface and it provided no significant code reduction. This leads to a change in the implementation of FOR_EACH_PARTITION_PAIR. * statistics.c'statistics_hashes Fold hash_statistics_eq into new struct stats_counter_hasher. * hash-table.h'hash_table Add documentation. Add nested class iterator and methods to hash_table. Add FOR_EACH_HASH_TABLE_ELEMENT implemented with those iterators. Change uses of FOR_EACH_HTAB_ELEMENT to FOR_EACH_HASH_TABLE_ELEMENT. * tree-ssa-sccvn.c'vn_tables_s.nary Fold vn_nary_op_hash, vn_nary_op_eq into new struct vn_nary_op_hasher. Add typedef vn_nary_op_table_type. Add typedef vn_nary_op_iterator_type. * tree-ssa-sccvn.c'vn_tables_s.phis Fold vn_phi_hash, free_phi into new struct vn_phi_hasher. Add typedef vn_phi_table_type. Add typedef vn_phi_iterator_type. * tree-ssa-sccvn.c'vn_tables_s.references Fold vn_reference_hash, vn_reference_op_eq, free_reference into new struct vn_reference_hasher. Add typedef vn_reference_table_type. Add typedef vn_reference_iterator_type. * tree-ssa-sccvn.c'constant_value_ids Fold vn_constant_hash, vn_constant_eq into new struct vn_constant_hasher. * tree-into-ssa.c'var_infos Fold var_info_hash, var_info_eq into new struct var_info_hasher. * tree-vectorizer.h'_loop_vec_info::peeling_htab * tree-vectorizer.h New struct peel_info_hasher. * tree-vect-loop.c Update dependent calls and types to match. * tree-vect-data-refs.c Fold vect_peeling_hash and vect_peeling_hash_eq into struct peel_info_hasher. * tree-ssa-reassoc.c'undistribute_ops_list::ctable Fold oecount_hash and oecount_eq into new struct oecount_hasher. * tree-ssa-loop-im.c'memory_accesses.refs Fold memref_hash and memref_eq into new struct mem_ref_hasher. Tested on x86_64. Index: gcc/ChangeLog 2013-04-23 Lawrence Crowl <crowl@google.com> * Makefile.in: Update as needed below. * hash-table.h (class hash_table): Correct many methods with parameter types compare_type to the correct value_type. (Correct code was unlikely to notice the change.) (hash_table::elements_with_deleted) New. (class hashtable::iterator): New. (hashtable::begin()): New. (hashtable::end()): New. (FOR_EACH_HASH_TABLE_ELEMENT): New. * statistics.c (statistics_hashes): Change type to hash_table. Update dependent calls and types. * tree-into-ssa.c (var_infos): Change type to hash_table. Update dependent calls and types. * tree-ssa-coalesce.c (struct coalesce_list_d.list): Change type to hash_table. Update dependent calls and types. * tree-ssa-loop-im.c (struct mem_ref.refs): Change type to hash_table. Update dependent calls and types. * tree-ssa-reassoc.c (undistribute_ops_list::ctable): Change type to hash_table. Update dependent calls and types. * tree-ssa-sccvn.c (vn_tables_s::nary): Change type to hash_table. Update dependent calls and types. (vn_tables_s::phis): Likewise. (vn_tables_s::references): Likewise. * tree-ssa-sccvn.h (vn_nary_op_eq): Update parameter and return types. (vn_reference_eq): Update parameter and return types. * tree-ssa-structalias.c (pointer_equiv_class_table): Change type to hash_table. Update dependent calls and types. (location_equiv_class_table): Likewise. * tree-vect-data-refs.c: Consequential changes for making peeling a hash_table. * tree-vect-loop.c (new_loop_vec_info): Dependent hash_table update. (destroy_loop_vec_info): Dependent hash_table update. * tree-vectorizer.h (peeling_htab): Change type to hash_table. Update dependent calls and types. From-SVN: r198213
2013-04-24 00:00:12 +02:00
};
/* Hash function for coalesce list. Calculate hash for PAIR. */
inline hashval_t
remove need for store_values_directly This switches all hash_table users to use the layout that stores elements of type value_type in the hash table instead of the one storing value_type *. Since it becomes unused support for the value_type * layout is removed. gcc/ * hash-table.h: Remove version of hash_table that stored value_type *. * asan.c, attribs.c, bitmap.c, cfg.c, cgraph.h, config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c, config/mips/mips.c, config/sol2.c, coverage.c, cselib.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c, gcse.c, genmatch.c, ggc-common.c, gimple-ssa-strength-reduction.c, gimplify.c, haifa-sched.c, hard-reg-set.h, hash-map.h, hash-set.h, ipa-devirt.c, ipa-icf.h, ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lto-streamer.h, plugin.c, postreload-gcse.c, reginfo.c, statistics.c, store-motion.c, trans-mem.c, tree-cfg.c, tree-eh.c, tree-hasher.h, tree-into-ssa.c, tree-parloops.c, tree-sra.c, tree-ssa-coalesce.c, tree-ssa-dom.c, tree-ssa-live.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-threadupdate.c, tree-vectorizer.c, tree-vectorizer.h, valtrack.h, var-tracking.c, vtable-verify.c, vtable-verify.h: Adjust. libcc1/ * plugin.cc: Adjust for hash_table changes. gcc/java/ * jcf-io.c: Adjust for hash_table changes. gcc/lto/ * lto.c: Adjust for hash_table changes. gcc/objc/ * objc-act.c: Adjust for hash_table changes. From-SVN: r222213
2015-04-18 20:13:18 +02:00
coalesce_pair_hasher::hash (const coalesce_pair *pair)
This patch extracts approved portions of the hash_table patches to the... This patch extracts approved portions of the hash_table patches to the cxx-conversion branch for files not under gcc/config. Update various hash tables from htab_t to hash_table. Modify types and calls to match. * tree-ssa-coalesce.c'coalesce_list_d.list from htab_t to hash_table. Fold coalesce_pair_map_hash and coalesce_pair_map_eq into new struct coalesce_pair_hasher. Removed struct coalesce_pair_iterator, as did not meet the hash_table iterator interface and it provided no significant code reduction. This leads to a change in the implementation of FOR_EACH_PARTITION_PAIR. * statistics.c'statistics_hashes Fold hash_statistics_eq into new struct stats_counter_hasher. * hash-table.h'hash_table Add documentation. Add nested class iterator and methods to hash_table. Add FOR_EACH_HASH_TABLE_ELEMENT implemented with those iterators. Change uses of FOR_EACH_HTAB_ELEMENT to FOR_EACH_HASH_TABLE_ELEMENT. * tree-ssa-sccvn.c'vn_tables_s.nary Fold vn_nary_op_hash, vn_nary_op_eq into new struct vn_nary_op_hasher. Add typedef vn_nary_op_table_type. Add typedef vn_nary_op_iterator_type. * tree-ssa-sccvn.c'vn_tables_s.phis Fold vn_phi_hash, free_phi into new struct vn_phi_hasher. Add typedef vn_phi_table_type. Add typedef vn_phi_iterator_type. * tree-ssa-sccvn.c'vn_tables_s.references Fold vn_reference_hash, vn_reference_op_eq, free_reference into new struct vn_reference_hasher. Add typedef vn_reference_table_type. Add typedef vn_reference_iterator_type. * tree-ssa-sccvn.c'constant_value_ids Fold vn_constant_hash, vn_constant_eq into new struct vn_constant_hasher. * tree-into-ssa.c'var_infos Fold var_info_hash, var_info_eq into new struct var_info_hasher. * tree-vectorizer.h'_loop_vec_info::peeling_htab * tree-vectorizer.h New struct peel_info_hasher. * tree-vect-loop.c Update dependent calls and types to match. * tree-vect-data-refs.c Fold vect_peeling_hash and vect_peeling_hash_eq into struct peel_info_hasher. * tree-ssa-reassoc.c'undistribute_ops_list::ctable Fold oecount_hash and oecount_eq into new struct oecount_hasher. * tree-ssa-loop-im.c'memory_accesses.refs Fold memref_hash and memref_eq into new struct mem_ref_hasher. Tested on x86_64. Index: gcc/ChangeLog 2013-04-23 Lawrence Crowl <crowl@google.com> * Makefile.in: Update as needed below. * hash-table.h (class hash_table): Correct many methods with parameter types compare_type to the correct value_type. (Correct code was unlikely to notice the change.) (hash_table::elements_with_deleted) New. (class hashtable::iterator): New. (hashtable::begin()): New. (hashtable::end()): New. (FOR_EACH_HASH_TABLE_ELEMENT): New. * statistics.c (statistics_hashes): Change type to hash_table. Update dependent calls and types. * tree-into-ssa.c (var_infos): Change type to hash_table. Update dependent calls and types. * tree-ssa-coalesce.c (struct coalesce_list_d.list): Change type to hash_table. Update dependent calls and types. * tree-ssa-loop-im.c (struct mem_ref.refs): Change type to hash_table. Update dependent calls and types. * tree-ssa-reassoc.c (undistribute_ops_list::ctable): Change type to hash_table. Update dependent calls and types. * tree-ssa-sccvn.c (vn_tables_s::nary): Change type to hash_table. Update dependent calls and types. (vn_tables_s::phis): Likewise. (vn_tables_s::references): Likewise. * tree-ssa-sccvn.h (vn_nary_op_eq): Update parameter and return types. (vn_reference_eq): Update parameter and return types. * tree-ssa-structalias.c (pointer_equiv_class_table): Change type to hash_table. Update dependent calls and types. (location_equiv_class_table): Likewise. * tree-vect-data-refs.c: Consequential changes for making peeling a hash_table. * tree-vect-loop.c (new_loop_vec_info): Dependent hash_table update. (destroy_loop_vec_info): Dependent hash_table update. * tree-vectorizer.h (peeling_htab): Change type to hash_table. Update dependent calls and types. From-SVN: r198213
2013-04-24 00:00:12 +02:00
{
hashval_t a = (hashval_t)(pair->first_element);
hashval_t b = (hashval_t)(pair->second_element);
return b * (b - 1) / 2 + a;
}
/* Equality function for coalesce list hash table. Compare PAIR1 and PAIR2,
returning TRUE if the two pairs are equivalent. */
inline bool
remove need for store_values_directly This switches all hash_table users to use the layout that stores elements of type value_type in the hash table instead of the one storing value_type *. Since it becomes unused support for the value_type * layout is removed. gcc/ * hash-table.h: Remove version of hash_table that stored value_type *. * asan.c, attribs.c, bitmap.c, cfg.c, cgraph.h, config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c, config/mips/mips.c, config/sol2.c, coverage.c, cselib.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c, gcse.c, genmatch.c, ggc-common.c, gimple-ssa-strength-reduction.c, gimplify.c, haifa-sched.c, hard-reg-set.h, hash-map.h, hash-set.h, ipa-devirt.c, ipa-icf.h, ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lto-streamer.h, plugin.c, postreload-gcse.c, reginfo.c, statistics.c, store-motion.c, trans-mem.c, tree-cfg.c, tree-eh.c, tree-hasher.h, tree-into-ssa.c, tree-parloops.c, tree-sra.c, tree-ssa-coalesce.c, tree-ssa-dom.c, tree-ssa-live.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-threadupdate.c, tree-vectorizer.c, tree-vectorizer.h, valtrack.h, var-tracking.c, vtable-verify.c, vtable-verify.h: Adjust. libcc1/ * plugin.cc: Adjust for hash_table changes. gcc/java/ * jcf-io.c: Adjust for hash_table changes. gcc/lto/ * lto.c: Adjust for hash_table changes. gcc/objc/ * objc-act.c: Adjust for hash_table changes. From-SVN: r222213
2015-04-18 20:13:18 +02:00
coalesce_pair_hasher::equal (const coalesce_pair *p1, const coalesce_pair *p2)
This patch extracts approved portions of the hash_table patches to the... This patch extracts approved portions of the hash_table patches to the cxx-conversion branch for files not under gcc/config. Update various hash tables from htab_t to hash_table. Modify types and calls to match. * tree-ssa-coalesce.c'coalesce_list_d.list from htab_t to hash_table. Fold coalesce_pair_map_hash and coalesce_pair_map_eq into new struct coalesce_pair_hasher. Removed struct coalesce_pair_iterator, as did not meet the hash_table iterator interface and it provided no significant code reduction. This leads to a change in the implementation of FOR_EACH_PARTITION_PAIR. * statistics.c'statistics_hashes Fold hash_statistics_eq into new struct stats_counter_hasher. * hash-table.h'hash_table Add documentation. Add nested class iterator and methods to hash_table. Add FOR_EACH_HASH_TABLE_ELEMENT implemented with those iterators. Change uses of FOR_EACH_HTAB_ELEMENT to FOR_EACH_HASH_TABLE_ELEMENT. * tree-ssa-sccvn.c'vn_tables_s.nary Fold vn_nary_op_hash, vn_nary_op_eq into new struct vn_nary_op_hasher. Add typedef vn_nary_op_table_type. Add typedef vn_nary_op_iterator_type. * tree-ssa-sccvn.c'vn_tables_s.phis Fold vn_phi_hash, free_phi into new struct vn_phi_hasher. Add typedef vn_phi_table_type. Add typedef vn_phi_iterator_type. * tree-ssa-sccvn.c'vn_tables_s.references Fold vn_reference_hash, vn_reference_op_eq, free_reference into new struct vn_reference_hasher. Add typedef vn_reference_table_type. Add typedef vn_reference_iterator_type. * tree-ssa-sccvn.c'constant_value_ids Fold vn_constant_hash, vn_constant_eq into new struct vn_constant_hasher. * tree-into-ssa.c'var_infos Fold var_info_hash, var_info_eq into new struct var_info_hasher. * tree-vectorizer.h'_loop_vec_info::peeling_htab * tree-vectorizer.h New struct peel_info_hasher. * tree-vect-loop.c Update dependent calls and types to match. * tree-vect-data-refs.c Fold vect_peeling_hash and vect_peeling_hash_eq into struct peel_info_hasher. * tree-ssa-reassoc.c'undistribute_ops_list::ctable Fold oecount_hash and oecount_eq into new struct oecount_hasher. * tree-ssa-loop-im.c'memory_accesses.refs Fold memref_hash and memref_eq into new struct mem_ref_hasher. Tested on x86_64. Index: gcc/ChangeLog 2013-04-23 Lawrence Crowl <crowl@google.com> * Makefile.in: Update as needed below. * hash-table.h (class hash_table): Correct many methods with parameter types compare_type to the correct value_type. (Correct code was unlikely to notice the change.) (hash_table::elements_with_deleted) New. (class hashtable::iterator): New. (hashtable::begin()): New. (hashtable::end()): New. (FOR_EACH_HASH_TABLE_ELEMENT): New. * statistics.c (statistics_hashes): Change type to hash_table. Update dependent calls and types. * tree-into-ssa.c (var_infos): Change type to hash_table. Update dependent calls and types. * tree-ssa-coalesce.c (struct coalesce_list_d.list): Change type to hash_table. Update dependent calls and types. * tree-ssa-loop-im.c (struct mem_ref.refs): Change type to hash_table. Update dependent calls and types. * tree-ssa-reassoc.c (undistribute_ops_list::ctable): Change type to hash_table. Update dependent calls and types. * tree-ssa-sccvn.c (vn_tables_s::nary): Change type to hash_table. Update dependent calls and types. (vn_tables_s::phis): Likewise. (vn_tables_s::references): Likewise. * tree-ssa-sccvn.h (vn_nary_op_eq): Update parameter and return types. (vn_reference_eq): Update parameter and return types. * tree-ssa-structalias.c (pointer_equiv_class_table): Change type to hash_table. Update dependent calls and types. (location_equiv_class_table): Likewise. * tree-vect-data-refs.c: Consequential changes for making peeling a hash_table. * tree-vect-loop.c (new_loop_vec_info): Dependent hash_table update. (destroy_loop_vec_info): Dependent hash_table update. * tree-vectorizer.h (peeling_htab): Change type to hash_table. Update dependent calls and types. From-SVN: r198213
2013-04-24 00:00:12 +02:00
{
return (p1->first_element == p2->first_element
&& p1->second_element == p2->second_element);
}
Remove a layer of indirection from hash_table gcc/ * hash-table.h: Remove a layer of indirection from hash_table so that it contains the hash table's data instead of a pointer to the data. * alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c, config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c, config/mips/mips.c, config/sol2.c, coverage.c, cselib.c, data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c, fold-const.c, gcse.c, ggc-common.c, gimple-ssa-strength-reduction.c, gimplify.c, graphite-clast-to-gimple.c, graphite-dependences.c, graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c, ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c, lto-streamer.c, lto-streamer.h, passes.c, plugin.c, postreload-gcse.c, sese.c, statistics.c, store-motion.c, trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c, tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c, tree-ssa-live.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c, tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c, vtable-verify.c, vtable-verify.h: Adjust. gcc/c/ * c-decl.c: Adjust. gcc/cp/ * class.c, semantics.c, tree.c, vtable-class-hierarchy.c: Adjust. gcc/java/ * jcf-io.c: Adjust. gcc/lto/ * lto.c: Adjust. gcc/objc/ * objc-act.c: Adjust. From-SVN: r211936
2014-06-24 15:21:35 +02:00
typedef hash_table<coalesce_pair_hasher> coalesce_table_type;
This patch extracts approved portions of the hash_table patches to the... This patch extracts approved portions of the hash_table patches to the cxx-conversion branch for files not under gcc/config. Update various hash tables from htab_t to hash_table. Modify types and calls to match. * tree-ssa-coalesce.c'coalesce_list_d.list from htab_t to hash_table. Fold coalesce_pair_map_hash and coalesce_pair_map_eq into new struct coalesce_pair_hasher. Removed struct coalesce_pair_iterator, as did not meet the hash_table iterator interface and it provided no significant code reduction. This leads to a change in the implementation of FOR_EACH_PARTITION_PAIR. * statistics.c'statistics_hashes Fold hash_statistics_eq into new struct stats_counter_hasher. * hash-table.h'hash_table Add documentation. Add nested class iterator and methods to hash_table. Add FOR_EACH_HASH_TABLE_ELEMENT implemented with those iterators. Change uses of FOR_EACH_HTAB_ELEMENT to FOR_EACH_HASH_TABLE_ELEMENT. * tree-ssa-sccvn.c'vn_tables_s.nary Fold vn_nary_op_hash, vn_nary_op_eq into new struct vn_nary_op_hasher. Add typedef vn_nary_op_table_type. Add typedef vn_nary_op_iterator_type. * tree-ssa-sccvn.c'vn_tables_s.phis Fold vn_phi_hash, free_phi into new struct vn_phi_hasher. Add typedef vn_phi_table_type. Add typedef vn_phi_iterator_type. * tree-ssa-sccvn.c'vn_tables_s.references Fold vn_reference_hash, vn_reference_op_eq, free_reference into new struct vn_reference_hasher. Add typedef vn_reference_table_type. Add typedef vn_reference_iterator_type. * tree-ssa-sccvn.c'constant_value_ids Fold vn_constant_hash, vn_constant_eq into new struct vn_constant_hasher. * tree-into-ssa.c'var_infos Fold var_info_hash, var_info_eq into new struct var_info_hasher. * tree-vectorizer.h'_loop_vec_info::peeling_htab * tree-vectorizer.h New struct peel_info_hasher. * tree-vect-loop.c Update dependent calls and types to match. * tree-vect-data-refs.c Fold vect_peeling_hash and vect_peeling_hash_eq into struct peel_info_hasher. * tree-ssa-reassoc.c'undistribute_ops_list::ctable Fold oecount_hash and oecount_eq into new struct oecount_hasher. * tree-ssa-loop-im.c'memory_accesses.refs Fold memref_hash and memref_eq into new struct mem_ref_hasher. Tested on x86_64. Index: gcc/ChangeLog 2013-04-23 Lawrence Crowl <crowl@google.com> * Makefile.in: Update as needed below. * hash-table.h (class hash_table): Correct many methods with parameter types compare_type to the correct value_type. (Correct code was unlikely to notice the change.) (hash_table::elements_with_deleted) New. (class hashtable::iterator): New. (hashtable::begin()): New. (hashtable::end()): New. (FOR_EACH_HASH_TABLE_ELEMENT): New. * statistics.c (statistics_hashes): Change type to hash_table. Update dependent calls and types. * tree-into-ssa.c (var_infos): Change type to hash_table. Update dependent calls and types. * tree-ssa-coalesce.c (struct coalesce_list_d.list): Change type to hash_table. Update dependent calls and types. * tree-ssa-loop-im.c (struct mem_ref.refs): Change type to hash_table. Update dependent calls and types. * tree-ssa-reassoc.c (undistribute_ops_list::ctable): Change type to hash_table. Update dependent calls and types. * tree-ssa-sccvn.c (vn_tables_s::nary): Change type to hash_table. Update dependent calls and types. (vn_tables_s::phis): Likewise. (vn_tables_s::references): Likewise. * tree-ssa-sccvn.h (vn_nary_op_eq): Update parameter and return types. (vn_reference_eq): Update parameter and return types. * tree-ssa-structalias.c (pointer_equiv_class_table): Change type to hash_table. Update dependent calls and types. (location_equiv_class_table): Likewise. * tree-vect-data-refs.c: Consequential changes for making peeling a hash_table. * tree-vect-loop.c (new_loop_vec_info): Dependent hash_table update. (destroy_loop_vec_info): Dependent hash_table update. * tree-vectorizer.h (peeling_htab): Change type to hash_table. Update dependent calls and types. From-SVN: r198213
2013-04-24 00:00:12 +02:00
typedef coalesce_table_type::iterator coalesce_iterator_type;
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
typedef struct cost_one_pair_d
{
int first_element;
int second_element;
struct cost_one_pair_d *next;
} * cost_one_pair_p;
/* This structure maintains the list of coalesce pairs. */
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
typedef struct coalesce_list_d
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
{
Remove a layer of indirection from hash_table gcc/ * hash-table.h: Remove a layer of indirection from hash_table so that it contains the hash table's data instead of a pointer to the data. * alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c, config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c, config/mips/mips.c, config/sol2.c, coverage.c, cselib.c, data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c, fold-const.c, gcse.c, ggc-common.c, gimple-ssa-strength-reduction.c, gimplify.c, graphite-clast-to-gimple.c, graphite-dependences.c, graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c, ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c, lto-streamer.c, lto-streamer.h, passes.c, plugin.c, postreload-gcse.c, sese.c, statistics.c, store-motion.c, trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c, tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c, tree-ssa-live.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c, tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c, vtable-verify.c, vtable-verify.h: Adjust. gcc/c/ * c-decl.c: Adjust. gcc/cp/ * class.c, semantics.c, tree.c, vtable-class-hierarchy.c: Adjust. gcc/java/ * jcf-io.c: Adjust. gcc/lto/ * lto.c: Adjust. gcc/objc/ * objc-act.c: Adjust. From-SVN: r211936
2014-06-24 15:21:35 +02:00
coalesce_table_type *list; /* Hash table. */
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
coalesce_pair_p *sorted; /* List when sorted. */
int num_sorted; /* Number in the sorted list. */
cost_one_pair_p cost_one_list;/* Single use coalesces with cost 1. */
} *coalesce_list_p;
#define NO_BEST_COALESCE -1
#define MUST_COALESCE_COST INT_MAX
/* Return cost of execution of copy instruction with FREQUENCY. */
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
static inline int
coalesce_cost (int frequency, bool optimize_for_size)
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
{
/* Base costs on BB frequencies bounded by 1. */
int cost = frequency;
if (!cost)
cost = 1;
loop-unswitch.c (unswitch_single_loop): Use optimize_loop_for_speed_p. * loop-unswitch.c (unswitch_single_loop): Use optimize_loop_for_speed_p. * tree-ssa-threadupdate.c (mark_threaded_blocks): Use optimize_function_for_size_p. * tracer.c (ignore_bb_p): Use optimize_bb_for_size_p. * postreload-gcse.c (eliminate_partially_redundant_load): Use optimize_bb_for_size_p. * value-prof.c (gimple_divmod_fixed_value_transform, gimple_mod_pow2_value_transform, gimple_mod_subtract_transform, gimple_stringops_transform): Use optimize_bb_for_size_p. * ipa-cp.c (ipcp_insert_stage): Use optimize_function_for_size_p. * final.c (compute_alignments): Use optimize_function_for_size_p. * builtins.c (fold_builtin_cabs): Use optimize_function_for_speed_p. (fold_builtin_strcpy, fold_builtin_fputs): Use optimize_function_for_size_p. * fold-const.c (tree_swap_operands_p): Use optimize_function_for_size_p. * recog.c (relax_delay_slots): Likewise. * tree-ssa-math-opts.c (replace_reciprocal): Use optimize_bb_for_speed_p. (execute_cse_reciprocals): Use optimize_bb_for_size_p. * ipa-inline.c (cgraph_decide_recursive_inlining): Use optimize_function_for_size_p. (cgraph_decide_inlining_of_small_function): Use optimize_function_for_size_p. * global.c (find_reg): Use optimize_function_for_size_p. * opts.c (decode_options): Do not clear flag_tree_ch, flag_inline_functions, flag_unswitch_loops, flag_unroll_loops, flag_unroll_all_loops and flag_prefetch_loop_arrays. Those can work it out from profile. * tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely): Use optimize_loop_for_speed_p. * predict.c (optimize_bb_for_size_p, optimize_bb_for_speed_p): Constify argument. (optimize_loop_nest_for_size_p, optimize_loop_nest_for_speed_p): New. * tree-parloops.c (parallelize_loops): Use optimize_loop_for_size_p. * tree-eh.c (decide_copy_try_finally): Use optimize_function_for_size_p. * local-alloc.c (block_alloc): Pass BB pointer. (find_free_reg): Add BB pointer, use optimize_bb_for_size_p. * gcse.c (gcse_main): Use optimize_function_for_size_p. * loop-unroll.c (decide_unrolling_and_peeling): Use optimize_loop_for_size_p. (decide_peel_completely): Likewise. * tree-vect-analyze.c (vect_mark_for_runtime_alias_test): Use optimize_loop_for_size_p. (vect_enhance_data_refs_alignment): Likewise. * tree-ssa-coalesce.c (coalesce_cost): Add optimize_for_size argument. (coalesce_cost_bb, coalesce_cost_edge, create_outofssa_var_map): Update call. * cfgcleanup.c (outgoing_edges_match): Use optimize_bb_for_speed_p. (try_crossjump_bb): Use optimize_bb_for_size_p. * tree-ssa-loop-prefetch.c (loop_prefetch_arrays): Use optimize_loop_for_speed_p. * bb-reorder.c (find_traces_1_round): Likewise. (copy_bb): Use optimize_bb_for_speed_p. (duplicate_computed_gotos): Likewise. * basic-block.h (optimize_loop_nest_for_size_p, optimize_loop_nest_for_speed_p): New. * stmt.c (expand_case): Use optimize_insn_for_size_p. From-SVN: r139760
2008-08-29 12:35:57 +02:00
if (optimize_for_size)
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
cost = 1;
return cost;
}
/* Return the cost of executing a copy instruction in basic block BB. */
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
static inline int
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
coalesce_cost_bb (basic_block bb)
{
return coalesce_cost (bb->frequency, optimize_bb_for_size_p (bb));
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
}
/* Return the cost of executing a copy instruction on edge E. */
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
static inline int
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
coalesce_cost_edge (edge e)
{
int mult = 1;
/* Inserting copy on critical edge costs more than inserting it elsewhere. */
if (EDGE_CRITICAL_P (e))
mult = 2;
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
if (e->flags & EDGE_ABNORMAL)
return MUST_COALESCE_COST;
if (e->flags & EDGE_EH)
{
edge e2;
edge_iterator ei;
FOR_EACH_EDGE (e2, ei, e->dest->preds)
if (e2 != e)
{
/* Putting code on EH edge that leads to BB
with multiple predecestors imply splitting of
edge too. */
if (mult < 2)
mult = 2;
/* If there are multiple EH predecestors, we
also copy EH regions and produce separate
landing pad. This is expensive. */
if (e2->flags & EDGE_EH)
{
mult = 5;
break;
}
}
}
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
return coalesce_cost (EDGE_FREQUENCY (e),
optimize_edge_for_size_p (e)) * mult;
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
}
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
/* Retrieve a pair to coalesce from the cost_one_list in CL. Returns the
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
2 elements via P1 and P2. 1 is returned by the function if there is a pair,
NO_BEST_COALESCE is returned if there aren't any. */
static inline int
pop_cost_one_pair (coalesce_list_p cl, int *p1, int *p2)
{
cost_one_pair_p ptr;
ptr = cl->cost_one_list;
if (!ptr)
return NO_BEST_COALESCE;
*p1 = ptr->first_element;
*p2 = ptr->second_element;
cl->cost_one_list = ptr->next;
free (ptr);
return 1;
}
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
/* Retrieve the most expensive remaining pair to coalesce from CL. Returns the
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
2 elements via P1 and P2. Their calculated cost is returned by the function.
NO_BEST_COALESCE is returned if the coalesce list is empty. */
static inline int
pop_best_coalesce (coalesce_list_p cl, int *p1, int *p2)
{
coalesce_pair_p node;
int ret;
if (cl->sorted == NULL)
return pop_cost_one_pair (cl, p1, p2);
if (cl->num_sorted == 0)
return pop_cost_one_pair (cl, p1, p2);
node = cl->sorted[--(cl->num_sorted)];
*p1 = node->first_element;
*p2 = node->second_element;
ret = node->cost;
free (node);
return ret;
}
/* Create a new empty coalesce list object and return it. */
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
static inline coalesce_list_p
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
create_coalesce_list (void)
{
coalesce_list_p list;
unsigned size = num_ssa_names * 3;
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
if (size < 40)
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
size = 40;
list = (coalesce_list_p) xmalloc (sizeof (struct coalesce_list_d));
Remove a layer of indirection from hash_table gcc/ * hash-table.h: Remove a layer of indirection from hash_table so that it contains the hash table's data instead of a pointer to the data. * alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c, config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c, config/mips/mips.c, config/sol2.c, coverage.c, cselib.c, data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c, fold-const.c, gcse.c, ggc-common.c, gimple-ssa-strength-reduction.c, gimplify.c, graphite-clast-to-gimple.c, graphite-dependences.c, graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c, ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c, lto-streamer.c, lto-streamer.h, passes.c, plugin.c, postreload-gcse.c, sese.c, statistics.c, store-motion.c, trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c, tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c, tree-ssa-live.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c, tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c, vtable-verify.c, vtable-verify.h: Adjust. gcc/c/ * c-decl.c: Adjust. gcc/cp/ * class.c, semantics.c, tree.c, vtable-class-hierarchy.c: Adjust. gcc/java/ * jcf-io.c: Adjust. gcc/lto/ * lto.c: Adjust. gcc/objc/ * objc-act.c: Adjust. From-SVN: r211936
2014-06-24 15:21:35 +02:00
list->list = new coalesce_table_type (size);
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
list->sorted = NULL;
list->num_sorted = 0;
list->cost_one_list = NULL;
return list;
}
/* Delete coalesce list CL. */
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
static inline void
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
delete_coalesce_list (coalesce_list_p cl)
{
gcc_assert (cl->cost_one_list == NULL);
Remove a layer of indirection from hash_table gcc/ * hash-table.h: Remove a layer of indirection from hash_table so that it contains the hash table's data instead of a pointer to the data. * alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c, config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c, config/mips/mips.c, config/sol2.c, coverage.c, cselib.c, data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c, fold-const.c, gcse.c, ggc-common.c, gimple-ssa-strength-reduction.c, gimplify.c, graphite-clast-to-gimple.c, graphite-dependences.c, graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c, ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c, lto-streamer.c, lto-streamer.h, passes.c, plugin.c, postreload-gcse.c, sese.c, statistics.c, store-motion.c, trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c, tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c, tree-ssa-live.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c, tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c, vtable-verify.c, vtable-verify.h: Adjust. gcc/c/ * c-decl.c: Adjust. gcc/cp/ * class.c, semantics.c, tree.c, vtable-class-hierarchy.c: Adjust. gcc/java/ * jcf-io.c: Adjust. gcc/lto/ * lto.c: Adjust. gcc/objc/ * objc-act.c: Adjust. From-SVN: r211936
2014-06-24 15:21:35 +02:00
delete cl->list;
cl->list = NULL;
free (cl->sorted);
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
gcc_assert (cl->num_sorted == 0);
free (cl);
}
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
/* Find a matching coalesce pair object in CL for the pair P1 and P2. If
one isn't found, return NULL if CREATE is false, otherwise create a new
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
coalesce pair object and return it. */
static coalesce_pair_p
find_coalesce_pair (coalesce_list_p cl, int p1, int p2, bool create)
{
struct coalesce_pair p;
This patch extracts approved portions of the hash_table patches to the... This patch extracts approved portions of the hash_table patches to the cxx-conversion branch for files not under gcc/config. Update various hash tables from htab_t to hash_table. Modify types and calls to match. * tree-ssa-coalesce.c'coalesce_list_d.list from htab_t to hash_table. Fold coalesce_pair_map_hash and coalesce_pair_map_eq into new struct coalesce_pair_hasher. Removed struct coalesce_pair_iterator, as did not meet the hash_table iterator interface and it provided no significant code reduction. This leads to a change in the implementation of FOR_EACH_PARTITION_PAIR. * statistics.c'statistics_hashes Fold hash_statistics_eq into new struct stats_counter_hasher. * hash-table.h'hash_table Add documentation. Add nested class iterator and methods to hash_table. Add FOR_EACH_HASH_TABLE_ELEMENT implemented with those iterators. Change uses of FOR_EACH_HTAB_ELEMENT to FOR_EACH_HASH_TABLE_ELEMENT. * tree-ssa-sccvn.c'vn_tables_s.nary Fold vn_nary_op_hash, vn_nary_op_eq into new struct vn_nary_op_hasher. Add typedef vn_nary_op_table_type. Add typedef vn_nary_op_iterator_type. * tree-ssa-sccvn.c'vn_tables_s.phis Fold vn_phi_hash, free_phi into new struct vn_phi_hasher. Add typedef vn_phi_table_type. Add typedef vn_phi_iterator_type. * tree-ssa-sccvn.c'vn_tables_s.references Fold vn_reference_hash, vn_reference_op_eq, free_reference into new struct vn_reference_hasher. Add typedef vn_reference_table_type. Add typedef vn_reference_iterator_type. * tree-ssa-sccvn.c'constant_value_ids Fold vn_constant_hash, vn_constant_eq into new struct vn_constant_hasher. * tree-into-ssa.c'var_infos Fold var_info_hash, var_info_eq into new struct var_info_hasher. * tree-vectorizer.h'_loop_vec_info::peeling_htab * tree-vectorizer.h New struct peel_info_hasher. * tree-vect-loop.c Update dependent calls and types to match. * tree-vect-data-refs.c Fold vect_peeling_hash and vect_peeling_hash_eq into struct peel_info_hasher. * tree-ssa-reassoc.c'undistribute_ops_list::ctable Fold oecount_hash and oecount_eq into new struct oecount_hasher. * tree-ssa-loop-im.c'memory_accesses.refs Fold memref_hash and memref_eq into new struct mem_ref_hasher. Tested on x86_64. Index: gcc/ChangeLog 2013-04-23 Lawrence Crowl <crowl@google.com> * Makefile.in: Update as needed below. * hash-table.h (class hash_table): Correct many methods with parameter types compare_type to the correct value_type. (Correct code was unlikely to notice the change.) (hash_table::elements_with_deleted) New. (class hashtable::iterator): New. (hashtable::begin()): New. (hashtable::end()): New. (FOR_EACH_HASH_TABLE_ELEMENT): New. * statistics.c (statistics_hashes): Change type to hash_table. Update dependent calls and types. * tree-into-ssa.c (var_infos): Change type to hash_table. Update dependent calls and types. * tree-ssa-coalesce.c (struct coalesce_list_d.list): Change type to hash_table. Update dependent calls and types. * tree-ssa-loop-im.c (struct mem_ref.refs): Change type to hash_table. Update dependent calls and types. * tree-ssa-reassoc.c (undistribute_ops_list::ctable): Change type to hash_table. Update dependent calls and types. * tree-ssa-sccvn.c (vn_tables_s::nary): Change type to hash_table. Update dependent calls and types. (vn_tables_s::phis): Likewise. (vn_tables_s::references): Likewise. * tree-ssa-sccvn.h (vn_nary_op_eq): Update parameter and return types. (vn_reference_eq): Update parameter and return types. * tree-ssa-structalias.c (pointer_equiv_class_table): Change type to hash_table. Update dependent calls and types. (location_equiv_class_table): Likewise. * tree-vect-data-refs.c: Consequential changes for making peeling a hash_table. * tree-vect-loop.c (new_loop_vec_info): Dependent hash_table update. (destroy_loop_vec_info): Dependent hash_table update. * tree-vectorizer.h (peeling_htab): Change type to hash_table. Update dependent calls and types. From-SVN: r198213
2013-04-24 00:00:12 +02:00
coalesce_pair **slot;
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
unsigned int hash;
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
/* Normalize so that p1 is the smaller value. */
if (p2 < p1)
{
p.first_element = p2;
p.second_element = p1;
}
else
{
p.first_element = p1;
p.second_element = p2;
}
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
This patch extracts approved portions of the hash_table patches to the... This patch extracts approved portions of the hash_table patches to the cxx-conversion branch for files not under gcc/config. Update various hash tables from htab_t to hash_table. Modify types and calls to match. * tree-ssa-coalesce.c'coalesce_list_d.list from htab_t to hash_table. Fold coalesce_pair_map_hash and coalesce_pair_map_eq into new struct coalesce_pair_hasher. Removed struct coalesce_pair_iterator, as did not meet the hash_table iterator interface and it provided no significant code reduction. This leads to a change in the implementation of FOR_EACH_PARTITION_PAIR. * statistics.c'statistics_hashes Fold hash_statistics_eq into new struct stats_counter_hasher. * hash-table.h'hash_table Add documentation. Add nested class iterator and methods to hash_table. Add FOR_EACH_HASH_TABLE_ELEMENT implemented with those iterators. Change uses of FOR_EACH_HTAB_ELEMENT to FOR_EACH_HASH_TABLE_ELEMENT. * tree-ssa-sccvn.c'vn_tables_s.nary Fold vn_nary_op_hash, vn_nary_op_eq into new struct vn_nary_op_hasher. Add typedef vn_nary_op_table_type. Add typedef vn_nary_op_iterator_type. * tree-ssa-sccvn.c'vn_tables_s.phis Fold vn_phi_hash, free_phi into new struct vn_phi_hasher. Add typedef vn_phi_table_type. Add typedef vn_phi_iterator_type. * tree-ssa-sccvn.c'vn_tables_s.references Fold vn_reference_hash, vn_reference_op_eq, free_reference into new struct vn_reference_hasher. Add typedef vn_reference_table_type. Add typedef vn_reference_iterator_type. * tree-ssa-sccvn.c'constant_value_ids Fold vn_constant_hash, vn_constant_eq into new struct vn_constant_hasher. * tree-into-ssa.c'var_infos Fold var_info_hash, var_info_eq into new struct var_info_hasher. * tree-vectorizer.h'_loop_vec_info::peeling_htab * tree-vectorizer.h New struct peel_info_hasher. * tree-vect-loop.c Update dependent calls and types to match. * tree-vect-data-refs.c Fold vect_peeling_hash and vect_peeling_hash_eq into struct peel_info_hasher. * tree-ssa-reassoc.c'undistribute_ops_list::ctable Fold oecount_hash and oecount_eq into new struct oecount_hasher. * tree-ssa-loop-im.c'memory_accesses.refs Fold memref_hash and memref_eq into new struct mem_ref_hasher. Tested on x86_64. Index: gcc/ChangeLog 2013-04-23 Lawrence Crowl <crowl@google.com> * Makefile.in: Update as needed below. * hash-table.h (class hash_table): Correct many methods with parameter types compare_type to the correct value_type. (Correct code was unlikely to notice the change.) (hash_table::elements_with_deleted) New. (class hashtable::iterator): New. (hashtable::begin()): New. (hashtable::end()): New. (FOR_EACH_HASH_TABLE_ELEMENT): New. * statistics.c (statistics_hashes): Change type to hash_table. Update dependent calls and types. * tree-into-ssa.c (var_infos): Change type to hash_table. Update dependent calls and types. * tree-ssa-coalesce.c (struct coalesce_list_d.list): Change type to hash_table. Update dependent calls and types. * tree-ssa-loop-im.c (struct mem_ref.refs): Change type to hash_table. Update dependent calls and types. * tree-ssa-reassoc.c (undistribute_ops_list::ctable): Change type to hash_table. Update dependent calls and types. * tree-ssa-sccvn.c (vn_tables_s::nary): Change type to hash_table. Update dependent calls and types. (vn_tables_s::phis): Likewise. (vn_tables_s::references): Likewise. * tree-ssa-sccvn.h (vn_nary_op_eq): Update parameter and return types. (vn_reference_eq): Update parameter and return types. * tree-ssa-structalias.c (pointer_equiv_class_table): Change type to hash_table. Update dependent calls and types. (location_equiv_class_table): Likewise. * tree-vect-data-refs.c: Consequential changes for making peeling a hash_table. * tree-vect-loop.c (new_loop_vec_info): Dependent hash_table update. (destroy_loop_vec_info): Dependent hash_table update. * tree-vectorizer.h (peeling_htab): Change type to hash_table. Update dependent calls and types. From-SVN: r198213
2013-04-24 00:00:12 +02:00
hash = coalesce_pair_hasher::hash (&p);
Remove a layer of indirection from hash_table gcc/ * hash-table.h: Remove a layer of indirection from hash_table so that it contains the hash table's data instead of a pointer to the data. * alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c, config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c, config/mips/mips.c, config/sol2.c, coverage.c, cselib.c, data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c, fold-const.c, gcse.c, ggc-common.c, gimple-ssa-strength-reduction.c, gimplify.c, graphite-clast-to-gimple.c, graphite-dependences.c, graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c, ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c, lto-streamer.c, lto-streamer.h, passes.c, plugin.c, postreload-gcse.c, sese.c, statistics.c, store-motion.c, trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c, tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c, tree-ssa-live.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c, tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c, vtable-verify.c, vtable-verify.h: Adjust. gcc/c/ * c-decl.c: Adjust. gcc/cp/ * class.c, semantics.c, tree.c, vtable-class-hierarchy.c: Adjust. gcc/java/ * jcf-io.c: Adjust. gcc/lto/ * lto.c: Adjust. gcc/objc/ * objc-act.c: Adjust. From-SVN: r211936
2014-06-24 15:21:35 +02:00
slot = cl->list->find_slot_with_hash (&p, hash, create ? INSERT : NO_INSERT);
if (!slot)
return NULL;
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
if (!*slot)
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
{
struct coalesce_pair * pair = XNEW (struct coalesce_pair);
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
gcc_assert (cl->sorted == NULL);
pair->first_element = p.first_element;
pair->second_element = p.second_element;
pair->cost = 0;
This patch extracts approved portions of the hash_table patches to the... This patch extracts approved portions of the hash_table patches to the cxx-conversion branch for files not under gcc/config. Update various hash tables from htab_t to hash_table. Modify types and calls to match. * tree-ssa-coalesce.c'coalesce_list_d.list from htab_t to hash_table. Fold coalesce_pair_map_hash and coalesce_pair_map_eq into new struct coalesce_pair_hasher. Removed struct coalesce_pair_iterator, as did not meet the hash_table iterator interface and it provided no significant code reduction. This leads to a change in the implementation of FOR_EACH_PARTITION_PAIR. * statistics.c'statistics_hashes Fold hash_statistics_eq into new struct stats_counter_hasher. * hash-table.h'hash_table Add documentation. Add nested class iterator and methods to hash_table. Add FOR_EACH_HASH_TABLE_ELEMENT implemented with those iterators. Change uses of FOR_EACH_HTAB_ELEMENT to FOR_EACH_HASH_TABLE_ELEMENT. * tree-ssa-sccvn.c'vn_tables_s.nary Fold vn_nary_op_hash, vn_nary_op_eq into new struct vn_nary_op_hasher. Add typedef vn_nary_op_table_type. Add typedef vn_nary_op_iterator_type. * tree-ssa-sccvn.c'vn_tables_s.phis Fold vn_phi_hash, free_phi into new struct vn_phi_hasher. Add typedef vn_phi_table_type. Add typedef vn_phi_iterator_type. * tree-ssa-sccvn.c'vn_tables_s.references Fold vn_reference_hash, vn_reference_op_eq, free_reference into new struct vn_reference_hasher. Add typedef vn_reference_table_type. Add typedef vn_reference_iterator_type. * tree-ssa-sccvn.c'constant_value_ids Fold vn_constant_hash, vn_constant_eq into new struct vn_constant_hasher. * tree-into-ssa.c'var_infos Fold var_info_hash, var_info_eq into new struct var_info_hasher. * tree-vectorizer.h'_loop_vec_info::peeling_htab * tree-vectorizer.h New struct peel_info_hasher. * tree-vect-loop.c Update dependent calls and types to match. * tree-vect-data-refs.c Fold vect_peeling_hash and vect_peeling_hash_eq into struct peel_info_hasher. * tree-ssa-reassoc.c'undistribute_ops_list::ctable Fold oecount_hash and oecount_eq into new struct oecount_hasher. * tree-ssa-loop-im.c'memory_accesses.refs Fold memref_hash and memref_eq into new struct mem_ref_hasher. Tested on x86_64. Index: gcc/ChangeLog 2013-04-23 Lawrence Crowl <crowl@google.com> * Makefile.in: Update as needed below. * hash-table.h (class hash_table): Correct many methods with parameter types compare_type to the correct value_type. (Correct code was unlikely to notice the change.) (hash_table::elements_with_deleted) New. (class hashtable::iterator): New. (hashtable::begin()): New. (hashtable::end()): New. (FOR_EACH_HASH_TABLE_ELEMENT): New. * statistics.c (statistics_hashes): Change type to hash_table. Update dependent calls and types. * tree-into-ssa.c (var_infos): Change type to hash_table. Update dependent calls and types. * tree-ssa-coalesce.c (struct coalesce_list_d.list): Change type to hash_table. Update dependent calls and types. * tree-ssa-loop-im.c (struct mem_ref.refs): Change type to hash_table. Update dependent calls and types. * tree-ssa-reassoc.c (undistribute_ops_list::ctable): Change type to hash_table. Update dependent calls and types. * tree-ssa-sccvn.c (vn_tables_s::nary): Change type to hash_table. Update dependent calls and types. (vn_tables_s::phis): Likewise. (vn_tables_s::references): Likewise. * tree-ssa-sccvn.h (vn_nary_op_eq): Update parameter and return types. (vn_reference_eq): Update parameter and return types. * tree-ssa-structalias.c (pointer_equiv_class_table): Change type to hash_table. Update dependent calls and types. (location_equiv_class_table): Likewise. * tree-vect-data-refs.c: Consequential changes for making peeling a hash_table. * tree-vect-loop.c (new_loop_vec_info): Dependent hash_table update. (destroy_loop_vec_info): Dependent hash_table update. * tree-vectorizer.h (peeling_htab): Change type to hash_table. Update dependent calls and types. From-SVN: r198213
2013-04-24 00:00:12 +02:00
*slot = pair;
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
}
return (struct coalesce_pair *) *slot;
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
}
static inline void
add_cost_one_coalesce (coalesce_list_p cl, int p1, int p2)
{
cost_one_pair_p pair;
tree-ssa-alias-warnings.c (maybe_add_match): Cast according to the coding conventions. * tree-ssa-alias-warnings.c (maybe_add_match): Cast according to the coding conventions. (add_key): Likewise. * tree-ssa.c (init_tree_ssa): Use type safe memory macros. * tree-ssa-ccp.c (ccp_fold_builtin): Avoid using C++ keywords as variable names. * tree-ssa-coalesce.c (find_coalesce_pair): Use type safe memory macros. (add_cost_one_coalesce): Likewise. * tree-ssa-copy.c (merge_alias_info): Avoid using C++ keywords as variable names. Rename orig to orig_name for consistency. * tree-ssa-dom.c (dom_thread_across_edge): Cast according to the coding conventions. (cprop_into_successor_phis): Avoid using C++ keywords as variable names. (record_equivalences_from_stmt): Likewise. * tree-ssa-dse.c (dse_initialize_block_local_data): Cast according to the coding conventions. (memory_ssa_name_same): Likewise. (dse_optimize_stmt): Likewise. (dse_record_phis): Likewise. (dse_finalize_block): Likewise. * tree-ssa-loop-im.c (outermost_invariant_loop_expr): Avoid using C++ keywords as variable names. (may_move_till): Cast according to the coding conventions. (force_move_till_expr): Avoid using C++ keywords as variable names. (force_move_till): Cast according to the coding conventions. (memref_hash): Likewise. (memref_eq): Likewise. (gather_mem_refs_stmt): Likewise. * tree-ssa-loop-ivopts.c (contains_abnormal_ssa_name_p): Avoid using C++ keywords as variable names. (idx_find_step): Cast according to the coding conventions. (idx_record_use): Likewise. (find_depends): Likewise. (prepare_decl_rtl): Likewise. (mbc_entry_hash): Likewise. (mbc_entry_eq): Likewise. * tree-ssa-loop-niter.c (SWAP): Use the correct the type for tmp. (simplify_replace_tree): Avoid using C++ keywords as variable names. (idx_infer_loop_bounds): Cast according to the coding conventions. * tree-ssa-loop-prefetch.c (idx_analyze_ref): Likewise. * tree-ssa-math-opts.c (occ_new ): Likwise. * tree-ssanames.c (duplicate_ssa_name_ptr_info): Use type safe memory macros. * tree-ssa-operands.c (add_def_op): Avoid using C++ keywords as variable names. (add_use_op): Likewise. (add_vop): Likewise. (add_vuse_op): Likewise. (add_vdef_op): Likewise. (get_expr_operands): Likewise. (push_stmt_changes): Use type safe memory macros. * tree-ssa-phiopt.c (replace_phi_edge_with_variable): Avoid using C++ keywords as variable names. (conditional_replacement): Likewise. (minmax_replacement): Likewise. (abs_replacement): Likewise. * tree-ssa-pre.c (create_expression_by_pieces): Cast according to the coding conventions. (insert_fake_stores): Avoid using C++ keywords as variable names. * tree-ssa-reassoc.c (add_to_ops_vec): Cast according to the coding conventions. * tree-ssa-structalias.c (heapvar_lookup): Likewise. (heapvar_insert): Use type safe memory macros. (new_var_info): Cast according to the coding conventions. (new_constraint): Likewise. (remove_preds_and_fake_succs): Use type safe memory macros. * tree-ssa-threadupdate.c (thread_block): Cast according to the coding conventions. (thread_single_edge): Likewise. From-SVN: r125504
2007-06-06 22:18:47 +02:00
pair = XNEW (struct cost_one_pair_d);
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
pair->first_element = p1;
pair->second_element = p2;
pair->next = cl->cost_one_list;
cl->cost_one_list = pair;
}
/* Add a coalesce between P1 and P2 in list CL with a cost of VALUE. */
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
static inline void
add_coalesce (coalesce_list_p cl, int p1, int p2, int value)
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
{
coalesce_pair_p node;
gcc_assert (cl->sorted == NULL);
if (p1 == p2)
return;
node = find_coalesce_pair (cl, p1, p2, true);
/* Once the value is at least MUST_COALESCE_COST - 1, leave it that way. */
if (node->cost < MUST_COALESCE_COST - 1)
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
{
if (value < MUST_COALESCE_COST - 1)
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
node->cost += value;
else
node->cost = value;
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
}
}
/* Comparison function to allow qsort to sort P1 and P2 in Ascending order. */
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
static int
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
compare_pairs (const void *p1, const void *p2)
{
ggc.h (GGC_RESIZEVAR): New, reorder macros. * ggc.h (GGC_RESIZEVAR): New, reorder macros. * tracer.c (tail_duplicate): Fix for -Wc++-compat. * tree-affine.c (aff_combination_expand, free_name_expansion): Likewise. * tree-cfg.c (replace_by_duplicate_decl, replace_ssa_name, move_stmt_r, new_label_mapper): Likewise. * tree-complex.c (cvc_lookup): Likewise. * tree-dfa.c (create_function_ann): Likewise. * tree-dump.c (dump_register): Likewise. * tree-if-conv.c (tree_if_conversion, add_to_predicate_list, find_phi_replacement_condition): Likewise. * tree-inline.c (copy_phis_for_bb, estimate_num_insns_1, tree_function_versioning): Likewise. * tree-into-ssa.c (cmp_dfsnum): Likewise. * tree-iterator.c (tsi_link_before, tsi_link_after): Likewise. * tree-nested.c (lookup_field_for_decl, lookup_tramp_for_decl, get_nonlocal_debug_decl, convert_nonlocal_reference, convert_nonlocal_omp_clauses, get_local_debug_decl, convert_local_reference, convert_local_omp_clauses, convert_nl_goto_reference, convert_nl_goto_receiver, convert_tramp_reference, convert_call_expr): Likewise. * tree-outof-ssa.c (contains_tree_r): Likewise. * tree-parloops.c (reduction_phi, initialize_reductions, eliminate_local_variables_1, add_field_for_reduction, add_field_for_name, create_phi_for_local_result, create_call_for_reduction_1, create_loads_for_reductions, create_stores_for_reduction, create_loads_and_stores_for_name): Likewise. * tree-phinodes.c (allocate_phi_node): Likewise. * tree-predcom.c (order_drefs, execute_pred_commoning_cbck): Likewise. * tree-sra.c (sra_elt_hash, sra_elt_eq, lookup_element): Likewise. * tree-ssa-alias.c (get_mem_sym_stats_for): Likewise. * tree-ssa-coalesce.c (compare_pairs): Likewise. * tree-ssa-loop-im.c (mem_ref_in_stmt, memref_hash, memref_eq, memref_free, gather_mem_refs_stmt, vtoe_hash, vtoe_eq, vtoe_free, record_vop_access, get_vop_accesses, get_vop_stores): Likewise. * tree-ssa-loop-prefetch.c (determine_loop_nest_reuse): Likewise. * tree-ssa-sccvn.c (VN_INFO_GET, free_phi, free_reference, vn_nary_op_insert): Likewise. * tree-ssa.c (redirect_edge_var_map_add, redirect_edge_var_map_clear, redirect_edge_var_map_dup): Likewise. * tree-vectorizer.c (vectorize_loops): Likewise. * tree.c (make_node_stat, copy_node_stat, build_int_cst_wide, build_fixed, build_real, make_tree_binfo_stat, make_tree_vec_stat, tree_cons_stat, build1_stat, build_variant_type_copy, decl_init_priority_lookup, decl_fini_priority_lookup, decl_priority_info, decl_restrict_base_lookup, decl_restrict_base_insert, decl_debug_expr_lookup, decl_debug_expr_insert, decl_value_expr_lookup, decl_value_expr_insert, type_hash_eq, type_hash_lookup, type_hash_add, get_file_function_name, tree_check_failed, tree_not_check_failed, tree_range_check_failed, omp_clause_range_check_failed, build_omp_clause, build_vl_exp_stat): Likewise. * value-prof.c (gimple_histogram_value, gimple_duplicate_stmt_histograms): Likewise. * var-tracking.c (attrs_list_insert, attrs_list_copy, unshare_variable, variable_union_info_cmp_pos, variable_union, dataflow_set_different_1, dataflow_set_different_2, vt_find_locations, variable_was_changed, set_variable_part, emit_notes_for_differences_1, emit_notes_for_differences_2): Likewise. * varasm.c (prefix_name, emutls_decl, section_entry_eq, section_entry_hash, object_block_entry_eq, object_block_entry_hash, create_block_symbol, initialize_cold_section_name, default_function_rodata_section, strip_reg_name, set_user_assembler_name, const_desc_eq, build_constant_desc, output_constant_def, lookup_constant_def, const_desc_rtx_hash, const_desc_rtx_eq, const_rtx_hash_1, create_constant_pool, force_const_mem, compute_reloc_for_rtx_1, default_internal_label): Likewise. * varray.c (varray_init, varray_grow): Likewise. * vec.c (vec_gc_o_reserve_1, vec_heap_o_reserve_1): Likewise. From-SVN: r136992
2008-06-20 20:34:07 +02:00
const_coalesce_pair_p const *const pp1 = (const_coalesce_pair_p const *) p1;
const_coalesce_pair_p const *const pp2 = (const_coalesce_pair_p const *) p2;
int result;
Expand from SSA. gcc/ Expand from SSA. * builtins.c (fold_builtin_next_arg): Handle SSA names. * tree-ssa-copyrename.c (rename_ssa_copies): Use ssa_name() directly. * tree-ssa-coalesce.c (create_outofssa_var_map): Mark only useful SSA names. (compare_pairs): Swap cost comparison. (coalesce_ssa_name): Don't use change_partition_var. * tree-nrv.c (struct nrv_data): Add modified member. (finalize_nrv_r): Set it. (tree_nrv): Use it to update statements. (pass_nrv): Require PROP_ssa. * tree-mudflap.c (mf_decl_cache_locals, mf_build_check_statement_for): Use make_rename_temp. (pass_mudflap_2): Require PROP_ssa, run ssa update at finish. * alias.c (find_base_decl): Handle SSA names. * emit-rtl (set_reg_attrs_for_parm): Make non-static. (component_ref_for_mem_expr): Don't leak SSA names into RTL. * rtl.h (set_reg_attrs_for_parm): Declare. * tree-optimize.c (pass_cleanup_cfg_post_optimizing): Rename to "optimized", remove unused locals at finish. (execute_free_datastructures): Make global, call delete_tree_cfg_annotations. (execute_free_cfg_annotations): Don't call delete_tree_cfg_annotations. * ssaexpand.h: New file. * expr.c (toplevel): Include ssaexpand.h. (expand_assignment): Handle SSA names the same as register variables. (expand_expr_real_1): Expand SSA names. * cfgexpand.c (toplevel): Include ssaexpand.h. (SA): New global variable. (gimple_cond_pred_to_tree): Fold TERed comparisons into predicates. (SSAVAR): New macro. (set_rtl): New helper function. (add_stack_var): Deal with SSA names, use set_rtl. (expand_one_stack_var_at): Likewise. (expand_one_stack_var): Deal with SSA names. (stack_var_size_cmp): Use code (SSA_NAME / DECL) as tie breaker before unique numbers. (expand_stack_vars): Use set_rtl. (expand_one_var): Accept SSA names, add asserts for them, feed them to above subroutines. (expand_used_vars): Expand all partitions (without default defs), then only the local decls (ignoring those expanded already). (expand_gimple_cond): Remove edges when jumpif() expands an unconditional jump. (expand_gimple_basic_block): Don't clear EDGE_EXECUTABLE here, or remove abnormal edges. Ignore insns setting the LHS of a TERed SSA name. (gimple_expand_cfg): Call into rewrite_out_of_ssa, initialize members of SA; deal with PARM_DECL partitions here; expand all PHI nodes, free tree datastructures and SA. Commit instructions on edges, clear EDGE_EXECUTABLE and remove abnormal edges here. (pass_expand): Require and destroy PROP_ssa, verify SSA form, flow info and statements at start, collect garbage at finish. * tree-ssa-live.h (struct _var_map): Remove partition_to_var member. (VAR_ANN_PARTITION) Remove. (change_partition_var): Don't declare. (partition_to_var): Always return SSA names. (var_to_partition): Only accept SSA names. (register_ssa_partition): Only check argument. * tree-ssa-live.c (init_var_map): Don't allocate partition_to_var member. (delete_var_map): Don't free it. (var_union): Only accept SSA names, simplify. (partition_view_init): Mark only useful SSA names as used. (partition_view_fini): Only deal with SSA names. (change_partition_var): Remove. (dump_var_map): Use ssa_name instead of partition_to_var member. * tree-ssa.c (delete_tree_ssa): Don't remove PHI nodes on RTL basic blocks. * tree-outof-ssa.c (toplevel): Include ssaexpand.h and expr.h. (struct _elim_graph): New member const_dests; nodes member vector of ints. (set_location_for_edge): New static helper. (create_temp): Remove. (insert_partition_copy_on_edge, insert_part_to_rtx_on_edge, insert_value_copy_on_edge, insert_rtx_to_part_on_edge): New functions. (new_elim_graph): Allocate const_dests member. (clean_elim_graph): Truncate const_dests member. (delete_elim_graph): Free const_dests member. (elim_graph_size): Adapt to new type of nodes member. (elim_graph_add_node): Likewise. (eliminate_name): Likewise. (eliminate_build): Don't take basic block argument, deal only with partition numbers, not variables. (get_temp_reg): New static helper. (elim_create): Use it, deal with RTL temporaries instead of trees. (eliminate_phi): Adjust all calls to new signature. (assign_vars, replace_use_variable, replace_def_variable): Remove. (rewrite_trees): Only do checking. (edge_leader, stmt_list, leader_has_match, leader_match): Remove. (same_stmt_list_p, identical_copies_p, identical_stmt_lists_p, init_analyze_edges_for_bb, fini_analyze_edges_for_bb, contains_tree_r, MAX_STMTS_IN_LATCH, process_single_block_loop_latch, analyze_edges_for_bb, perform_edge_inserts): Remove. (expand_phi_nodes): New global function. (remove_ssa_form): Take ssaexpand parameter. Don't call removed functions, initialize new parameter, remember partitions having a default def. (finish_out_of_ssa): New global function. (rewrite_out_of_ssa): Make global. Adjust call to remove_ssa_form, don't reset in_ssa_p here, don't disable TER when mudflap. (pass_del_ssa): Remove. * tree-flow.h (struct var_ann_d): Remove out_of_ssa_tag and partition members. (execute_free_datastructures): Declare. * Makefile.in (SSAEXPAND_H): New variable. (tree-outof-ssa.o, expr.o, cfgexpand.o): Depend on SSAEXPAND_H. * basic-block.h (commit_one_edge_insertion): Declare. * passes.c (init_optimization_passes): Move pass_nrv and pass_mudflap2 before pass_cleanup_cfg_post_optimizing, remove pass_del_ssa, pass_free_datastructures, pass_free_cfg_annotations. * cfgrtl.c (commit_one_edge_insertion): Make global, don't declare. (redirect_branch_edge): Deal with super block when expanding, split out jump patching itself into ... (patch_jump_insn): ... here, new static helper. testsuite/ Expand from SSA. * gcc.dg/tree-ssa/20030728-1.c: Use -rtl-expand-details dump and change regexps. * gcc.target/i386/pr37248-1.c: Modified. * gcc.target/i386/pr37248-3.c: Modified. * gcc.target/i386/pr37248-2.c: Modified. * gnat.dg/aliasing1.adb: Modified. * gnat.dg/pack9.adb: Modified. * gnat.dg/aliasing2.adb: Modified. * gcc.dg/strict-overflow-2.c: Modified. * gcc.dg/autopar/reduc-1char.c: Modified. * gcc.dg/autopar/reduc-2char.c: Modified. * gcc.dg/autopar/reduc-1.c: Modified. * gcc.dg/autopar/reduc-2.c: Modified. * gcc.dg/autopar/reduc-3.c: Modified. * gcc.dg/autopar/reduc-6.c: Modified. * gcc.dg/autopar/reduc-7.c: Modified. * gcc.dg/autopar/reduc-8.c: Modified. * gcc.dg/autopar/reduc-9.c: Modified. * gcc.dg/autopar/reduc-1short.c: Modified. * gcc.dg/autopar/reduc-2short.c: Modified. * gcc.dg/autopar/parallelization-1.c: Modified. * gcc.dg/strict-overflow-4.c: Modified. * gcc.dg/strict-overflow-6.c: Modified. * gcc.dg/gomp/combined-1.c: Modified. * gcc.dg/no-strict-overflow-1.c: Modified. * gcc.dg/no-strict-overflow-3.c: Modified. * gcc.dg/no-strict-overflow-5.c: Modified. * gcc.dg/tree-ssa/reassoc-13.c: Modified. * gcc.dg/tree-ssa/pr18134.c: Modified. * gcc.dg/tree-ssa/20030824-1.c: Modified. * gcc.dg/tree-ssa/vector-2.c: Modified. * gcc.dg/tree-ssa/forwprop-9.c: Modified. * gcc.dg/tree-ssa/loop-21.c: Modified. * gcc.dg/tree-ssa/20030824-2.c: Modified. * gcc.dg/tree-ssa/vector-3.c: Modified. * gcc.dg/tree-ssa/asm-3.c: Modified. * gcc.dg/tree-ssa/pr23294.c: Modified. * gcc.dg/tree-ssa/loop-22.c: Modified. * gcc.dg/tree-ssa/loop-15.c: Modified. * gcc.dg/tree-ssa/prefetch-4.c: Modified. * gcc.dg/tree-ssa/pr22051-1.c: Modified. * gcc.dg/tree-ssa/pr20139.c: Modified. * gcc.dg/tree-ssa/scev-cast.c: Modified. * gcc.dg/tree-ssa/pr22051-2.c: Modified. * gcc.dg/tree-ssa/reassoc-1.c: Modified. * gcc.dg/tree-ssa/loop-5.c: Modified. * gcc.dg/tree-ssa/pr19431.c: Modified. * gcc.dg/tree-ssa/pr32044.c: Modified. * gcc.dg/tree-ssa/prefetch-7.c: Modified. * gcc.dg/tree-ssa/loop-19.c: Modified. * gcc.dg/tree-ssa/loop-28.c: Modified. * gcc.dg/tree-ssa/ssa-pre-15.c: Modified. * gcc.dg/tree-ssa/divide-1.c: Modified. * gcc.dg/tree-ssa/inline-1.c: Modified. * gcc.dg/tree-ssa/divide-3.c: Modified. * gcc.dg/tree-ssa/pr30978.c: Modified. * gcc.dg/tree-ssa/alias-6.c: Modified. * gcc.dg/tree-ssa/divide-4.c: Modified. * gcc.dg/tree-ssa/alias-11.c: Modified. * gcc.dg/no-strict-overflow-7.c: Modified. * gcc.dg/strict-overflow-1.c: Modified. * gcc.dg/pr15784-4.c: Modified. * gcc.dg/pr34263.c: Modified. * gcc.dg/strict-overflow-3.c: Modified. * gcc.dg/tree-prof/stringop-1.c: Modified. * gcc.dg/tree-prof/val-prof-1.c: Modified. * gcc.dg/tree-prof/val-prof-2.c: Modified. * gcc.dg/tree-prof/val-prof-3.c: Modified. * gcc.dg/tree-prof/val-prof-4.c: Modified. * gcc.dg/no-strict-overflow-2.c: Modified. * gcc.dg/no-strict-overflow-4.c: Modified. * gcc.dg/no-strict-overflow-6.c: Modified. * g++.dg/tree-ssa/pr27090.C: Modified. * g++.dg/tree-ssa/tmmti-2.C: Modified. * g++.dg/tree-ssa/ptrmemfield.C: Modified. * g++.dg/tree-ssa/pr19807.C: Modified. * g++.dg/opt/pr30965.C: Modified. * g++.dg/init/new17.C: Modified. * gfortran.dg/whole_file_6.f90: Modified. * gfortran.dg/whole_file_5.f90: Modified. * gfortran.dg/reassoc_1.f90: Modified. * gfortran.dg/reassoc_3.f90: Modified. From-SVN: r146817
2009-04-26 21:35:04 +02:00
result = (* pp1)->cost - (* pp2)->cost;
/* Since qsort does not guarantee stability we use the elements
as a secondary key. This provides us with independence from
the host's implementation of the sorting algorithm. */
if (result == 0)
{
result = (* pp2)->first_element - (* pp1)->first_element;
if (result == 0)
result = (* pp2)->second_element - (* pp1)->second_element;
}
return result;
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
}
/* Return the number of unique coalesce pairs in CL. */
static inline int
num_coalesce_pairs (coalesce_list_p cl)
{
Remove a layer of indirection from hash_table gcc/ * hash-table.h: Remove a layer of indirection from hash_table so that it contains the hash table's data instead of a pointer to the data. * alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c, config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c, config/mips/mips.c, config/sol2.c, coverage.c, cselib.c, data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c, fold-const.c, gcse.c, ggc-common.c, gimple-ssa-strength-reduction.c, gimplify.c, graphite-clast-to-gimple.c, graphite-dependences.c, graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c, ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c, lto-streamer.c, lto-streamer.h, passes.c, plugin.c, postreload-gcse.c, sese.c, statistics.c, store-motion.c, trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c, tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c, tree-ssa-live.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c, tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c, vtable-verify.c, vtable-verify.h: Adjust. gcc/c/ * c-decl.c: Adjust. gcc/cp/ * class.c, semantics.c, tree.c, vtable-class-hierarchy.c: Adjust. gcc/java/ * jcf-io.c: Adjust. gcc/lto/ * lto.c: Adjust. gcc/objc/ * objc-act.c: Adjust. From-SVN: r211936
2014-06-24 15:21:35 +02:00
return cl->list->elements ();
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
}
/* Iterate over CL using ITER, returning values in PAIR. */
#define FOR_EACH_PARTITION_PAIR(PAIR, ITER, CL) \
Remove a layer of indirection from hash_table gcc/ * hash-table.h: Remove a layer of indirection from hash_table so that it contains the hash table's data instead of a pointer to the data. * alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c, config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c, config/mips/mips.c, config/sol2.c, coverage.c, cselib.c, data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c, fold-const.c, gcse.c, ggc-common.c, gimple-ssa-strength-reduction.c, gimplify.c, graphite-clast-to-gimple.c, graphite-dependences.c, graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c, ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c, lto-streamer.c, lto-streamer.h, passes.c, plugin.c, postreload-gcse.c, sese.c, statistics.c, store-motion.c, trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c, tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c, tree-ssa-live.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c, tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c, vtable-verify.c, vtable-verify.h: Adjust. gcc/c/ * c-decl.c: Adjust. gcc/cp/ * class.c, semantics.c, tree.c, vtable-class-hierarchy.c: Adjust. gcc/java/ * jcf-io.c: Adjust. gcc/lto/ * lto.c: Adjust. gcc/objc/ * objc-act.c: Adjust. From-SVN: r211936
2014-06-24 15:21:35 +02:00
FOR_EACH_HASH_TABLE_ELEMENT (*(CL)->list, (PAIR), coalesce_pair_p, (ITER))
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
/* Prepare CL for removal of preferred pairs. When finished they are sorted
in order from most important coalesce to least important. */
static void
sort_coalesce_list (coalesce_list_p cl)
{
unsigned x, num;
coalesce_pair_p p;
This patch extracts approved portions of the hash_table patches to the... This patch extracts approved portions of the hash_table patches to the cxx-conversion branch for files not under gcc/config. Update various hash tables from htab_t to hash_table. Modify types and calls to match. * tree-ssa-coalesce.c'coalesce_list_d.list from htab_t to hash_table. Fold coalesce_pair_map_hash and coalesce_pair_map_eq into new struct coalesce_pair_hasher. Removed struct coalesce_pair_iterator, as did not meet the hash_table iterator interface and it provided no significant code reduction. This leads to a change in the implementation of FOR_EACH_PARTITION_PAIR. * statistics.c'statistics_hashes Fold hash_statistics_eq into new struct stats_counter_hasher. * hash-table.h'hash_table Add documentation. Add nested class iterator and methods to hash_table. Add FOR_EACH_HASH_TABLE_ELEMENT implemented with those iterators. Change uses of FOR_EACH_HTAB_ELEMENT to FOR_EACH_HASH_TABLE_ELEMENT. * tree-ssa-sccvn.c'vn_tables_s.nary Fold vn_nary_op_hash, vn_nary_op_eq into new struct vn_nary_op_hasher. Add typedef vn_nary_op_table_type. Add typedef vn_nary_op_iterator_type. * tree-ssa-sccvn.c'vn_tables_s.phis Fold vn_phi_hash, free_phi into new struct vn_phi_hasher. Add typedef vn_phi_table_type. Add typedef vn_phi_iterator_type. * tree-ssa-sccvn.c'vn_tables_s.references Fold vn_reference_hash, vn_reference_op_eq, free_reference into new struct vn_reference_hasher. Add typedef vn_reference_table_type. Add typedef vn_reference_iterator_type. * tree-ssa-sccvn.c'constant_value_ids Fold vn_constant_hash, vn_constant_eq into new struct vn_constant_hasher. * tree-into-ssa.c'var_infos Fold var_info_hash, var_info_eq into new struct var_info_hasher. * tree-vectorizer.h'_loop_vec_info::peeling_htab * tree-vectorizer.h New struct peel_info_hasher. * tree-vect-loop.c Update dependent calls and types to match. * tree-vect-data-refs.c Fold vect_peeling_hash and vect_peeling_hash_eq into struct peel_info_hasher. * tree-ssa-reassoc.c'undistribute_ops_list::ctable Fold oecount_hash and oecount_eq into new struct oecount_hasher. * tree-ssa-loop-im.c'memory_accesses.refs Fold memref_hash and memref_eq into new struct mem_ref_hasher. Tested on x86_64. Index: gcc/ChangeLog 2013-04-23 Lawrence Crowl <crowl@google.com> * Makefile.in: Update as needed below. * hash-table.h (class hash_table): Correct many methods with parameter types compare_type to the correct value_type. (Correct code was unlikely to notice the change.) (hash_table::elements_with_deleted) New. (class hashtable::iterator): New. (hashtable::begin()): New. (hashtable::end()): New. (FOR_EACH_HASH_TABLE_ELEMENT): New. * statistics.c (statistics_hashes): Change type to hash_table. Update dependent calls and types. * tree-into-ssa.c (var_infos): Change type to hash_table. Update dependent calls and types. * tree-ssa-coalesce.c (struct coalesce_list_d.list): Change type to hash_table. Update dependent calls and types. * tree-ssa-loop-im.c (struct mem_ref.refs): Change type to hash_table. Update dependent calls and types. * tree-ssa-reassoc.c (undistribute_ops_list::ctable): Change type to hash_table. Update dependent calls and types. * tree-ssa-sccvn.c (vn_tables_s::nary): Change type to hash_table. Update dependent calls and types. (vn_tables_s::phis): Likewise. (vn_tables_s::references): Likewise. * tree-ssa-sccvn.h (vn_nary_op_eq): Update parameter and return types. (vn_reference_eq): Update parameter and return types. * tree-ssa-structalias.c (pointer_equiv_class_table): Change type to hash_table. Update dependent calls and types. (location_equiv_class_table): Likewise. * tree-vect-data-refs.c: Consequential changes for making peeling a hash_table. * tree-vect-loop.c (new_loop_vec_info): Dependent hash_table update. (destroy_loop_vec_info): Dependent hash_table update. * tree-vectorizer.h (peeling_htab): Change type to hash_table. Update dependent calls and types. From-SVN: r198213
2013-04-24 00:00:12 +02:00
coalesce_iterator_type ppi;
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
gcc_assert (cl->sorted == NULL);
num = num_coalesce_pairs (cl);
cl->num_sorted = num;
if (num == 0)
return;
/* Allocate a vector for the pair pointers. */
cl->sorted = XNEWVEC (coalesce_pair_p, num);
/* Populate the vector with pointers to the pairs. */
x = 0;
FOR_EACH_PARTITION_PAIR (p, ppi, cl)
cl->sorted[x++] = p;
gcc_assert (x == num);
/* Already sorted. */
if (num == 1)
return;
/* If there are only 2, just pick swap them if the order isn't correct. */
if (num == 2)
{
if (cl->sorted[0]->cost > cl->sorted[1]->cost)
Use std::swap instead of explicit swaps gcc/ * bb-reorder.c (fix_up_fall_thru_edges): Use std::swap instead of explicit swaps. * dojump.c (do_compare_rtx_and_jump): Likewise. * expmed.c (emit_store_flag_1): Likewise. * fibonacci_heap.h (fibonacci_heap::union_with): Likewise. * final.c (sprint_ul): Use std::reverse for reversing a string. * fold-const.c (extract_muldiv_1): Use std::swap. * genmodes.c (emit_mode_int_n): Likewise. * ifcvt.c (dead_or_predicable): Likewise. * ira-build.c (ira_merge_live_ranges): Likewise. (swap_allocno_copy_ends_if_necessary): Likewise. * ira.c (ira_setup_alts): Likewise. * loop-iv.c (iv_analyze_expr): Likewise. (implies_p): Likewise. (canon_condition): Likewise. * lra-constraints.c (swap_operands): Likewise. * lra-lives.c (lra_merge_live_ranges): Likewise. * omega.c (swap): Remove. (bswap): Remove. (omega_unprotect_1): Use std::swap. (omega_solve_geq): Likewise. * optabs.c (expand_binop_directly): Likewise. (expand_binop): Likewise. (emit_conditional_move): Likewise. (emit_conditional_add): Likewise. * postreload.c (reload_cse_simplify_operands): Likewise. * reg-stack.c (emit_swap_insn): Likewise. (swap_to_top): Likewise. (compare_for_stack_reg): Likewise. (subst_asm_stack_regs): Likewise. * reload.c (find_reloads): Likewise. * reload1.c (gen_reload_chain_without_interm_reg_p): Likewise. * sel-sched.c (invoke_reorder_hooks): Likewise. (create_block_for_bookkeeping): Likewise. * tree-data-ref.c (lambda_matrix_row_exchange): Remove. (lambda_matrix_right_hermite): Use std::swap. * tree-ssa-coalesce.c (sort_coalesce_list): Likewise. * tree-ssa-ifcombine.c (ifcombine_ifandif): Likewise. * tree-ssa-loop-ivopts.c (iv_ca_delta_reverse): Likewise. * tree-ssa-math-opts.c (is_widening_mult_p): Likewise. * tree-ssa-phiopt.c (hoist_adjacent_loads): Likewise. * tree-ssa-reassoc.c (linearize_expr_tree): Likewise. * tree-ssa-threadedge.c (simplify_control_stmt_condition): Likewise. * tree-vrp.c (compare_ranges): Likewise. * var-tracking.c (add_with_sets): Likewise. (vt_find_locations): Likewise. gcc/c/ * c-typeck.c (build_array_ref): Use std::swap instead of explicit swaps gcc/cp/ * typeck.c (composite_pointer_type): Use std::swap instead of explicit swaps. gcc/c-family/ * c-common.c (shorten_compare): Use std::swap instead of explicit swaps. gcc/fortran/ * interface.c (compare_actual_formal): Use std::swap instead of explicit swaps. * trans-array.c (gfc_trans_scalarized_loop_end): Likewise. * trans-intrinsic.c (walk_inline_intrinsic_transpose): Likewise. From-SVN: r223332
2015-05-19 06:24:31 +02:00
std::swap (cl->sorted[0], cl->sorted[1]);
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
return;
}
Use std::swap instead of explicit swaps gcc/ * bb-reorder.c (fix_up_fall_thru_edges): Use std::swap instead of explicit swaps. * dojump.c (do_compare_rtx_and_jump): Likewise. * expmed.c (emit_store_flag_1): Likewise. * fibonacci_heap.h (fibonacci_heap::union_with): Likewise. * final.c (sprint_ul): Use std::reverse for reversing a string. * fold-const.c (extract_muldiv_1): Use std::swap. * genmodes.c (emit_mode_int_n): Likewise. * ifcvt.c (dead_or_predicable): Likewise. * ira-build.c (ira_merge_live_ranges): Likewise. (swap_allocno_copy_ends_if_necessary): Likewise. * ira.c (ira_setup_alts): Likewise. * loop-iv.c (iv_analyze_expr): Likewise. (implies_p): Likewise. (canon_condition): Likewise. * lra-constraints.c (swap_operands): Likewise. * lra-lives.c (lra_merge_live_ranges): Likewise. * omega.c (swap): Remove. (bswap): Remove. (omega_unprotect_1): Use std::swap. (omega_solve_geq): Likewise. * optabs.c (expand_binop_directly): Likewise. (expand_binop): Likewise. (emit_conditional_move): Likewise. (emit_conditional_add): Likewise. * postreload.c (reload_cse_simplify_operands): Likewise. * reg-stack.c (emit_swap_insn): Likewise. (swap_to_top): Likewise. (compare_for_stack_reg): Likewise. (subst_asm_stack_regs): Likewise. * reload.c (find_reloads): Likewise. * reload1.c (gen_reload_chain_without_interm_reg_p): Likewise. * sel-sched.c (invoke_reorder_hooks): Likewise. (create_block_for_bookkeeping): Likewise. * tree-data-ref.c (lambda_matrix_row_exchange): Remove. (lambda_matrix_right_hermite): Use std::swap. * tree-ssa-coalesce.c (sort_coalesce_list): Likewise. * tree-ssa-ifcombine.c (ifcombine_ifandif): Likewise. * tree-ssa-loop-ivopts.c (iv_ca_delta_reverse): Likewise. * tree-ssa-math-opts.c (is_widening_mult_p): Likewise. * tree-ssa-phiopt.c (hoist_adjacent_loads): Likewise. * tree-ssa-reassoc.c (linearize_expr_tree): Likewise. * tree-ssa-threadedge.c (simplify_control_stmt_condition): Likewise. * tree-vrp.c (compare_ranges): Likewise. * var-tracking.c (add_with_sets): Likewise. (vt_find_locations): Likewise. gcc/c/ * c-typeck.c (build_array_ref): Use std::swap instead of explicit swaps gcc/cp/ * typeck.c (composite_pointer_type): Use std::swap instead of explicit swaps. gcc/c-family/ * c-common.c (shorten_compare): Use std::swap instead of explicit swaps. gcc/fortran/ * interface.c (compare_actual_formal): Use std::swap instead of explicit swaps. * trans-array.c (gfc_trans_scalarized_loop_end): Likewise. * trans-intrinsic.c (walk_inline_intrinsic_transpose): Likewise. From-SVN: r223332
2015-05-19 06:24:31 +02:00
/* Only call qsort if there are more than 2 items.
??? Maybe std::sort will do better, provided that compare_pairs
can be inlined. */
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
if (num > 2)
qsort (cl->sorted, num, sizeof (coalesce_pair_p), compare_pairs);
}
/* Send debug info for coalesce list CL to file F. */
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
static void
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
dump_coalesce_list (FILE *f, coalesce_list_p cl)
{
coalesce_pair_p node;
This patch extracts approved portions of the hash_table patches to the... This patch extracts approved portions of the hash_table patches to the cxx-conversion branch for files not under gcc/config. Update various hash tables from htab_t to hash_table. Modify types and calls to match. * tree-ssa-coalesce.c'coalesce_list_d.list from htab_t to hash_table. Fold coalesce_pair_map_hash and coalesce_pair_map_eq into new struct coalesce_pair_hasher. Removed struct coalesce_pair_iterator, as did not meet the hash_table iterator interface and it provided no significant code reduction. This leads to a change in the implementation of FOR_EACH_PARTITION_PAIR. * statistics.c'statistics_hashes Fold hash_statistics_eq into new struct stats_counter_hasher. * hash-table.h'hash_table Add documentation. Add nested class iterator and methods to hash_table. Add FOR_EACH_HASH_TABLE_ELEMENT implemented with those iterators. Change uses of FOR_EACH_HTAB_ELEMENT to FOR_EACH_HASH_TABLE_ELEMENT. * tree-ssa-sccvn.c'vn_tables_s.nary Fold vn_nary_op_hash, vn_nary_op_eq into new struct vn_nary_op_hasher. Add typedef vn_nary_op_table_type. Add typedef vn_nary_op_iterator_type. * tree-ssa-sccvn.c'vn_tables_s.phis Fold vn_phi_hash, free_phi into new struct vn_phi_hasher. Add typedef vn_phi_table_type. Add typedef vn_phi_iterator_type. * tree-ssa-sccvn.c'vn_tables_s.references Fold vn_reference_hash, vn_reference_op_eq, free_reference into new struct vn_reference_hasher. Add typedef vn_reference_table_type. Add typedef vn_reference_iterator_type. * tree-ssa-sccvn.c'constant_value_ids Fold vn_constant_hash, vn_constant_eq into new struct vn_constant_hasher. * tree-into-ssa.c'var_infos Fold var_info_hash, var_info_eq into new struct var_info_hasher. * tree-vectorizer.h'_loop_vec_info::peeling_htab * tree-vectorizer.h New struct peel_info_hasher. * tree-vect-loop.c Update dependent calls and types to match. * tree-vect-data-refs.c Fold vect_peeling_hash and vect_peeling_hash_eq into struct peel_info_hasher. * tree-ssa-reassoc.c'undistribute_ops_list::ctable Fold oecount_hash and oecount_eq into new struct oecount_hasher. * tree-ssa-loop-im.c'memory_accesses.refs Fold memref_hash and memref_eq into new struct mem_ref_hasher. Tested on x86_64. Index: gcc/ChangeLog 2013-04-23 Lawrence Crowl <crowl@google.com> * Makefile.in: Update as needed below. * hash-table.h (class hash_table): Correct many methods with parameter types compare_type to the correct value_type. (Correct code was unlikely to notice the change.) (hash_table::elements_with_deleted) New. (class hashtable::iterator): New. (hashtable::begin()): New. (hashtable::end()): New. (FOR_EACH_HASH_TABLE_ELEMENT): New. * statistics.c (statistics_hashes): Change type to hash_table. Update dependent calls and types. * tree-into-ssa.c (var_infos): Change type to hash_table. Update dependent calls and types. * tree-ssa-coalesce.c (struct coalesce_list_d.list): Change type to hash_table. Update dependent calls and types. * tree-ssa-loop-im.c (struct mem_ref.refs): Change type to hash_table. Update dependent calls and types. * tree-ssa-reassoc.c (undistribute_ops_list::ctable): Change type to hash_table. Update dependent calls and types. * tree-ssa-sccvn.c (vn_tables_s::nary): Change type to hash_table. Update dependent calls and types. (vn_tables_s::phis): Likewise. (vn_tables_s::references): Likewise. * tree-ssa-sccvn.h (vn_nary_op_eq): Update parameter and return types. (vn_reference_eq): Update parameter and return types. * tree-ssa-structalias.c (pointer_equiv_class_table): Change type to hash_table. Update dependent calls and types. (location_equiv_class_table): Likewise. * tree-vect-data-refs.c: Consequential changes for making peeling a hash_table. * tree-vect-loop.c (new_loop_vec_info): Dependent hash_table update. (destroy_loop_vec_info): Dependent hash_table update. * tree-vectorizer.h (peeling_htab): Change type to hash_table. Update dependent calls and types. From-SVN: r198213
2013-04-24 00:00:12 +02:00
coalesce_iterator_type ppi;
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
int x;
tree var;
if (cl->sorted == NULL)
{
fprintf (f, "Coalesce List:\n");
FOR_EACH_PARTITION_PAIR (node, ppi, cl)
{
tree var1 = ssa_name (node->first_element);
tree var2 = ssa_name (node->second_element);
print_generic_expr (f, var1, TDF_SLIM);
fprintf (f, " <-> ");
print_generic_expr (f, var2, TDF_SLIM);
fprintf (f, " (%1d), ", node->cost);
fprintf (f, "\n");
}
}
else
{
fprintf (f, "Sorted Coalesce list:\n");
for (x = cl->num_sorted - 1 ; x >=0; x--)
{
node = cl->sorted[x];
fprintf (f, "(%d) ", node->cost);
var = ssa_name (node->first_element);
print_generic_expr (f, var, TDF_SLIM);
fprintf (f, " <-> ");
var = ssa_name (node->second_element);
print_generic_expr (f, var, TDF_SLIM);
fprintf (f, "\n");
}
}
}
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
/* This represents a conflict graph. Implemented as an array of bitmaps.
A full matrix is used for conflicts rather than just upper triangular form.
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
this make sit much simpler and faster to perform conflict merges. */
typedef struct ssa_conflicts_d
{
bitmap_obstack obstack; /* A place to allocate our bitmaps. */
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
vec<bitmap> conflicts;
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
} * ssa_conflicts_p;
/* Return an empty new conflict graph for SIZE elements. */
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
static inline ssa_conflicts_p
ssa_conflicts_new (unsigned size)
{
ssa_conflicts_p ptr;
ptr = XNEW (struct ssa_conflicts_d);
bitmap_obstack_initialize (&ptr->obstack);
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
ptr->conflicts.create (size);
ptr->conflicts.safe_grow_cleared (size);
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
return ptr;
}
/* Free storage for conflict graph PTR. */
static inline void
ssa_conflicts_delete (ssa_conflicts_p ptr)
{
bitmap_obstack_release (&ptr->obstack);
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
ptr->conflicts.release ();
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
free (ptr);
}
/* Test if elements X and Y conflict in graph PTR. */
static inline bool
ssa_conflicts_test_p (ssa_conflicts_p ptr, unsigned x, unsigned y)
{
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
bitmap bx = ptr->conflicts[x];
bitmap by = ptr->conflicts[y];
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
basic-block.h (single_succ_edge): Use gcc_checking_assert. * basic-block.h (single_succ_edge): Use gcc_checking_assert. (single_pred_edge, ei_container, ei_next, ei_prev): Likewise. * cfghooks.c (fixup_reorder_chain): Likewise. * cfgrtl.c (cfg_layout_merge_blocks): Likewise. * cgraph.c (cgraph_add_thunk): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_create_virtual_clone): Likewise. * ddg.c (add_cross_iteration_register_deps): Likewise. * dwarf2out.c (modified_type_die): Likewise. * emit-rtl.c (set_mem_alias_set): Likewise. * ggc-zone.c (zone_allocate_marks): Likewise. * gimple-iterator.c (gsi_move_to_bb_end): Likewise. * gimple.c (iterative_hash_gimple_type): Likewise. * graphite-scop-detection.c (create_single_entry_edge): Likewise. (create_single_exit_edge): Likewise. * haifa-sched.c (choose_ready): Likewise. * lto-streamer-in.c (input_gimple_stmt): Likewise. * passes.c (execute_todo): Likewise. * sched-ebb.c (begin_schedule_ready): Likewise. * sel-sched.c (code_motion_process_successors): Likewise. * tree-call-cdce.c (gen_conditions_for_pow): Likewise. * tree-cfg-cleanup.c (tree_forwarder_block_p): Likewise. * tree-flow-inline.h (link_imm_use, move_use_after_head): Likewise. (phi_arg_index_from_use, phi_ssa_name_p): Likewise. * tree-into-ssa.c (insert_updated_phi_nodes_for): Likewise. * tree-ssa-coalesce.c (ssa_conflicts_test_p): Likewise. (ssa_conflicts_add): Likewise. * tree-ssa-copy.c (replace_exp): Likewise. * tree-ssa-dom.c (eliminate_redundant_computations): Likewise. * tree-ssa-forwprop.c (simple_gimple_switch): Likewise. * tree-ssa-math-opts.c (execute_cse_reciprocals): Likewise. * tree-ssa-pre.c (bitmap_value_insert_into_set): Likewise. (compute_antic): Likewise. * tree-ssa-ter.c (add_to_partition_kill_list): Likewise. (add_dependence): Likewise. (process_replaceable, kill_expr, find_replaceable_exprs): Likewise. * tree-vrp.c (supports_overflow_infinity): Likewise. (make_overflow_infinity, negative_overflow_infinity): Likewise. (avoid_overflow_infinity, register_new_assert_for): Likewise. (process_assert_insertions_for): Likewise. * var-tracking.c (dv_is_value_p, dv_as_decl, dv_from_decl): Likewise. (dv_from_value, variable_union, find_loc_in_1pdv): Likewise. (intersect_loc_chains, variable_merge_over_cur): Likewise. From-SVN: r165774
2010-10-21 15:08:28 +02:00
gcc_checking_assert (x != y);
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
if (bx)
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
/* Avoid the lookup if Y has no conflicts. */
return by ? bitmap_bit_p (bx, y) : false;
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
else
return false;
}
/* Add a conflict with Y to the bitmap for X in graph PTR. */
static inline void
ssa_conflicts_add_one (ssa_conflicts_p ptr, unsigned x, unsigned y)
{
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
bitmap bx = ptr->conflicts[x];
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
/* If there are no conflicts yet, allocate the bitmap and set bit. */
if (! bx)
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
bx = ptr->conflicts[x] = BITMAP_ALLOC (&ptr->obstack);
bitmap_set_bit (bx, y);
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
}
/* Add conflicts between X and Y in graph PTR. */
static inline void
ssa_conflicts_add (ssa_conflicts_p ptr, unsigned x, unsigned y)
{
basic-block.h (single_succ_edge): Use gcc_checking_assert. * basic-block.h (single_succ_edge): Use gcc_checking_assert. (single_pred_edge, ei_container, ei_next, ei_prev): Likewise. * cfghooks.c (fixup_reorder_chain): Likewise. * cfgrtl.c (cfg_layout_merge_blocks): Likewise. * cgraph.c (cgraph_add_thunk): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_create_virtual_clone): Likewise. * ddg.c (add_cross_iteration_register_deps): Likewise. * dwarf2out.c (modified_type_die): Likewise. * emit-rtl.c (set_mem_alias_set): Likewise. * ggc-zone.c (zone_allocate_marks): Likewise. * gimple-iterator.c (gsi_move_to_bb_end): Likewise. * gimple.c (iterative_hash_gimple_type): Likewise. * graphite-scop-detection.c (create_single_entry_edge): Likewise. (create_single_exit_edge): Likewise. * haifa-sched.c (choose_ready): Likewise. * lto-streamer-in.c (input_gimple_stmt): Likewise. * passes.c (execute_todo): Likewise. * sched-ebb.c (begin_schedule_ready): Likewise. * sel-sched.c (code_motion_process_successors): Likewise. * tree-call-cdce.c (gen_conditions_for_pow): Likewise. * tree-cfg-cleanup.c (tree_forwarder_block_p): Likewise. * tree-flow-inline.h (link_imm_use, move_use_after_head): Likewise. (phi_arg_index_from_use, phi_ssa_name_p): Likewise. * tree-into-ssa.c (insert_updated_phi_nodes_for): Likewise. * tree-ssa-coalesce.c (ssa_conflicts_test_p): Likewise. (ssa_conflicts_add): Likewise. * tree-ssa-copy.c (replace_exp): Likewise. * tree-ssa-dom.c (eliminate_redundant_computations): Likewise. * tree-ssa-forwprop.c (simple_gimple_switch): Likewise. * tree-ssa-math-opts.c (execute_cse_reciprocals): Likewise. * tree-ssa-pre.c (bitmap_value_insert_into_set): Likewise. (compute_antic): Likewise. * tree-ssa-ter.c (add_to_partition_kill_list): Likewise. (add_dependence): Likewise. (process_replaceable, kill_expr, find_replaceable_exprs): Likewise. * tree-vrp.c (supports_overflow_infinity): Likewise. (make_overflow_infinity, negative_overflow_infinity): Likewise. (avoid_overflow_infinity, register_new_assert_for): Likewise. (process_assert_insertions_for): Likewise. * var-tracking.c (dv_is_value_p, dv_as_decl, dv_from_decl): Likewise. (dv_from_value, variable_union, find_loc_in_1pdv): Likewise. (intersect_loc_chains, variable_merge_over_cur): Likewise. From-SVN: r165774
2010-10-21 15:08:28 +02:00
gcc_checking_assert (x != y);
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
ssa_conflicts_add_one (ptr, x, y);
ssa_conflicts_add_one (ptr, y, x);
}
/* Merge all Y's conflict into X in graph PTR. */
static inline void
ssa_conflicts_merge (ssa_conflicts_p ptr, unsigned x, unsigned y)
{
unsigned z;
bitmap_iterator bi;
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
bitmap bx = ptr->conflicts[x];
bitmap by = ptr->conflicts[y];
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
gcc_checking_assert (x != y);
if (! by)
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
return;
/* Add a conflict between X and every one Y has. If the bitmap doesn't
cgraph.c: Fix typos in comments. gcc/ * cgraph.c: Fix typos in comments. (cgraph_availability_names): Fix string typo. * fold-const.c: Fix typos in comments. (fold_binary): Fix typo in warning. * genautomata.c: Fix typos in comments. (check_presence_pattern_sets): Fix typo in local variable. (output_description): Fix typo in output. * ggc-zone.c (ggc_pch_finish): Fix typo in error message. * hwint.h: Likewise. * matrix-reorg.c (check_allocation_function): Likewise. * omega.c (smooth_weird_equations): Likewise. * auto-inc-dec.c: Fix typos in comments. * bb-reorder.c: Likewise. * builtins.c: Likewise. * c-common.c: Likewise. * c-cppbuiltin.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfglayout.c: Likewise. * cfgloopmanip.c: Likewise. * cgraphunit.c: Likewise. * coverage.c: Likewise. * dbxout.c: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dfp.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * dse.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * function.c: Likewise. * function.h: Likewise. * gcc.c: Likewise. * gcov-io.c: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattrtab.c: Likewise. * ggc-page.c: Likewise. * gimplify.c: Likewise. * gthr-lynx.h: Likewise. * haifa-sched.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa.c: Likewise. * loop-doloop.c: Likewise. * mips-tfile.c: Likewise. * mkmap-flat.awk: Likewise. * mkmap-symver.awk: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts.c: Likewise. * passes.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * pretty-print.h: Likewise. * profile.c: Likewise. * protoize.c: Likewise. * ra-conflict.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * regclass.c: Likewise. * regs.h: Likewise. * reload.c: Likewise. * rtl-error.c: Likewise. * rtlanal.c: Likewise. * scan.h: Likewise. * sched-rgn.c: Likewise. * see.c: Likewise. * stmt.c: Likewise. * target.h: Likewise. * tree-dfa.c: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-nested.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa.c: Likewise. * tree-vect-analyze.c: Likewise. * tree-vect-transform.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vn.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * unwind-dw2-fde.c: Likewise. * unwind.inc: Likewise. * value-prof.c: Likewise. * vmsdbgout.c: Likewise. From-SVN: r136425
2008-06-06 07:42:00 +02:00
exist, then it has already been coalesced, and we don't need to add a
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
conflict. */
EXECUTE_IF_SET_IN_BITMAP (by, 0, z, bi)
{
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
bitmap bz = ptr->conflicts[z];
if (bz)
bitmap_set_bit (bz, x);
}
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
if (bx)
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
{
/* If X has conflicts, add Y's to X. */
bitmap_ior_into (bx, by);
BITMAP_FREE (by);
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
ptr->conflicts[y] = NULL;
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
}
else
{
/* If X has no conflicts, simply use Y's. */
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
ptr->conflicts[x] = by;
ptr->conflicts[y] = NULL;
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
}
}
/* Dump a conflicts graph. */
static void
ssa_conflicts_dump (FILE *file, ssa_conflicts_p ptr)
{
unsigned x;
bitmap b;
fprintf (file, "\nConflict graph:\n");
This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. This patch rewrites the old VEC macro-based interface into a new one based on the template class 'vec'. The user-visible changes are described in http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec. I have tested the patch pretty extensively: - Regular bootstraps on x86_64, ppc, ia64, sparc and hppa. - Bootstraps with --enable-checking=release - Bootstraps with --enable-checking=gc,gcac - Basic builds on all targets (using contrib/config-list.mk). We no longer access the vectors via VEC_* macros. The pattern is "VEC_operation (T, A, V, args)" becomes "V.operation (args)". The only thing I could not do is create proper ctors and dtors for the vec class. Since these vectors are stored in unions, we have to keep them as PODs (C++03 does not allow non-PODs in unions). This means that creation and destruction must be explicit. There is a new method vec<type, allocation, layout>::create() and another vec<type, allocation, layout>::destroy() to allocate the internal vector. For vectors that must be pointers, there is a family of free functions that implement the operations that need to tolerate NULL vectors. These functions all start with the prefix 'vec_safe_'. See the wiki page for details. The gengtype change removes the special handling for VEC() that used to exist in gengtype. Additionally, it allows gengtype to recognize templates of more than one argument and introduces the concept of an undefined type (useful for template arguments that may or may not be types). When a TYPE_UNDEFINED is reached, gengtype will ignore it if it happens inside a type marked with GTY((user)). Otherwise, it will emit an error. Finally, gengtype rejects root types marked GTY((user)) that are not first class pointers. 2012-11-16 Diego Novillo <dnovillo@google.com> VEC API overhaul (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * vec.c (register_overhead): Convert it into member function of vec_prefix. (release_overhead): Likewise. (calculate_allocation): Likewise. (vec_heap_free): Remove. (vec_gc_o_reserve_1): Remove. (vec_heap_o_reserve_1): Remove. (vec_stack_o_reserve_1): Remove. (vec_stack_o_reserve_exact): Remove. (register_stack_vec): New. (stack_vec_register_index): New. (unregister_stack_vec): New. (vec_assert_fail): Remove. * vec.h: Conditionally include ggc.h. Document conditional hackery. Update top-level documentation. (ALONE_VEC_CHECK_INFO): Remove. (VEC_CHECK_INFO): Remove. (ALONE_VEC_CHECK_DECL): Remove. (VEC_CHECK_DECL): Remove. (ALONE_VEC_CHECK_PASS): Remove. (VEC_CHECK_PASS): Remove. (VEC_ASSERT): Remove. (vec_prefix): Add friends va_gc, va_gc_atomic, va_heap and va_stack. Mark fields alloc_ and num_ as protected. (struct vec_t): Remove. Remove all function members. (struct vl_embed): Declare. (struct vl_ptr): Declare. (free): Remove. (reserve_exact): Remove. (reserve): Remove. (safe_splice): Remove. (safe_push): Remove. (safe_grow): Remove. (safe_grow_cleared): Remove. (safe_insert): Remove. (DEF_VEC_I): Remove. (DEF_VEC_ALLOC_I): Remove. (DEF_VEC_P): Remove. (DEF_VEC_ALLOC_P): Remove. (DEF_VEC_O): Remove. (DEF_VEC_ALLOC_O): Remove. (DEF_VEC_ALLOC_P_STACK): Remove. (DEF_VEC_ALLOC_O_STACK): Remove. (DEF_VEC_ALLOC_I_STACK): Remove. (DEF_VEC_A): Remove. (DEF_VEC_ALLOC_A): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (VEC_length): Remove. (VEC_empty): Remove. (VEC_address): Remove. (vec_address): Remove. (VEC_last): Remove. (VEC_index): Remove. (VEC_iterate): Remove. (VEC_embedded_size): Remove. (VEC_embedded_init): Remove. (VEC_free): Remove. (VEC_copy): Remove. (VEC_space): Remove. (VEC_reserve): Remove. (VEC_reserve_exact): Remove. (VEC_splice): Remove. (VEC_safe_splice): Remove. (VEC_quick_push): Remove. (VEC_safe_push): Remove. (VEC_pop): Remove. (VEC_truncate): Remove. (VEC_safe_grow): Remove. (VEC_replace): Remove. (VEC_quick_insert): Remove. (VEC_safe_insert): Remove. (VEC_ordered_remove): Remove. (VEC_unordered_remove): Remove. (VEC_block_remove): Remove. (VEC_lower_bound): Remove. (VEC_alloc): Remove. (VEC_qsort): Remove. (va_heap): Declare. (va_heap::default_layout): New typedef to vl_ptr. (va_heap::reserve): New. (va_heap::release): New. (va_gc): Declare. (va_gc::default_layout): New typedef to vl_embed. (va_gc::reserve): New. (va_gc::release): New. (va_gc_atomic): Declare. Inherit from va_gc. (va_stack): Declare. (va_stack::default_layout): New typedef to vl_ptr. (va_stack::alloc): New. (va_stack::reserve): New. (va_stack::release): New. (register_stack_vec): Declare. (stack_vec_register_index): Declare. (unregister_stack_vec): Declare. (vec<T, A = va_heap, L = typename A::default_layout>): Declare empty vec template. (vec<T, A, vl_embed>): Partial specialization for embedded layout. (vec<T, A, vl_embed>::allocated): New. (vec<T, A, vl_embed>::length): New. (vec<T, A, vl_embed>::is_empty): New. (vec<T, A, vl_embed>::address): New. (vec<T, A, vl_embed>::operator[]): New. (vec<T, A, vl_embed>::last New. (vec<T, A, vl_embed>::space): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::iterate): New. (vec<T, A, vl_embed>::copy): New. (vec<T, A, vl_embed>::splice): New. (vec<T, A, vl_embed>::quick_push New. (vec<T, A, vl_embed>::pop New. (vec<T, A, vl_embed>::truncate): New. (vec<T, A, vl_embed>::quick_insert): New. (vec<T, A, vl_embed>::ordered_remove): New. (vec<T, A, vl_embed>::unordered_remove): New. (vec<T, A, vl_embed>::block_remove): New. (vec<T, A, vl_embed>::qsort): New. (vec<T, A, vl_embed>::lower_bound): New. (vec<T, A, vl_embed>::embedded_size): New. (vec<T, A, vl_embed>::embedded_init): New. (vec<T, A, vl_embed>::quick_grow): New. (vec<T, A, vl_embed>::quick_grow_cleared): New. (vec_safe_space): New. (vec_safe_length): New. (vec_safe_address): New. (vec_safe_is_empty): New. (vec_safe_reserve): New. (vec_safe_reserve_exact): New. (vec_alloc): New. (vec_free): New. (vec_safe_grow): New. (vec_safe_grow_cleared): New. (vec_safe_iterate): New. (vec_safe_push): New. (vec_safe_insert): New. (vec_safe_truncate): New. (vec_safe_copy): New. (vec_safe_splice): New. (vec<T, A, vl_ptr>): New partial specialization for the space efficient layout. (vec<T, A, vl_ptr>::exists): New. (vec<T, A, vl_ptr>::is_empty): New. (vec<T, A, vl_ptr>::length): New. (vec<T, A, vl_ptr>::address): New. (vec<T, A, vl_ptr>::operator[]): New. (vec<T, A, vl_ptr>::operator!=): New. (vec<T, A, vl_ptr>::operator==): New. (vec<T, A, vl_ptr>::last): New. (vec<T, A, vl_ptr>::space): New. (vec<T, A, vl_ptr>::iterate): New. (vec<T, A, vl_ptr>::copy): New. (vec<T, A, vl_ptr>::reserve): New. (vec<T, A, vl_ptr>::reserve_exact): New. (vec<T, A, vl_ptr>::splice): New. (vec<T, A, vl_ptr>::safe_splice): New. (vec<T, A, vl_ptr>::quick_push): New. (vec<T, A, vl_ptr>::safe_push): New. (vec<T, A, vl_ptr>::pop): New. (vec<T, A, vl_ptr>::truncate): New. (vec<T, A, vl_ptr>::safe_grow): New. (vec<T, A, vl_ptr>::safe_grow_cleared): New. (vec<T, A, vl_ptr>::quick_grow): New. (vec<T, A, vl_ptr>::quick_grow_cleared): New. (vec<T, A, vl_ptr>::quick_insert): New. (vec<T, A, vl_ptr>::safe_insert): New. (vec<T, A, vl_ptr>::ordered_remove): New. (vec<T, A, vl_ptr>::unordered_remove): New. (vec<T, A, vl_ptr>::block_remove): New. (vec<T, A, vl_ptr>::qsort): New. (vec<T, A, vl_ptr>::lower_bound): New. (vec_stack_alloc): Define. (FOR_EACH_VEC_SAFE_ELT): Define. * vecir.h: Remove. Update all users. * vecprim.h: Remove. Update all users. Move uchar to coretypes.h. * Makefile.in (VEC_H): Add $(GGC_H). Remove vecir.h and vecprim.h dependencies everywhere. 2012-11-16 Diego Novillo <dnovillo@google.com> * gengtype-lex.l (VEC): Remove. Add characters in the set [\!\>\.-]. * gengtype-parse.c (token_names): Remove "VEC". (require_template_declaration): Remove handling of VEC_TOKEN. (type): Likewise. Call create_user_defined_type when parsing GTY((user)). * gengtype-state.c (type_lineloc): handle TYPE_UNDEFINED. (write_state_undefined_type): New. (write_state_type): Call write_state_undefined_type for TYPE_UNDEFINED. (read_state_type): Call read_state_undefined_type for TYPE_UNDEFINED. * gengtype.c (dbgprint_count_type_at): Handle TYPE_UNDEFINED. (create_user_defined_type): Make extern. (type_for_name): Factor out of resolve_typedef. (create_undefined_type): New (resolve_typedef): Call it when we cannot find a previous typedef and the type is not a template. (find_structure): Accept TYPE_UNDEFINED. (set_gc_used_type): Add argument ALLOWED_UNDEFINED_TYPES, default to false. Emit an error for TYPE_UNDEFINED unless LEVEL is GC_UNUSED or ALLOWED_UNDEFINED_TYPES is set. Set ALLOWED_UNDEFINED_TYPES to true for TYPE_USER_STRUCT. (filter_type_name): Accept templates with more than one argument. (output_mangled_typename): Handle TYPE_UNDEFINED (walk_type): Likewise. (write_types_process_field): Likewise. (write_func_for_structure): If CHAIN_NEXT is set, ORIG_S should not be a user-defined type. (write_types_local_user_process_field): Handle TYPE_ARRAY, TYPE_NONE and TYPE_UNDEFINED. (write_types_local_process_field): Likewise. (contains_scalar_p): Return 0 for TYPE_USER_STRUCT. (write_root): Reject user-defined types that are not pointers. Handle TYPE_NONE, TYPE_UNDEFINED, TYPE_UNION, TYPE_LANG_STRUCT and TYPE_PARAM_STRUCT. (output_typename): Handle TYPE_NONE, TYPE_UNDEFINED, and TYPE_ARRAY. (dump_typekind): Handle TYPE_UNDEFINED. * gengtype.h (enum typekind): Add TYPE_UNDEFINED. (create_user_defined_type): Declare. (enum gty_token): Remove VEC_TOKEN. 2012-11-16 Diego Novillo <dnovillo@google.com> Adjust for new vec API (http://gcc.gnu.org/wiki/cxx-conversion/cxx-vec) * coretypes.h (uchar): Define. * alias.c: Use new vec API in vec.h. * asan.c: Likewise. * attribs.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * builtins.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * coverage.c: Likewise. * cprop.c: Likewise. * data-streamer.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * domwalk.h: Likewise. * dse.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * dwarf2out.h: Likewise. * emit-rtl.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genextract.c: Likewise. * genopinit.c: Likewise * ggc-common.c: Likewise. * ggc.h: Likewise. * gimple-low.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple.c: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * graphds.c: Likewise. * graphds.h: Likewise. * graphite-blocking.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-poly.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-scop-detection.h: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * godump.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * hw-doloop.h: Likewise. * ifcvt.c: Likewise. * insn-addr.h: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-inline.h: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref-inline.h: Likewise. * ipa-ref.c: Likewise. * ipa-ref.h: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira.c: Likewise. * loop-invariant.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-lives.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * mcf.c: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * opts-common.c: Likewise. * opts-global.c: Likewise. * opts.c: Likewise. * opts.h: Likewise. * passes.c: Likewise. * predict.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * profile.h: Likewise. * read-rtl.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regrename.c: Likewise. * regrename.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * rtl.h: Likewise. * sched-deps.c: Likewise. * sched-int.h: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * sese.h: Likewise. * statistics.h: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-mudflap.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-streamer.h: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.h: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/pa.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/spu/spu-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. From-SVN: r193595
2012-11-18 03:54:30 +01:00
FOR_EACH_VEC_ELT (ptr->conflicts, x, b)
if (b)
{
fprintf (file, "%d: ", x);
dump_bitmap (file, b);
}
}
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
/* This structure is used to efficiently record the current status of live
SSA_NAMES when building a conflict graph.
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
LIVE_BASE_VAR has a bit set for each base variable which has at least one
ssa version live.
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
LIVE_BASE_PARTITIONS is an array of bitmaps using the basevar table as an
index, and is used to track what partitions of each base variable are
live. This makes it easy to add conflicts between just live partitions
with the same base variable.
The values in LIVE_BASE_PARTITIONS are only valid if the base variable is
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
marked as being live. This delays clearing of these bitmaps until
they are actually needed again. */
typedef struct live_track_d
{
bitmap_obstack obstack; /* A place to allocate our bitmaps. */
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
bitmap live_base_var; /* Indicates if a basevar is live. */
bitmap *live_base_partitions; /* Live partitions for each basevar. */
var_map map; /* Var_map being used for partition mapping. */
} * live_track_p;
/* This routine will create a new live track structure based on the partitions
in MAP. */
static live_track_p
new_live_track (var_map map)
{
live_track_p ptr;
int lim, x;
/* Make sure there is a partition view in place. */
gcc_assert (map->partition_to_base_index != NULL);
ptr = (live_track_p) xmalloc (sizeof (struct live_track_d));
ptr->map = map;
lim = num_basevars (map);
bitmap_obstack_initialize (&ptr->obstack);
alloc-pool.c, [...]: Add missing whitespace before "(". gcc/ * alloc-pool.c, asan.c, auto-inc-dec.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, bt-load.c, builtins.c, calls.c, cfgcleanup.c, cfgexpand.c, cfghooks.c, cfgloop.c, cfgloopmanip.c, cfgrtl.c, cgraph.c, cgraph.h, cgraphbuild.c, cgraphclones.c, cgraphunit.c, collect2.c, combine-stack-adj.c, combine.c, compare-elim.c, context.c, context.h, cprop.c, cse.c, cselib.c, dbxout.c, dce.c, defaults.h, df-core.c, df-problems.c, df-scan.c, df.h, diagnostic.c, double-int.c, dse.c, dumpfile.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c, errors.c, except.c, expmed.c, expr.c, file-find.c, final.c, fixed-value.c, fold-const.c, function.c, fwprop.c, gcc-ar.c, gcc.c, gcov-io.c, gcov-io.h, gcov.c, gcse.c, genattr-common.c, genattr.c, genattrtab.c, genautomata.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, gengtype-state.c, gengtype.c, genmodes.c, genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c, gensupport.c, ggc-common.c, ggc-page.c, gimple-fold.c, gimple-low.c, gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimple.c, gimple.h, godump.c, graphite-clast-to-gimple.c, graphite-optimize-isl.c, graphite-poly.h, graphite-sese-to-poly.c, graphite.c, haifa-sched.c, hash-table.c, hash-table.h, hwint.c, hwint.h, ifcvt.c, incpath.c, init-regs.c, input.h, intl.c, intl.h, ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c, ipa-utils.c, ipa.c, ira-build.c, ira.c, jump.c, loop-doloop.c, loop-init.c, loop-invariant.c, loop-iv.c, lower-subreg.c, lto-cgraph.c, lto-streamer-in.c, lto-streamer-out.c, lto-wrapper.c, mcf.c, mode-switching.c, modulo-sched.c, omp-low.c, optabs.c, opts.c, pass_manager.h, passes.c, plugin.c, postreload-gcse.c, postreload.c, predict.c, prefix.c, pretty-print.c, print-rtl.c, print-tree.c, profile.c, read-md.c, real.c, real.h, recog.c, ree.c, reg-stack.c, regcprop.c, reginfo.c, regmove.c, regrename.c, regs.h, regstat.c, reload1.c, reorg.c, rtl.c, rtl.h, rtlanal.c, sbitmap.c, sched-rgn.c, sdbout.c, sel-sched-ir.c, sel-sched.c, sparseset.c, stack-ptr-mod.c, statistics.c, stmt.c, stor-layout.c, store-motion.c, streamer-hooks.h, system.h, target-hooks-macros.h, targhooks.c, targhooks.h, toplev.c, tracer.c, trans-mem.c, tree-browser.c, tree-call-cdce.c, tree-cfg.c, tree-cfgcleanup.c, tree-complex.c, tree-data-ref.c, tree-data-ref.h, tree-eh.c, tree-emutls.c, tree-flow.h, tree-if-conv.c, tree-into-ssa.c, tree-iterator.c, tree-loop-distribution.c, tree-mudflap.c, tree-nested.c, tree-nomudflap.c, tree-nrv.c, tree-object-size.c, tree-optimize.c, tree-pass.h, tree-pretty-print.c, tree-profile.c, tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-ifcombine.c, tree-ssa-live.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c, tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-operands.c, tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c, tree-vect-stmts.c, tree-vectorizer.c, tree-vectorizer.h, tree-vrp.c, tree.c, tree.h, tsan.c, tsystem.h, value-prof.c, var-tracking.c, varasm.c, vec.h, vmsdbgout.c, vtable-verify.c, web.c: Add missing whitespace before "(". From-SVN: r203004
2013-09-28 10:42:34 +02:00
ptr->live_base_partitions = (bitmap *) xmalloc (sizeof (bitmap *) * lim);
ptr->live_base_var = BITMAP_ALLOC (&ptr->obstack);
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
for (x = 0; x < lim; x++)
ptr->live_base_partitions[x] = BITMAP_ALLOC (&ptr->obstack);
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
return ptr;
}
/* This routine will free the memory associated with PTR. */
static void
delete_live_track (live_track_p ptr)
{
bitmap_obstack_release (&ptr->obstack);
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
free (ptr->live_base_partitions);
free (ptr);
}
/* This function will remove PARTITION from the live list in PTR. */
static inline void
live_track_remove_partition (live_track_p ptr, int partition)
{
int root;
root = basevar_index (ptr->map, partition);
bitmap_clear_bit (ptr->live_base_partitions[root], partition);
/* If the element list is empty, make the base variable not live either. */
if (bitmap_empty_p (ptr->live_base_partitions[root]))
bitmap_clear_bit (ptr->live_base_var, root);
}
/* This function will adds PARTITION to the live list in PTR. */
static inline void
live_track_add_partition (live_track_p ptr, int partition)
{
int root;
root = basevar_index (ptr->map, partition);
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
/* If this base var wasn't live before, it is now. Clear the element list
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
since it was delayed until needed. */
cfgloop.c (get_loop_body_in_bfs_order): Avoid redundant call to bitmap_bit_p. * cfgloop.c (get_loop_body_in_bfs_order): Avoid redundant call to bitmap_bit_p. * config/bfin/bifn.c (bfin_discover_loop): Likewise. * dominance.c (iterate_fix_dominators): Likewise. * dse.c (set_usage_bits): Likewise. (set_position_unneeded, record_store): Likewise. * gimple-fold.c (get_maxval_strlen): Likewise. * haifa-sched.c (fix_inter_tick, fix_recovery_deps): Likewise. * ipa-inline.c (update_caller_keys): Likewise. * ipa-split.c (verify_non_ssa_vars): Likewise. * ipa-type-escape.c (mark_type, close_type_seen): Likewise. (close_type_exposed_parameter, close_type_full_escape): Likewise. (close_addressof_down): Likewise. * ira-color.c (assign_hard_reg, push_allocno_to_stack): Likewise. (setup_allocno_left_conflicts_size): Likewise. (ira_reassign_conflict_allocnos): Likewise. (ira_reassign_pseudos): Likewise. * ira-emit.c (change_loop): Likewise. * loop-invariant.c (mark_regno_live, mark_regno_death): Likewise. * lto-streamer-out.c (write_symbol): Likewise. * predict.c (expr_expected_value_1): Likewise. * regstat.c (regstat_bb_compute_ri): Likewise. * sel-sched.c (create_block_for_bookkeeping): Likewise. (track_scheduled_insns_and_blocks, sel_sched_region_1): Likewise. * stmt.c (expand_case): Likewise. * tree-eh.c (emit_eh_dispatch): Likewise. * tree-into-ssa.c (prune_unused_phi_nodes): Likewise. * tree-loop-distribution.c (make_nodes_having_upstream_mem_writes): Likewise. (rdg_flag_vertex, rdg_flag_loop_exits): Likewise. (rdg_build_components): Likewise. * tree-object-size.c (collect_object_sizes_for): Likewise. * tree-sra.c (convert_callers): Likewise. * tree-ssa-coalesce.c (live_track_add_partition): Likewise. * tree-ssa-live.c (mark_all_vars_used_1): Likewise. * tree-ssa-pre.c (bitmap_set_replace_value): Likewise. From-SVN: r163378
2010-08-19 18:51:39 +02:00
if (bitmap_set_bit (ptr->live_base_var, root))
bitmap_clear (ptr->live_base_partitions[root]);
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
bitmap_set_bit (ptr->live_base_partitions[root], partition);
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
}
/* Clear the live bit for VAR in PTR. */
static inline void
live_track_clear_var (live_track_p ptr, tree var)
{
int p;
p = var_to_partition (ptr->map, var);
if (p != NO_PARTITION)
live_track_remove_partition (ptr, p);
}
/* Return TRUE if VAR is live in PTR. */
static inline bool
live_track_live_p (live_track_p ptr, tree var)
{
int p, root;
p = var_to_partition (ptr->map, var);
if (p != NO_PARTITION)
{
root = basevar_index (ptr->map, p);
if (bitmap_bit_p (ptr->live_base_var, root))
return bitmap_bit_p (ptr->live_base_partitions[root], p);
}
return false;
}
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
/* This routine will add USE to PTR. USE will be marked as live in both the
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
ssa live map and the live bitmap for the root of USE. */
static inline void
live_track_process_use (live_track_p ptr, tree use)
{
int p;
p = var_to_partition (ptr->map, use);
if (p == NO_PARTITION)
return;
/* Mark as live in the appropriate live list. */
live_track_add_partition (ptr, p);
}
/* This routine will process a DEF in PTR. DEF will be removed from the live
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
lists, and if there are any other live partitions with the same base
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
variable, conflicts will be added to GRAPH. */
static inline void
live_track_process_def (live_track_p ptr, tree def, ssa_conflicts_p graph)
{
int p, root;
bitmap b;
unsigned x;
bitmap_iterator bi;
p = var_to_partition (ptr->map, def);
if (p == NO_PARTITION)
return;
/* Clear the liveness bit. */
live_track_remove_partition (ptr, p);
/* If the bitmap isn't empty now, conflicts need to be added. */
root = basevar_index (ptr->map, p);
if (bitmap_bit_p (ptr->live_base_var, root))
{
b = ptr->live_base_partitions[root];
EXECUTE_IF_SET_IN_BITMAP (b, 0, x, bi)
ssa_conflicts_add (graph, p, x);
}
}
/* Initialize PTR with the partitions set in INIT. */
static inline void
live_track_init (live_track_p ptr, bitmap init)
{
unsigned p;
bitmap_iterator bi;
/* Mark all live on exit partitions. */
EXECUTE_IF_SET_IN_BITMAP (init, 0, p, bi)
live_track_add_partition (ptr, p);
}
/* This routine will clear all live partitions in PTR. */
static inline void
live_track_clear_base_vars (live_track_p ptr)
{
/* Simply clear the live base list. Anything marked as live in the element
lists will be cleared later if/when the base variable ever comes alive
again. */
bitmap_clear (ptr->live_base_var);
}
/* Build a conflict graph based on LIVEINFO. Any partitions which are in the
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
partition view of the var_map liveinfo is based on get entries in the
conflict graph. Only conflicts between ssa_name partitions with the same
base variable are added. */
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
static ssa_conflicts_p
build_ssa_conflict_graph (tree_live_info_p liveinfo)
{
ssa_conflicts_p graph;
var_map map;
basic_block bb;
ssa_op_iter iter;
live_track_p live;
map = live_var_map (liveinfo);
graph = ssa_conflicts_new (num_var_partitions (map));
live = new_live_track (map);
Eliminate FOR_EACH_BB macro. gcc/ * basic-block.h (FOR_EACH_BB): Eliminate macro. * asan.c (transform_statements, execute_sanopt): Eliminate use of FOR_EACH_BB in favor of FOR_EACH_BB_FN, to make use of cfun explicit. * auto-inc-dec.c (rest_of_handle_auto_inc_dec): Likewise. * bb-reorder.c (find_rarely_executed_basic_blocks_and_crossing_edges, set_edge_can_fallthru_flag, fix_up_fall_thru_edges, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes, insert_section_boundary_note, rest_of_handle_reorder_blocks, duplicate_computed_gotos): Likewise. * cfg.c (clear_edges, compact_blocks, brief_dump_cfg): Likewise. * cfganal.c (find_unreachable_blocks, add_noreturn_fake_exit_edges, compute_dominance_frontiers_1, single_pred_before_succ_order): Likewise. * cfgbuild.c (find_many_sub_basic_blocks): Likewise. * cfgcleanup.c (try_optimize_cfg, delete_dead_jumptables): Likewise. * cfgexpand.c (add_scope_conflicts, discover_nonconstant_array_refs): Likewise. * cfgloop.c (flow_loops_cfg_dump, get_loop_body, record_loop_exits, verify_loop_structure): Likewise. * cfgloopanal.c (mark_loop_exit_edges): Likewise. * cfgrtl.c (compute_bb_for_insn, find_partition_fixes, verify_hot_cold_block_grouping, purge_all_dead_edges, fixup_abnormal_edges, record_effective_endpoints, outof_cfg_layout_mode, fixup_reorder_chain, force_one_exit_fallthru, break_superblocks): Likewise. * cgraphbuild.c (build_cgraph_edges, rebuild_cgraph_edges, cgraph_rebuild_references): Likewise. * combine-stack-adj.c (combine_stack_adjustments): Likewise. * combine.c (delete_noop_moves, create_log_links, combine_instructions): Likewise. * config/arm/arm.c (thumb1_reorg, thumb2_reorg): Likewise. * config/bfin/bfin.c (bfin_gen_bundles, reorder_var_tracking_notes): Likewise. * config/c6x/c6x.c (c6x_gen_bundles, conditionalize_after_sched, c6x_reorg): Likewise. * config/epiphany/resolve-sw-modes.c (resolve_sw_modes): Likewise. * config/frv/frv.c (frv_optimize_membar): Likewise. * config/i386/i386.c (ix86_finalize_stack_realign_flags): Likewise. * config/ia64/ia64.c (ia64_reorg): Likewise. * config/mips/mips.c (mips_annotate_pic_calls): Likewise. * config/picochip/picochip.c (reorder_var_tracking_notes): Likewise. * config/rs6000/rs6000.c (rs6000_alloc_sdmode_stack_slot): Likewise. * config/s390/s390.c (s390_regs_ever_clobbered): Likewise. * config/sh/sh_treg_combine.cc (sh_treg_combine::execute): Likewise. * config/spu/spu.c (spu_machine_dependent_reorg): Likewise. * config/tilegx/tilegx.c (tilegx_gen_bundles, reorder_var_tracking_notes): Likewise. * config/tilepro/tilepro.c (tilepro_gen_bundles, reorder_var_tracking_notes): Likewise. * coverage.c (coverage_compute_cfg_checksum): Likewise. * cprop.c (compute_hash_table_work, compute_cprop_data, local_cprop_pass, find_implicit_sets): Likewise. * cse.c (cse_condition_code_reg): Likewise. * dce.c (prescan_insns_for_dce): Likewise. * df-core.c (df_compact_blocks): Likewise. * df-problems.c (df_word_lr_alloc): Likewise. * df-scan.c (df_scan_start_dump, df_scan_blocks, df_insn_rescan_all, df_update_entry_exit_and_calls): Likewise. * dominance.c (calculate_dominance_info, verify_dominators, debug_dominance_info): Likewise. * dse.c (dse_step5_nospill): Likewise. * except.c (finish_eh_generation): Likewise. * final.c (compute_alignments): Likewise. * function.c (thread_prologue_and_epilogue_insns, rest_of_match_asm_constraints): Likewise. * gcse.c (compute_hash_table_work, prune_expressions, compute_pre_data, compute_code_hoist_vbeinout, hoist_code, calculate_bb_reg_pressure, compute_ld_motion_mems): Likewise. * gimple-iterator.c (gsi_commit_edge_inserts): Likewise. * gimple-ssa-isolate-paths.c (find_implicit_erroneous_behaviour, find_explicit_erroneous_behaviour): Likewise. * graphite-sese-to-poly.c (rewrite_reductions_out_of_ssa, rewrite_cross_bb_scalar_deps_out_of_ssa): Likewise. * haifa-sched.c (haifa_sched_init): Likewise. * hw-doloop.c (discover_loops, set_bb_indices, reorder_loops): Likewise. * ifcvt.c (if_convert): Likewise. * init-regs.c (initialize_uninitialized_regs): Likewise. * ipa-prop.c (ipcp_transform_function): Likewise. * ipa-pure-const.c (analyze_function): Likewise. * ipa-split.c (find_split_points, execute_split_functions): Likewise. * ira-build.c (form_loop_tree): Likewise. * ira-costs.c (find_costs_and_classes): Likewise. * ira-emit.c (emit_moves, add_ranges_and_copies, ira_emit): Likewise. * ira.c (decrease_live_ranges_number, compute_regs_asm_clobbered, mark_elimination, update_equiv_regs, find_moveable_pseudos, split_live_ranges_for_shrink_wrap, allocate_initial_values): Likewise. * jump.c (mark_all_labels): Likewise. * lcm.c (compute_laterin, compute_insert_delete, compute_available, compute_nearerout, compute_rev_insert_delete): Likewise. * loop-init.c (fix_loop_structure): Likewise. * loop-invariant.c (calculate_loop_reg_pressure): Likewise. * lower-subreg.c (decompose_multiword_subregs, decompose_multiword_subregs): Likewise. * lra-assigns.c (assign_by_spills): Likewise. * lra-coalesce.c (lra_coalesce): Likewise. * lra-constraints.c (lra_inheritance, remove_inheritance_pseudos): Likewise. * lra-eliminations.c (lra_init_elimination): Likewise. * lra-spills.c (assign_spill_hard_regs, spill_pseudos, lra_final_code_change): Likewise. * lra.c (remove_scratches, check_rtl, has_nonexceptional_receiver, update_inc_notes): Likewise. * mcf.c (adjust_cfg_counts): Likewise. * mode-switching.c (optimize_mode_switching): Likewise. * modulo-sched.c (rest_of_handle_sms): Likewise. * omp-low.c (optimize_omp_library_calls, expand_omp_taskreg, expand_omp_target): Likewise. * postreload-gcse.c (alloc_mem, compute_hash_table): Likewise. * postreload.c (reload_cse_regs_1): Likewise. * predict.c (strip_predict_hints, tree_bb_level_predictions, tree_estimate_probability, expensive_function_p, estimate_bb_frequencies, compute_function_frequency): Likewise. * profile.c (is_inconsistent, compute_branch_probabilities, branch_prob): Likewise. * ree.c (find_removable_extensions): Likewise. * reg-stack.c (compensate_edges, convert_regs, reg_to_stack): Likewise. * regcprop.c (copyprop_hardreg_forward): Likewise. * reginfo.c (init_subregs_of_mode): Likewise. * regrename.c (regrename_analyze): Likewise. * regstat.c (regstat_compute_ri, regstat_compute_calls_crossed): Likewise. * reload1.c (has_nonexceptional_receiver, reload, calculate_elim_costs_all_insns): Likewise. * resource.c (init_resource_info, free_resource_info): Likewise. * sched-ebb.c (schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_single_block_region, haifa_find_rgns, sched_rgn_local_init): Likewise. * sel-sched-dump.c (sel_dump_cfg_2): Likewise. * sel-sched-ir.c (init_lv_sets, free_lv_sets, make_regions_from_the_rest): Likewise. * sese.c (build_sese_loop_nests, sese_build_liveouts): Likewise. * stack-ptr-mod.c (notice_stack_pointer_modification): Likewise. * store-motion.c (compute_store_table, build_store_vectors, one_store_motion_pass): Likewise. * tracer.c (tail_duplicate): Likewise. * trans-mem.c (compute_transaction_bits): Likewise. * tree-call-cdce.c (tree_call_cdce): Likewise. * tree-cfg.c (replace_loop_annotate, factor_computed_gotos, fold_cond_expr_cond, make_edges, assign_discriminators, make_abnormal_goto_edges, cleanup_dead_labels, group_case_labels, dump_cfg_stats, gimple_verify_flow_info, print_loop, execute_fixup_cfg): Likewise. * tree-cfgcleanup.c (cleanup_tree_cfg_1, merge_phi_nodes): Likewise. * tree-complex.c (init_dont_simulate_again, tree_lower_complex): Likewise. * tree-dfa.c (collect_dfa_stats, dump_enumerated_decls): Likewise. * tree-eh.c (execute_lower_resx, execute_lower_eh_dispatch, mark_reachable_handlers): Likewise. * tree-emutls.c (lower_emutls_function_body): Likewise. * tree-if-conv.c (main_tree_if_conversion): Likewise. * tree-inline.c (optimize_inline_calls): Likewise. * tree-into-ssa.c (rewrite_into_ssa, update_ssa): Likewise. * tree-nrv.c (tree_nrv, execute_return_slot_opt): Likewise. * tree-object-size.c (compute_object_sizes): Likewise. * tree-outof-ssa.c (eliminate_useless_phis, rewrite_trees, insert_backedge_copies, tree_profiling): Likewise. * tree-scalar-evolution.c (scev_const_prop): Likewise. * tree-sra.c (scan_function, sra_modify_function_body, propagate_dereference_distances, ipa_sra_modify_function_body, convert_callers): Likewise. * tree-ssa-ccp.c (ccp_initialize, execute_fold_all_builtins): Likewise. * tree-ssa-coalesce.c (build_ssa_conflict_graph): Likewise. create_outofssa_var_map, coalesce_partitions): Likewise. * tree-ssa-copy.c (init_copy_prop): Likewise. * tree-ssa-copyrename.c (rename_ssa_copies): Likewise. * tree-ssa-dce.c (find_obviously_necessary_stmts, eliminate_unnecessary_stmts): Likewise. * tree-ssa-dom.c (free_all_edge_infos, tree_ssa_dominator_optimize): Likewise. * tree-ssa-forwprop.c (ssa_forward_propagate_and_combine): Likewise. * tree-ssa-live.c (clear_unused_block_pointer, remove_unused_locals, new_tree_live_info, calculate_live_on_exit, dump_live_info, analyze_memory_references, fill_always_executed_in, tree_ssa_lim_finalize): Likewise. * tree-ssa-loop-manip.c (find_uses_to_rename, verify_loop_closed_ssa): Likewise. * tree-ssa-math-opts.c (execute_cse_reciprocals, execute_cse_sincos, execute_optimize_bswap, execute_optimize_widening_mul): Likewise. * tree-ssa-propagate.c (substitute_and_fold): Likewise. * tree-ssa-structalias.c (compute_points_to_sets): Likewise. * tree-ssa-tail-merge.c (find_same_succ, reset_cluster_vectors): Likewise. * tree-ssa-ter.c (find_replaceable_exprs): Likewise. * tree-ssa-threadupdate.c (thread_through_all_blocks): Likewise. * tree-ssa-uncprop.c (associate_equivalences_with_edges, tree_ssa_uncprop): Likewise. * tree-ssa-uninit.c (warn_uninitialized_vars, execute_late_warn_uninitialized): Likewise. * tree-ssa.c (verify_ssa, execute_update_addresses_taken): Likewise. * tree-stdarg.c (check_all_va_list_escapes, execute_optimize_stdarg): Likewise. * tree-switch-conversion.c (do_switchconv): Likewise. * tree-vect-generic.c (expand_vector_operations): Likewise. * tree-vectorizer.c (adjust_simduid_builtins, note_simd_array_uses, execute_vect_slp): Likewise. * tree-vrp.c (check_all_array_refs, remove_range_assertions, vrp_initialize, identify_jump_threads, instrument_memory_accesses): Likewise. * ubsan.c (ubsan_pass): Likewise. * value-prof.c (verify_histograms, gimple_value_profile_transformations, gimple_find_values_to_profile): Likewise. * var-tracking.c (vt_find_locations, dump_dataflow_sets, vt_emit_notes, vt_initialize, delete_debug_insns, vt_finalize): Likewise. gcc/testsuite/ * g++.dg/plugin/selfassign.c (execute_warn_self_assign): Eliminate use of FOR_EACH_BB in favor of FOR_EACH_BB_FN, to make use of cfun explicit. * gcc.dg/plugin/selfassign.c (execute_warn_self_assign): Likewise. From-SVN: r205828
2013-12-09 22:06:06 +01:00
FOR_EACH_BB_FN (bb, cfun)
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
{
/* Start with live on exit temporaries. */
live_track_init (live, live_on_exit (liveinfo, bb));
Merger of git branch "gimple-classes-v2-option-3" gcc/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * coretypes.h (struct gcond): Add forward decl. (struct gdebug): Likewise. (struct ggoto): Likewise. (struct glabel): Likewise. (struct gswitch): Likewise. (struct gassign): Likewise. (struct gasm): Likewise. (struct gcall): Likewise. (struct gtransaction): Likewise. (struct greturn): Likewise. (struct gbind): Likewise. (struct gcatch): Likewise. (struct geh_filter): Likewise. (struct geh_mnt): Likewise. (struct geh_else): Likewise. (struct gresx): Likewise. (struct geh_dispatch): Likewise. (struct gphi): Likewise. (struct gtry): Likewise. (struct gomp_atomic_load): Likewise. (struct gomp_atomic_store): Likewise. (struct gomp_continue): Likewise. (struct gomp_critical): Likewise. (struct gomp_for): Likewise. (struct gomp_parallel): Likewise. (struct gomp_task): Likewise. (struct gomp_sections): Likewise. (struct gomp_single): Likewise. (struct gomp_target): Likewise. (struct gomp_teams): Likewise. * doc/gimple.texi (Class hierarchy of GIMPLE statements): Update for renaming of gimple subclasses. * gdbhooks.py: Update. * gimple-iterator.c (gsi_for_phi): New. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. * gimple-iterator.h (struct gphi_iterator): New subclass of gimple_stmt_iterator. (gsi_for_phi): New prototype. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. (gsi_next_nonvirtual_phi): Strengthen param from gimple_stmt_iterator * to gphi_iterator *, and local "phi" from gimple to gphi *. * gsstruct.def: Update for renamings of classes. * gimple.c (gimple_build_return): Strengthen return type from gimple to greturn *. (gimple_call_reset_alias_info): Strengthen param to gcall *. (gimple_build_call_1): Strengthen return type from gimple to gcall *. (gimple_build_call_vec): Likewise. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal_1): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Strengthen return type from gimple to gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Strengthen return type from gimple to gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Strengthen return type from gimple to glabel *. (gimple_build_goto): Strengthen return type from gimple to ggoto *. (gimple_build_bind): Strengthen return type from gimple to gbind *. (gimple_build_asm_1): Strengthen return type from gimple to gasm *. (gimple_build_asm_vec): Likewise. (gimple_build_catch): Strengthen return type from gimple to gcatch *. (gimple_build_eh_filter): Strengthen return type from gimple to geh_filter *. (gimple_build_eh_must_not_throw): Strengthen return type from gimple to geh_mnt *. (gimple_build_eh_else): Strengthen return type from gimple to geh_else *. (gimple_build_try): Update for renaming of gimple_statement_try to gtry. (gimple_build_resx): Strengthen return type from gimple to gresx *. (gimple_build_switch_nlabels): Strengthen return type from gimple to gswitch *. (gimple_build_switch): Likewise. (gimple_build_eh_dispatch): Strengthen return type from gimple to geh_dispatch *. (gimple_build_debug_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_debug_source_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_omp_critical): Strengthen return type from gimple to gomp_critical *. (gimple_build_omp_for): Strengthen return type from gimple to gomp_for *. (gimple_build_omp_parallel): Strengthen return type from gimple to gomp_parallel *. (gimple_build_omp_task): Strengthen return type from gimple to gomp_task *. (gimple_build_omp_continue): Strengthen return type from gimple to gomp_continue *. (gimple_build_omp_sections): Strengthen return type from gimple to gomp_sections *. (gimple_build_omp_single): Strengthen return type from gimple to gomp_single *. (gimple_build_omp_target): Strengthen return type from gimple to gomp_target *. (gimple_build_omp_teams): Strengthen return type from gimple to gomp_teams *. (gimple_build_omp_atomic_load): Strengthen return type from gimple to gomp_atomic_load *. (gimple_build_omp_atomic_store): Strengthen return type from gimple to gomp_atomic_store *. (gimple_build_transaction): Strengthen return type from gimple to gtransaction *. (empty_stmt_p): Replace check for GIMPLE_BIND with a dyn_cast. (gimple_call_fnspec): Require a const gcall *. (gimple_call_arg_flags): Likewise. (gimple_call_return_flags): Likewise. (gimple_set_bb): Add a checked cast. (gimple_copy): Within the cases, add locals of the appropriate subclass and use in place of "stmt" and "copy" for typesafety. (gimple_has_side_effects): Add a checked cast. (gimple_could_trap_p_1): Likewise. (gimple_call_copy_skip_args): Require a gcall *, and return one. (gimple_asm_clobbers_memory_p): Require a const gasm *. (infer_nonnull_range): Replace a check for GIMPLE_RETURN with a dyn_cast, introducing local "return_stmt" and using ti in place of "stmt". * gimple.h (gimple_vec): Eliminate this typedef. (struct gimple_statement_call): Rename to... (struct gcall): ...this. (struct gimple_statement_bind): Rename to... (struct gbind): ...this. (struct gimple_statement_catch): Rename to... (struct gcatch): ...this. (struct gimple_statement_eh_filter): Rename to... (struct geh_filter): ...this. (struct gimple_statement_eh_else): Rename to... (struct geh_else): ...this. (struct gimple_statement_eh_mnt): Rename to... (struct geh_mnt): ...this. (struct gimple_statement_phi): Rename to... (struct gphi): ...this. (struct gimple_statement_resx): Rename to... (struct gresx): ...this. (struct gimple_statement_eh_dispatch): Rename to... (struct geh_dispatch): ...this. (struct gimple_statement_try): Rename to... (struct gtry): ...this. (struct gimple_statement_asm): Rename to... (struct gasm): ...this. (struct gimple_statement_omp_critical): Rename to... (struct gomp_critical): ...this. (struct gimple_statement_omp_for): Rename to... (struct gomp_for): ...this. (struct gimple_statement_omp_parallel): Rename to... (struct gomp_parallel): ...this. (struct gimple_statement_omp_target): Rename to... (struct gomp_target): ...this. (struct gimple_statement_omp_task): Rename to... (struct gomp_task): ...this. (struct gimple_statement_omp_sections): Rename to... (struct gomp_sections): ...this. (struct gimple_statement_omp_continue): Rename to... (struct gomp_continue): ...this. (struct gimple_statement_omp_single): Rename to... (struct gomp_single): ...this. (struct gimple_statement_omp_teams): Rename to... (struct gomp_teams): ...this. (struct gimple_statement_omp_atomic_load): Rename to... (struct gomp_atomic_load): ...this. (struct gimple_statement_omp_atomic_store :): Rename to... (struct gomp_atomic_store :): ...this. (struct gimple_statement_transaction): Rename to... (struct gtransaction): ...this. (struct gcond): New subclass. (struct gdebug): New subclass. (struct ggoto): New subclass. (struct glabel): New subclass. (struct gswitch): New subclass. (struct gassign): New subclass. (struct greturn): New subclass. (is_a_helper <gimple_statement_asm *>::test): Rename to... (is_a_helper <gasm *>::test): ...this. (is_a_helper <gimple_statement_bind *>::test): Rename to... (is_a_helper <gbind *>::test): ...this. (is_a_helper <gassign *>::test): New. (is_a_helper <gimple_statement_call *>::test): Rename to... (is_a_helper <gcall *>::test): ...this. (is_a_helper <gimple_statement_catch *>::test): Rename to... (is_a_helper <gcatch *>::test): ...this. (is_a_helper <gimple_statement_resx *>::test): Rename to... (is_a_helper <gresx *>::test): ...this. (is_a_helper <gcond *>::test): New. (is_a_helper <gdebug *>::test): New. (is_a_helper <ggoto *>::test): New. (is_a_helper <glabel *>::test): New. (is_a_helper <gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <geh_dispatch *>::test): ...this. (is_a_helper <gimple_statement_eh_else *>::test): Rename to... (is_a_helper <geh_else *>::test): ...this. (is_a_helper <gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <geh_filter *>::test): ...this. (is_a_helper <gimple_statement_eh_mnt *>::test): Rename to... (is_a_helper <geh_mnt *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <gomp_atomic_load *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <gomp_atomic_store *>::test): ...this. (is_a_helper <gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <gomp_continue *>::test): ...this. (is_a_helper <gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <gomp_critical *>::test): ...this. (is_a_helper <gimple_statement_omp_for *>::test): Rename to... (is_a_helper <gomp_for *>::test): ...this. (is_a_helper <gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <gomp_parallel *>::test): ...this. (is_a_helper <gimple_statement_omp_target *>::test): Rename to... (is_a_helper <gomp_target *>::test): ...this. (is_a_helper <gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <gomp_sections *>::test): ...this. (is_a_helper <gimple_statement_omp_single *>::test): Rename to... (is_a_helper <gomp_single *>::test): ...this. (is_a_helper <gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <gomp_teams *>::test): ...this. (is_a_helper <gimple_statement_omp_task *>::test): Rename to... (is_a_helper <gomp_task *>::test): ...this. (is_a_helper <gimple_statement_phi *>::test): Rename to... (is_a_helper <gphi *>::test): ...this. (is_a_helper <gimple_statement_transaction *>::test): Rename to... (is_a_helper <gtransaction *>::test): ...this. (is_a_helper <greturn *>::test): New. (is_a_helper <gswitch *>::test): New. (is_a_helper <gimple_statement_try *>::test): Rename to... (is_a_helper <gtry *>::test): ...this. (is_a_helper <const gimple_statement_asm *>::test): Rename to... (is_a_helper <const gasm *>::test): ...this. (is_a_helper <const gimple_statement_bind *>::test): Rename to... (is_a_helper <const gbind *>::test): ...this. (is_a_helper <const gimple_statement_call *>::test): Rename to... (is_a_helper <const gcall *>::test): ...this. (is_a_helper <const gimple_statement_catch *>::test): Rename to... (is_a_helper <const gcatch *>::test): ...this. (is_a_helper <const gimple_statement_resx *>::test): Rename to... (is_a_helper <const gresx *>::test): ...this. (is_a_helper <const gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <const geh_dispatch *>::test): ...this. (is_a_helper <const gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <const geh_filter *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <const gomp_atomic_load *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <const gomp_atomic_store *>::test): ...this. (is_a_helper <const gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <const gomp_continue *>::test): ...this. (is_a_helper <const gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <const gomp_critical *>::test): ...this. (is_a_helper <const gimple_statement_omp_for *>::test): Rename to... (is_a_helper <const gomp_for *>::test): ...this. (is_a_helper <const gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <const gomp_parallel *>::test): ...this. (is_a_helper <const gimple_statement_omp_target *>::test): Rename to... (is_a_helper <const gomp_target *>::test): ...this. (is_a_helper <const gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <const gomp_sections *>::test): ...this. (is_a_helper <const gimple_statement_omp_single *>::test): Rename to... (is_a_helper <const gomp_single *>::test): ...this. (is_a_helper <const gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <const gomp_teams *>::test): ...this. (is_a_helper <const gimple_statement_omp_task *>::test): Rename to... (is_a_helper <const gomp_task *>::test): ...this. (is_a_helper <const gimple_statement_phi *>::test): Rename to... (is_a_helper <const gphi *>::test): ...this. (is_a_helper <const gimple_statement_transaction *>::test): Rename to... (is_a_helper <const gtransaction *>::test): ...this. (gimple_build_return): Strengthen return type to greturn *. (gimple_call_reset_alias_info): Require a gcall *. (gimple_build_call_vec): Return a gcall *. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Return a gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Return a gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Return a glabel *. (gimple_build_goto): Return a ggoto *. (gimple_build_bind): Return a gbind *. (gimple_build_asm_vec): Return a gasm *. (gimple_build_catch): Return a gcatch *. (gimple_build_eh_filter): Return a geh_filter *. (gimple_build_eh_must_not_throw): Return a geh_mnt *. (gimple_build_eh_else): Return a geh_else *. (gimple_build_try): Return a gtry *. (gimple_build_resx): Return a gresx *. (gimple_build_switch_nlabels): Return a gswitch *. (gimple_build_switch): Return a gswitch *. (gimple_build_eh_dispatch): Return a geh_dispatch *. (gimple_build_debug_bind_stat): Return a gdebug *. (gimple_build_debug_source_bind_stat): Return a gdebug *. (gimple_build_omp_critical): Return a gomp_critical *. (gimple_build_omp_for): Return a gomp_for *. (gimple_build_omp_parallel): Return a gomp_parallel *. (gimple_build_omp_task): Return a gomp_task *. (gimple_build_omp_continue): Return a gomp_continue *. (gimple_build_omp_sections): Return a gomp_sections *. (gimple_build_omp_single): Return a gomp_single *. (gimple_build_omp_target): Return a gomp_target *. (gimple_build_omp_teams): Return a gomp_teams *. (gimple_build_omp_atomic_load): Return a gomp_atomic_load *. (gimple_build_omp_atomic_store): Return a gomp_atomic_store *. (gimple_build_transaction): Return a gtransaction *. (gimple_call_arg_flags): Require a const gcall *. (gimple_call_return_flags): Likewise. (gimple_call_copy_skip_args): Require and return a gcall *. (gimple_asm_clobbers_memory_p): Require a const gasm *. (gimple_seq_first_stmt_as_a_bind): New. (gimple_assign_nontemporal_move_p): Require a const gassign * rather than a const_gimple. (gimple_call_internal_fn): Update for renaming to gcall. (gimple_call_fntype): Likewise. (gimple_call_set_fntype): Require a gcall * rather than a gimple. (gimple_call_set_fn): Likewise. (gimple_call_set_internal_fn): Likewise. (gimple_call_set_chain): Likewise. (gimple_call_set_tail): Likewise. (gimple_call_tail_p): Likewise. (gimple_call_set_return_slot_opt): Likewise. (gimple_call_return_slot_opt_p): Likewise. (gimple_call_set_from_thunk): Likewise. (gimple_call_from_thunk_p): Likewise. (gimple_call_set_va_arg_pack): Likewise. (gimple_call_va_arg_pack_p): Likewise. (gimple_call_set_nothrow): Likewise. (gimple_call_nothrow_p): Likewise. (gimple_call_set_alloca_for_var): Likewise. (gimple_call_alloca_for_var_p): Likewise. (gimple_call_use_set): Likewise. (gimple_call_clobber_set): Likewise. (gimple_call_return_type): Require a const gcall * rather than a const_gimple. (gimple_call_chain_ptr): Likewise. (gimple_call_copy_flags): Require a pair of gcall *. (gimple_cond_set_code): Require a gcond * rather than a gimple (gimple_cond_set_lhs): Likewise. (gimple_cond_set_rhs): Likewise. (gimple_cond_set_true_label): Likewise. (gimple_cond_set_false_label): Likewise. (gimple_cond_make_false): Likewise. (gimple_cond_make_true): Likewise. (gimple_cond_lhs_ptr): Require a const gcond * rather than a const_gimple. (gimple_cond_rhs_ptr): Likewise. (gimple_cond_true_label): Likewise. (gimple_cond_false_label): Likewise. (gimple_cond_true_p): Likewise. (gimple_cond_false_p): Likewise. (gimple_cond_set_condition): Likewise. (gimple_label_label): Require a const glabel *. (gimple_label_set_label): Require a glabel *. (gimple_goto_set_dest): Require a ggoto *. (gimple_bind_vars): Require a const gbind *. (gimple_bind_block): Likewise. (gimple_bind_set_vars): Require a gbind *. (gimple_bind_append_vars): Likewise. (gimple_bind_body_ptr): Likewise. (gimple_bind_body): Likewise. (gimple_bind_set_body): Likewise. (gimple_bind_add_stmt): Likewise. (gimple_bind_add_seq): Likewise. (gimple_bind_set_block): Likewise. (gimple_asm_ninputs): Require a const gasm *. (gimple_asm_noutputs): Likewise. (gimple_asm_nclobbers): Likewise. (gimple_asm_nlabels): Likewise. (gimple_asm_input_op): Likewise. (gimple_asm_input_op_ptr): Likewise. (gimple_asm_output_op): Likewise. (gimple_asm_output_op_ptr): Likewise. (gimple_asm_clobber_op): Likewise. (gimple_asm_label_op): Likewise. (gimple_asm_string): Likewise. (gimple_asm_volatile_p): Likewise. (gimple_asm_input_p): Likewise. (gimple_asm_set_input_op): Require a gasm *. (gimple_asm_set_output_op): Likewise. (gimple_asm_set_clobber_op): Likewise. (gimple_asm_set_label_op): Likewise. (gimple_asm_set_volatile): Likewise. (gimple_asm_set_input): Likewise. (gimple_catch_types): Require a const gcatch *. (gimple_catch_types_ptr): Require a gcatch *. (gimple_catch_handler_ptr): Likewise. (gimple_catch_handler): Likewise. (gimple_catch_set_types): Likewise. (gimple_catch_set_handler): Likewise. (gimple_eh_filter_types): Update for renaming of subclass to geh_filter. (gimple_eh_filter_types_ptr): Likewise. (gimple_eh_filter_failure_ptr): Likewise. (gimple_eh_filter_set_types): Require a geh_filter *. (gimple_eh_filter_set_failure): Likewise. (gimple_eh_must_not_throw_fndecl): Require a geh_mnt *. (gimple_eh_must_not_throw_set_fndecl): Likewise. (gimple_eh_else_n_body_ptr): Require a geh_else *. (gimple_eh_else_n_body): Likewise. (gimple_eh_else_e_body_ptr): Likewise. (gimple_eh_else_e_body): Likewise. (gimple_eh_else_set_n_body): Likewise. (gimple_eh_else_set_e_body): Likewise. (gimple_try_set_kind): Require a gtry *. (gimple_try_set_catch_is_cleanup): Likewise. (gimple_try_set_eval): Likewise. (gimple_try_set_cleanup): Likewise. (gimple_try_eval_ptr): Update for renaming of subclass to gtry. (gimple_try_cleanup_ptr): Likewise. (gimple_phi_capacity): Update for renaming of subclass to gphi. (gimple_phi_num_args): Likewise. (gimple_phi_result): Likewise. (gimple_phi_result_ptr): Likewise. (gimple_phi_arg): Likewise. (gimple_phi_set_result): Require a gphi *. (gimple_phi_set_arg): Likewise. (gimple_phi_arg_def_ptr): Likewise. (gimple_phi_arg_edge): Likewise. (gimple_phi_arg_location): Likewise. (gimple_phi_arg_location_from_edge): Likewise. (gimple_phi_arg_set_location): Likewise. (gimple_phi_arg_has_location): Likewise. (gimple_resx_region): Require a const gresx *. (gimple_resx_set_region): Require a gresx *. (gimple_eh_dispatch_region): Require a const geh_dispatch *. (gimple_eh_dispatch_set_region): Require a geh_dispatch *. (gimple_switch_num_labels): Require a const gswitch *. (gimple_switch_set_num_labels): Likewise. (gimple_switch_index): Likewise. (gimple_switch_index_ptr): Likewise. (gimple_switch_label): Likewise. (gimple_switch_default_label): Likewise. (gimple_switch_set_index): Require a gswitch *. (gimple_switch_set_label): Likewise. (gimple_switch_set_default_label): Likewise. (gimple_omp_critical_name): Require a const gomp_critical *. (gimple_omp_critical_name_ptr): Require a gomp_critical *. (gimple_omp_critical_set_name): Likewise. (gimple_omp_for_set_kind): Require a gomp_for *. (gimple_omp_for_set_combined_p): Likewise. (gimple_omp_for_set_combined_into_p): Likewise. (gimple_omp_for_clauses): Update for renaming of subclass to gomp_for. (gimple_omp_for_clauses_ptr): Likewise. (gimple_omp_for_set_clauses): Likewise. (gimple_omp_for_collapse): Likewise. (gimple_omp_for_index): Likewise. (gimple_omp_for_index_ptr): Likewise. (gimple_omp_for_set_index): Likewise. (gimple_omp_for_initial): Likewise. (gimple_omp_for_initial_ptr): Likewise. (gimple_omp_for_set_initial): Likewise. (gimple_omp_for_final): Likewise. (gimple_omp_for_final_ptr): Likewise. (gimple_omp_for_set_final): Likewise. (gimple_omp_for_incr): Likewise. (gimple_omp_for_incr_ptr): Likewise. (gimple_omp_for_set_incr): Likewise. (gimple_omp_for_pre_body): Likewise. (gimple_omp_for_set_pre_body): Likewise. (gimple_omp_parallel_clauses): Update for renaming of subclass to gomp_parallel. (gimple_omp_parallel_clauses_ptr): Require a gomp_parallel *. (gimple_omp_parallel_set_clauses): Likewise. (gimple_omp_parallel_child_fn_ptr): Likewise. (gimple_omp_parallel_set_child_fn): Likewise. (gimple_omp_parallel_data_arg_ptr): Likewise. (gimple_omp_parallel_set_data_arg): Likewise. (gimple_omp_parallel_child_fn): Require a const gomp_parallel *. (gimple_omp_parallel_data_arg): Likewise. (gimple_omp_task_clauses): Update for renaming of subclass to gomp_task. (gimple_omp_task_clauses_ptr): Likewise. (gimple_omp_task_set_clauses): Likewise. (gimple_omp_task_child_fn): Likewise. (gimple_omp_task_child_fn_ptr): Likewise. (gimple_omp_task_set_child_fn): Likewise. (gimple_omp_task_data_arg): Likewise. (gimple_omp_task_data_arg_ptr): Likewise. (gimple_omp_task_set_data_arg): Likewise. (gimple_omp_taskreg_clauses): Whitespace fixes. (gimple_omp_taskreg_clauses_ptr): Likewise. (gimple_omp_taskreg_set_clauses): Likewise. (gimple_omp_taskreg_child_fn): Likewise. (gimple_omp_taskreg_child_fn_ptr): Likewise. (gimple_omp_taskreg_set_child_fn): Likewise. (gimple_omp_taskreg_data_arg): Likewise. (gimple_omp_taskreg_data_arg_ptr): Likewise. (gimple_omp_taskreg_set_data_arg): Likewise. (gimple_omp_task_copy_fn): Update for renaming of subclass to gomp_task. (gimple_omp_task_copy_fn_ptr): Likewise. (gimple_omp_task_set_copy_fn): Likewise. (gimple_omp_task_arg_size): Likewise. (gimple_omp_task_arg_size_ptr): Likewise. (gimple_omp_task_set_arg_size): Likewise. (gimple_omp_task_arg_align): Likewise. (gimple_omp_task_arg_align_ptr): Likewise. (gimple_omp_task_set_arg_align): Likewise. (gimple_omp_single_clauses): Update for renaming of subclass to gomp_single. (gimple_omp_single_clauses_ptr): Likewise. (gimple_omp_single_set_clauses): Likewise. (gimple_omp_target_clauses): Update for renaming of subclass to gomp_target. (gimple_omp_target_clauses_ptr): Likewise. (gimple_omp_target_set_clauses): Require a gomp_target *. (gimple_omp_target_set_kind): Likewise. (gimple_omp_target_child_fn_ptr): Likewise. (gimple_omp_target_set_child_fn): Likewise. (gimple_omp_target_data_arg_ptr): Likewise. (gimple_omp_target_set_data_arg): Likewise. (gimple_omp_target_child_fn): Require a const gomp_target *. (gimple_omp_target_data_arg): Likewise. (gimple_omp_teams_clauses): Update for renaming of subclass to gomp_teams. (gimple_omp_teams_clauses_ptr): Likewise. (gimple_omp_teams_set_clauses): Require a gomp_teams *. (gimple_omp_sections_clauses): Update for renaming of subclass to gomp_sections. (gimple_omp_sections_clauses_ptr): Likewise. (gimple_omp_sections_set_clauses): Likewise. (gimple_omp_sections_control): Likewise. (gimple_omp_sections_control_ptr): Likewise. (gimple_omp_sections_set_control): Likewise. (gimple_omp_for_set_cond): Likewise. (gimple_omp_for_cond): Likewise. (gimple_omp_atomic_store_set_val): Require a gomp_atomic_store *. (gimple_omp_atomic_store_val_ptr): Likewise. (gimple_omp_atomic_load_set_lhs): Likewise. (gimple_omp_atomic_store_val): Require a const gomp_atomic_store *. (gimple_omp_atomic_load_lhs): Likewise. (gimple_omp_atomic_load_rhs): Likewise. (gimple_omp_atomic_load_lhs_ptr): Require a gomp_atomic_load *. (gimple_omp_atomic_load_set_rhs): Likewise. (gimple_omp_atomic_load_rhs_ptr): Likewise. (gimple_omp_continue_control_def): Require a const gomp_continue *. (gimple_omp_continue_control_use): Likewise. (gimple_omp_continue_control_def_ptr): Require a gomp_continue *. (gimple_omp_continue_set_control_def): Likewise. (gimple_omp_continue_control_use_ptr): Likewise. (gimple_omp_continue_set_control_use): Likewise. (gimple_transaction_body_ptr): Require a gtransaction *. (gimple_transaction_body): Likewise. (gimple_transaction_label_ptr): Likewise. (gimple_transaction_label): Require a const gtransaction *. (gimple_transaction_subcode): Likewise. (gimple_transaction_set_body): Require a gtransaction *. (gimple_transaction_set_label): Likewise. (gimple_transaction_set_subcode): Likewise. (gimple_return_retval_ptr): Require a const greturn *. (gimple_return_retval): Likewise. (gimple_return_set_retval): Require a greturn *. (gimple_expr_type): Introduce local "call_stmt" and use in place of "stmt" for typesafety. * asan.c: Use gimple subclasses. * auto-profile.c: Likewise. * builtins.c: Likewise. * builtins.h: Likewise. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * expr.h: Likewise. * gimple-builder.c: Likewise. * gimple-builder.h: Likewise. * gimple-fold.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimple-walk.c: Likewise. * gimplify-me.c: Likewise. * gimplify.c: Likewise. * gimplify.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * internal-fn.c: Likewise. * internal-fn.def:: Likewise. * internal-fn.h: Likewise. * ipa-icf-gimple.c: Likewise. * ipa-icf-gimple.h: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-split.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * omp-low.c: Likewise. * predict.c: Likewise. * sanopt.c: Likewise. * sese.c: Likewise. * ssa-iterators.h: Likewise. * stmt.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfg.h: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chkp.c: Likewise. * tree-chkp.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-eh.c: Likewise. * tree-eh.h: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-into-ssa.h: Likewise. * tree-loop-distribution.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-phinodes.h: Likewise. * tree-predcom.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h * tree-sra.cn_function): * tree-ssa-alias.c: Likewise. * tree-ssa-alias.h: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c * tree-ssa-structalias.c * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadedge.h: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-stdarg.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * ubsan.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * vtable-verify.c: Likewise. gcc/c-family/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * c-gimplify.c (add_block_to_enclosing): Strengthen local "stack" from being just a vec<gimple> to a vec<gbind *>. gcc/java/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * java-gimplify.c (java_gimplify_block): Strengthen local "outer" from gimple to gbind *. From-SVN: r217787
2014-11-19 18:00:54 +01:00
for (gimple_stmt_iterator gsi = gsi_last_bb (bb); !gsi_end_p (gsi);
gsi_prev (&gsi))
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
{
tree var;
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
gimple stmt = gsi_stmt (gsi);
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
/* A copy between 2 partitions does not introduce an interference
by itself. If they did, you would never be able to coalesce
two things which are copied. If the two variables really do
conflict, they will conflict elsewhere in the program.
This is handled by simply removing the SRC of the copy from the
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
live list, and processing the stmt normally. */
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
if (is_gimple_assign (stmt))
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
{
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
tree lhs = gimple_assign_lhs (stmt);
tree rhs1 = gimple_assign_rhs1 (stmt);
if (gimple_assign_copy_p (stmt)
&& TREE_CODE (lhs) == SSA_NAME
&& TREE_CODE (rhs1) == SSA_NAME)
live_track_clear_var (live, rhs1);
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
}
invoke.texi (-fvar-tracking-assignments): New. gcc/ChangeLog: * doc/invoke.texi (-fvar-tracking-assignments): New. (-fvar-tracking-assignments-toggle): New. (-fdump-final-insns=file): Mark filename as optional. (--param min-nondebug-insn-uid): New. (-gdwarf-@{version}): Mention version 4. * opts.c (common_handle_option): Accept it. * tree-vrp.c (find_assert_locations_1): Skip debug stmts. * regrename.c (regrename_optimize): Drop last. Don't count debug insns as uses. Don't reject change because of debug insn. (do_replace): Reject DEBUG_INSN as chain starter. Take base_regno from the chain starter, and check for inexact matches in DEBUG_INSNS. (scan_rtx_reg): Accept inexact matches in DEBUG_INSNs. (build_def_use): Simplify and fix the marking of DEBUG_INSNs. * sched-ebb.c (schedule_ebbs): Skip boundary debug insns. * fwprop.c (forward_propagate_and_simplify): ...into debug insns. * doc/gimple.texi (is_gimple_debug): New. (gimple_debug_bind_p): New. (is_gimple_call, gimple_assign_cast_p): End sentence with period. * doc/install.texi (bootstrap-debug): More details. (bootstrap-debug-big, bootstrap-debug-lean): Document. (bootstrap-debug-lib): More details. (bootstrap-debug-ckovw): Update. (bootstrap-time): New. * tree-into-ssa.c (mark_def_sites): Skip debug stmts. (insert_phi_nodes_for): Insert debug stmts. (rewrite_stmt): Take iterator. Insert debug stmts. (rewrite_enter_block): Adjust. (maybe_replace_use_in_debug_stmt): New. (rewrite_update_stmt): Use it. (mark_use_interesting): Return early for debug stmts. * tree-ssa-loop-im.c (rewrite_bittest): Propagate DEFs into debug stmts before replacing stmt. (move_computations_stmt): Likewise. * ira-conflicts.c (add_copies): Skip debug insns. * regstat.c (regstat_init_n_sets_and_refs): Discount debug insns. (regstat_bb_compute_ri): Skip debug insns. * tree-ssa-threadupdate.c (redirection_block_p): Skip debug stmts. * tree-ssa-loop-manip.c (find_uses_to_rename_stmt, check_loop_closed_ssa_stmt): Skip debug stmts. * tree-tailcall.c (find_tail_calls): Likewise. * tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Likewise. * tree.h (MAY_HAVE_DEBUG_STMTS): New. (build_var_debug_value_stat): Declare. (build_var_debug_value): Define. (target_for_debug_bind): Declare. * reload.c (find_equiv_reg): Skip debug insns. * rtlanal.c (reg_used_between_p): Skip debug insns. (side_effects_p): Likewise. (canonicalize_condition): Likewise. * ddg.c (create_ddg_dep_from_intra_loop_link): Check that non-debug insns never depend on debug insns. (create_ddg_dep_no_link): Likewise. (add_cross_iteration_register_deps): Use ANTI_DEP for debug insns. Don't add inter-loop dependencies for debug insns. (build_intra_loop_deps): Likewise. (create_ddg): Count debug insns. * ddg.h (struct ddg::num_debug): New. (num_backargs): Pair up with previous int field. * diagnostic.c (diagnostic_report_diagnostic): Skip notes on -fcompare-debug-second. * final.c (get_attr_length_1): Skip debug insns. (rest_of_clean-state): Don't dump CFA_RESTORE_STATE. * gcc.c (invoke_as): Call compare-debug-dump-opt. (driver_self_specs): Map -fdump-final-insns to -fdump-final-insns=.. (get_local_tick): New. (compare_debug_dump_opt_spec_function): Test for . argument and compute output name. Compute temp output spec without flag name. Compute -frandom-seed. (OPT): Undef after use. * cfgloopanal.c (num_loop_insns): Skip debug insns. (average_num_loop_insns): Likewise. * params.h (MIN_NONDEBUG_INSN_UID): New. * gimple.def (GIMPLE_DEBUG): New. * ipa-reference.c (scan_stmt_for_static_refs): Skip debug stmts. * auto-inc-dec.c (merge_in_block): Skip debug insns. (merge_in_block): Fix whitespace. * toplev.c (flag_var_tracking): Update comment. (flag_var_tracking_assignments): New. (flag_var_tracking_assignments_toggle): New. (process_options): Don't open final insns dump file if we're not going to write to it. Compute defaults for var_tracking. * df-scan.c (df_insn_rescan_debug_internal): New. (df_uses_record): Handle debug insns. * haifa-sched.c (ready): Initialize n_debug. (contributes_to_priority): Skip debug insns. (dep_list_size): New. (priority): Use it. (rank_for_schedule): Likewise. Schedule debug insns as soon as they're ready. Disregard previous debug insns to make decisions. (queue_insn): Never queue debug insns. (ready_add, ready_remove_first, ready_remove): Count debug insns. (schedule_insn): Don't reject debug insns because of issue rate. (get_ebb_head_tail, no_real_insns_p): Skip boundary debug insns. (queue_to_ready): Skip and discount debug insns. (choose_ready): Let debug insns through. (schedule_block): Check boundary debug insns. Discount debug insns, schedule them early. Adjust whitespace. (set_priorities): Check for boundary debug insns. (add_jump_dependencies): Use dep_list_size. (prev_non_location_insn): New. (check_cfg): Use it. * tree-ssa-loop-ivopts.c (find-interesting_users): Skip debug stmts. (remove_unused_ivs): Reset debug stmts. * modulo-sched.c (const_iteration_count): Skip debug insns. (res_MII): Discount debug insns. (loop_single_full_bb_p): Skip debug insns. (sms_schedule): Likewise. (sms_schedule_by_order): Likewise. (ps_has_conflicts): Likewise. * caller-save.c (refmarker_fn): New. (save_call_clobbered_regs): Replace regs with saved mem in debug insns. (mark_referenced_regs): Take pointer, mark and arg. Adjust. Call refmarker_fn mark for hardregnos. (mark_reg_as_referenced): New. (replace_reg_with_saved_mem): New. * ipa-pure-const.c (check_stmt): Skip debug stmts. * cse.c (cse_insn): Canonicalize debug insns. Skip them when searching back. (cse_extended_basic_block): Skip debug insns. (count_reg_usage): Likewise. (is_dead_reg): New, split out of... (set_live_p): ... here. (insn_live_p): Use it for debug insns. * tree-stdarg.c (check_all_va_list_escapes): Skip debug stmts. (execute_optimize_stdarg): Likewise. * tree-ssa-dom.c (propagate_rhs_into_lhs): Likewise. * tree-ssa-propagate.c (substitute_and_fold): Don't regard changes in debug stmts as changes. * sel-sched.c (moving_insn_creates_bookkeeping_block_p): New. (moveup_expr): Don't move across debug insns. Don't move debug insn if it would create a bookkeeping block. (moveup_expr_cached): Don't use cache for debug insns that are heads of blocks. (compute_av_set_inside_bb): Skip debug insns. (sel_rank_for_schedule): Schedule debug insns first. Remove dead code. (block_valid_for_bookkeeping_p); Support lax searches. (create_block_for_bookkeeping): Adjust block numbers when encountering debug-only blocks. (find_place_for_bookkeeping): Deal with debug-only blocks. (generate_bookkeeping_insn): Accept no place to insert. (remove_temp_moveop_nops): New argument full_tidying. (prepare_place_to_insert): Deal with debug insns. (advance_state_on_fence): Debug insns don't start cycles. (update_boundaries): Take fence as argument. Deal with debug insns. (schedule_expr_on_boundary): No full_tidying on debug insns. (fill_insns): Deal with debug insns. (track_scheduled_insns_and_blocks): Don't count debug insns. (need_nop_to_preserve_insn_bb): New, split out of... (remove_insn_from_stream): ... this. (fur_orig_expr_not_found): Skip debug insns. * rtl.def (VALUE): Move up. (DEBUG_INSN): New. * tree-ssa-sink.c (all_immediate_uses_same_place): Skip debug stmts. (nearest_common_dominator_of_uses): Take debug_stmts argument. Set it if debug stmts are found. (statement_sink_location): Skip debug stmts. Propagate moving defs into debug stmts. * ifcvt.c (first_active_insn): Skip debug insns. (last_active_insns): Likewise. (cond_exec_process_insns): Likewise. (noce_process_if_block): Likewise. (check_cond_move_block): Likewise. (cond_move_convert_if_block): Likewise. (block_jumps_and_fallthru_p): Likewise. (dead_or_predicable): Likewise. * dwarf2out.c (debug_str_hash_forced): New. (find_AT_string): Add comment. (gen_label_for_indirect_string): New. (get_debug_string_label): New. (AT_string_form): Use it. (mem_loc_descriptor): Handle non-TLS symbols. Handle MINUS , DIV, MOD, AND, IOR, XOR, NOT, ABS, NEG, and CONST_STRING. Accept but discard COMPARE, IF_THEN_ELSE, ROTATE, ROTATERT, TRUNCATE and several operations that cannot be represented with DWARF opcodes. (loc_descriptor): Ignore SIGN_EXTEND and ZERO_EXTEND. Require dwarf_version 4 for DW_OP_implicit_value and DW_OP_stack_value. (dwarf2out_var_location): Take during-call mark into account. (output_indirect_string): Update comment. Output if there are label and references. (prune_indirect_string): New. (prune_unused_types): Call it if debug_str_hash_forced. More in dwarf2out.c, from Jakub Jelinek <jakub@redhat.com>: (dw_long_long_const): Remove. (struct dw_val_struct): Change val_long_long type to rtx. (print_die, attr_checksum, same_dw_val_p, loc_descriptor): Adjust for val_long_long change to CONST_DOUBLE rtx from a long hi/lo pair. (output_die): Likewise. Use HOST_BITS_PER_WIDE_INT size of each component instead of HOST_BITS_PER_LONG. (output_loc_operands): Likewise. For const8* assert HOST_BITS_PER_WIDE_INT rather than HOST_BITS_PER_LONG is >= 64. (output_loc_operands_raw): For const8* assert HOST_BITS_PER_WIDE_INT rather than HOST_BITS_PER_LONG is >= 64. (add_AT_long_long): Remove val_hi and val_lo arguments, add val_const_double. (size_of_die): Use HOST_BITS_PER_WIDE_INT size multiplier instead of HOST_BITS_PER_LONG for dw_val_class_long_long. (add_const_value_attribute): Adjust add_AT_long_long caller. Don't handle TLS SYMBOL_REFs. If CONST wraps a constant, tail recurse. (dwarf_stack_op_name): Handle DW_OP_implicit_value and DW_OP_stack_value. (size_of_loc_descr, output_loc_operands, output_loc_operands_raw): Handle DW_OP_implicit_value. (extract_int): Move prototype earlier. (mem_loc_descriptor): For SUBREG punt if inner mode size is wider than DWARF2_ADDR_SIZE. Handle SIGN_EXTEND and ZERO_EXTEND by DW_OP_shl and DW_OP_shr{a,}. Handle EQ, NE, GT, GE, LT, LE, GTU, GEU, LTU, LEU, SMIN, SMAX, UMIN, UMAX, SIGN_EXTRACT, ZERO_EXTRACT. (loc_descriptor): Compare mode size with DWARF2_ADDR_SIZE instead of Pmode size. (loc_descriptor): Add MODE argument. Handle CONST_INT, CONST_DOUBLE, CONST_VECTOR, CONST, LABEL_REF and SYMBOL_REF if mode != VOIDmode, attempt to handle other expressions. Don't handle TLS SYMBOL_REFs. (concat_loc_descriptor, concatn_loc_descriptor, loc_descriptor_from_tree_1): Adjust loc_descriptor callers. (add_location_or_const_value_attribute): Likewise. For single location loc_lists attempt to use add_const_value_attribute for constant decls. Add DW_AT_const_value even if NOTE_VAR_LOCATION is VAR_LOCATION with CONSTANT_P or CONST_STRING in its expression. * cfgbuild.c (inside_basic_block_p): Handle debug insns. (control_flow_insn_p): Likewise. * tree-parloops.c (eliminate_local_variables_stmt): Handle debug stmt. (separate_decls_in_region_debug_bind): New. (separate_decls_in_region): Process debug bind stmts afterwards. * recog.c (verify_changes): Handle debug insns. (extract_insn): Likewise. (peephole2_optimize): Skip debug insns. * dse.c (scan_insn): Skip debug insns. * sel-sched-ir.c (return_nop_to_pool): Take full_tidying argument. Pass it on. (setup_id_for_insn): Handle debug insns. (maybe_tidy_empty_bb): Adjust whitespace. (tidy_control_flow): Skip debug insns. (sel_remove_insn): Adjust for debug insns. (sel_estimate_number_of_insns): Skip debug insns. (create_insn_rtx_from_pattern): Handle debug insns. (create_copy_of_insn_rtx): Likewise. * sel-sched-.h (sel_bb_end): Declare. (sel_bb_empty_or_nop_p): New. (get_all_loop_exits): Use it. (_eligible_successor_edge_p): Likewise. (return_nop_to_pool): Adjust. * tree-eh.c (tre_empty_eh_handler_p): Skip debug stmts. * ira-lives.c (process_bb_node_lives): Skip debug insns. * gimple-pretty-print.c (dump_gimple_debug): New. (dump_gimple_stmt): Use it. (dump_bb_header): Skip gimple debug stmts. * regmove.c (optimize_reg_copy_1): Discount debug insns. (fixup_match_2): Likewise. (regmove_backward_pass): Likewise. Simplify combined replacement. Handle debug insns. * function.c (instantiate_virtual_regs): Handle debug insns. * function.h (struct emit_status): Add x_cur_debug_insn_uid. * print-rtl.h: Include cselib.h. (print_rtx): Print VALUEs. Split out and recurse for VAR_LOCATIONs. * df.h (df_inns_rescan_debug_internal): Declare. * gcse.c (alloc_hash_table): Estimate n_insns. (cprop_insn): Don't regard debug insns as changes. (bypass_conditional_jumps): Skip debug insns. (one_pre_gcse_pass): Adjust. (one_code_hoisting_pass): Likewise. (compute_ld_motion_mems): Skip debug insns. (one_cprop_pass): Adjust. * tree-if-conv.c (tree_if_convert_stmt): Reset debug stmts. (if_convertible_stmt_p): Handle debug stmts. * init-regs.c (initialize_uninitialized_regs): Skip debug insns. * tree-vect-loop.c (vect_is_simple_reduction): Skip debug stmts. * ira-build.c (create_bb_allocnos): Skip debug insns. * tree-flow-inline.h (has_zero_uses): Discount debug stmts. (has_single_use): Likewise. (single_imm_use): Likewise. (num_imm_uses): Likewise. * tree-ssa-phiopt.c (empty_block_p): Skip debug stmts. * tree-ssa-coalesce.c (build_ssa_conflict_graph): Skip debug stmts. (create_outofssa_var_map): Likewise. * lower-subreg.c (adjust_decomposed_uses): New. (resolve_debug): New. (decompose_multiword_subregs): Use it. * tree-dfa.c (find_referenced_vars): Skip debug stmts. * emit-rtl.c: Include params.h. (cur_debug_insn_uid): Define. (set_new_first_and_last_insn): Set cur_debug_insn_uid too. (copy_rtx_if_shared_1): Handle debug insns. (reset_used_flags): Likewise. (set_used_flags): LIkewise. (get_max_insn_count): New. (next_nondebug_insn): New. (prev_nondebug_insn): New. (make_debug_insn_raw): New. (emit_insn_before_noloc): Handle debug insns. (emit_jump_insn_before_noloc): Likewise. (emit_call_insn_before_noloc): Likewise. (emit_debug_insn_before_noloc): New. (emit_insn_after_noloc): Handle debug insns. (emit_jump_insn_after_noloc): Likewise. (emit_call_insn_after_noloc): Likewise. (emit_debug_insn_after_noloc): Likewise. (emit_insn_after): Take loc from earlier non-debug insn. (emit_jump_insn_after): Likewise. (emit_call_insn_after): Likewise. (emit_debug_insn_after_setloc): New. (emit_debug_insn_after): New. (emit_insn_before): Take loc from later non-debug insn. (emit_jump_insn_before): Likewise. (emit_call_insn_before): Likewise. (emit_debug_insn_before_setloc): New. (emit_debug_insn_before): New. (emit_insn): Handle debug insns. (emit_debug_insn): New. (emit_jump_insn): Handle debug insns. (emit_call_insn): Likewise. (emit): Likewise. (init_emit): Take min-nondebug-insn-uid into account. Initialize cur_debug_insn_uid. (emit_copy_of_insn_after): Handle debug insns. * cfgexpand.c (gimple_assign_rhs_to_tree): Do not overwrite location of single rhs in place. (maybe_dump_rtl_for_gimple_stmt): Dump lineno. (floor_sdiv_adjust): New. (cell_sdiv_adjust): New. (cell_udiv_adjust): New. (round_sdiv_adjust): New. (round_udiv_adjust): New. (wrap_constant): Moved from cselib. (unwrap_constant): New. (expand_debug_expr): New. (expand_debug_locations): New. (expand_gimple_basic_block): Drop hiding redeclaration. Expand debug bind stmts. (gimple_expand_cfg): Expand debug locations. * cselib.c: Include tree-pass.h. (struct expand_value_data): New. (cselib_record_sets_hook): New. (PRESERVED_VALUE_P, LONG_TERM_PRESERVED_VALUE_P): New. (cselib_clear_table): Move, and implemnet in terms of... (cselib_reset_table_with_next_value): ... this. (cselib_get_next_unknown_value): New. (discard_useless_locs): Don't discard preserved values. (cselib_preserve_value): New. (cselib_preserved_value_p): New. (cselib_preserve_definitely): New. (cselib_clear_preserve): New. (cselib_preserve_only_values): New. (new_cselib_val): Take rtx argument. Dump it in details. (cselib_lookup_mem): Adjust. (expand_loc): Take regs_active in struct. Adjust. Silence dumps unless details are requested. (cselib_expand_value_rtx_cb): New. (cselib_expand_value_rtx): Rename and reimplment in terms of... (cselib_expand_value_rtx_1): ... this. Adjust. Silence dumps without details. Copy more subregs. Try to resolve values using a callback. Wrap constants. (cselib_subst_to_values): Adjust. (cselib_log_lookup): New. (cselib_lookup): Call it. (cselib_invalidate_regno): Don't count preserved values as useless. (cselib_invalidate_mem): Likewise. (cselib_record_set): Likewise. (struct set): Renamed to cselib_set, moved to cselib.h. (cselib_record_sets): Adjust. Call hook. (cselib_process_insn): Reset table when it would be cleared. (dump_cselib_val): New. (dump_cselib_table): New. * tree-cfgcleanup.c (tree_forwarded_block_p): Skip debug stmts. (remove_forwarder_block): Support moving debug stmts. * cselib.h (cselib_record_sets_hook): Declare. (cselib_expand_callback): New type. (cselib_expand_value_rtx_cb): Declare. (cselib_reset_table_with_next_value): Declare. (cselib_get_next_unknown_value): Declare. (cselib_preserve_value): Declare. (cselib_preserved_value_p): Declare. (cselib_preserve_only_values): Declare. (dump_cselib_table): Declare. * cfgcleanup.c (flow_find_cross_jump): Skip debug insns. (try_crossjump_to_edge): Likewise. (delete_unreachable_blocks): Remove dominant GIMPLE blocks after dominated blocks when debug stmts are present. * simplify-rtx.c (delegitimize_mem_from_attrs): New. * tree-ssa-live.c (remove_unused_locals): Skip debug stmts. (set_var_live_on_entry): Likewise. * loop-invariant.c (find_invariants_bb): Skip debug insns. * cfglayout.c (curr_location, last_location): Make static. (set_curr_insn_source_location): Don't avoid bouncing. (get_curr_insn_source_location): New. (get_curr_insn_block): New. (duplicate_insn_chain): Handle debug insns. * tree-ssa-forwprop.c (forward_propagate_addr_expr): Propagate into debug stmts. * common.opt (fcompare-debug): Move to sort order. (fdump-unnumbered-links): Likewise. (fvar-tracking-assignments): New. (fvar-tracking-assignments-toggle): New. * tree-ssa-dce.c (mark_stmt_necessary): Don't mark blocks because of debug stmts. (mark_stmt_if_obviously_necessary): Mark debug stmts. (eliminate_unnecessary_stmts): Walk dominated blocks before dominators. * tree-ssa-ter.c (find_replaceable_in_bb): Skip debug stmts. * ira.c (memref_used_between_p): Skip debug insns. (update_equiv_regs): Likewise. * sched-deps.c (sd_lists_size): Accept empty list. (sd_init_insn): Mark debug insns. (sd_finish_insn): Unmark them. (sd_add_dep): Reject non-debug deps on debug insns. (fixup_sched_groups): Give debug insns group treatment. Skip debug insns. (sched_analyze_reg): Don't mark debug insns for sched before call. (sched_analyze_2): Handle debug insns. (sched_analyze_insn): Compute next non-debug insn. Handle debug insns. (deps_analyze_insn): Handle debug insns. (deps_start_bb): Skip debug insns. (init_deps): Initialize last_debug_insn. * tree-ssa.c (target_for_debug_bind): New. (find_released_ssa_name): New. (propagate_var_def_into_debug_stmts): New. (propagate_defs_into_debug_stmts): New. (verify_ssa): Skip debug bind stmts without values. (warn_uninialized_vars): Skip debug stmts. * target-def.h (TARGET_DELEGITIMIZE_ADDRESS): Set default. * rtl.c (rtx_equal_p_cb): Handle VALUEs. (rtx_equal_p): Likewise. * ira-costs.c (scan_one_insn): Skip debug insns. (process_bb_node_for_hard_reg_moves): Likewise. * rtl.h (DEBUG_INSN_P): New. (NONDEBUG_INSN_P): New. (MAY_HAVE_DEBUG_INSNS): New. (INSN_P): Accept debug insns. (RTX_FRAME_RELATED_P): Likewise. (INSN_DELETED_P): Likewise (PAT_VAR_LOCATION_DECL): New. (PAT_VAR_LOCATION_LOC): New. (PAT_VAR_OCATION_STATUS): New. (NOTE_VAR_LOCATION_DECL): Reimplement. (NOTE_VAR_LOCATION_LOC): Likewise. (NOTE_VAR_LOCATION_STATUS): Likewise. (INSN_VAR_LOCATION): New. (INSN_VAR_LOCATION_DECL): New. (INSN_VAR_LOCATION_LOC): New. (INSN_VAR_LOCATION_STATUS): New. (gen_rtx_UNKNOWN_VAR_LOC): New. (VAR_LOC_UNKNOWN_P): New. (NOTE_DURING_CALL_P): New. (SCHED_GROUP_P): Accept debug insns. (emit_debug_insn_before): Declare. (emit_debug_insn_before_noloc): Declare. (emit_debug_insn_beore_setloc): Declare. (emit_debug_insn_after): Declare. (emit_debug_insn_after_noloc): Declare. (emit_debug_insn_after_setloc): Declare. (emit_debug_insn): Declare. (make_debug_insn_raw): Declare. (prev_nondebug_insn): Declare. (next_nondebug_insn): Declare. (delegitimize_mem_from_attrs): Declare. (get_max_insn_count): Declare. (wrap_constant): Declare. (unwrap_constant): Declare. (get_curr_insn_source_location): Declare. (get_curr_insn_block): Declare. * tree-inline.c (insert_debug_decl_map): New. (processing_debug_stmt): New. (remap_decl): Don't create new mappings in debug stmts. (remap_gimple_op_r): Don't add references in debug stmts. (copy_tree_body_r): Likewise. (remap_gimple_stmt): Handle debug bind stmts. (copy_bb): Skip debug stmts. (copy_edges_for_bb): Likewise. (copy_debug_stmt): New. (copy_debug_stmts): New. (copy_body): Copy debug stmts at the end. (insert_init_debug_bind): New. (insert_init_stmt): Take id. Skip and emit debug stmts. (setup_one_parameter): Remap variable earlier, register debug mapping. (estimate_num_insns): Skip debug stmts. (expand_call_inline): Preserve debug_map. (optimize_inline_calls): Check for no debug_stmts left-overs. (unsave_expr_now): Preserve debug_map. (copy_gimple_seq_and_replace_locals): Likewise. (tree_function_versioning): Check for no debug_stmts left-overs. Init and destroy debug_map as needed. Split edges unconditionally. (build_duplicate_type): Init and destroy debug_map as needed. * tree-inline.h: Include gimple.h instead of pointer-set.h. (struct copy_body_data): Add debug_stmts and debug_map. * sched-int.h (struct ready_list): Add n_debug. (struct deps): Add last_debug_insn. (DEBUG_INSN_SCHED_P): New. (BOUNDARY_DEBUG_INSN_P): New. (SCHEDULE_DEBUG_INSN_P): New. (sd_iterator_cond): Accept empty list. * combine.c (create_log_links): Skip debug insns. (combine_instructions): Likewise. (cleanup_auto_inc_dec): New. From Jakub Jelinek: Make sure the return value is always unshared. (struct rtx_subst_pair): New. (auto_adjust_pair): New. (propagate_for_debug_subst): New. (propagate_for_debug): New. (try_combine): Skip debug insns. Propagate removed defs into debug insns. (next_nonnote_nondebug_insn): New. (distribute_notes): Use it. Skip debug insns. (distribute_links): Skip debug insns. * tree-outof-ssa.c (set_location_for_edge): Likewise. * resource.c (mark_target_live_regs): Likewise. * var-tracking.c: Include cselib.h and target.h. (enum micro_operation_type): Add MO_VAL_USE, MO_VAL_LOC, and MO_VAL_SET. (micro_operation_type_name): New. (enum emit_note_where): Add EMIT_NOTE_AFTER_CALL_INSN. (struct micro_operation_def): Update comments. (decl_or_value): New type. Use instead of decls. (struct emit_note_data_def): Add vars. (struct attrs_def): Use decl_or_value. (struct variable_tracking_info_def): Add permp, flooded. (struct location_chain_def): Update comment. (struct variable_part_def): Use decl_or_value. (struct variable_def): Make var_part a variable length array. (valvar_pool): New. (scratch_regs): New. (cselib_hook_called): New. (dv_is_decl_p): New. (dv_is_value_p): New. (dv_as_decl): New. (dv_as_value): New. (dv_as_opaque): New. (dv_onepart_p): New. (dv_pool): New. (IS_DECL_CODE): New. (check_value_is_not_decl): New. (dv_from_decl): New. (dv_from_value): New. (dv_htab_hash): New. (variable_htab_hash): Use it. (variable_htab_eq): Support values. (variable_htab_free): Free from the right pool. (attrs_list_member, attrs_list_insert): Use decl_or_value. (attrs_list_union): Adjust. (attrs_list_mpdv_union): New. (tie_break_pointers): New. (canon_value_cmp): New. (unshare_variable): Return possibly-modified slot. (vars_copy_1): Adjust. (var_reg_decl_set): Adjust. Split out of... (var_reg_set): ... this. (get_init_value): Adjust. (var_reg_delete_and_set): Adjust. (var_reg_delete): Adjust. (var_regno_delete): Adjust. (var_mem_decl_set): Split out of... (var_mem_set): ... this. (var_mem_delete_and_set): Adjust. (var_mem_delete): Adjust. (val_store): New. (val_reset): New. (val_resolve): New. (variable_union): Adjust. Speed up merge of 1-part vars. (variable_canonicalize): Use unshared slot. (VALUED_RECURSED_INTO): New. (find_loc_in_1pdv): New. (struct dfset_merge): New. (insert_into_intersection): New. (intersect_loc_chains): New. (loc_cmp): New. (canonicalize_loc_order_check): New. (canonicalize_values_mark): New. (canonicalize_values_star): New. (variable_merge_over_cur): New. (variable_merge_over_src): New. (dataflow_set_merge): New. (dataflow_set_equiv_regs): New. (remove_duplicate_values): New. (struct dfset_post_merge): New. (variable_post_merge_new_vals): New. (variable_post_merge_perm_vals): New. (dataflow_post_merge_adjust): New. (find_mem_expr_in_1pdv): New. (dataflow_set_preserve_mem_locs): New. (dataflow_set_remove_mem_locs): New. (dataflow_set_clear_at_call): New. (onepart_variable_different_p): New. (variable_different_p): Use it. (dataflow_set_different_1): Adjust. Make detailed dump more verbose. (track_expr_p): Add need_rtl parameter. Don't generate rtl if not needed. (track_loc_p): Pass it true. (struct count_use_info): New. (find_use_val): New. (replace_expr_with_values): New. (log_op_type): New. (use_type): New, partially split out of... (count_uses): ... this. Count new micro-ops. (count_uses_1): Adjust. (count_stores): Adjust. (count_with_sets): New. (VAL_NEEDS_RESOLUTION): New. (VAL_HOLDS_TRACK_EXPR): New. (VAL_EXPR_IS_COPIED): New. (VAL_EXPR_IS_CLOBBERED): New. (add_uses): Adjust. Generate new micro-ops. (add_uses_1): Adjust. (add_stores): Generate new micro-ops. (add_with_sets): New. (find_src_status): Adjust. (find_src_set_src): Adjust. (compute_bb_dataflow): Use dataflow_set_clear_at_call. Handle new micro-ops. Canonicalize value equivalances. (vt_find_locations): Compute total size of hash tables for dumping. Perform merge for var-tracking-assignments. Don't disregard single-block loops. (dump_attrs_list): Handle decl_or_value. (dump_variable): Take variable. Deal with decl_or_value. (dump_variable_slot): New. (dump_vars): Use it. (dump_dataflow_sets): Adjust. (set_slot_part): New, extended to support one-part variables after splitting out of... (set_variable_part): ... this. (clobber_slot_part): New, split out of... (clobber_variable_part): ... this. (delete_slot_part): New, split out of... (delete_variable_part): .... this. (check_wrap_constant): New. (vt_expand_loc_callback): New. (vt_expand_loc): New. (emit_note_insn_var_location): Adjust. Handle values. Handle EMIT_NOTE_AFTER_CALL_INSN. (emit_notes_for_differences_1): Adjust. Handle values. (emit_notes_for_differences_2): Likewise. (emit_notes_for_differences): Adjust. (emit_notes_in_bb): Take pointer to set. Emit AFTER_CALL_INSN notes. Adjust. Handle new micro-ops. (vt_add_function_parameters): Adjust. Create and bind values. (vt_initialize): Adjust. Initialize scratch_regs and valvar_pool, flooded and perm.. Initialize and use cselib. Log operations. Move some code to count_with_sets and add_with_sets. (delete_debug_insns): New. (vt_debug_insns_local): New. (vt_finalize): Release permp, valvar_pool, scratch_regs. Finish cselib. (var_tracking_main): If var-tracking-assignments is enabled but var-tracking isn't, delete debug insns and leave. Likewise if we exceed limits or fail the stack adjustments tests, and after all var-tracking processing. More in var-tracking, from Jakub Jelinek <jakub@redhat.com>: (dataflow_set): Add traversed_vars. (value_chain, const_value_chain): New typedefs. (value_chain_pool, value_chains): New variables. (value_chain_htab_hash, value_chain_htab_eq, add_value_chain, add_value_chains, add_cselib_value_chains, remove_value_chain, remove_value_chains, remove_cselib_value_chains): New functions. (shared_hash_find_slot_unshare_1, shared_hash_find_slot_1, shared_hash_find_slot_noinsert_1, shared_hash_find_1): New static inlines. (shared_hash_find_slot_unshare, shared_hash_find_slot, shared_hash_find_slot_noinsert, shared_hash_find): Update. (dst_can_be_shared): New variable. (unshare_variable): Unshare set->vars if shared, use shared_hash_*. Clear dst_can_be_shared. If set->traversed_vars is non-NULL and different from set->vars, look up slot again instead of using the passed in slot. (dataflow_set_init): Initialize traversed_vars. (variable_union): Use shared_hash_*. Use initially NO_INSERT lookup if set->vars is shared. Don't keep slot cleared before calling unshare_variable. Unshare set->vars if needed. Adjust unshare_variable callers. Clear dst_can_be_shared if needed. Even ->refcount == 1 vars must be unshared if set->vars is shared and var needs to be modified. (dataflow_set_union): Set traversed_vars during canonicalization. (VALUE_CHANGED, DECL_CHANGED): Define. (set_dv_changed, dv_changed_p): New static inlines. (track_expr_p): Clear DECL_CHANGED. (dump_dataflow_sets): Set it. (variable_was_changed): Call set_dv_changed. (emit_note_insn_var_location): Likewise. (changed_variables_stack): New variable. (check_changed_vars_1, check_changed_vars_2): New functions. (emit_notes_for_changes): Do nothing if changed_variables is empty. Traverse changed_variables with check_changed_vars_1, call check_changed_vars_2 on each changed_variables_stack entry. (emit_notes_in_bb): Add SET argument. Just clear it at the beginning, use it instead of local &set, don't destroy it at the end. (vt_emit_notes): Call dataflow_set_clear early on all VTI(bb)->out sets, never use them, instead use emit_notes_in_bb computed set, dataflow_set_clear also VTI(bb)->in when we are done with the basic block. Initialize changed_variables_stack, free it afterwards. If ENABLE_CHECKING verify that after noting differences to an empty set value_chains hash table is empty. (vt_initialize): Initialize value_chains and value_chain_pool. (vt_finalize): Delete value_chains htab, free value_chain_pool. (variable_tracking_main): Call dump_dataflow_sets before calling vt_emit_notes, not after it. * tree-flow.h (propagate_defs_into_debug_stmts): Declare. (propagate_var_def_into_debug_stmts): Declare. * df-problems.c (df_lr_bb_local_compute): Skip debug insns. (df_set_note): Reject debug insns. (df_whole_mw_reg_dead_p): Take added_notes_p argument. Don't add notes to debug insns. (df_note_bb_compute): Adjust. Likewise. (df_simulate_uses): Skip debug insns. (df_simulate_initialize_backwards): Likewise. * reg-stack.c (subst_stack_regs_in_debug_insn): New. (subst_stack_regs_pat): Reject debug insns. (convert_regs_1): Handle debug insns. * Makefile.in (TREE_INLINE_H): Take pointer-set.h from GIMPLE_H. (print-rtl.o): Depend on cselib.h. (cselib.o): Depend on TREE_PASS_H. (var-tracking.o): Depend on cselib.h and TARGET_H. * sched-rgn.c (rgn_estimate_number_of_insns): Discount debug insns. (init_ready_list): Skip boundary debug insns. (add_branch_dependences): Skip debug insns. (free_block_dependencies): Check for blocks with only debug insns. (compute_priorities): Likewise. * gimple.c (gss_for_code): Handle GIMPLE_DEBUG. (gimple_build_with_ops_stat): Take subcode as unsigned. Adjust all callers. (gimple_build_debug_bind_stat): New. (empty_body_p): Skip debug stmts. (gimple_has_side_effects): Likewise. (gimple_rhs_has_side_effects): Likewise. * gimple.h (enum gimple_debug_subcode, GIMPLE_DEBUG_BIND): New. (gimple_build_debug_bind_stat): Declare. (gimple_build_debug_bind): Define. (is_gimple_debug): New. (gimple_debug_bind_p): New. (gimple_debug_bind_get_var): New. (gimple_debug_bind_get_value): New. (gimple_debug_bind_get_value_ptr): New. (gimple_debug_bind_set_var): New. (gimple_debug_bind_set_value): New. (GIMPLE_DEBUG_BIND_NOVALUE): New internal temporary macro. (gimple_debug_bind_reset_value): New. (gimple_debug_bind_has_value_p): New. (gsi_next_nondebug): New. (gsi_prev_nondebug): New. (gsi_start_nondebug_bb): New. (gsi_last_nondebug_bb): New. * sched-vis.c (print_pattern): Handle VAR_LOCATION. (print_insn): Handle DEBUG_INSN. * tree-cfg.c (remove_bb): Walk stmts backwards. Let loc of first insn prevail. (first_stmt): Skip debug stmts. (first_non_label_stmt): Likewise. (last_stmt): Likewise. (has_zero_uses_1): New. (single_imm_use_1): New. (verify_gimple_debug): New. (verify_types_in_gimple_stmt): Handle debug stmts. (verify_stmt): Likewise. (debug_loop_num): Skip debug stmts. (remove_edge_and_dominated_blocks): Remove dominators last. * tree-ssa-reasssoc.c (rewrite_expr_tree): Propagate into debug stmts. (linearize_expr): Likewise. * config/i386/i386.c (ix86_delegitimize_address): Call default implementation. * config/ia64/ia64.c (ia64_safe_itanium_class): Handle debug insns. (group_barrier_needed): Skip debug insns. (emit_insn_group_barriers): Likewise. (emit_all_insn_group_barriers): Likewise. (ia64_variable_issue): Handle debug insns. (ia64_dfa_new_cycle): Likewise. (final_emit_insn_group_barriers): Skip debug insns. (ia64_dwarf2out_def_steady_cfa): Take frame argument. Don't def cfa without frame. (process_set): Likewise. (process_for_unwind_directive): Pass frame on. * config/rs6000/rs6000.c (TARGET_DELEGITIMIZE_ADDRESS): Define. (rs6000_delegitimize_address): New. (rs6000_debug_adjust_cost): Handle debug insns. (is_microcoded_insn): Likewise. (is_cracked_insn): Likewise. (is_nonpipeline_insn): Likewise. (insn_must_be_first_in_group): Likewise. (insn_must_be_last_in_group): Likewise. (force_new_group): Likewise. * cfgrtl.c (rtl_split_block): Emit INSN_DELETED note if block contains only debug insns. (rtl_merge_blocks): Skip debug insns. (purge_dead_edges): Likewise. (rtl_block_ends_with_call_p): Skip debug insns. * dce.c (deletable_insn_p): Handle VAR_LOCATION. (mark_reg_dependencies): Skip debug insns. * params.def (PARAM_MIN_NONDEBUG_INSN_UID): New. * tree-ssanames.c (release_ssa_name): Propagate def into debug stmts. * tree-ssa-threadedge.c (record_temporary_equivalences_from_stmts): Skip debug stmts. * regcprop.c (replace_oldest_value_addr): Skip debug insns. (replace_oldest_value_mem): Use ALL_REGS for debug insns. (copyprop_hardreg_forward_1): Handle debug insns. * reload1.c (reload): Skip debug insns. Replace unassigned pseudos in debug insns with their equivalences. (eliminate_regs_in_insn): Skip debug insns. (emit_input_reload_insns): Skip debug insns at first, adjust them later. * tree-ssa-operands.c (add_virtual_operand): Reject debug stmts. (get_indirect_ref_operands): Pass opf_no_vops on. (get_expr_operands): Likewise. Skip debug stmts. (parse_ssa_operands): Scan debug insns with opf_no_vops. gcc/testsuite/ChangeLog: * gcc.dg/guality/guality.c: New. * gcc.dg/guality/guality.h: New. * gcc.dg/guality/guality.exp: New. * gcc.dg/guality/example.c: New. * lib/gcc-dg.exp (cleanup-dump): Remove .gk files. (cleanup-saved-temps): Likewise, .gkd files too. gcc/cp/ChangeLog: * cp-tree.h (TFF_NO_OMIT_DEFAULT_TEMPLATE_ARGUMENTS): New. * cp-lang.c (cxx_dwarf_name): Pass it. * error.c (count_non_default_template_args): Take flags as argument. Adjust all callers. Skip counting of default arguments if the new flag is given. ChangeLog: * Makefile.tpl (BUILD_CONFIG): Default to bootstrap-debug. * Makefile.in: Rebuilt. contrib/ChangeLog: * compare-debug: Look for .gkd files and compare them. config/ChangeLog: * bootstrap-debug.mk: Add comments. * bootstrap-debug-big.mk: New. * bootstrap-debug-lean.mk: New. * bootstrap-debug-ckovw.mk: Add comments. * bootstrap-debug-lib.mk: Drop CFLAGS for stages. Use -g0 for TFLAGS in stage1. Drop -fvar-tracking-assignments-toggle. From-SVN: r151312
2009-09-02 04:42:21 +02:00
else if (is_gimple_debug (stmt))
continue;
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
FOR_EACH_SSA_TREE_OPERAND (var, stmt, iter, SSA_OP_DEF)
live_track_process_def (live, var, graph);
FOR_EACH_SSA_TREE_OPERAND (var, stmt, iter, SSA_OP_USE)
live_track_process_use (live, var);
}
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
/* If result of a PHI is unused, looping over the statements will not
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
record any conflicts since the def was never live. Since the PHI node
is going to be translated out of SSA form, it will insert a copy.
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
There must be a conflict recorded between the result of the PHI and
any variables that are live. Otherwise the out-of-ssa translation
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
may create incorrect code. */
Merger of git branch "gimple-classes-v2-option-3" gcc/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * coretypes.h (struct gcond): Add forward decl. (struct gdebug): Likewise. (struct ggoto): Likewise. (struct glabel): Likewise. (struct gswitch): Likewise. (struct gassign): Likewise. (struct gasm): Likewise. (struct gcall): Likewise. (struct gtransaction): Likewise. (struct greturn): Likewise. (struct gbind): Likewise. (struct gcatch): Likewise. (struct geh_filter): Likewise. (struct geh_mnt): Likewise. (struct geh_else): Likewise. (struct gresx): Likewise. (struct geh_dispatch): Likewise. (struct gphi): Likewise. (struct gtry): Likewise. (struct gomp_atomic_load): Likewise. (struct gomp_atomic_store): Likewise. (struct gomp_continue): Likewise. (struct gomp_critical): Likewise. (struct gomp_for): Likewise. (struct gomp_parallel): Likewise. (struct gomp_task): Likewise. (struct gomp_sections): Likewise. (struct gomp_single): Likewise. (struct gomp_target): Likewise. (struct gomp_teams): Likewise. * doc/gimple.texi (Class hierarchy of GIMPLE statements): Update for renaming of gimple subclasses. * gdbhooks.py: Update. * gimple-iterator.c (gsi_for_phi): New. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. * gimple-iterator.h (struct gphi_iterator): New subclass of gimple_stmt_iterator. (gsi_for_phi): New prototype. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. (gsi_next_nonvirtual_phi): Strengthen param from gimple_stmt_iterator * to gphi_iterator *, and local "phi" from gimple to gphi *. * gsstruct.def: Update for renamings of classes. * gimple.c (gimple_build_return): Strengthen return type from gimple to greturn *. (gimple_call_reset_alias_info): Strengthen param to gcall *. (gimple_build_call_1): Strengthen return type from gimple to gcall *. (gimple_build_call_vec): Likewise. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal_1): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Strengthen return type from gimple to gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Strengthen return type from gimple to gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Strengthen return type from gimple to glabel *. (gimple_build_goto): Strengthen return type from gimple to ggoto *. (gimple_build_bind): Strengthen return type from gimple to gbind *. (gimple_build_asm_1): Strengthen return type from gimple to gasm *. (gimple_build_asm_vec): Likewise. (gimple_build_catch): Strengthen return type from gimple to gcatch *. (gimple_build_eh_filter): Strengthen return type from gimple to geh_filter *. (gimple_build_eh_must_not_throw): Strengthen return type from gimple to geh_mnt *. (gimple_build_eh_else): Strengthen return type from gimple to geh_else *. (gimple_build_try): Update for renaming of gimple_statement_try to gtry. (gimple_build_resx): Strengthen return type from gimple to gresx *. (gimple_build_switch_nlabels): Strengthen return type from gimple to gswitch *. (gimple_build_switch): Likewise. (gimple_build_eh_dispatch): Strengthen return type from gimple to geh_dispatch *. (gimple_build_debug_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_debug_source_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_omp_critical): Strengthen return type from gimple to gomp_critical *. (gimple_build_omp_for): Strengthen return type from gimple to gomp_for *. (gimple_build_omp_parallel): Strengthen return type from gimple to gomp_parallel *. (gimple_build_omp_task): Strengthen return type from gimple to gomp_task *. (gimple_build_omp_continue): Strengthen return type from gimple to gomp_continue *. (gimple_build_omp_sections): Strengthen return type from gimple to gomp_sections *. (gimple_build_omp_single): Strengthen return type from gimple to gomp_single *. (gimple_build_omp_target): Strengthen return type from gimple to gomp_target *. (gimple_build_omp_teams): Strengthen return type from gimple to gomp_teams *. (gimple_build_omp_atomic_load): Strengthen return type from gimple to gomp_atomic_load *. (gimple_build_omp_atomic_store): Strengthen return type from gimple to gomp_atomic_store *. (gimple_build_transaction): Strengthen return type from gimple to gtransaction *. (empty_stmt_p): Replace check for GIMPLE_BIND with a dyn_cast. (gimple_call_fnspec): Require a const gcall *. (gimple_call_arg_flags): Likewise. (gimple_call_return_flags): Likewise. (gimple_set_bb): Add a checked cast. (gimple_copy): Within the cases, add locals of the appropriate subclass and use in place of "stmt" and "copy" for typesafety. (gimple_has_side_effects): Add a checked cast. (gimple_could_trap_p_1): Likewise. (gimple_call_copy_skip_args): Require a gcall *, and return one. (gimple_asm_clobbers_memory_p): Require a const gasm *. (infer_nonnull_range): Replace a check for GIMPLE_RETURN with a dyn_cast, introducing local "return_stmt" and using ti in place of "stmt". * gimple.h (gimple_vec): Eliminate this typedef. (struct gimple_statement_call): Rename to... (struct gcall): ...this. (struct gimple_statement_bind): Rename to... (struct gbind): ...this. (struct gimple_statement_catch): Rename to... (struct gcatch): ...this. (struct gimple_statement_eh_filter): Rename to... (struct geh_filter): ...this. (struct gimple_statement_eh_else): Rename to... (struct geh_else): ...this. (struct gimple_statement_eh_mnt): Rename to... (struct geh_mnt): ...this. (struct gimple_statement_phi): Rename to... (struct gphi): ...this. (struct gimple_statement_resx): Rename to... (struct gresx): ...this. (struct gimple_statement_eh_dispatch): Rename to... (struct geh_dispatch): ...this. (struct gimple_statement_try): Rename to... (struct gtry): ...this. (struct gimple_statement_asm): Rename to... (struct gasm): ...this. (struct gimple_statement_omp_critical): Rename to... (struct gomp_critical): ...this. (struct gimple_statement_omp_for): Rename to... (struct gomp_for): ...this. (struct gimple_statement_omp_parallel): Rename to... (struct gomp_parallel): ...this. (struct gimple_statement_omp_target): Rename to... (struct gomp_target): ...this. (struct gimple_statement_omp_task): Rename to... (struct gomp_task): ...this. (struct gimple_statement_omp_sections): Rename to... (struct gomp_sections): ...this. (struct gimple_statement_omp_continue): Rename to... (struct gomp_continue): ...this. (struct gimple_statement_omp_single): Rename to... (struct gomp_single): ...this. (struct gimple_statement_omp_teams): Rename to... (struct gomp_teams): ...this. (struct gimple_statement_omp_atomic_load): Rename to... (struct gomp_atomic_load): ...this. (struct gimple_statement_omp_atomic_store :): Rename to... (struct gomp_atomic_store :): ...this. (struct gimple_statement_transaction): Rename to... (struct gtransaction): ...this. (struct gcond): New subclass. (struct gdebug): New subclass. (struct ggoto): New subclass. (struct glabel): New subclass. (struct gswitch): New subclass. (struct gassign): New subclass. (struct greturn): New subclass. (is_a_helper <gimple_statement_asm *>::test): Rename to... (is_a_helper <gasm *>::test): ...this. (is_a_helper <gimple_statement_bind *>::test): Rename to... (is_a_helper <gbind *>::test): ...this. (is_a_helper <gassign *>::test): New. (is_a_helper <gimple_statement_call *>::test): Rename to... (is_a_helper <gcall *>::test): ...this. (is_a_helper <gimple_statement_catch *>::test): Rename to... (is_a_helper <gcatch *>::test): ...this. (is_a_helper <gimple_statement_resx *>::test): Rename to... (is_a_helper <gresx *>::test): ...this. (is_a_helper <gcond *>::test): New. (is_a_helper <gdebug *>::test): New. (is_a_helper <ggoto *>::test): New. (is_a_helper <glabel *>::test): New. (is_a_helper <gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <geh_dispatch *>::test): ...this. (is_a_helper <gimple_statement_eh_else *>::test): Rename to... (is_a_helper <geh_else *>::test): ...this. (is_a_helper <gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <geh_filter *>::test): ...this. (is_a_helper <gimple_statement_eh_mnt *>::test): Rename to... (is_a_helper <geh_mnt *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <gomp_atomic_load *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <gomp_atomic_store *>::test): ...this. (is_a_helper <gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <gomp_continue *>::test): ...this. (is_a_helper <gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <gomp_critical *>::test): ...this. (is_a_helper <gimple_statement_omp_for *>::test): Rename to... (is_a_helper <gomp_for *>::test): ...this. (is_a_helper <gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <gomp_parallel *>::test): ...this. (is_a_helper <gimple_statement_omp_target *>::test): Rename to... (is_a_helper <gomp_target *>::test): ...this. (is_a_helper <gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <gomp_sections *>::test): ...this. (is_a_helper <gimple_statement_omp_single *>::test): Rename to... (is_a_helper <gomp_single *>::test): ...this. (is_a_helper <gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <gomp_teams *>::test): ...this. (is_a_helper <gimple_statement_omp_task *>::test): Rename to... (is_a_helper <gomp_task *>::test): ...this. (is_a_helper <gimple_statement_phi *>::test): Rename to... (is_a_helper <gphi *>::test): ...this. (is_a_helper <gimple_statement_transaction *>::test): Rename to... (is_a_helper <gtransaction *>::test): ...this. (is_a_helper <greturn *>::test): New. (is_a_helper <gswitch *>::test): New. (is_a_helper <gimple_statement_try *>::test): Rename to... (is_a_helper <gtry *>::test): ...this. (is_a_helper <const gimple_statement_asm *>::test): Rename to... (is_a_helper <const gasm *>::test): ...this. (is_a_helper <const gimple_statement_bind *>::test): Rename to... (is_a_helper <const gbind *>::test): ...this. (is_a_helper <const gimple_statement_call *>::test): Rename to... (is_a_helper <const gcall *>::test): ...this. (is_a_helper <const gimple_statement_catch *>::test): Rename to... (is_a_helper <const gcatch *>::test): ...this. (is_a_helper <const gimple_statement_resx *>::test): Rename to... (is_a_helper <const gresx *>::test): ...this. (is_a_helper <const gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <const geh_dispatch *>::test): ...this. (is_a_helper <const gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <const geh_filter *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <const gomp_atomic_load *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <const gomp_atomic_store *>::test): ...this. (is_a_helper <const gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <const gomp_continue *>::test): ...this. (is_a_helper <const gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <const gomp_critical *>::test): ...this. (is_a_helper <const gimple_statement_omp_for *>::test): Rename to... (is_a_helper <const gomp_for *>::test): ...this. (is_a_helper <const gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <const gomp_parallel *>::test): ...this. (is_a_helper <const gimple_statement_omp_target *>::test): Rename to... (is_a_helper <const gomp_target *>::test): ...this. (is_a_helper <const gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <const gomp_sections *>::test): ...this. (is_a_helper <const gimple_statement_omp_single *>::test): Rename to... (is_a_helper <const gomp_single *>::test): ...this. (is_a_helper <const gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <const gomp_teams *>::test): ...this. (is_a_helper <const gimple_statement_omp_task *>::test): Rename to... (is_a_helper <const gomp_task *>::test): ...this. (is_a_helper <const gimple_statement_phi *>::test): Rename to... (is_a_helper <const gphi *>::test): ...this. (is_a_helper <const gimple_statement_transaction *>::test): Rename to... (is_a_helper <const gtransaction *>::test): ...this. (gimple_build_return): Strengthen return type to greturn *. (gimple_call_reset_alias_info): Require a gcall *. (gimple_build_call_vec): Return a gcall *. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Return a gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Return a gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Return a glabel *. (gimple_build_goto): Return a ggoto *. (gimple_build_bind): Return a gbind *. (gimple_build_asm_vec): Return a gasm *. (gimple_build_catch): Return a gcatch *. (gimple_build_eh_filter): Return a geh_filter *. (gimple_build_eh_must_not_throw): Return a geh_mnt *. (gimple_build_eh_else): Return a geh_else *. (gimple_build_try): Return a gtry *. (gimple_build_resx): Return a gresx *. (gimple_build_switch_nlabels): Return a gswitch *. (gimple_build_switch): Return a gswitch *. (gimple_build_eh_dispatch): Return a geh_dispatch *. (gimple_build_debug_bind_stat): Return a gdebug *. (gimple_build_debug_source_bind_stat): Return a gdebug *. (gimple_build_omp_critical): Return a gomp_critical *. (gimple_build_omp_for): Return a gomp_for *. (gimple_build_omp_parallel): Return a gomp_parallel *. (gimple_build_omp_task): Return a gomp_task *. (gimple_build_omp_continue): Return a gomp_continue *. (gimple_build_omp_sections): Return a gomp_sections *. (gimple_build_omp_single): Return a gomp_single *. (gimple_build_omp_target): Return a gomp_target *. (gimple_build_omp_teams): Return a gomp_teams *. (gimple_build_omp_atomic_load): Return a gomp_atomic_load *. (gimple_build_omp_atomic_store): Return a gomp_atomic_store *. (gimple_build_transaction): Return a gtransaction *. (gimple_call_arg_flags): Require a const gcall *. (gimple_call_return_flags): Likewise. (gimple_call_copy_skip_args): Require and return a gcall *. (gimple_asm_clobbers_memory_p): Require a const gasm *. (gimple_seq_first_stmt_as_a_bind): New. (gimple_assign_nontemporal_move_p): Require a const gassign * rather than a const_gimple. (gimple_call_internal_fn): Update for renaming to gcall. (gimple_call_fntype): Likewise. (gimple_call_set_fntype): Require a gcall * rather than a gimple. (gimple_call_set_fn): Likewise. (gimple_call_set_internal_fn): Likewise. (gimple_call_set_chain): Likewise. (gimple_call_set_tail): Likewise. (gimple_call_tail_p): Likewise. (gimple_call_set_return_slot_opt): Likewise. (gimple_call_return_slot_opt_p): Likewise. (gimple_call_set_from_thunk): Likewise. (gimple_call_from_thunk_p): Likewise. (gimple_call_set_va_arg_pack): Likewise. (gimple_call_va_arg_pack_p): Likewise. (gimple_call_set_nothrow): Likewise. (gimple_call_nothrow_p): Likewise. (gimple_call_set_alloca_for_var): Likewise. (gimple_call_alloca_for_var_p): Likewise. (gimple_call_use_set): Likewise. (gimple_call_clobber_set): Likewise. (gimple_call_return_type): Require a const gcall * rather than a const_gimple. (gimple_call_chain_ptr): Likewise. (gimple_call_copy_flags): Require a pair of gcall *. (gimple_cond_set_code): Require a gcond * rather than a gimple (gimple_cond_set_lhs): Likewise. (gimple_cond_set_rhs): Likewise. (gimple_cond_set_true_label): Likewise. (gimple_cond_set_false_label): Likewise. (gimple_cond_make_false): Likewise. (gimple_cond_make_true): Likewise. (gimple_cond_lhs_ptr): Require a const gcond * rather than a const_gimple. (gimple_cond_rhs_ptr): Likewise. (gimple_cond_true_label): Likewise. (gimple_cond_false_label): Likewise. (gimple_cond_true_p): Likewise. (gimple_cond_false_p): Likewise. (gimple_cond_set_condition): Likewise. (gimple_label_label): Require a const glabel *. (gimple_label_set_label): Require a glabel *. (gimple_goto_set_dest): Require a ggoto *. (gimple_bind_vars): Require a const gbind *. (gimple_bind_block): Likewise. (gimple_bind_set_vars): Require a gbind *. (gimple_bind_append_vars): Likewise. (gimple_bind_body_ptr): Likewise. (gimple_bind_body): Likewise. (gimple_bind_set_body): Likewise. (gimple_bind_add_stmt): Likewise. (gimple_bind_add_seq): Likewise. (gimple_bind_set_block): Likewise. (gimple_asm_ninputs): Require a const gasm *. (gimple_asm_noutputs): Likewise. (gimple_asm_nclobbers): Likewise. (gimple_asm_nlabels): Likewise. (gimple_asm_input_op): Likewise. (gimple_asm_input_op_ptr): Likewise. (gimple_asm_output_op): Likewise. (gimple_asm_output_op_ptr): Likewise. (gimple_asm_clobber_op): Likewise. (gimple_asm_label_op): Likewise. (gimple_asm_string): Likewise. (gimple_asm_volatile_p): Likewise. (gimple_asm_input_p): Likewise. (gimple_asm_set_input_op): Require a gasm *. (gimple_asm_set_output_op): Likewise. (gimple_asm_set_clobber_op): Likewise. (gimple_asm_set_label_op): Likewise. (gimple_asm_set_volatile): Likewise. (gimple_asm_set_input): Likewise. (gimple_catch_types): Require a const gcatch *. (gimple_catch_types_ptr): Require a gcatch *. (gimple_catch_handler_ptr): Likewise. (gimple_catch_handler): Likewise. (gimple_catch_set_types): Likewise. (gimple_catch_set_handler): Likewise. (gimple_eh_filter_types): Update for renaming of subclass to geh_filter. (gimple_eh_filter_types_ptr): Likewise. (gimple_eh_filter_failure_ptr): Likewise. (gimple_eh_filter_set_types): Require a geh_filter *. (gimple_eh_filter_set_failure): Likewise. (gimple_eh_must_not_throw_fndecl): Require a geh_mnt *. (gimple_eh_must_not_throw_set_fndecl): Likewise. (gimple_eh_else_n_body_ptr): Require a geh_else *. (gimple_eh_else_n_body): Likewise. (gimple_eh_else_e_body_ptr): Likewise. (gimple_eh_else_e_body): Likewise. (gimple_eh_else_set_n_body): Likewise. (gimple_eh_else_set_e_body): Likewise. (gimple_try_set_kind): Require a gtry *. (gimple_try_set_catch_is_cleanup): Likewise. (gimple_try_set_eval): Likewise. (gimple_try_set_cleanup): Likewise. (gimple_try_eval_ptr): Update for renaming of subclass to gtry. (gimple_try_cleanup_ptr): Likewise. (gimple_phi_capacity): Update for renaming of subclass to gphi. (gimple_phi_num_args): Likewise. (gimple_phi_result): Likewise. (gimple_phi_result_ptr): Likewise. (gimple_phi_arg): Likewise. (gimple_phi_set_result): Require a gphi *. (gimple_phi_set_arg): Likewise. (gimple_phi_arg_def_ptr): Likewise. (gimple_phi_arg_edge): Likewise. (gimple_phi_arg_location): Likewise. (gimple_phi_arg_location_from_edge): Likewise. (gimple_phi_arg_set_location): Likewise. (gimple_phi_arg_has_location): Likewise. (gimple_resx_region): Require a const gresx *. (gimple_resx_set_region): Require a gresx *. (gimple_eh_dispatch_region): Require a const geh_dispatch *. (gimple_eh_dispatch_set_region): Require a geh_dispatch *. (gimple_switch_num_labels): Require a const gswitch *. (gimple_switch_set_num_labels): Likewise. (gimple_switch_index): Likewise. (gimple_switch_index_ptr): Likewise. (gimple_switch_label): Likewise. (gimple_switch_default_label): Likewise. (gimple_switch_set_index): Require a gswitch *. (gimple_switch_set_label): Likewise. (gimple_switch_set_default_label): Likewise. (gimple_omp_critical_name): Require a const gomp_critical *. (gimple_omp_critical_name_ptr): Require a gomp_critical *. (gimple_omp_critical_set_name): Likewise. (gimple_omp_for_set_kind): Require a gomp_for *. (gimple_omp_for_set_combined_p): Likewise. (gimple_omp_for_set_combined_into_p): Likewise. (gimple_omp_for_clauses): Update for renaming of subclass to gomp_for. (gimple_omp_for_clauses_ptr): Likewise. (gimple_omp_for_set_clauses): Likewise. (gimple_omp_for_collapse): Likewise. (gimple_omp_for_index): Likewise. (gimple_omp_for_index_ptr): Likewise. (gimple_omp_for_set_index): Likewise. (gimple_omp_for_initial): Likewise. (gimple_omp_for_initial_ptr): Likewise. (gimple_omp_for_set_initial): Likewise. (gimple_omp_for_final): Likewise. (gimple_omp_for_final_ptr): Likewise. (gimple_omp_for_set_final): Likewise. (gimple_omp_for_incr): Likewise. (gimple_omp_for_incr_ptr): Likewise. (gimple_omp_for_set_incr): Likewise. (gimple_omp_for_pre_body): Likewise. (gimple_omp_for_set_pre_body): Likewise. (gimple_omp_parallel_clauses): Update for renaming of subclass to gomp_parallel. (gimple_omp_parallel_clauses_ptr): Require a gomp_parallel *. (gimple_omp_parallel_set_clauses): Likewise. (gimple_omp_parallel_child_fn_ptr): Likewise. (gimple_omp_parallel_set_child_fn): Likewise. (gimple_omp_parallel_data_arg_ptr): Likewise. (gimple_omp_parallel_set_data_arg): Likewise. (gimple_omp_parallel_child_fn): Require a const gomp_parallel *. (gimple_omp_parallel_data_arg): Likewise. (gimple_omp_task_clauses): Update for renaming of subclass to gomp_task. (gimple_omp_task_clauses_ptr): Likewise. (gimple_omp_task_set_clauses): Likewise. (gimple_omp_task_child_fn): Likewise. (gimple_omp_task_child_fn_ptr): Likewise. (gimple_omp_task_set_child_fn): Likewise. (gimple_omp_task_data_arg): Likewise. (gimple_omp_task_data_arg_ptr): Likewise. (gimple_omp_task_set_data_arg): Likewise. (gimple_omp_taskreg_clauses): Whitespace fixes. (gimple_omp_taskreg_clauses_ptr): Likewise. (gimple_omp_taskreg_set_clauses): Likewise. (gimple_omp_taskreg_child_fn): Likewise. (gimple_omp_taskreg_child_fn_ptr): Likewise. (gimple_omp_taskreg_set_child_fn): Likewise. (gimple_omp_taskreg_data_arg): Likewise. (gimple_omp_taskreg_data_arg_ptr): Likewise. (gimple_omp_taskreg_set_data_arg): Likewise. (gimple_omp_task_copy_fn): Update for renaming of subclass to gomp_task. (gimple_omp_task_copy_fn_ptr): Likewise. (gimple_omp_task_set_copy_fn): Likewise. (gimple_omp_task_arg_size): Likewise. (gimple_omp_task_arg_size_ptr): Likewise. (gimple_omp_task_set_arg_size): Likewise. (gimple_omp_task_arg_align): Likewise. (gimple_omp_task_arg_align_ptr): Likewise. (gimple_omp_task_set_arg_align): Likewise. (gimple_omp_single_clauses): Update for renaming of subclass to gomp_single. (gimple_omp_single_clauses_ptr): Likewise. (gimple_omp_single_set_clauses): Likewise. (gimple_omp_target_clauses): Update for renaming of subclass to gomp_target. (gimple_omp_target_clauses_ptr): Likewise. (gimple_omp_target_set_clauses): Require a gomp_target *. (gimple_omp_target_set_kind): Likewise. (gimple_omp_target_child_fn_ptr): Likewise. (gimple_omp_target_set_child_fn): Likewise. (gimple_omp_target_data_arg_ptr): Likewise. (gimple_omp_target_set_data_arg): Likewise. (gimple_omp_target_child_fn): Require a const gomp_target *. (gimple_omp_target_data_arg): Likewise. (gimple_omp_teams_clauses): Update for renaming of subclass to gomp_teams. (gimple_omp_teams_clauses_ptr): Likewise. (gimple_omp_teams_set_clauses): Require a gomp_teams *. (gimple_omp_sections_clauses): Update for renaming of subclass to gomp_sections. (gimple_omp_sections_clauses_ptr): Likewise. (gimple_omp_sections_set_clauses): Likewise. (gimple_omp_sections_control): Likewise. (gimple_omp_sections_control_ptr): Likewise. (gimple_omp_sections_set_control): Likewise. (gimple_omp_for_set_cond): Likewise. (gimple_omp_for_cond): Likewise. (gimple_omp_atomic_store_set_val): Require a gomp_atomic_store *. (gimple_omp_atomic_store_val_ptr): Likewise. (gimple_omp_atomic_load_set_lhs): Likewise. (gimple_omp_atomic_store_val): Require a const gomp_atomic_store *. (gimple_omp_atomic_load_lhs): Likewise. (gimple_omp_atomic_load_rhs): Likewise. (gimple_omp_atomic_load_lhs_ptr): Require a gomp_atomic_load *. (gimple_omp_atomic_load_set_rhs): Likewise. (gimple_omp_atomic_load_rhs_ptr): Likewise. (gimple_omp_continue_control_def): Require a const gomp_continue *. (gimple_omp_continue_control_use): Likewise. (gimple_omp_continue_control_def_ptr): Require a gomp_continue *. (gimple_omp_continue_set_control_def): Likewise. (gimple_omp_continue_control_use_ptr): Likewise. (gimple_omp_continue_set_control_use): Likewise. (gimple_transaction_body_ptr): Require a gtransaction *. (gimple_transaction_body): Likewise. (gimple_transaction_label_ptr): Likewise. (gimple_transaction_label): Require a const gtransaction *. (gimple_transaction_subcode): Likewise. (gimple_transaction_set_body): Require a gtransaction *. (gimple_transaction_set_label): Likewise. (gimple_transaction_set_subcode): Likewise. (gimple_return_retval_ptr): Require a const greturn *. (gimple_return_retval): Likewise. (gimple_return_set_retval): Require a greturn *. (gimple_expr_type): Introduce local "call_stmt" and use in place of "stmt" for typesafety. * asan.c: Use gimple subclasses. * auto-profile.c: Likewise. * builtins.c: Likewise. * builtins.h: Likewise. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * expr.h: Likewise. * gimple-builder.c: Likewise. * gimple-builder.h: Likewise. * gimple-fold.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimple-walk.c: Likewise. * gimplify-me.c: Likewise. * gimplify.c: Likewise. * gimplify.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * internal-fn.c: Likewise. * internal-fn.def:: Likewise. * internal-fn.h: Likewise. * ipa-icf-gimple.c: Likewise. * ipa-icf-gimple.h: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-split.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * omp-low.c: Likewise. * predict.c: Likewise. * sanopt.c: Likewise. * sese.c: Likewise. * ssa-iterators.h: Likewise. * stmt.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfg.h: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chkp.c: Likewise. * tree-chkp.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-eh.c: Likewise. * tree-eh.h: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-into-ssa.h: Likewise. * tree-loop-distribution.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-phinodes.h: Likewise. * tree-predcom.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h * tree-sra.cn_function): * tree-ssa-alias.c: Likewise. * tree-ssa-alias.h: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c * tree-ssa-structalias.c * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadedge.h: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-stdarg.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * ubsan.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * vtable-verify.c: Likewise. gcc/c-family/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * c-gimplify.c (add_block_to_enclosing): Strengthen local "stack" from being just a vec<gimple> to a vec<gbind *>. gcc/java/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * java-gimplify.c (java_gimplify_block): Strengthen local "outer" from gimple to gbind *. From-SVN: r217787
2014-11-19 18:00:54 +01:00
for (gphi_iterator gsi = gsi_start_phis (bb); !gsi_end_p (gsi);
gsi_next (&gsi))
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
{
Merger of git branch "gimple-classes-v2-option-3" gcc/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * coretypes.h (struct gcond): Add forward decl. (struct gdebug): Likewise. (struct ggoto): Likewise. (struct glabel): Likewise. (struct gswitch): Likewise. (struct gassign): Likewise. (struct gasm): Likewise. (struct gcall): Likewise. (struct gtransaction): Likewise. (struct greturn): Likewise. (struct gbind): Likewise. (struct gcatch): Likewise. (struct geh_filter): Likewise. (struct geh_mnt): Likewise. (struct geh_else): Likewise. (struct gresx): Likewise. (struct geh_dispatch): Likewise. (struct gphi): Likewise. (struct gtry): Likewise. (struct gomp_atomic_load): Likewise. (struct gomp_atomic_store): Likewise. (struct gomp_continue): Likewise. (struct gomp_critical): Likewise. (struct gomp_for): Likewise. (struct gomp_parallel): Likewise. (struct gomp_task): Likewise. (struct gomp_sections): Likewise. (struct gomp_single): Likewise. (struct gomp_target): Likewise. (struct gomp_teams): Likewise. * doc/gimple.texi (Class hierarchy of GIMPLE statements): Update for renaming of gimple subclasses. * gdbhooks.py: Update. * gimple-iterator.c (gsi_for_phi): New. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. * gimple-iterator.h (struct gphi_iterator): New subclass of gimple_stmt_iterator. (gsi_for_phi): New prototype. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. (gsi_next_nonvirtual_phi): Strengthen param from gimple_stmt_iterator * to gphi_iterator *, and local "phi" from gimple to gphi *. * gsstruct.def: Update for renamings of classes. * gimple.c (gimple_build_return): Strengthen return type from gimple to greturn *. (gimple_call_reset_alias_info): Strengthen param to gcall *. (gimple_build_call_1): Strengthen return type from gimple to gcall *. (gimple_build_call_vec): Likewise. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal_1): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Strengthen return type from gimple to gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Strengthen return type from gimple to gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Strengthen return type from gimple to glabel *. (gimple_build_goto): Strengthen return type from gimple to ggoto *. (gimple_build_bind): Strengthen return type from gimple to gbind *. (gimple_build_asm_1): Strengthen return type from gimple to gasm *. (gimple_build_asm_vec): Likewise. (gimple_build_catch): Strengthen return type from gimple to gcatch *. (gimple_build_eh_filter): Strengthen return type from gimple to geh_filter *. (gimple_build_eh_must_not_throw): Strengthen return type from gimple to geh_mnt *. (gimple_build_eh_else): Strengthen return type from gimple to geh_else *. (gimple_build_try): Update for renaming of gimple_statement_try to gtry. (gimple_build_resx): Strengthen return type from gimple to gresx *. (gimple_build_switch_nlabels): Strengthen return type from gimple to gswitch *. (gimple_build_switch): Likewise. (gimple_build_eh_dispatch): Strengthen return type from gimple to geh_dispatch *. (gimple_build_debug_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_debug_source_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_omp_critical): Strengthen return type from gimple to gomp_critical *. (gimple_build_omp_for): Strengthen return type from gimple to gomp_for *. (gimple_build_omp_parallel): Strengthen return type from gimple to gomp_parallel *. (gimple_build_omp_task): Strengthen return type from gimple to gomp_task *. (gimple_build_omp_continue): Strengthen return type from gimple to gomp_continue *. (gimple_build_omp_sections): Strengthen return type from gimple to gomp_sections *. (gimple_build_omp_single): Strengthen return type from gimple to gomp_single *. (gimple_build_omp_target): Strengthen return type from gimple to gomp_target *. (gimple_build_omp_teams): Strengthen return type from gimple to gomp_teams *. (gimple_build_omp_atomic_load): Strengthen return type from gimple to gomp_atomic_load *. (gimple_build_omp_atomic_store): Strengthen return type from gimple to gomp_atomic_store *. (gimple_build_transaction): Strengthen return type from gimple to gtransaction *. (empty_stmt_p): Replace check for GIMPLE_BIND with a dyn_cast. (gimple_call_fnspec): Require a const gcall *. (gimple_call_arg_flags): Likewise. (gimple_call_return_flags): Likewise. (gimple_set_bb): Add a checked cast. (gimple_copy): Within the cases, add locals of the appropriate subclass and use in place of "stmt" and "copy" for typesafety. (gimple_has_side_effects): Add a checked cast. (gimple_could_trap_p_1): Likewise. (gimple_call_copy_skip_args): Require a gcall *, and return one. (gimple_asm_clobbers_memory_p): Require a const gasm *. (infer_nonnull_range): Replace a check for GIMPLE_RETURN with a dyn_cast, introducing local "return_stmt" and using ti in place of "stmt". * gimple.h (gimple_vec): Eliminate this typedef. (struct gimple_statement_call): Rename to... (struct gcall): ...this. (struct gimple_statement_bind): Rename to... (struct gbind): ...this. (struct gimple_statement_catch): Rename to... (struct gcatch): ...this. (struct gimple_statement_eh_filter): Rename to... (struct geh_filter): ...this. (struct gimple_statement_eh_else): Rename to... (struct geh_else): ...this. (struct gimple_statement_eh_mnt): Rename to... (struct geh_mnt): ...this. (struct gimple_statement_phi): Rename to... (struct gphi): ...this. (struct gimple_statement_resx): Rename to... (struct gresx): ...this. (struct gimple_statement_eh_dispatch): Rename to... (struct geh_dispatch): ...this. (struct gimple_statement_try): Rename to... (struct gtry): ...this. (struct gimple_statement_asm): Rename to... (struct gasm): ...this. (struct gimple_statement_omp_critical): Rename to... (struct gomp_critical): ...this. (struct gimple_statement_omp_for): Rename to... (struct gomp_for): ...this. (struct gimple_statement_omp_parallel): Rename to... (struct gomp_parallel): ...this. (struct gimple_statement_omp_target): Rename to... (struct gomp_target): ...this. (struct gimple_statement_omp_task): Rename to... (struct gomp_task): ...this. (struct gimple_statement_omp_sections): Rename to... (struct gomp_sections): ...this. (struct gimple_statement_omp_continue): Rename to... (struct gomp_continue): ...this. (struct gimple_statement_omp_single): Rename to... (struct gomp_single): ...this. (struct gimple_statement_omp_teams): Rename to... (struct gomp_teams): ...this. (struct gimple_statement_omp_atomic_load): Rename to... (struct gomp_atomic_load): ...this. (struct gimple_statement_omp_atomic_store :): Rename to... (struct gomp_atomic_store :): ...this. (struct gimple_statement_transaction): Rename to... (struct gtransaction): ...this. (struct gcond): New subclass. (struct gdebug): New subclass. (struct ggoto): New subclass. (struct glabel): New subclass. (struct gswitch): New subclass. (struct gassign): New subclass. (struct greturn): New subclass. (is_a_helper <gimple_statement_asm *>::test): Rename to... (is_a_helper <gasm *>::test): ...this. (is_a_helper <gimple_statement_bind *>::test): Rename to... (is_a_helper <gbind *>::test): ...this. (is_a_helper <gassign *>::test): New. (is_a_helper <gimple_statement_call *>::test): Rename to... (is_a_helper <gcall *>::test): ...this. (is_a_helper <gimple_statement_catch *>::test): Rename to... (is_a_helper <gcatch *>::test): ...this. (is_a_helper <gimple_statement_resx *>::test): Rename to... (is_a_helper <gresx *>::test): ...this. (is_a_helper <gcond *>::test): New. (is_a_helper <gdebug *>::test): New. (is_a_helper <ggoto *>::test): New. (is_a_helper <glabel *>::test): New. (is_a_helper <gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <geh_dispatch *>::test): ...this. (is_a_helper <gimple_statement_eh_else *>::test): Rename to... (is_a_helper <geh_else *>::test): ...this. (is_a_helper <gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <geh_filter *>::test): ...this. (is_a_helper <gimple_statement_eh_mnt *>::test): Rename to... (is_a_helper <geh_mnt *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <gomp_atomic_load *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <gomp_atomic_store *>::test): ...this. (is_a_helper <gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <gomp_continue *>::test): ...this. (is_a_helper <gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <gomp_critical *>::test): ...this. (is_a_helper <gimple_statement_omp_for *>::test): Rename to... (is_a_helper <gomp_for *>::test): ...this. (is_a_helper <gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <gomp_parallel *>::test): ...this. (is_a_helper <gimple_statement_omp_target *>::test): Rename to... (is_a_helper <gomp_target *>::test): ...this. (is_a_helper <gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <gomp_sections *>::test): ...this. (is_a_helper <gimple_statement_omp_single *>::test): Rename to... (is_a_helper <gomp_single *>::test): ...this. (is_a_helper <gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <gomp_teams *>::test): ...this. (is_a_helper <gimple_statement_omp_task *>::test): Rename to... (is_a_helper <gomp_task *>::test): ...this. (is_a_helper <gimple_statement_phi *>::test): Rename to... (is_a_helper <gphi *>::test): ...this. (is_a_helper <gimple_statement_transaction *>::test): Rename to... (is_a_helper <gtransaction *>::test): ...this. (is_a_helper <greturn *>::test): New. (is_a_helper <gswitch *>::test): New. (is_a_helper <gimple_statement_try *>::test): Rename to... (is_a_helper <gtry *>::test): ...this. (is_a_helper <const gimple_statement_asm *>::test): Rename to... (is_a_helper <const gasm *>::test): ...this. (is_a_helper <const gimple_statement_bind *>::test): Rename to... (is_a_helper <const gbind *>::test): ...this. (is_a_helper <const gimple_statement_call *>::test): Rename to... (is_a_helper <const gcall *>::test): ...this. (is_a_helper <const gimple_statement_catch *>::test): Rename to... (is_a_helper <const gcatch *>::test): ...this. (is_a_helper <const gimple_statement_resx *>::test): Rename to... (is_a_helper <const gresx *>::test): ...this. (is_a_helper <const gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <const geh_dispatch *>::test): ...this. (is_a_helper <const gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <const geh_filter *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <const gomp_atomic_load *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <const gomp_atomic_store *>::test): ...this. (is_a_helper <const gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <const gomp_continue *>::test): ...this. (is_a_helper <const gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <const gomp_critical *>::test): ...this. (is_a_helper <const gimple_statement_omp_for *>::test): Rename to... (is_a_helper <const gomp_for *>::test): ...this. (is_a_helper <const gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <const gomp_parallel *>::test): ...this. (is_a_helper <const gimple_statement_omp_target *>::test): Rename to... (is_a_helper <const gomp_target *>::test): ...this. (is_a_helper <const gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <const gomp_sections *>::test): ...this. (is_a_helper <const gimple_statement_omp_single *>::test): Rename to... (is_a_helper <const gomp_single *>::test): ...this. (is_a_helper <const gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <const gomp_teams *>::test): ...this. (is_a_helper <const gimple_statement_omp_task *>::test): Rename to... (is_a_helper <const gomp_task *>::test): ...this. (is_a_helper <const gimple_statement_phi *>::test): Rename to... (is_a_helper <const gphi *>::test): ...this. (is_a_helper <const gimple_statement_transaction *>::test): Rename to... (is_a_helper <const gtransaction *>::test): ...this. (gimple_build_return): Strengthen return type to greturn *. (gimple_call_reset_alias_info): Require a gcall *. (gimple_build_call_vec): Return a gcall *. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Return a gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Return a gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Return a glabel *. (gimple_build_goto): Return a ggoto *. (gimple_build_bind): Return a gbind *. (gimple_build_asm_vec): Return a gasm *. (gimple_build_catch): Return a gcatch *. (gimple_build_eh_filter): Return a geh_filter *. (gimple_build_eh_must_not_throw): Return a geh_mnt *. (gimple_build_eh_else): Return a geh_else *. (gimple_build_try): Return a gtry *. (gimple_build_resx): Return a gresx *. (gimple_build_switch_nlabels): Return a gswitch *. (gimple_build_switch): Return a gswitch *. (gimple_build_eh_dispatch): Return a geh_dispatch *. (gimple_build_debug_bind_stat): Return a gdebug *. (gimple_build_debug_source_bind_stat): Return a gdebug *. (gimple_build_omp_critical): Return a gomp_critical *. (gimple_build_omp_for): Return a gomp_for *. (gimple_build_omp_parallel): Return a gomp_parallel *. (gimple_build_omp_task): Return a gomp_task *. (gimple_build_omp_continue): Return a gomp_continue *. (gimple_build_omp_sections): Return a gomp_sections *. (gimple_build_omp_single): Return a gomp_single *. (gimple_build_omp_target): Return a gomp_target *. (gimple_build_omp_teams): Return a gomp_teams *. (gimple_build_omp_atomic_load): Return a gomp_atomic_load *. (gimple_build_omp_atomic_store): Return a gomp_atomic_store *. (gimple_build_transaction): Return a gtransaction *. (gimple_call_arg_flags): Require a const gcall *. (gimple_call_return_flags): Likewise. (gimple_call_copy_skip_args): Require and return a gcall *. (gimple_asm_clobbers_memory_p): Require a const gasm *. (gimple_seq_first_stmt_as_a_bind): New. (gimple_assign_nontemporal_move_p): Require a const gassign * rather than a const_gimple. (gimple_call_internal_fn): Update for renaming to gcall. (gimple_call_fntype): Likewise. (gimple_call_set_fntype): Require a gcall * rather than a gimple. (gimple_call_set_fn): Likewise. (gimple_call_set_internal_fn): Likewise. (gimple_call_set_chain): Likewise. (gimple_call_set_tail): Likewise. (gimple_call_tail_p): Likewise. (gimple_call_set_return_slot_opt): Likewise. (gimple_call_return_slot_opt_p): Likewise. (gimple_call_set_from_thunk): Likewise. (gimple_call_from_thunk_p): Likewise. (gimple_call_set_va_arg_pack): Likewise. (gimple_call_va_arg_pack_p): Likewise. (gimple_call_set_nothrow): Likewise. (gimple_call_nothrow_p): Likewise. (gimple_call_set_alloca_for_var): Likewise. (gimple_call_alloca_for_var_p): Likewise. (gimple_call_use_set): Likewise. (gimple_call_clobber_set): Likewise. (gimple_call_return_type): Require a const gcall * rather than a const_gimple. (gimple_call_chain_ptr): Likewise. (gimple_call_copy_flags): Require a pair of gcall *. (gimple_cond_set_code): Require a gcond * rather than a gimple (gimple_cond_set_lhs): Likewise. (gimple_cond_set_rhs): Likewise. (gimple_cond_set_true_label): Likewise. (gimple_cond_set_false_label): Likewise. (gimple_cond_make_false): Likewise. (gimple_cond_make_true): Likewise. (gimple_cond_lhs_ptr): Require a const gcond * rather than a const_gimple. (gimple_cond_rhs_ptr): Likewise. (gimple_cond_true_label): Likewise. (gimple_cond_false_label): Likewise. (gimple_cond_true_p): Likewise. (gimple_cond_false_p): Likewise. (gimple_cond_set_condition): Likewise. (gimple_label_label): Require a const glabel *. (gimple_label_set_label): Require a glabel *. (gimple_goto_set_dest): Require a ggoto *. (gimple_bind_vars): Require a const gbind *. (gimple_bind_block): Likewise. (gimple_bind_set_vars): Require a gbind *. (gimple_bind_append_vars): Likewise. (gimple_bind_body_ptr): Likewise. (gimple_bind_body): Likewise. (gimple_bind_set_body): Likewise. (gimple_bind_add_stmt): Likewise. (gimple_bind_add_seq): Likewise. (gimple_bind_set_block): Likewise. (gimple_asm_ninputs): Require a const gasm *. (gimple_asm_noutputs): Likewise. (gimple_asm_nclobbers): Likewise. (gimple_asm_nlabels): Likewise. (gimple_asm_input_op): Likewise. (gimple_asm_input_op_ptr): Likewise. (gimple_asm_output_op): Likewise. (gimple_asm_output_op_ptr): Likewise. (gimple_asm_clobber_op): Likewise. (gimple_asm_label_op): Likewise. (gimple_asm_string): Likewise. (gimple_asm_volatile_p): Likewise. (gimple_asm_input_p): Likewise. (gimple_asm_set_input_op): Require a gasm *. (gimple_asm_set_output_op): Likewise. (gimple_asm_set_clobber_op): Likewise. (gimple_asm_set_label_op): Likewise. (gimple_asm_set_volatile): Likewise. (gimple_asm_set_input): Likewise. (gimple_catch_types): Require a const gcatch *. (gimple_catch_types_ptr): Require a gcatch *. (gimple_catch_handler_ptr): Likewise. (gimple_catch_handler): Likewise. (gimple_catch_set_types): Likewise. (gimple_catch_set_handler): Likewise. (gimple_eh_filter_types): Update for renaming of subclass to geh_filter. (gimple_eh_filter_types_ptr): Likewise. (gimple_eh_filter_failure_ptr): Likewise. (gimple_eh_filter_set_types): Require a geh_filter *. (gimple_eh_filter_set_failure): Likewise. (gimple_eh_must_not_throw_fndecl): Require a geh_mnt *. (gimple_eh_must_not_throw_set_fndecl): Likewise. (gimple_eh_else_n_body_ptr): Require a geh_else *. (gimple_eh_else_n_body): Likewise. (gimple_eh_else_e_body_ptr): Likewise. (gimple_eh_else_e_body): Likewise. (gimple_eh_else_set_n_body): Likewise. (gimple_eh_else_set_e_body): Likewise. (gimple_try_set_kind): Require a gtry *. (gimple_try_set_catch_is_cleanup): Likewise. (gimple_try_set_eval): Likewise. (gimple_try_set_cleanup): Likewise. (gimple_try_eval_ptr): Update for renaming of subclass to gtry. (gimple_try_cleanup_ptr): Likewise. (gimple_phi_capacity): Update for renaming of subclass to gphi. (gimple_phi_num_args): Likewise. (gimple_phi_result): Likewise. (gimple_phi_result_ptr): Likewise. (gimple_phi_arg): Likewise. (gimple_phi_set_result): Require a gphi *. (gimple_phi_set_arg): Likewise. (gimple_phi_arg_def_ptr): Likewise. (gimple_phi_arg_edge): Likewise. (gimple_phi_arg_location): Likewise. (gimple_phi_arg_location_from_edge): Likewise. (gimple_phi_arg_set_location): Likewise. (gimple_phi_arg_has_location): Likewise. (gimple_resx_region): Require a const gresx *. (gimple_resx_set_region): Require a gresx *. (gimple_eh_dispatch_region): Require a const geh_dispatch *. (gimple_eh_dispatch_set_region): Require a geh_dispatch *. (gimple_switch_num_labels): Require a const gswitch *. (gimple_switch_set_num_labels): Likewise. (gimple_switch_index): Likewise. (gimple_switch_index_ptr): Likewise. (gimple_switch_label): Likewise. (gimple_switch_default_label): Likewise. (gimple_switch_set_index): Require a gswitch *. (gimple_switch_set_label): Likewise. (gimple_switch_set_default_label): Likewise. (gimple_omp_critical_name): Require a const gomp_critical *. (gimple_omp_critical_name_ptr): Require a gomp_critical *. (gimple_omp_critical_set_name): Likewise. (gimple_omp_for_set_kind): Require a gomp_for *. (gimple_omp_for_set_combined_p): Likewise. (gimple_omp_for_set_combined_into_p): Likewise. (gimple_omp_for_clauses): Update for renaming of subclass to gomp_for. (gimple_omp_for_clauses_ptr): Likewise. (gimple_omp_for_set_clauses): Likewise. (gimple_omp_for_collapse): Likewise. (gimple_omp_for_index): Likewise. (gimple_omp_for_index_ptr): Likewise. (gimple_omp_for_set_index): Likewise. (gimple_omp_for_initial): Likewise. (gimple_omp_for_initial_ptr): Likewise. (gimple_omp_for_set_initial): Likewise. (gimple_omp_for_final): Likewise. (gimple_omp_for_final_ptr): Likewise. (gimple_omp_for_set_final): Likewise. (gimple_omp_for_incr): Likewise. (gimple_omp_for_incr_ptr): Likewise. (gimple_omp_for_set_incr): Likewise. (gimple_omp_for_pre_body): Likewise. (gimple_omp_for_set_pre_body): Likewise. (gimple_omp_parallel_clauses): Update for renaming of subclass to gomp_parallel. (gimple_omp_parallel_clauses_ptr): Require a gomp_parallel *. (gimple_omp_parallel_set_clauses): Likewise. (gimple_omp_parallel_child_fn_ptr): Likewise. (gimple_omp_parallel_set_child_fn): Likewise. (gimple_omp_parallel_data_arg_ptr): Likewise. (gimple_omp_parallel_set_data_arg): Likewise. (gimple_omp_parallel_child_fn): Require a const gomp_parallel *. (gimple_omp_parallel_data_arg): Likewise. (gimple_omp_task_clauses): Update for renaming of subclass to gomp_task. (gimple_omp_task_clauses_ptr): Likewise. (gimple_omp_task_set_clauses): Likewise. (gimple_omp_task_child_fn): Likewise. (gimple_omp_task_child_fn_ptr): Likewise. (gimple_omp_task_set_child_fn): Likewise. (gimple_omp_task_data_arg): Likewise. (gimple_omp_task_data_arg_ptr): Likewise. (gimple_omp_task_set_data_arg): Likewise. (gimple_omp_taskreg_clauses): Whitespace fixes. (gimple_omp_taskreg_clauses_ptr): Likewise. (gimple_omp_taskreg_set_clauses): Likewise. (gimple_omp_taskreg_child_fn): Likewise. (gimple_omp_taskreg_child_fn_ptr): Likewise. (gimple_omp_taskreg_set_child_fn): Likewise. (gimple_omp_taskreg_data_arg): Likewise. (gimple_omp_taskreg_data_arg_ptr): Likewise. (gimple_omp_taskreg_set_data_arg): Likewise. (gimple_omp_task_copy_fn): Update for renaming of subclass to gomp_task. (gimple_omp_task_copy_fn_ptr): Likewise. (gimple_omp_task_set_copy_fn): Likewise. (gimple_omp_task_arg_size): Likewise. (gimple_omp_task_arg_size_ptr): Likewise. (gimple_omp_task_set_arg_size): Likewise. (gimple_omp_task_arg_align): Likewise. (gimple_omp_task_arg_align_ptr): Likewise. (gimple_omp_task_set_arg_align): Likewise. (gimple_omp_single_clauses): Update for renaming of subclass to gomp_single. (gimple_omp_single_clauses_ptr): Likewise. (gimple_omp_single_set_clauses): Likewise. (gimple_omp_target_clauses): Update for renaming of subclass to gomp_target. (gimple_omp_target_clauses_ptr): Likewise. (gimple_omp_target_set_clauses): Require a gomp_target *. (gimple_omp_target_set_kind): Likewise. (gimple_omp_target_child_fn_ptr): Likewise. (gimple_omp_target_set_child_fn): Likewise. (gimple_omp_target_data_arg_ptr): Likewise. (gimple_omp_target_set_data_arg): Likewise. (gimple_omp_target_child_fn): Require a const gomp_target *. (gimple_omp_target_data_arg): Likewise. (gimple_omp_teams_clauses): Update for renaming of subclass to gomp_teams. (gimple_omp_teams_clauses_ptr): Likewise. (gimple_omp_teams_set_clauses): Require a gomp_teams *. (gimple_omp_sections_clauses): Update for renaming of subclass to gomp_sections. (gimple_omp_sections_clauses_ptr): Likewise. (gimple_omp_sections_set_clauses): Likewise. (gimple_omp_sections_control): Likewise. (gimple_omp_sections_control_ptr): Likewise. (gimple_omp_sections_set_control): Likewise. (gimple_omp_for_set_cond): Likewise. (gimple_omp_for_cond): Likewise. (gimple_omp_atomic_store_set_val): Require a gomp_atomic_store *. (gimple_omp_atomic_store_val_ptr): Likewise. (gimple_omp_atomic_load_set_lhs): Likewise. (gimple_omp_atomic_store_val): Require a const gomp_atomic_store *. (gimple_omp_atomic_load_lhs): Likewise. (gimple_omp_atomic_load_rhs): Likewise. (gimple_omp_atomic_load_lhs_ptr): Require a gomp_atomic_load *. (gimple_omp_atomic_load_set_rhs): Likewise. (gimple_omp_atomic_load_rhs_ptr): Likewise. (gimple_omp_continue_control_def): Require a const gomp_continue *. (gimple_omp_continue_control_use): Likewise. (gimple_omp_continue_control_def_ptr): Require a gomp_continue *. (gimple_omp_continue_set_control_def): Likewise. (gimple_omp_continue_control_use_ptr): Likewise. (gimple_omp_continue_set_control_use): Likewise. (gimple_transaction_body_ptr): Require a gtransaction *. (gimple_transaction_body): Likewise. (gimple_transaction_label_ptr): Likewise. (gimple_transaction_label): Require a const gtransaction *. (gimple_transaction_subcode): Likewise. (gimple_transaction_set_body): Require a gtransaction *. (gimple_transaction_set_label): Likewise. (gimple_transaction_set_subcode): Likewise. (gimple_return_retval_ptr): Require a const greturn *. (gimple_return_retval): Likewise. (gimple_return_set_retval): Require a greturn *. (gimple_expr_type): Introduce local "call_stmt" and use in place of "stmt" for typesafety. * asan.c: Use gimple subclasses. * auto-profile.c: Likewise. * builtins.c: Likewise. * builtins.h: Likewise. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * expr.h: Likewise. * gimple-builder.c: Likewise. * gimple-builder.h: Likewise. * gimple-fold.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimple-walk.c: Likewise. * gimplify-me.c: Likewise. * gimplify.c: Likewise. * gimplify.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * internal-fn.c: Likewise. * internal-fn.def:: Likewise. * internal-fn.h: Likewise. * ipa-icf-gimple.c: Likewise. * ipa-icf-gimple.h: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-split.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * omp-low.c: Likewise. * predict.c: Likewise. * sanopt.c: Likewise. * sese.c: Likewise. * ssa-iterators.h: Likewise. * stmt.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfg.h: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chkp.c: Likewise. * tree-chkp.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-eh.c: Likewise. * tree-eh.h: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-into-ssa.h: Likewise. * tree-loop-distribution.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-phinodes.h: Likewise. * tree-predcom.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h * tree-sra.cn_function): * tree-ssa-alias.c: Likewise. * tree-ssa-alias.h: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c * tree-ssa-structalias.c * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadedge.h: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-stdarg.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * ubsan.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * vtable-verify.c: Likewise. gcc/c-family/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * c-gimplify.c (add_block_to_enclosing): Strengthen local "stack" from being just a vec<gimple> to a vec<gbind *>. gcc/java/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * java-gimplify.c (java_gimplify_block): Strengthen local "outer" from gimple to gbind *. From-SVN: r217787
2014-11-19 18:00:54 +01:00
gphi *phi = gsi.phi ();
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
tree result = PHI_RESULT (phi);
if (live_track_live_p (live, result))
live_track_process_def (live, result, graph);
}
live_track_clear_base_vars (live);
}
delete_live_track (live);
return graph;
}
/* Shortcut routine to print messages to file F of the form:
"STR1 EXPR1 STR2 EXPR2 STR3." */
static inline void
print_exprs (FILE *f, const char *str1, tree expr1, const char *str2,
tree expr2, const char *str3)
{
fprintf (f, "%s", str1);
print_generic_expr (f, expr1, TDF_SLIM);
fprintf (f, "%s", str2);
print_generic_expr (f, expr2, TDF_SLIM);
fprintf (f, "%s", str3);
}
/* Print a failure to coalesce a MUST_COALESCE pair X and Y. */
static inline void
fail_abnormal_edge_coalesce (int x, int y)
{
fprintf (stderr, "\nUnable to coalesce ssa_names %d and %d",x, y);
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
fprintf (stderr, " which are marked as MUST COALESCE.\n");
print_generic_expr (stderr, ssa_name (x), TDF_SLIM);
fprintf (stderr, " and ");
print_generic_stmt (stderr, ssa_name (y), TDF_SLIM);
internal_error ("SSA corruption");
}
/* This function creates a var_map for the current function as well as creating
a coalesce list for use later in the out of ssa process. */
static var_map
create_outofssa_var_map (coalesce_list_p cl, bitmap used_in_copy)
{
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
gimple_stmt_iterator gsi;
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
basic_block bb;
tree var;
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
gimple stmt;
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
tree first;
var_map map;
ssa_op_iter iter;
int v1, v2, cost;
unsigned i;
map = init_var_map (num_ssa_names);
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
Eliminate FOR_EACH_BB macro. gcc/ * basic-block.h (FOR_EACH_BB): Eliminate macro. * asan.c (transform_statements, execute_sanopt): Eliminate use of FOR_EACH_BB in favor of FOR_EACH_BB_FN, to make use of cfun explicit. * auto-inc-dec.c (rest_of_handle_auto_inc_dec): Likewise. * bb-reorder.c (find_rarely_executed_basic_blocks_and_crossing_edges, set_edge_can_fallthru_flag, fix_up_fall_thru_edges, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes, insert_section_boundary_note, rest_of_handle_reorder_blocks, duplicate_computed_gotos): Likewise. * cfg.c (clear_edges, compact_blocks, brief_dump_cfg): Likewise. * cfganal.c (find_unreachable_blocks, add_noreturn_fake_exit_edges, compute_dominance_frontiers_1, single_pred_before_succ_order): Likewise. * cfgbuild.c (find_many_sub_basic_blocks): Likewise. * cfgcleanup.c (try_optimize_cfg, delete_dead_jumptables): Likewise. * cfgexpand.c (add_scope_conflicts, discover_nonconstant_array_refs): Likewise. * cfgloop.c (flow_loops_cfg_dump, get_loop_body, record_loop_exits, verify_loop_structure): Likewise. * cfgloopanal.c (mark_loop_exit_edges): Likewise. * cfgrtl.c (compute_bb_for_insn, find_partition_fixes, verify_hot_cold_block_grouping, purge_all_dead_edges, fixup_abnormal_edges, record_effective_endpoints, outof_cfg_layout_mode, fixup_reorder_chain, force_one_exit_fallthru, break_superblocks): Likewise. * cgraphbuild.c (build_cgraph_edges, rebuild_cgraph_edges, cgraph_rebuild_references): Likewise. * combine-stack-adj.c (combine_stack_adjustments): Likewise. * combine.c (delete_noop_moves, create_log_links, combine_instructions): Likewise. * config/arm/arm.c (thumb1_reorg, thumb2_reorg): Likewise. * config/bfin/bfin.c (bfin_gen_bundles, reorder_var_tracking_notes): Likewise. * config/c6x/c6x.c (c6x_gen_bundles, conditionalize_after_sched, c6x_reorg): Likewise. * config/epiphany/resolve-sw-modes.c (resolve_sw_modes): Likewise. * config/frv/frv.c (frv_optimize_membar): Likewise. * config/i386/i386.c (ix86_finalize_stack_realign_flags): Likewise. * config/ia64/ia64.c (ia64_reorg): Likewise. * config/mips/mips.c (mips_annotate_pic_calls): Likewise. * config/picochip/picochip.c (reorder_var_tracking_notes): Likewise. * config/rs6000/rs6000.c (rs6000_alloc_sdmode_stack_slot): Likewise. * config/s390/s390.c (s390_regs_ever_clobbered): Likewise. * config/sh/sh_treg_combine.cc (sh_treg_combine::execute): Likewise. * config/spu/spu.c (spu_machine_dependent_reorg): Likewise. * config/tilegx/tilegx.c (tilegx_gen_bundles, reorder_var_tracking_notes): Likewise. * config/tilepro/tilepro.c (tilepro_gen_bundles, reorder_var_tracking_notes): Likewise. * coverage.c (coverage_compute_cfg_checksum): Likewise. * cprop.c (compute_hash_table_work, compute_cprop_data, local_cprop_pass, find_implicit_sets): Likewise. * cse.c (cse_condition_code_reg): Likewise. * dce.c (prescan_insns_for_dce): Likewise. * df-core.c (df_compact_blocks): Likewise. * df-problems.c (df_word_lr_alloc): Likewise. * df-scan.c (df_scan_start_dump, df_scan_blocks, df_insn_rescan_all, df_update_entry_exit_and_calls): Likewise. * dominance.c (calculate_dominance_info, verify_dominators, debug_dominance_info): Likewise. * dse.c (dse_step5_nospill): Likewise. * except.c (finish_eh_generation): Likewise. * final.c (compute_alignments): Likewise. * function.c (thread_prologue_and_epilogue_insns, rest_of_match_asm_constraints): Likewise. * gcse.c (compute_hash_table_work, prune_expressions, compute_pre_data, compute_code_hoist_vbeinout, hoist_code, calculate_bb_reg_pressure, compute_ld_motion_mems): Likewise. * gimple-iterator.c (gsi_commit_edge_inserts): Likewise. * gimple-ssa-isolate-paths.c (find_implicit_erroneous_behaviour, find_explicit_erroneous_behaviour): Likewise. * graphite-sese-to-poly.c (rewrite_reductions_out_of_ssa, rewrite_cross_bb_scalar_deps_out_of_ssa): Likewise. * haifa-sched.c (haifa_sched_init): Likewise. * hw-doloop.c (discover_loops, set_bb_indices, reorder_loops): Likewise. * ifcvt.c (if_convert): Likewise. * init-regs.c (initialize_uninitialized_regs): Likewise. * ipa-prop.c (ipcp_transform_function): Likewise. * ipa-pure-const.c (analyze_function): Likewise. * ipa-split.c (find_split_points, execute_split_functions): Likewise. * ira-build.c (form_loop_tree): Likewise. * ira-costs.c (find_costs_and_classes): Likewise. * ira-emit.c (emit_moves, add_ranges_and_copies, ira_emit): Likewise. * ira.c (decrease_live_ranges_number, compute_regs_asm_clobbered, mark_elimination, update_equiv_regs, find_moveable_pseudos, split_live_ranges_for_shrink_wrap, allocate_initial_values): Likewise. * jump.c (mark_all_labels): Likewise. * lcm.c (compute_laterin, compute_insert_delete, compute_available, compute_nearerout, compute_rev_insert_delete): Likewise. * loop-init.c (fix_loop_structure): Likewise. * loop-invariant.c (calculate_loop_reg_pressure): Likewise. * lower-subreg.c (decompose_multiword_subregs, decompose_multiword_subregs): Likewise. * lra-assigns.c (assign_by_spills): Likewise. * lra-coalesce.c (lra_coalesce): Likewise. * lra-constraints.c (lra_inheritance, remove_inheritance_pseudos): Likewise. * lra-eliminations.c (lra_init_elimination): Likewise. * lra-spills.c (assign_spill_hard_regs, spill_pseudos, lra_final_code_change): Likewise. * lra.c (remove_scratches, check_rtl, has_nonexceptional_receiver, update_inc_notes): Likewise. * mcf.c (adjust_cfg_counts): Likewise. * mode-switching.c (optimize_mode_switching): Likewise. * modulo-sched.c (rest_of_handle_sms): Likewise. * omp-low.c (optimize_omp_library_calls, expand_omp_taskreg, expand_omp_target): Likewise. * postreload-gcse.c (alloc_mem, compute_hash_table): Likewise. * postreload.c (reload_cse_regs_1): Likewise. * predict.c (strip_predict_hints, tree_bb_level_predictions, tree_estimate_probability, expensive_function_p, estimate_bb_frequencies, compute_function_frequency): Likewise. * profile.c (is_inconsistent, compute_branch_probabilities, branch_prob): Likewise. * ree.c (find_removable_extensions): Likewise. * reg-stack.c (compensate_edges, convert_regs, reg_to_stack): Likewise. * regcprop.c (copyprop_hardreg_forward): Likewise. * reginfo.c (init_subregs_of_mode): Likewise. * regrename.c (regrename_analyze): Likewise. * regstat.c (regstat_compute_ri, regstat_compute_calls_crossed): Likewise. * reload1.c (has_nonexceptional_receiver, reload, calculate_elim_costs_all_insns): Likewise. * resource.c (init_resource_info, free_resource_info): Likewise. * sched-ebb.c (schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_single_block_region, haifa_find_rgns, sched_rgn_local_init): Likewise. * sel-sched-dump.c (sel_dump_cfg_2): Likewise. * sel-sched-ir.c (init_lv_sets, free_lv_sets, make_regions_from_the_rest): Likewise. * sese.c (build_sese_loop_nests, sese_build_liveouts): Likewise. * stack-ptr-mod.c (notice_stack_pointer_modification): Likewise. * store-motion.c (compute_store_table, build_store_vectors, one_store_motion_pass): Likewise. * tracer.c (tail_duplicate): Likewise. * trans-mem.c (compute_transaction_bits): Likewise. * tree-call-cdce.c (tree_call_cdce): Likewise. * tree-cfg.c (replace_loop_annotate, factor_computed_gotos, fold_cond_expr_cond, make_edges, assign_discriminators, make_abnormal_goto_edges, cleanup_dead_labels, group_case_labels, dump_cfg_stats, gimple_verify_flow_info, print_loop, execute_fixup_cfg): Likewise. * tree-cfgcleanup.c (cleanup_tree_cfg_1, merge_phi_nodes): Likewise. * tree-complex.c (init_dont_simulate_again, tree_lower_complex): Likewise. * tree-dfa.c (collect_dfa_stats, dump_enumerated_decls): Likewise. * tree-eh.c (execute_lower_resx, execute_lower_eh_dispatch, mark_reachable_handlers): Likewise. * tree-emutls.c (lower_emutls_function_body): Likewise. * tree-if-conv.c (main_tree_if_conversion): Likewise. * tree-inline.c (optimize_inline_calls): Likewise. * tree-into-ssa.c (rewrite_into_ssa, update_ssa): Likewise. * tree-nrv.c (tree_nrv, execute_return_slot_opt): Likewise. * tree-object-size.c (compute_object_sizes): Likewise. * tree-outof-ssa.c (eliminate_useless_phis, rewrite_trees, insert_backedge_copies, tree_profiling): Likewise. * tree-scalar-evolution.c (scev_const_prop): Likewise. * tree-sra.c (scan_function, sra_modify_function_body, propagate_dereference_distances, ipa_sra_modify_function_body, convert_callers): Likewise. * tree-ssa-ccp.c (ccp_initialize, execute_fold_all_builtins): Likewise. * tree-ssa-coalesce.c (build_ssa_conflict_graph): Likewise. create_outofssa_var_map, coalesce_partitions): Likewise. * tree-ssa-copy.c (init_copy_prop): Likewise. * tree-ssa-copyrename.c (rename_ssa_copies): Likewise. * tree-ssa-dce.c (find_obviously_necessary_stmts, eliminate_unnecessary_stmts): Likewise. * tree-ssa-dom.c (free_all_edge_infos, tree_ssa_dominator_optimize): Likewise. * tree-ssa-forwprop.c (ssa_forward_propagate_and_combine): Likewise. * tree-ssa-live.c (clear_unused_block_pointer, remove_unused_locals, new_tree_live_info, calculate_live_on_exit, dump_live_info, analyze_memory_references, fill_always_executed_in, tree_ssa_lim_finalize): Likewise. * tree-ssa-loop-manip.c (find_uses_to_rename, verify_loop_closed_ssa): Likewise. * tree-ssa-math-opts.c (execute_cse_reciprocals, execute_cse_sincos, execute_optimize_bswap, execute_optimize_widening_mul): Likewise. * tree-ssa-propagate.c (substitute_and_fold): Likewise. * tree-ssa-structalias.c (compute_points_to_sets): Likewise. * tree-ssa-tail-merge.c (find_same_succ, reset_cluster_vectors): Likewise. * tree-ssa-ter.c (find_replaceable_exprs): Likewise. * tree-ssa-threadupdate.c (thread_through_all_blocks): Likewise. * tree-ssa-uncprop.c (associate_equivalences_with_edges, tree_ssa_uncprop): Likewise. * tree-ssa-uninit.c (warn_uninitialized_vars, execute_late_warn_uninitialized): Likewise. * tree-ssa.c (verify_ssa, execute_update_addresses_taken): Likewise. * tree-stdarg.c (check_all_va_list_escapes, execute_optimize_stdarg): Likewise. * tree-switch-conversion.c (do_switchconv): Likewise. * tree-vect-generic.c (expand_vector_operations): Likewise. * tree-vectorizer.c (adjust_simduid_builtins, note_simd_array_uses, execute_vect_slp): Likewise. * tree-vrp.c (check_all_array_refs, remove_range_assertions, vrp_initialize, identify_jump_threads, instrument_memory_accesses): Likewise. * ubsan.c (ubsan_pass): Likewise. * value-prof.c (verify_histograms, gimple_value_profile_transformations, gimple_find_values_to_profile): Likewise. * var-tracking.c (vt_find_locations, dump_dataflow_sets, vt_emit_notes, vt_initialize, delete_debug_insns, vt_finalize): Likewise. gcc/testsuite/ * g++.dg/plugin/selfassign.c (execute_warn_self_assign): Eliminate use of FOR_EACH_BB in favor of FOR_EACH_BB_FN, to make use of cfun explicit. * gcc.dg/plugin/selfassign.c (execute_warn_self_assign): Likewise. From-SVN: r205828
2013-12-09 22:06:06 +01:00
FOR_EACH_BB_FN (bb, cfun)
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
{
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
tree arg;
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
Merger of git branch "gimple-classes-v2-option-3" gcc/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * coretypes.h (struct gcond): Add forward decl. (struct gdebug): Likewise. (struct ggoto): Likewise. (struct glabel): Likewise. (struct gswitch): Likewise. (struct gassign): Likewise. (struct gasm): Likewise. (struct gcall): Likewise. (struct gtransaction): Likewise. (struct greturn): Likewise. (struct gbind): Likewise. (struct gcatch): Likewise. (struct geh_filter): Likewise. (struct geh_mnt): Likewise. (struct geh_else): Likewise. (struct gresx): Likewise. (struct geh_dispatch): Likewise. (struct gphi): Likewise. (struct gtry): Likewise. (struct gomp_atomic_load): Likewise. (struct gomp_atomic_store): Likewise. (struct gomp_continue): Likewise. (struct gomp_critical): Likewise. (struct gomp_for): Likewise. (struct gomp_parallel): Likewise. (struct gomp_task): Likewise. (struct gomp_sections): Likewise. (struct gomp_single): Likewise. (struct gomp_target): Likewise. (struct gomp_teams): Likewise. * doc/gimple.texi (Class hierarchy of GIMPLE statements): Update for renaming of gimple subclasses. * gdbhooks.py: Update. * gimple-iterator.c (gsi_for_phi): New. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. * gimple-iterator.h (struct gphi_iterator): New subclass of gimple_stmt_iterator. (gsi_for_phi): New prototype. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. (gsi_next_nonvirtual_phi): Strengthen param from gimple_stmt_iterator * to gphi_iterator *, and local "phi" from gimple to gphi *. * gsstruct.def: Update for renamings of classes. * gimple.c (gimple_build_return): Strengthen return type from gimple to greturn *. (gimple_call_reset_alias_info): Strengthen param to gcall *. (gimple_build_call_1): Strengthen return type from gimple to gcall *. (gimple_build_call_vec): Likewise. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal_1): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Strengthen return type from gimple to gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Strengthen return type from gimple to gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Strengthen return type from gimple to glabel *. (gimple_build_goto): Strengthen return type from gimple to ggoto *. (gimple_build_bind): Strengthen return type from gimple to gbind *. (gimple_build_asm_1): Strengthen return type from gimple to gasm *. (gimple_build_asm_vec): Likewise. (gimple_build_catch): Strengthen return type from gimple to gcatch *. (gimple_build_eh_filter): Strengthen return type from gimple to geh_filter *. (gimple_build_eh_must_not_throw): Strengthen return type from gimple to geh_mnt *. (gimple_build_eh_else): Strengthen return type from gimple to geh_else *. (gimple_build_try): Update for renaming of gimple_statement_try to gtry. (gimple_build_resx): Strengthen return type from gimple to gresx *. (gimple_build_switch_nlabels): Strengthen return type from gimple to gswitch *. (gimple_build_switch): Likewise. (gimple_build_eh_dispatch): Strengthen return type from gimple to geh_dispatch *. (gimple_build_debug_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_debug_source_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_omp_critical): Strengthen return type from gimple to gomp_critical *. (gimple_build_omp_for): Strengthen return type from gimple to gomp_for *. (gimple_build_omp_parallel): Strengthen return type from gimple to gomp_parallel *. (gimple_build_omp_task): Strengthen return type from gimple to gomp_task *. (gimple_build_omp_continue): Strengthen return type from gimple to gomp_continue *. (gimple_build_omp_sections): Strengthen return type from gimple to gomp_sections *. (gimple_build_omp_single): Strengthen return type from gimple to gomp_single *. (gimple_build_omp_target): Strengthen return type from gimple to gomp_target *. (gimple_build_omp_teams): Strengthen return type from gimple to gomp_teams *. (gimple_build_omp_atomic_load): Strengthen return type from gimple to gomp_atomic_load *. (gimple_build_omp_atomic_store): Strengthen return type from gimple to gomp_atomic_store *. (gimple_build_transaction): Strengthen return type from gimple to gtransaction *. (empty_stmt_p): Replace check for GIMPLE_BIND with a dyn_cast. (gimple_call_fnspec): Require a const gcall *. (gimple_call_arg_flags): Likewise. (gimple_call_return_flags): Likewise. (gimple_set_bb): Add a checked cast. (gimple_copy): Within the cases, add locals of the appropriate subclass and use in place of "stmt" and "copy" for typesafety. (gimple_has_side_effects): Add a checked cast. (gimple_could_trap_p_1): Likewise. (gimple_call_copy_skip_args): Require a gcall *, and return one. (gimple_asm_clobbers_memory_p): Require a const gasm *. (infer_nonnull_range): Replace a check for GIMPLE_RETURN with a dyn_cast, introducing local "return_stmt" and using ti in place of "stmt". * gimple.h (gimple_vec): Eliminate this typedef. (struct gimple_statement_call): Rename to... (struct gcall): ...this. (struct gimple_statement_bind): Rename to... (struct gbind): ...this. (struct gimple_statement_catch): Rename to... (struct gcatch): ...this. (struct gimple_statement_eh_filter): Rename to... (struct geh_filter): ...this. (struct gimple_statement_eh_else): Rename to... (struct geh_else): ...this. (struct gimple_statement_eh_mnt): Rename to... (struct geh_mnt): ...this. (struct gimple_statement_phi): Rename to... (struct gphi): ...this. (struct gimple_statement_resx): Rename to... (struct gresx): ...this. (struct gimple_statement_eh_dispatch): Rename to... (struct geh_dispatch): ...this. (struct gimple_statement_try): Rename to... (struct gtry): ...this. (struct gimple_statement_asm): Rename to... (struct gasm): ...this. (struct gimple_statement_omp_critical): Rename to... (struct gomp_critical): ...this. (struct gimple_statement_omp_for): Rename to... (struct gomp_for): ...this. (struct gimple_statement_omp_parallel): Rename to... (struct gomp_parallel): ...this. (struct gimple_statement_omp_target): Rename to... (struct gomp_target): ...this. (struct gimple_statement_omp_task): Rename to... (struct gomp_task): ...this. (struct gimple_statement_omp_sections): Rename to... (struct gomp_sections): ...this. (struct gimple_statement_omp_continue): Rename to... (struct gomp_continue): ...this. (struct gimple_statement_omp_single): Rename to... (struct gomp_single): ...this. (struct gimple_statement_omp_teams): Rename to... (struct gomp_teams): ...this. (struct gimple_statement_omp_atomic_load): Rename to... (struct gomp_atomic_load): ...this. (struct gimple_statement_omp_atomic_store :): Rename to... (struct gomp_atomic_store :): ...this. (struct gimple_statement_transaction): Rename to... (struct gtransaction): ...this. (struct gcond): New subclass. (struct gdebug): New subclass. (struct ggoto): New subclass. (struct glabel): New subclass. (struct gswitch): New subclass. (struct gassign): New subclass. (struct greturn): New subclass. (is_a_helper <gimple_statement_asm *>::test): Rename to... (is_a_helper <gasm *>::test): ...this. (is_a_helper <gimple_statement_bind *>::test): Rename to... (is_a_helper <gbind *>::test): ...this. (is_a_helper <gassign *>::test): New. (is_a_helper <gimple_statement_call *>::test): Rename to... (is_a_helper <gcall *>::test): ...this. (is_a_helper <gimple_statement_catch *>::test): Rename to... (is_a_helper <gcatch *>::test): ...this. (is_a_helper <gimple_statement_resx *>::test): Rename to... (is_a_helper <gresx *>::test): ...this. (is_a_helper <gcond *>::test): New. (is_a_helper <gdebug *>::test): New. (is_a_helper <ggoto *>::test): New. (is_a_helper <glabel *>::test): New. (is_a_helper <gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <geh_dispatch *>::test): ...this. (is_a_helper <gimple_statement_eh_else *>::test): Rename to... (is_a_helper <geh_else *>::test): ...this. (is_a_helper <gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <geh_filter *>::test): ...this. (is_a_helper <gimple_statement_eh_mnt *>::test): Rename to... (is_a_helper <geh_mnt *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <gomp_atomic_load *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <gomp_atomic_store *>::test): ...this. (is_a_helper <gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <gomp_continue *>::test): ...this. (is_a_helper <gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <gomp_critical *>::test): ...this. (is_a_helper <gimple_statement_omp_for *>::test): Rename to... (is_a_helper <gomp_for *>::test): ...this. (is_a_helper <gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <gomp_parallel *>::test): ...this. (is_a_helper <gimple_statement_omp_target *>::test): Rename to... (is_a_helper <gomp_target *>::test): ...this. (is_a_helper <gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <gomp_sections *>::test): ...this. (is_a_helper <gimple_statement_omp_single *>::test): Rename to... (is_a_helper <gomp_single *>::test): ...this. (is_a_helper <gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <gomp_teams *>::test): ...this. (is_a_helper <gimple_statement_omp_task *>::test): Rename to... (is_a_helper <gomp_task *>::test): ...this. (is_a_helper <gimple_statement_phi *>::test): Rename to... (is_a_helper <gphi *>::test): ...this. (is_a_helper <gimple_statement_transaction *>::test): Rename to... (is_a_helper <gtransaction *>::test): ...this. (is_a_helper <greturn *>::test): New. (is_a_helper <gswitch *>::test): New. (is_a_helper <gimple_statement_try *>::test): Rename to... (is_a_helper <gtry *>::test): ...this. (is_a_helper <const gimple_statement_asm *>::test): Rename to... (is_a_helper <const gasm *>::test): ...this. (is_a_helper <const gimple_statement_bind *>::test): Rename to... (is_a_helper <const gbind *>::test): ...this. (is_a_helper <const gimple_statement_call *>::test): Rename to... (is_a_helper <const gcall *>::test): ...this. (is_a_helper <const gimple_statement_catch *>::test): Rename to... (is_a_helper <const gcatch *>::test): ...this. (is_a_helper <const gimple_statement_resx *>::test): Rename to... (is_a_helper <const gresx *>::test): ...this. (is_a_helper <const gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <const geh_dispatch *>::test): ...this. (is_a_helper <const gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <const geh_filter *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <const gomp_atomic_load *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <const gomp_atomic_store *>::test): ...this. (is_a_helper <const gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <const gomp_continue *>::test): ...this. (is_a_helper <const gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <const gomp_critical *>::test): ...this. (is_a_helper <const gimple_statement_omp_for *>::test): Rename to... (is_a_helper <const gomp_for *>::test): ...this. (is_a_helper <const gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <const gomp_parallel *>::test): ...this. (is_a_helper <const gimple_statement_omp_target *>::test): Rename to... (is_a_helper <const gomp_target *>::test): ...this. (is_a_helper <const gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <const gomp_sections *>::test): ...this. (is_a_helper <const gimple_statement_omp_single *>::test): Rename to... (is_a_helper <const gomp_single *>::test): ...this. (is_a_helper <const gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <const gomp_teams *>::test): ...this. (is_a_helper <const gimple_statement_omp_task *>::test): Rename to... (is_a_helper <const gomp_task *>::test): ...this. (is_a_helper <const gimple_statement_phi *>::test): Rename to... (is_a_helper <const gphi *>::test): ...this. (is_a_helper <const gimple_statement_transaction *>::test): Rename to... (is_a_helper <const gtransaction *>::test): ...this. (gimple_build_return): Strengthen return type to greturn *. (gimple_call_reset_alias_info): Require a gcall *. (gimple_build_call_vec): Return a gcall *. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Return a gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Return a gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Return a glabel *. (gimple_build_goto): Return a ggoto *. (gimple_build_bind): Return a gbind *. (gimple_build_asm_vec): Return a gasm *. (gimple_build_catch): Return a gcatch *. (gimple_build_eh_filter): Return a geh_filter *. (gimple_build_eh_must_not_throw): Return a geh_mnt *. (gimple_build_eh_else): Return a geh_else *. (gimple_build_try): Return a gtry *. (gimple_build_resx): Return a gresx *. (gimple_build_switch_nlabels): Return a gswitch *. (gimple_build_switch): Return a gswitch *. (gimple_build_eh_dispatch): Return a geh_dispatch *. (gimple_build_debug_bind_stat): Return a gdebug *. (gimple_build_debug_source_bind_stat): Return a gdebug *. (gimple_build_omp_critical): Return a gomp_critical *. (gimple_build_omp_for): Return a gomp_for *. (gimple_build_omp_parallel): Return a gomp_parallel *. (gimple_build_omp_task): Return a gomp_task *. (gimple_build_omp_continue): Return a gomp_continue *. (gimple_build_omp_sections): Return a gomp_sections *. (gimple_build_omp_single): Return a gomp_single *. (gimple_build_omp_target): Return a gomp_target *. (gimple_build_omp_teams): Return a gomp_teams *. (gimple_build_omp_atomic_load): Return a gomp_atomic_load *. (gimple_build_omp_atomic_store): Return a gomp_atomic_store *. (gimple_build_transaction): Return a gtransaction *. (gimple_call_arg_flags): Require a const gcall *. (gimple_call_return_flags): Likewise. (gimple_call_copy_skip_args): Require and return a gcall *. (gimple_asm_clobbers_memory_p): Require a const gasm *. (gimple_seq_first_stmt_as_a_bind): New. (gimple_assign_nontemporal_move_p): Require a const gassign * rather than a const_gimple. (gimple_call_internal_fn): Update for renaming to gcall. (gimple_call_fntype): Likewise. (gimple_call_set_fntype): Require a gcall * rather than a gimple. (gimple_call_set_fn): Likewise. (gimple_call_set_internal_fn): Likewise. (gimple_call_set_chain): Likewise. (gimple_call_set_tail): Likewise. (gimple_call_tail_p): Likewise. (gimple_call_set_return_slot_opt): Likewise. (gimple_call_return_slot_opt_p): Likewise. (gimple_call_set_from_thunk): Likewise. (gimple_call_from_thunk_p): Likewise. (gimple_call_set_va_arg_pack): Likewise. (gimple_call_va_arg_pack_p): Likewise. (gimple_call_set_nothrow): Likewise. (gimple_call_nothrow_p): Likewise. (gimple_call_set_alloca_for_var): Likewise. (gimple_call_alloca_for_var_p): Likewise. (gimple_call_use_set): Likewise. (gimple_call_clobber_set): Likewise. (gimple_call_return_type): Require a const gcall * rather than a const_gimple. (gimple_call_chain_ptr): Likewise. (gimple_call_copy_flags): Require a pair of gcall *. (gimple_cond_set_code): Require a gcond * rather than a gimple (gimple_cond_set_lhs): Likewise. (gimple_cond_set_rhs): Likewise. (gimple_cond_set_true_label): Likewise. (gimple_cond_set_false_label): Likewise. (gimple_cond_make_false): Likewise. (gimple_cond_make_true): Likewise. (gimple_cond_lhs_ptr): Require a const gcond * rather than a const_gimple. (gimple_cond_rhs_ptr): Likewise. (gimple_cond_true_label): Likewise. (gimple_cond_false_label): Likewise. (gimple_cond_true_p): Likewise. (gimple_cond_false_p): Likewise. (gimple_cond_set_condition): Likewise. (gimple_label_label): Require a const glabel *. (gimple_label_set_label): Require a glabel *. (gimple_goto_set_dest): Require a ggoto *. (gimple_bind_vars): Require a const gbind *. (gimple_bind_block): Likewise. (gimple_bind_set_vars): Require a gbind *. (gimple_bind_append_vars): Likewise. (gimple_bind_body_ptr): Likewise. (gimple_bind_body): Likewise. (gimple_bind_set_body): Likewise. (gimple_bind_add_stmt): Likewise. (gimple_bind_add_seq): Likewise. (gimple_bind_set_block): Likewise. (gimple_asm_ninputs): Require a const gasm *. (gimple_asm_noutputs): Likewise. (gimple_asm_nclobbers): Likewise. (gimple_asm_nlabels): Likewise. (gimple_asm_input_op): Likewise. (gimple_asm_input_op_ptr): Likewise. (gimple_asm_output_op): Likewise. (gimple_asm_output_op_ptr): Likewise. (gimple_asm_clobber_op): Likewise. (gimple_asm_label_op): Likewise. (gimple_asm_string): Likewise. (gimple_asm_volatile_p): Likewise. (gimple_asm_input_p): Likewise. (gimple_asm_set_input_op): Require a gasm *. (gimple_asm_set_output_op): Likewise. (gimple_asm_set_clobber_op): Likewise. (gimple_asm_set_label_op): Likewise. (gimple_asm_set_volatile): Likewise. (gimple_asm_set_input): Likewise. (gimple_catch_types): Require a const gcatch *. (gimple_catch_types_ptr): Require a gcatch *. (gimple_catch_handler_ptr): Likewise. (gimple_catch_handler): Likewise. (gimple_catch_set_types): Likewise. (gimple_catch_set_handler): Likewise. (gimple_eh_filter_types): Update for renaming of subclass to geh_filter. (gimple_eh_filter_types_ptr): Likewise. (gimple_eh_filter_failure_ptr): Likewise. (gimple_eh_filter_set_types): Require a geh_filter *. (gimple_eh_filter_set_failure): Likewise. (gimple_eh_must_not_throw_fndecl): Require a geh_mnt *. (gimple_eh_must_not_throw_set_fndecl): Likewise. (gimple_eh_else_n_body_ptr): Require a geh_else *. (gimple_eh_else_n_body): Likewise. (gimple_eh_else_e_body_ptr): Likewise. (gimple_eh_else_e_body): Likewise. (gimple_eh_else_set_n_body): Likewise. (gimple_eh_else_set_e_body): Likewise. (gimple_try_set_kind): Require a gtry *. (gimple_try_set_catch_is_cleanup): Likewise. (gimple_try_set_eval): Likewise. (gimple_try_set_cleanup): Likewise. (gimple_try_eval_ptr): Update for renaming of subclass to gtry. (gimple_try_cleanup_ptr): Likewise. (gimple_phi_capacity): Update for renaming of subclass to gphi. (gimple_phi_num_args): Likewise. (gimple_phi_result): Likewise. (gimple_phi_result_ptr): Likewise. (gimple_phi_arg): Likewise. (gimple_phi_set_result): Require a gphi *. (gimple_phi_set_arg): Likewise. (gimple_phi_arg_def_ptr): Likewise. (gimple_phi_arg_edge): Likewise. (gimple_phi_arg_location): Likewise. (gimple_phi_arg_location_from_edge): Likewise. (gimple_phi_arg_set_location): Likewise. (gimple_phi_arg_has_location): Likewise. (gimple_resx_region): Require a const gresx *. (gimple_resx_set_region): Require a gresx *. (gimple_eh_dispatch_region): Require a const geh_dispatch *. (gimple_eh_dispatch_set_region): Require a geh_dispatch *. (gimple_switch_num_labels): Require a const gswitch *. (gimple_switch_set_num_labels): Likewise. (gimple_switch_index): Likewise. (gimple_switch_index_ptr): Likewise. (gimple_switch_label): Likewise. (gimple_switch_default_label): Likewise. (gimple_switch_set_index): Require a gswitch *. (gimple_switch_set_label): Likewise. (gimple_switch_set_default_label): Likewise. (gimple_omp_critical_name): Require a const gomp_critical *. (gimple_omp_critical_name_ptr): Require a gomp_critical *. (gimple_omp_critical_set_name): Likewise. (gimple_omp_for_set_kind): Require a gomp_for *. (gimple_omp_for_set_combined_p): Likewise. (gimple_omp_for_set_combined_into_p): Likewise. (gimple_omp_for_clauses): Update for renaming of subclass to gomp_for. (gimple_omp_for_clauses_ptr): Likewise. (gimple_omp_for_set_clauses): Likewise. (gimple_omp_for_collapse): Likewise. (gimple_omp_for_index): Likewise. (gimple_omp_for_index_ptr): Likewise. (gimple_omp_for_set_index): Likewise. (gimple_omp_for_initial): Likewise. (gimple_omp_for_initial_ptr): Likewise. (gimple_omp_for_set_initial): Likewise. (gimple_omp_for_final): Likewise. (gimple_omp_for_final_ptr): Likewise. (gimple_omp_for_set_final): Likewise. (gimple_omp_for_incr): Likewise. (gimple_omp_for_incr_ptr): Likewise. (gimple_omp_for_set_incr): Likewise. (gimple_omp_for_pre_body): Likewise. (gimple_omp_for_set_pre_body): Likewise. (gimple_omp_parallel_clauses): Update for renaming of subclass to gomp_parallel. (gimple_omp_parallel_clauses_ptr): Require a gomp_parallel *. (gimple_omp_parallel_set_clauses): Likewise. (gimple_omp_parallel_child_fn_ptr): Likewise. (gimple_omp_parallel_set_child_fn): Likewise. (gimple_omp_parallel_data_arg_ptr): Likewise. (gimple_omp_parallel_set_data_arg): Likewise. (gimple_omp_parallel_child_fn): Require a const gomp_parallel *. (gimple_omp_parallel_data_arg): Likewise. (gimple_omp_task_clauses): Update for renaming of subclass to gomp_task. (gimple_omp_task_clauses_ptr): Likewise. (gimple_omp_task_set_clauses): Likewise. (gimple_omp_task_child_fn): Likewise. (gimple_omp_task_child_fn_ptr): Likewise. (gimple_omp_task_set_child_fn): Likewise. (gimple_omp_task_data_arg): Likewise. (gimple_omp_task_data_arg_ptr): Likewise. (gimple_omp_task_set_data_arg): Likewise. (gimple_omp_taskreg_clauses): Whitespace fixes. (gimple_omp_taskreg_clauses_ptr): Likewise. (gimple_omp_taskreg_set_clauses): Likewise. (gimple_omp_taskreg_child_fn): Likewise. (gimple_omp_taskreg_child_fn_ptr): Likewise. (gimple_omp_taskreg_set_child_fn): Likewise. (gimple_omp_taskreg_data_arg): Likewise. (gimple_omp_taskreg_data_arg_ptr): Likewise. (gimple_omp_taskreg_set_data_arg): Likewise. (gimple_omp_task_copy_fn): Update for renaming of subclass to gomp_task. (gimple_omp_task_copy_fn_ptr): Likewise. (gimple_omp_task_set_copy_fn): Likewise. (gimple_omp_task_arg_size): Likewise. (gimple_omp_task_arg_size_ptr): Likewise. (gimple_omp_task_set_arg_size): Likewise. (gimple_omp_task_arg_align): Likewise. (gimple_omp_task_arg_align_ptr): Likewise. (gimple_omp_task_set_arg_align): Likewise. (gimple_omp_single_clauses): Update for renaming of subclass to gomp_single. (gimple_omp_single_clauses_ptr): Likewise. (gimple_omp_single_set_clauses): Likewise. (gimple_omp_target_clauses): Update for renaming of subclass to gomp_target. (gimple_omp_target_clauses_ptr): Likewise. (gimple_omp_target_set_clauses): Require a gomp_target *. (gimple_omp_target_set_kind): Likewise. (gimple_omp_target_child_fn_ptr): Likewise. (gimple_omp_target_set_child_fn): Likewise. (gimple_omp_target_data_arg_ptr): Likewise. (gimple_omp_target_set_data_arg): Likewise. (gimple_omp_target_child_fn): Require a const gomp_target *. (gimple_omp_target_data_arg): Likewise. (gimple_omp_teams_clauses): Update for renaming of subclass to gomp_teams. (gimple_omp_teams_clauses_ptr): Likewise. (gimple_omp_teams_set_clauses): Require a gomp_teams *. (gimple_omp_sections_clauses): Update for renaming of subclass to gomp_sections. (gimple_omp_sections_clauses_ptr): Likewise. (gimple_omp_sections_set_clauses): Likewise. (gimple_omp_sections_control): Likewise. (gimple_omp_sections_control_ptr): Likewise. (gimple_omp_sections_set_control): Likewise. (gimple_omp_for_set_cond): Likewise. (gimple_omp_for_cond): Likewise. (gimple_omp_atomic_store_set_val): Require a gomp_atomic_store *. (gimple_omp_atomic_store_val_ptr): Likewise. (gimple_omp_atomic_load_set_lhs): Likewise. (gimple_omp_atomic_store_val): Require a const gomp_atomic_store *. (gimple_omp_atomic_load_lhs): Likewise. (gimple_omp_atomic_load_rhs): Likewise. (gimple_omp_atomic_load_lhs_ptr): Require a gomp_atomic_load *. (gimple_omp_atomic_load_set_rhs): Likewise. (gimple_omp_atomic_load_rhs_ptr): Likewise. (gimple_omp_continue_control_def): Require a const gomp_continue *. (gimple_omp_continue_control_use): Likewise. (gimple_omp_continue_control_def_ptr): Require a gomp_continue *. (gimple_omp_continue_set_control_def): Likewise. (gimple_omp_continue_control_use_ptr): Likewise. (gimple_omp_continue_set_control_use): Likewise. (gimple_transaction_body_ptr): Require a gtransaction *. (gimple_transaction_body): Likewise. (gimple_transaction_label_ptr): Likewise. (gimple_transaction_label): Require a const gtransaction *. (gimple_transaction_subcode): Likewise. (gimple_transaction_set_body): Require a gtransaction *. (gimple_transaction_set_label): Likewise. (gimple_transaction_set_subcode): Likewise. (gimple_return_retval_ptr): Require a const greturn *. (gimple_return_retval): Likewise. (gimple_return_set_retval): Require a greturn *. (gimple_expr_type): Introduce local "call_stmt" and use in place of "stmt" for typesafety. * asan.c: Use gimple subclasses. * auto-profile.c: Likewise. * builtins.c: Likewise. * builtins.h: Likewise. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * expr.h: Likewise. * gimple-builder.c: Likewise. * gimple-builder.h: Likewise. * gimple-fold.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimple-walk.c: Likewise. * gimplify-me.c: Likewise. * gimplify.c: Likewise. * gimplify.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * internal-fn.c: Likewise. * internal-fn.def:: Likewise. * internal-fn.h: Likewise. * ipa-icf-gimple.c: Likewise. * ipa-icf-gimple.h: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-split.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * omp-low.c: Likewise. * predict.c: Likewise. * sanopt.c: Likewise. * sese.c: Likewise. * ssa-iterators.h: Likewise. * stmt.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfg.h: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chkp.c: Likewise. * tree-chkp.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-eh.c: Likewise. * tree-eh.h: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-into-ssa.h: Likewise. * tree-loop-distribution.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-phinodes.h: Likewise. * tree-predcom.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h * tree-sra.cn_function): * tree-ssa-alias.c: Likewise. * tree-ssa-alias.h: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c * tree-ssa-structalias.c * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadedge.h: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-stdarg.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * ubsan.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * vtable-verify.c: Likewise. gcc/c-family/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * c-gimplify.c (add_block_to_enclosing): Strengthen local "stack" from being just a vec<gimple> to a vec<gbind *>. gcc/java/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * java-gimplify.c (java_gimplify_block): Strengthen local "outer" from gimple to gbind *. From-SVN: r217787
2014-11-19 18:00:54 +01:00
for (gphi_iterator gpi = gsi_start_phis (bb);
!gsi_end_p (gpi);
gsi_next (&gpi))
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
{
Merger of git branch "gimple-classes-v2-option-3" gcc/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * coretypes.h (struct gcond): Add forward decl. (struct gdebug): Likewise. (struct ggoto): Likewise. (struct glabel): Likewise. (struct gswitch): Likewise. (struct gassign): Likewise. (struct gasm): Likewise. (struct gcall): Likewise. (struct gtransaction): Likewise. (struct greturn): Likewise. (struct gbind): Likewise. (struct gcatch): Likewise. (struct geh_filter): Likewise. (struct geh_mnt): Likewise. (struct geh_else): Likewise. (struct gresx): Likewise. (struct geh_dispatch): Likewise. (struct gphi): Likewise. (struct gtry): Likewise. (struct gomp_atomic_load): Likewise. (struct gomp_atomic_store): Likewise. (struct gomp_continue): Likewise. (struct gomp_critical): Likewise. (struct gomp_for): Likewise. (struct gomp_parallel): Likewise. (struct gomp_task): Likewise. (struct gomp_sections): Likewise. (struct gomp_single): Likewise. (struct gomp_target): Likewise. (struct gomp_teams): Likewise. * doc/gimple.texi (Class hierarchy of GIMPLE statements): Update for renaming of gimple subclasses. * gdbhooks.py: Update. * gimple-iterator.c (gsi_for_phi): New. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. * gimple-iterator.h (struct gphi_iterator): New subclass of gimple_stmt_iterator. (gsi_for_phi): New prototype. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. (gsi_next_nonvirtual_phi): Strengthen param from gimple_stmt_iterator * to gphi_iterator *, and local "phi" from gimple to gphi *. * gsstruct.def: Update for renamings of classes. * gimple.c (gimple_build_return): Strengthen return type from gimple to greturn *. (gimple_call_reset_alias_info): Strengthen param to gcall *. (gimple_build_call_1): Strengthen return type from gimple to gcall *. (gimple_build_call_vec): Likewise. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal_1): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Strengthen return type from gimple to gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Strengthen return type from gimple to gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Strengthen return type from gimple to glabel *. (gimple_build_goto): Strengthen return type from gimple to ggoto *. (gimple_build_bind): Strengthen return type from gimple to gbind *. (gimple_build_asm_1): Strengthen return type from gimple to gasm *. (gimple_build_asm_vec): Likewise. (gimple_build_catch): Strengthen return type from gimple to gcatch *. (gimple_build_eh_filter): Strengthen return type from gimple to geh_filter *. (gimple_build_eh_must_not_throw): Strengthen return type from gimple to geh_mnt *. (gimple_build_eh_else): Strengthen return type from gimple to geh_else *. (gimple_build_try): Update for renaming of gimple_statement_try to gtry. (gimple_build_resx): Strengthen return type from gimple to gresx *. (gimple_build_switch_nlabels): Strengthen return type from gimple to gswitch *. (gimple_build_switch): Likewise. (gimple_build_eh_dispatch): Strengthen return type from gimple to geh_dispatch *. (gimple_build_debug_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_debug_source_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_omp_critical): Strengthen return type from gimple to gomp_critical *. (gimple_build_omp_for): Strengthen return type from gimple to gomp_for *. (gimple_build_omp_parallel): Strengthen return type from gimple to gomp_parallel *. (gimple_build_omp_task): Strengthen return type from gimple to gomp_task *. (gimple_build_omp_continue): Strengthen return type from gimple to gomp_continue *. (gimple_build_omp_sections): Strengthen return type from gimple to gomp_sections *. (gimple_build_omp_single): Strengthen return type from gimple to gomp_single *. (gimple_build_omp_target): Strengthen return type from gimple to gomp_target *. (gimple_build_omp_teams): Strengthen return type from gimple to gomp_teams *. (gimple_build_omp_atomic_load): Strengthen return type from gimple to gomp_atomic_load *. (gimple_build_omp_atomic_store): Strengthen return type from gimple to gomp_atomic_store *. (gimple_build_transaction): Strengthen return type from gimple to gtransaction *. (empty_stmt_p): Replace check for GIMPLE_BIND with a dyn_cast. (gimple_call_fnspec): Require a const gcall *. (gimple_call_arg_flags): Likewise. (gimple_call_return_flags): Likewise. (gimple_set_bb): Add a checked cast. (gimple_copy): Within the cases, add locals of the appropriate subclass and use in place of "stmt" and "copy" for typesafety. (gimple_has_side_effects): Add a checked cast. (gimple_could_trap_p_1): Likewise. (gimple_call_copy_skip_args): Require a gcall *, and return one. (gimple_asm_clobbers_memory_p): Require a const gasm *. (infer_nonnull_range): Replace a check for GIMPLE_RETURN with a dyn_cast, introducing local "return_stmt" and using ti in place of "stmt". * gimple.h (gimple_vec): Eliminate this typedef. (struct gimple_statement_call): Rename to... (struct gcall): ...this. (struct gimple_statement_bind): Rename to... (struct gbind): ...this. (struct gimple_statement_catch): Rename to... (struct gcatch): ...this. (struct gimple_statement_eh_filter): Rename to... (struct geh_filter): ...this. (struct gimple_statement_eh_else): Rename to... (struct geh_else): ...this. (struct gimple_statement_eh_mnt): Rename to... (struct geh_mnt): ...this. (struct gimple_statement_phi): Rename to... (struct gphi): ...this. (struct gimple_statement_resx): Rename to... (struct gresx): ...this. (struct gimple_statement_eh_dispatch): Rename to... (struct geh_dispatch): ...this. (struct gimple_statement_try): Rename to... (struct gtry): ...this. (struct gimple_statement_asm): Rename to... (struct gasm): ...this. (struct gimple_statement_omp_critical): Rename to... (struct gomp_critical): ...this. (struct gimple_statement_omp_for): Rename to... (struct gomp_for): ...this. (struct gimple_statement_omp_parallel): Rename to... (struct gomp_parallel): ...this. (struct gimple_statement_omp_target): Rename to... (struct gomp_target): ...this. (struct gimple_statement_omp_task): Rename to... (struct gomp_task): ...this. (struct gimple_statement_omp_sections): Rename to... (struct gomp_sections): ...this. (struct gimple_statement_omp_continue): Rename to... (struct gomp_continue): ...this. (struct gimple_statement_omp_single): Rename to... (struct gomp_single): ...this. (struct gimple_statement_omp_teams): Rename to... (struct gomp_teams): ...this. (struct gimple_statement_omp_atomic_load): Rename to... (struct gomp_atomic_load): ...this. (struct gimple_statement_omp_atomic_store :): Rename to... (struct gomp_atomic_store :): ...this. (struct gimple_statement_transaction): Rename to... (struct gtransaction): ...this. (struct gcond): New subclass. (struct gdebug): New subclass. (struct ggoto): New subclass. (struct glabel): New subclass. (struct gswitch): New subclass. (struct gassign): New subclass. (struct greturn): New subclass. (is_a_helper <gimple_statement_asm *>::test): Rename to... (is_a_helper <gasm *>::test): ...this. (is_a_helper <gimple_statement_bind *>::test): Rename to... (is_a_helper <gbind *>::test): ...this. (is_a_helper <gassign *>::test): New. (is_a_helper <gimple_statement_call *>::test): Rename to... (is_a_helper <gcall *>::test): ...this. (is_a_helper <gimple_statement_catch *>::test): Rename to... (is_a_helper <gcatch *>::test): ...this. (is_a_helper <gimple_statement_resx *>::test): Rename to... (is_a_helper <gresx *>::test): ...this. (is_a_helper <gcond *>::test): New. (is_a_helper <gdebug *>::test): New. (is_a_helper <ggoto *>::test): New. (is_a_helper <glabel *>::test): New. (is_a_helper <gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <geh_dispatch *>::test): ...this. (is_a_helper <gimple_statement_eh_else *>::test): Rename to... (is_a_helper <geh_else *>::test): ...this. (is_a_helper <gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <geh_filter *>::test): ...this. (is_a_helper <gimple_statement_eh_mnt *>::test): Rename to... (is_a_helper <geh_mnt *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <gomp_atomic_load *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <gomp_atomic_store *>::test): ...this. (is_a_helper <gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <gomp_continue *>::test): ...this. (is_a_helper <gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <gomp_critical *>::test): ...this. (is_a_helper <gimple_statement_omp_for *>::test): Rename to... (is_a_helper <gomp_for *>::test): ...this. (is_a_helper <gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <gomp_parallel *>::test): ...this. (is_a_helper <gimple_statement_omp_target *>::test): Rename to... (is_a_helper <gomp_target *>::test): ...this. (is_a_helper <gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <gomp_sections *>::test): ...this. (is_a_helper <gimple_statement_omp_single *>::test): Rename to... (is_a_helper <gomp_single *>::test): ...this. (is_a_helper <gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <gomp_teams *>::test): ...this. (is_a_helper <gimple_statement_omp_task *>::test): Rename to... (is_a_helper <gomp_task *>::test): ...this. (is_a_helper <gimple_statement_phi *>::test): Rename to... (is_a_helper <gphi *>::test): ...this. (is_a_helper <gimple_statement_transaction *>::test): Rename to... (is_a_helper <gtransaction *>::test): ...this. (is_a_helper <greturn *>::test): New. (is_a_helper <gswitch *>::test): New. (is_a_helper <gimple_statement_try *>::test): Rename to... (is_a_helper <gtry *>::test): ...this. (is_a_helper <const gimple_statement_asm *>::test): Rename to... (is_a_helper <const gasm *>::test): ...this. (is_a_helper <const gimple_statement_bind *>::test): Rename to... (is_a_helper <const gbind *>::test): ...this. (is_a_helper <const gimple_statement_call *>::test): Rename to... (is_a_helper <const gcall *>::test): ...this. (is_a_helper <const gimple_statement_catch *>::test): Rename to... (is_a_helper <const gcatch *>::test): ...this. (is_a_helper <const gimple_statement_resx *>::test): Rename to... (is_a_helper <const gresx *>::test): ...this. (is_a_helper <const gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <const geh_dispatch *>::test): ...this. (is_a_helper <const gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <const geh_filter *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <const gomp_atomic_load *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <const gomp_atomic_store *>::test): ...this. (is_a_helper <const gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <const gomp_continue *>::test): ...this. (is_a_helper <const gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <const gomp_critical *>::test): ...this. (is_a_helper <const gimple_statement_omp_for *>::test): Rename to... (is_a_helper <const gomp_for *>::test): ...this. (is_a_helper <const gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <const gomp_parallel *>::test): ...this. (is_a_helper <const gimple_statement_omp_target *>::test): Rename to... (is_a_helper <const gomp_target *>::test): ...this. (is_a_helper <const gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <const gomp_sections *>::test): ...this. (is_a_helper <const gimple_statement_omp_single *>::test): Rename to... (is_a_helper <const gomp_single *>::test): ...this. (is_a_helper <const gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <const gomp_teams *>::test): ...this. (is_a_helper <const gimple_statement_omp_task *>::test): Rename to... (is_a_helper <const gomp_task *>::test): ...this. (is_a_helper <const gimple_statement_phi *>::test): Rename to... (is_a_helper <const gphi *>::test): ...this. (is_a_helper <const gimple_statement_transaction *>::test): Rename to... (is_a_helper <const gtransaction *>::test): ...this. (gimple_build_return): Strengthen return type to greturn *. (gimple_call_reset_alias_info): Require a gcall *. (gimple_build_call_vec): Return a gcall *. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Return a gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Return a gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Return a glabel *. (gimple_build_goto): Return a ggoto *. (gimple_build_bind): Return a gbind *. (gimple_build_asm_vec): Return a gasm *. (gimple_build_catch): Return a gcatch *. (gimple_build_eh_filter): Return a geh_filter *. (gimple_build_eh_must_not_throw): Return a geh_mnt *. (gimple_build_eh_else): Return a geh_else *. (gimple_build_try): Return a gtry *. (gimple_build_resx): Return a gresx *. (gimple_build_switch_nlabels): Return a gswitch *. (gimple_build_switch): Return a gswitch *. (gimple_build_eh_dispatch): Return a geh_dispatch *. (gimple_build_debug_bind_stat): Return a gdebug *. (gimple_build_debug_source_bind_stat): Return a gdebug *. (gimple_build_omp_critical): Return a gomp_critical *. (gimple_build_omp_for): Return a gomp_for *. (gimple_build_omp_parallel): Return a gomp_parallel *. (gimple_build_omp_task): Return a gomp_task *. (gimple_build_omp_continue): Return a gomp_continue *. (gimple_build_omp_sections): Return a gomp_sections *. (gimple_build_omp_single): Return a gomp_single *. (gimple_build_omp_target): Return a gomp_target *. (gimple_build_omp_teams): Return a gomp_teams *. (gimple_build_omp_atomic_load): Return a gomp_atomic_load *. (gimple_build_omp_atomic_store): Return a gomp_atomic_store *. (gimple_build_transaction): Return a gtransaction *. (gimple_call_arg_flags): Require a const gcall *. (gimple_call_return_flags): Likewise. (gimple_call_copy_skip_args): Require and return a gcall *. (gimple_asm_clobbers_memory_p): Require a const gasm *. (gimple_seq_first_stmt_as_a_bind): New. (gimple_assign_nontemporal_move_p): Require a const gassign * rather than a const_gimple. (gimple_call_internal_fn): Update for renaming to gcall. (gimple_call_fntype): Likewise. (gimple_call_set_fntype): Require a gcall * rather than a gimple. (gimple_call_set_fn): Likewise. (gimple_call_set_internal_fn): Likewise. (gimple_call_set_chain): Likewise. (gimple_call_set_tail): Likewise. (gimple_call_tail_p): Likewise. (gimple_call_set_return_slot_opt): Likewise. (gimple_call_return_slot_opt_p): Likewise. (gimple_call_set_from_thunk): Likewise. (gimple_call_from_thunk_p): Likewise. (gimple_call_set_va_arg_pack): Likewise. (gimple_call_va_arg_pack_p): Likewise. (gimple_call_set_nothrow): Likewise. (gimple_call_nothrow_p): Likewise. (gimple_call_set_alloca_for_var): Likewise. (gimple_call_alloca_for_var_p): Likewise. (gimple_call_use_set): Likewise. (gimple_call_clobber_set): Likewise. (gimple_call_return_type): Require a const gcall * rather than a const_gimple. (gimple_call_chain_ptr): Likewise. (gimple_call_copy_flags): Require a pair of gcall *. (gimple_cond_set_code): Require a gcond * rather than a gimple (gimple_cond_set_lhs): Likewise. (gimple_cond_set_rhs): Likewise. (gimple_cond_set_true_label): Likewise. (gimple_cond_set_false_label): Likewise. (gimple_cond_make_false): Likewise. (gimple_cond_make_true): Likewise. (gimple_cond_lhs_ptr): Require a const gcond * rather than a const_gimple. (gimple_cond_rhs_ptr): Likewise. (gimple_cond_true_label): Likewise. (gimple_cond_false_label): Likewise. (gimple_cond_true_p): Likewise. (gimple_cond_false_p): Likewise. (gimple_cond_set_condition): Likewise. (gimple_label_label): Require a const glabel *. (gimple_label_set_label): Require a glabel *. (gimple_goto_set_dest): Require a ggoto *. (gimple_bind_vars): Require a const gbind *. (gimple_bind_block): Likewise. (gimple_bind_set_vars): Require a gbind *. (gimple_bind_append_vars): Likewise. (gimple_bind_body_ptr): Likewise. (gimple_bind_body): Likewise. (gimple_bind_set_body): Likewise. (gimple_bind_add_stmt): Likewise. (gimple_bind_add_seq): Likewise. (gimple_bind_set_block): Likewise. (gimple_asm_ninputs): Require a const gasm *. (gimple_asm_noutputs): Likewise. (gimple_asm_nclobbers): Likewise. (gimple_asm_nlabels): Likewise. (gimple_asm_input_op): Likewise. (gimple_asm_input_op_ptr): Likewise. (gimple_asm_output_op): Likewise. (gimple_asm_output_op_ptr): Likewise. (gimple_asm_clobber_op): Likewise. (gimple_asm_label_op): Likewise. (gimple_asm_string): Likewise. (gimple_asm_volatile_p): Likewise. (gimple_asm_input_p): Likewise. (gimple_asm_set_input_op): Require a gasm *. (gimple_asm_set_output_op): Likewise. (gimple_asm_set_clobber_op): Likewise. (gimple_asm_set_label_op): Likewise. (gimple_asm_set_volatile): Likewise. (gimple_asm_set_input): Likewise. (gimple_catch_types): Require a const gcatch *. (gimple_catch_types_ptr): Require a gcatch *. (gimple_catch_handler_ptr): Likewise. (gimple_catch_handler): Likewise. (gimple_catch_set_types): Likewise. (gimple_catch_set_handler): Likewise. (gimple_eh_filter_types): Update for renaming of subclass to geh_filter. (gimple_eh_filter_types_ptr): Likewise. (gimple_eh_filter_failure_ptr): Likewise. (gimple_eh_filter_set_types): Require a geh_filter *. (gimple_eh_filter_set_failure): Likewise. (gimple_eh_must_not_throw_fndecl): Require a geh_mnt *. (gimple_eh_must_not_throw_set_fndecl): Likewise. (gimple_eh_else_n_body_ptr): Require a geh_else *. (gimple_eh_else_n_body): Likewise. (gimple_eh_else_e_body_ptr): Likewise. (gimple_eh_else_e_body): Likewise. (gimple_eh_else_set_n_body): Likewise. (gimple_eh_else_set_e_body): Likewise. (gimple_try_set_kind): Require a gtry *. (gimple_try_set_catch_is_cleanup): Likewise. (gimple_try_set_eval): Likewise. (gimple_try_set_cleanup): Likewise. (gimple_try_eval_ptr): Update for renaming of subclass to gtry. (gimple_try_cleanup_ptr): Likewise. (gimple_phi_capacity): Update for renaming of subclass to gphi. (gimple_phi_num_args): Likewise. (gimple_phi_result): Likewise. (gimple_phi_result_ptr): Likewise. (gimple_phi_arg): Likewise. (gimple_phi_set_result): Require a gphi *. (gimple_phi_set_arg): Likewise. (gimple_phi_arg_def_ptr): Likewise. (gimple_phi_arg_edge): Likewise. (gimple_phi_arg_location): Likewise. (gimple_phi_arg_location_from_edge): Likewise. (gimple_phi_arg_set_location): Likewise. (gimple_phi_arg_has_location): Likewise. (gimple_resx_region): Require a const gresx *. (gimple_resx_set_region): Require a gresx *. (gimple_eh_dispatch_region): Require a const geh_dispatch *. (gimple_eh_dispatch_set_region): Require a geh_dispatch *. (gimple_switch_num_labels): Require a const gswitch *. (gimple_switch_set_num_labels): Likewise. (gimple_switch_index): Likewise. (gimple_switch_index_ptr): Likewise. (gimple_switch_label): Likewise. (gimple_switch_default_label): Likewise. (gimple_switch_set_index): Require a gswitch *. (gimple_switch_set_label): Likewise. (gimple_switch_set_default_label): Likewise. (gimple_omp_critical_name): Require a const gomp_critical *. (gimple_omp_critical_name_ptr): Require a gomp_critical *. (gimple_omp_critical_set_name): Likewise. (gimple_omp_for_set_kind): Require a gomp_for *. (gimple_omp_for_set_combined_p): Likewise. (gimple_omp_for_set_combined_into_p): Likewise. (gimple_omp_for_clauses): Update for renaming of subclass to gomp_for. (gimple_omp_for_clauses_ptr): Likewise. (gimple_omp_for_set_clauses): Likewise. (gimple_omp_for_collapse): Likewise. (gimple_omp_for_index): Likewise. (gimple_omp_for_index_ptr): Likewise. (gimple_omp_for_set_index): Likewise. (gimple_omp_for_initial): Likewise. (gimple_omp_for_initial_ptr): Likewise. (gimple_omp_for_set_initial): Likewise. (gimple_omp_for_final): Likewise. (gimple_omp_for_final_ptr): Likewise. (gimple_omp_for_set_final): Likewise. (gimple_omp_for_incr): Likewise. (gimple_omp_for_incr_ptr): Likewise. (gimple_omp_for_set_incr): Likewise. (gimple_omp_for_pre_body): Likewise. (gimple_omp_for_set_pre_body): Likewise. (gimple_omp_parallel_clauses): Update for renaming of subclass to gomp_parallel. (gimple_omp_parallel_clauses_ptr): Require a gomp_parallel *. (gimple_omp_parallel_set_clauses): Likewise. (gimple_omp_parallel_child_fn_ptr): Likewise. (gimple_omp_parallel_set_child_fn): Likewise. (gimple_omp_parallel_data_arg_ptr): Likewise. (gimple_omp_parallel_set_data_arg): Likewise. (gimple_omp_parallel_child_fn): Require a const gomp_parallel *. (gimple_omp_parallel_data_arg): Likewise. (gimple_omp_task_clauses): Update for renaming of subclass to gomp_task. (gimple_omp_task_clauses_ptr): Likewise. (gimple_omp_task_set_clauses): Likewise. (gimple_omp_task_child_fn): Likewise. (gimple_omp_task_child_fn_ptr): Likewise. (gimple_omp_task_set_child_fn): Likewise. (gimple_omp_task_data_arg): Likewise. (gimple_omp_task_data_arg_ptr): Likewise. (gimple_omp_task_set_data_arg): Likewise. (gimple_omp_taskreg_clauses): Whitespace fixes. (gimple_omp_taskreg_clauses_ptr): Likewise. (gimple_omp_taskreg_set_clauses): Likewise. (gimple_omp_taskreg_child_fn): Likewise. (gimple_omp_taskreg_child_fn_ptr): Likewise. (gimple_omp_taskreg_set_child_fn): Likewise. (gimple_omp_taskreg_data_arg): Likewise. (gimple_omp_taskreg_data_arg_ptr): Likewise. (gimple_omp_taskreg_set_data_arg): Likewise. (gimple_omp_task_copy_fn): Update for renaming of subclass to gomp_task. (gimple_omp_task_copy_fn_ptr): Likewise. (gimple_omp_task_set_copy_fn): Likewise. (gimple_omp_task_arg_size): Likewise. (gimple_omp_task_arg_size_ptr): Likewise. (gimple_omp_task_set_arg_size): Likewise. (gimple_omp_task_arg_align): Likewise. (gimple_omp_task_arg_align_ptr): Likewise. (gimple_omp_task_set_arg_align): Likewise. (gimple_omp_single_clauses): Update for renaming of subclass to gomp_single. (gimple_omp_single_clauses_ptr): Likewise. (gimple_omp_single_set_clauses): Likewise. (gimple_omp_target_clauses): Update for renaming of subclass to gomp_target. (gimple_omp_target_clauses_ptr): Likewise. (gimple_omp_target_set_clauses): Require a gomp_target *. (gimple_omp_target_set_kind): Likewise. (gimple_omp_target_child_fn_ptr): Likewise. (gimple_omp_target_set_child_fn): Likewise. (gimple_omp_target_data_arg_ptr): Likewise. (gimple_omp_target_set_data_arg): Likewise. (gimple_omp_target_child_fn): Require a const gomp_target *. (gimple_omp_target_data_arg): Likewise. (gimple_omp_teams_clauses): Update for renaming of subclass to gomp_teams. (gimple_omp_teams_clauses_ptr): Likewise. (gimple_omp_teams_set_clauses): Require a gomp_teams *. (gimple_omp_sections_clauses): Update for renaming of subclass to gomp_sections. (gimple_omp_sections_clauses_ptr): Likewise. (gimple_omp_sections_set_clauses): Likewise. (gimple_omp_sections_control): Likewise. (gimple_omp_sections_control_ptr): Likewise. (gimple_omp_sections_set_control): Likewise. (gimple_omp_for_set_cond): Likewise. (gimple_omp_for_cond): Likewise. (gimple_omp_atomic_store_set_val): Require a gomp_atomic_store *. (gimple_omp_atomic_store_val_ptr): Likewise. (gimple_omp_atomic_load_set_lhs): Likewise. (gimple_omp_atomic_store_val): Require a const gomp_atomic_store *. (gimple_omp_atomic_load_lhs): Likewise. (gimple_omp_atomic_load_rhs): Likewise. (gimple_omp_atomic_load_lhs_ptr): Require a gomp_atomic_load *. (gimple_omp_atomic_load_set_rhs): Likewise. (gimple_omp_atomic_load_rhs_ptr): Likewise. (gimple_omp_continue_control_def): Require a const gomp_continue *. (gimple_omp_continue_control_use): Likewise. (gimple_omp_continue_control_def_ptr): Require a gomp_continue *. (gimple_omp_continue_set_control_def): Likewise. (gimple_omp_continue_control_use_ptr): Likewise. (gimple_omp_continue_set_control_use): Likewise. (gimple_transaction_body_ptr): Require a gtransaction *. (gimple_transaction_body): Likewise. (gimple_transaction_label_ptr): Likewise. (gimple_transaction_label): Require a const gtransaction *. (gimple_transaction_subcode): Likewise. (gimple_transaction_set_body): Require a gtransaction *. (gimple_transaction_set_label): Likewise. (gimple_transaction_set_subcode): Likewise. (gimple_return_retval_ptr): Require a const greturn *. (gimple_return_retval): Likewise. (gimple_return_set_retval): Require a greturn *. (gimple_expr_type): Introduce local "call_stmt" and use in place of "stmt" for typesafety. * asan.c: Use gimple subclasses. * auto-profile.c: Likewise. * builtins.c: Likewise. * builtins.h: Likewise. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * expr.h: Likewise. * gimple-builder.c: Likewise. * gimple-builder.h: Likewise. * gimple-fold.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimple-walk.c: Likewise. * gimplify-me.c: Likewise. * gimplify.c: Likewise. * gimplify.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * internal-fn.c: Likewise. * internal-fn.def:: Likewise. * internal-fn.h: Likewise. * ipa-icf-gimple.c: Likewise. * ipa-icf-gimple.h: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-split.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * omp-low.c: Likewise. * predict.c: Likewise. * sanopt.c: Likewise. * sese.c: Likewise. * ssa-iterators.h: Likewise. * stmt.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfg.h: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chkp.c: Likewise. * tree-chkp.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-eh.c: Likewise. * tree-eh.h: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-into-ssa.h: Likewise. * tree-loop-distribution.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-phinodes.h: Likewise. * tree-predcom.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h * tree-sra.cn_function): * tree-ssa-alias.c: Likewise. * tree-ssa-alias.h: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c * tree-ssa-structalias.c * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadedge.h: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-stdarg.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * ubsan.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * vtable-verify.c: Likewise. gcc/c-family/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * c-gimplify.c (add_block_to_enclosing): Strengthen local "stack" from being just a vec<gimple> to a vec<gbind *>. gcc/java/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * java-gimplify.c (java_gimplify_block): Strengthen local "outer" from gimple to gbind *. From-SVN: r217787
2014-11-19 18:00:54 +01:00
gphi *phi = gpi.phi ();
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
size_t i;
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
int ver;
tree res;
bool saw_copy = false;
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
res = gimple_phi_result (phi);
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
ver = SSA_NAME_VERSION (res);
register_ssa_partition (map, res);
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
/* Register ssa_names and coalesces between the args and the result
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
of all PHI. */
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
for (i = 0; i < gimple_phi_num_args (phi); i++)
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
{
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
edge e = gimple_phi_arg_edge (phi, i);
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
arg = PHI_ARG_DEF (phi, i);
tree.h (SSA_NAME_VAR): Return NULL_TREE if an IDENTIFIER_NODE is recorded as var. 2012-08-10 Richard Guenther <rguenther@suse.de> * tree.h (SSA_NAME_VAR): Return NULL_TREE if an IDENTIFIER_NODE is recorded as var. (SSA_NAME_IDENTIFIER): Return the IDENTIFIER_NODE of the SSA_NAME or its SSA_NAME_VAR. (SET_SSA_NAME_VAR_OR_IDENTIFIER): New setter. * tree-ssanames.c (make_ssa_name_fn): Handle creating anonymous SSA names by passing a type instead of a variable decl. (release_ssa_name): Use SET_SSA_NAME_VAR_OR_IDENTIFIER. (copy_ssa_name_fn): Handle anonymous SSA names. (replace_ssa_name_symbol): Use SET_SSA_NAME_VAR_OR_IDENTIFIER. * tree-flow-inline.h (make_temp_ssa_name): New inline function. * tree-pretty-print.c (dump_generic_node): Use SSA_NAME_IDENTIFIER, dump SSA names without a name as <anon>. * cfgexpand.c (expand_used_vars): Assing anonymous SSA names we are going to expand a decl. (gimple_expand_cfg): Assign all SSA names of a partition the decl we created for its leader. * tree-ssa.c (target_for_debug_bind): Handle SSA_NAMEs. (verify_ssa_name): Handle anonymous SSA names. (verify_def): Likewise. * tree-predcom.c (eliminate_temp_copies): Likewise. * tree-ssa-copyrename.c (copy_rename_partition_coalesce): Likewise. * tree-ssa-live.c (var_map_base_init): Compute conflicts for anonymous SSA names with the same type. (mark_all_vars_used_1): Handle anonymous SSA names. (verify_live_on_entry): Likewise. * tree-ssa-coalesce.c (abnormal_corrupt): Remove. (create_outofssa_var_map): Adjust with respect to conflicts we compute for anonymous SSA names. Do not restrict abnormal coalescing. (coalesce_partitions): Do not restrict abnormal coalescing. Assert we only ever coalesce variables we computed conflicts for. * tree-ssa-ter.c (process_replaceable): Do not restrict TER of anonymous names. * expr.c (expand_expr_real_1): Handle anonymous SSA names expanded from IVOPTs by creating a raw REG here. * tree-cfg.c (replace_ssa_name): Handle anonymous SSA names. (dump_function_to_file): Dump anonymous SSA names alongside with their types in the variable list. (verify_gimple_return): Guard use of SSA_NAME_VAR. * tree-into-ssa.c (mark_for_renaming): Handle a NULL symbol. (rewrite_into_ssa): Make SSA names anonymous. * tree-ssa-structalias.c (alias_get_name): Rewrite. * tree-ssa-uninit.c (ssa_undefined_value_p): Handle anonymous SSA names. (warn_uninitialized_phi): Likewise. * tree-ssa-loop-ivopts.c (prepare_decl_rtl): Defer expanding anonymous SSA names to the expander. (determine_iv_cost): Anonymous SSA names are artificial. * tree-ssa-loop-manip.c (tree_transform_and_unroll_loop): Handle anonymous SSA names. * lto-streamer-out.c (output_ssa_names): Stream SSA_NAME_VAR or if NULL, the type of the SSA name. * tree-inline.c (remap_ssa_name): Handle anonymous SSA names, remap names as anonymous where appropriate. (insert_init_stmt): Pass SSA names down to insert_init_debug_bind. * tree-ssa-uncprop.c (uncprop_into_successor_phis): Adjust according to what we create conflicts for in out-of-SSA coalescing. * tree-parloops.c (separate_decls_in_region_name): Handle anonymous SSA names. (add_field_for_name): Likewise. * tree.c (get_name): Handle SSA names. * tree-ssa-loop-im.c (gen_lsm_tmp_name): Defer to get_name for SSA_NAMEs. * tree-vect-loop-manip.c (adjust_debug_stmts): Use virtual_operand_p. * tree-sra.c (create_access_replacement): Give up generating a DECL_DEBUG_EXPR for SSA names in the memory reference. (replace_removed_params_ssa_names): Guard use of SSA_NAME_VAR. * tree-complex.c (get_component_ssa_name): Handle anonymous SSA names. (set_component_ssa_name): Likewise. * tree-ssa-sccvn.c (visit_reference_op_load): Likewise. * tree-object-size.c (collect_object_sizes_for): Handle uninitialized SSA names properly. * ipa-inline-analysis.c (eliminated_by_inlining_prob): Guard use of SSA_NAME_VAR. * ipa-split.c (test_nonssa_use): Likewise. (consider_split): Likewise. (mark_nonssa_use): Likewise. c-family/ * c-pretty-print.c (pp_c_expression): Handle anonymous SSA names. cp/ * error.c (dump_expr): Likewise. * g++.dg/plugin/selfassign.c: Adjust. * gcc.dg/plugin/selfassign.c: Likewise. * gcc.dg/strlenopt-11.c: Likewise. * gcc.dg/strlenopt-13.c: Likewise. * gcc.dg/no-strict-overflow-4.c: Likewise. * gcc.dg/strict-overflow-4.c: Likewise. * gcc.dg/tree-ssa/alias-11.c: Likewise. * gcc.dg/tree-ssa/alias-6.c: Likewise. * gcc.dg/tree-ssa/asm-3.c: Likewise. * gcc.dg/tree-ssa/pr18908.c: Likewise. * gcc.dg/tree-ssa/pr19431.c: Likewise. * gcc.dg/tree-ssa/ssa-pre-21.c: Likewise. * gcc.dg/tree-ssa/phi-opt-10.c: Likewise. * gcc.dg/tree-ssa/phi-opt-7.c: Likewise. * gcc.dg/tree-ssa/slsr-27.c: Likewise. * gcc.dg/tree-ssa/slsr-28.c: Likewise. * gcc.dg/tree-ssa/slsr-29.c: Likewise. * gcc.dg/pr46309.c: Likewise. * gcc.dg/tree-ssa/loop-5.c: Likewise. From-SVN: r190284
2012-08-10 10:29:29 +02:00
if (TREE_CODE (arg) != SSA_NAME)
continue;
register_ssa_partition (map, arg);
if (gimple_can_coalesce_p (arg, res)
tree.h (SSA_NAME_VAR): Return NULL_TREE if an IDENTIFIER_NODE is recorded as var. 2012-08-10 Richard Guenther <rguenther@suse.de> * tree.h (SSA_NAME_VAR): Return NULL_TREE if an IDENTIFIER_NODE is recorded as var. (SSA_NAME_IDENTIFIER): Return the IDENTIFIER_NODE of the SSA_NAME or its SSA_NAME_VAR. (SET_SSA_NAME_VAR_OR_IDENTIFIER): New setter. * tree-ssanames.c (make_ssa_name_fn): Handle creating anonymous SSA names by passing a type instead of a variable decl. (release_ssa_name): Use SET_SSA_NAME_VAR_OR_IDENTIFIER. (copy_ssa_name_fn): Handle anonymous SSA names. (replace_ssa_name_symbol): Use SET_SSA_NAME_VAR_OR_IDENTIFIER. * tree-flow-inline.h (make_temp_ssa_name): New inline function. * tree-pretty-print.c (dump_generic_node): Use SSA_NAME_IDENTIFIER, dump SSA names without a name as <anon>. * cfgexpand.c (expand_used_vars): Assing anonymous SSA names we are going to expand a decl. (gimple_expand_cfg): Assign all SSA names of a partition the decl we created for its leader. * tree-ssa.c (target_for_debug_bind): Handle SSA_NAMEs. (verify_ssa_name): Handle anonymous SSA names. (verify_def): Likewise. * tree-predcom.c (eliminate_temp_copies): Likewise. * tree-ssa-copyrename.c (copy_rename_partition_coalesce): Likewise. * tree-ssa-live.c (var_map_base_init): Compute conflicts for anonymous SSA names with the same type. (mark_all_vars_used_1): Handle anonymous SSA names. (verify_live_on_entry): Likewise. * tree-ssa-coalesce.c (abnormal_corrupt): Remove. (create_outofssa_var_map): Adjust with respect to conflicts we compute for anonymous SSA names. Do not restrict abnormal coalescing. (coalesce_partitions): Do not restrict abnormal coalescing. Assert we only ever coalesce variables we computed conflicts for. * tree-ssa-ter.c (process_replaceable): Do not restrict TER of anonymous names. * expr.c (expand_expr_real_1): Handle anonymous SSA names expanded from IVOPTs by creating a raw REG here. * tree-cfg.c (replace_ssa_name): Handle anonymous SSA names. (dump_function_to_file): Dump anonymous SSA names alongside with their types in the variable list. (verify_gimple_return): Guard use of SSA_NAME_VAR. * tree-into-ssa.c (mark_for_renaming): Handle a NULL symbol. (rewrite_into_ssa): Make SSA names anonymous. * tree-ssa-structalias.c (alias_get_name): Rewrite. * tree-ssa-uninit.c (ssa_undefined_value_p): Handle anonymous SSA names. (warn_uninitialized_phi): Likewise. * tree-ssa-loop-ivopts.c (prepare_decl_rtl): Defer expanding anonymous SSA names to the expander. (determine_iv_cost): Anonymous SSA names are artificial. * tree-ssa-loop-manip.c (tree_transform_and_unroll_loop): Handle anonymous SSA names. * lto-streamer-out.c (output_ssa_names): Stream SSA_NAME_VAR or if NULL, the type of the SSA name. * tree-inline.c (remap_ssa_name): Handle anonymous SSA names, remap names as anonymous where appropriate. (insert_init_stmt): Pass SSA names down to insert_init_debug_bind. * tree-ssa-uncprop.c (uncprop_into_successor_phis): Adjust according to what we create conflicts for in out-of-SSA coalescing. * tree-parloops.c (separate_decls_in_region_name): Handle anonymous SSA names. (add_field_for_name): Likewise. * tree.c (get_name): Handle SSA names. * tree-ssa-loop-im.c (gen_lsm_tmp_name): Defer to get_name for SSA_NAMEs. * tree-vect-loop-manip.c (adjust_debug_stmts): Use virtual_operand_p. * tree-sra.c (create_access_replacement): Give up generating a DECL_DEBUG_EXPR for SSA names in the memory reference. (replace_removed_params_ssa_names): Guard use of SSA_NAME_VAR. * tree-complex.c (get_component_ssa_name): Handle anonymous SSA names. (set_component_ssa_name): Likewise. * tree-ssa-sccvn.c (visit_reference_op_load): Likewise. * tree-object-size.c (collect_object_sizes_for): Handle uninitialized SSA names properly. * ipa-inline-analysis.c (eliminated_by_inlining_prob): Guard use of SSA_NAME_VAR. * ipa-split.c (test_nonssa_use): Likewise. (consider_split): Likewise. (mark_nonssa_use): Likewise. c-family/ * c-pretty-print.c (pp_c_expression): Handle anonymous SSA names. cp/ * error.c (dump_expr): Likewise. * g++.dg/plugin/selfassign.c: Adjust. * gcc.dg/plugin/selfassign.c: Likewise. * gcc.dg/strlenopt-11.c: Likewise. * gcc.dg/strlenopt-13.c: Likewise. * gcc.dg/no-strict-overflow-4.c: Likewise. * gcc.dg/strict-overflow-4.c: Likewise. * gcc.dg/tree-ssa/alias-11.c: Likewise. * gcc.dg/tree-ssa/alias-6.c: Likewise. * gcc.dg/tree-ssa/asm-3.c: Likewise. * gcc.dg/tree-ssa/pr18908.c: Likewise. * gcc.dg/tree-ssa/pr19431.c: Likewise. * gcc.dg/tree-ssa/ssa-pre-21.c: Likewise. * gcc.dg/tree-ssa/phi-opt-10.c: Likewise. * gcc.dg/tree-ssa/phi-opt-7.c: Likewise. * gcc.dg/tree-ssa/slsr-27.c: Likewise. * gcc.dg/tree-ssa/slsr-28.c: Likewise. * gcc.dg/tree-ssa/slsr-29.c: Likewise. * gcc.dg/pr46309.c: Likewise. * gcc.dg/tree-ssa/loop-5.c: Likewise. From-SVN: r190284
2012-08-10 10:29:29 +02:00
|| (e->flags & EDGE_ABNORMAL))
{
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
saw_copy = true;
bitmap_set_bit (used_in_copy, SSA_NAME_VERSION (arg));
if ((e->flags & EDGE_ABNORMAL) == 0)
{
int cost = coalesce_cost_edge (e);
if (cost == 1 && has_single_use (arg))
tree.h (SSA_NAME_VAR): Return NULL_TREE if an IDENTIFIER_NODE is recorded as var. 2012-08-10 Richard Guenther <rguenther@suse.de> * tree.h (SSA_NAME_VAR): Return NULL_TREE if an IDENTIFIER_NODE is recorded as var. (SSA_NAME_IDENTIFIER): Return the IDENTIFIER_NODE of the SSA_NAME or its SSA_NAME_VAR. (SET_SSA_NAME_VAR_OR_IDENTIFIER): New setter. * tree-ssanames.c (make_ssa_name_fn): Handle creating anonymous SSA names by passing a type instead of a variable decl. (release_ssa_name): Use SET_SSA_NAME_VAR_OR_IDENTIFIER. (copy_ssa_name_fn): Handle anonymous SSA names. (replace_ssa_name_symbol): Use SET_SSA_NAME_VAR_OR_IDENTIFIER. * tree-flow-inline.h (make_temp_ssa_name): New inline function. * tree-pretty-print.c (dump_generic_node): Use SSA_NAME_IDENTIFIER, dump SSA names without a name as <anon>. * cfgexpand.c (expand_used_vars): Assing anonymous SSA names we are going to expand a decl. (gimple_expand_cfg): Assign all SSA names of a partition the decl we created for its leader. * tree-ssa.c (target_for_debug_bind): Handle SSA_NAMEs. (verify_ssa_name): Handle anonymous SSA names. (verify_def): Likewise. * tree-predcom.c (eliminate_temp_copies): Likewise. * tree-ssa-copyrename.c (copy_rename_partition_coalesce): Likewise. * tree-ssa-live.c (var_map_base_init): Compute conflicts for anonymous SSA names with the same type. (mark_all_vars_used_1): Handle anonymous SSA names. (verify_live_on_entry): Likewise. * tree-ssa-coalesce.c (abnormal_corrupt): Remove. (create_outofssa_var_map): Adjust with respect to conflicts we compute for anonymous SSA names. Do not restrict abnormal coalescing. (coalesce_partitions): Do not restrict abnormal coalescing. Assert we only ever coalesce variables we computed conflicts for. * tree-ssa-ter.c (process_replaceable): Do not restrict TER of anonymous names. * expr.c (expand_expr_real_1): Handle anonymous SSA names expanded from IVOPTs by creating a raw REG here. * tree-cfg.c (replace_ssa_name): Handle anonymous SSA names. (dump_function_to_file): Dump anonymous SSA names alongside with their types in the variable list. (verify_gimple_return): Guard use of SSA_NAME_VAR. * tree-into-ssa.c (mark_for_renaming): Handle a NULL symbol. (rewrite_into_ssa): Make SSA names anonymous. * tree-ssa-structalias.c (alias_get_name): Rewrite. * tree-ssa-uninit.c (ssa_undefined_value_p): Handle anonymous SSA names. (warn_uninitialized_phi): Likewise. * tree-ssa-loop-ivopts.c (prepare_decl_rtl): Defer expanding anonymous SSA names to the expander. (determine_iv_cost): Anonymous SSA names are artificial. * tree-ssa-loop-manip.c (tree_transform_and_unroll_loop): Handle anonymous SSA names. * lto-streamer-out.c (output_ssa_names): Stream SSA_NAME_VAR or if NULL, the type of the SSA name. * tree-inline.c (remap_ssa_name): Handle anonymous SSA names, remap names as anonymous where appropriate. (insert_init_stmt): Pass SSA names down to insert_init_debug_bind. * tree-ssa-uncprop.c (uncprop_into_successor_phis): Adjust according to what we create conflicts for in out-of-SSA coalescing. * tree-parloops.c (separate_decls_in_region_name): Handle anonymous SSA names. (add_field_for_name): Likewise. * tree.c (get_name): Handle SSA names. * tree-ssa-loop-im.c (gen_lsm_tmp_name): Defer to get_name for SSA_NAMEs. * tree-vect-loop-manip.c (adjust_debug_stmts): Use virtual_operand_p. * tree-sra.c (create_access_replacement): Give up generating a DECL_DEBUG_EXPR for SSA names in the memory reference. (replace_removed_params_ssa_names): Guard use of SSA_NAME_VAR. * tree-complex.c (get_component_ssa_name): Handle anonymous SSA names. (set_component_ssa_name): Likewise. * tree-ssa-sccvn.c (visit_reference_op_load): Likewise. * tree-object-size.c (collect_object_sizes_for): Handle uninitialized SSA names properly. * ipa-inline-analysis.c (eliminated_by_inlining_prob): Guard use of SSA_NAME_VAR. * ipa-split.c (test_nonssa_use): Likewise. (consider_split): Likewise. (mark_nonssa_use): Likewise. c-family/ * c-pretty-print.c (pp_c_expression): Handle anonymous SSA names. cp/ * error.c (dump_expr): Likewise. * g++.dg/plugin/selfassign.c: Adjust. * gcc.dg/plugin/selfassign.c: Likewise. * gcc.dg/strlenopt-11.c: Likewise. * gcc.dg/strlenopt-13.c: Likewise. * gcc.dg/no-strict-overflow-4.c: Likewise. * gcc.dg/strict-overflow-4.c: Likewise. * gcc.dg/tree-ssa/alias-11.c: Likewise. * gcc.dg/tree-ssa/alias-6.c: Likewise. * gcc.dg/tree-ssa/asm-3.c: Likewise. * gcc.dg/tree-ssa/pr18908.c: Likewise. * gcc.dg/tree-ssa/pr19431.c: Likewise. * gcc.dg/tree-ssa/ssa-pre-21.c: Likewise. * gcc.dg/tree-ssa/phi-opt-10.c: Likewise. * gcc.dg/tree-ssa/phi-opt-7.c: Likewise. * gcc.dg/tree-ssa/slsr-27.c: Likewise. * gcc.dg/tree-ssa/slsr-28.c: Likewise. * gcc.dg/tree-ssa/slsr-29.c: Likewise. * gcc.dg/pr46309.c: Likewise. * gcc.dg/tree-ssa/loop-5.c: Likewise. From-SVN: r190284
2012-08-10 10:29:29 +02:00
add_cost_one_coalesce (cl, ver, SSA_NAME_VERSION (arg));
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
else
add_coalesce (cl, ver, SSA_NAME_VERSION (arg), cost);
}
}
}
if (saw_copy)
bitmap_set_bit (used_in_copy, ver);
}
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
{
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
stmt = gsi_stmt (gsi);
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
invoke.texi (-fvar-tracking-assignments): New. gcc/ChangeLog: * doc/invoke.texi (-fvar-tracking-assignments): New. (-fvar-tracking-assignments-toggle): New. (-fdump-final-insns=file): Mark filename as optional. (--param min-nondebug-insn-uid): New. (-gdwarf-@{version}): Mention version 4. * opts.c (common_handle_option): Accept it. * tree-vrp.c (find_assert_locations_1): Skip debug stmts. * regrename.c (regrename_optimize): Drop last. Don't count debug insns as uses. Don't reject change because of debug insn. (do_replace): Reject DEBUG_INSN as chain starter. Take base_regno from the chain starter, and check for inexact matches in DEBUG_INSNS. (scan_rtx_reg): Accept inexact matches in DEBUG_INSNs. (build_def_use): Simplify and fix the marking of DEBUG_INSNs. * sched-ebb.c (schedule_ebbs): Skip boundary debug insns. * fwprop.c (forward_propagate_and_simplify): ...into debug insns. * doc/gimple.texi (is_gimple_debug): New. (gimple_debug_bind_p): New. (is_gimple_call, gimple_assign_cast_p): End sentence with period. * doc/install.texi (bootstrap-debug): More details. (bootstrap-debug-big, bootstrap-debug-lean): Document. (bootstrap-debug-lib): More details. (bootstrap-debug-ckovw): Update. (bootstrap-time): New. * tree-into-ssa.c (mark_def_sites): Skip debug stmts. (insert_phi_nodes_for): Insert debug stmts. (rewrite_stmt): Take iterator. Insert debug stmts. (rewrite_enter_block): Adjust. (maybe_replace_use_in_debug_stmt): New. (rewrite_update_stmt): Use it. (mark_use_interesting): Return early for debug stmts. * tree-ssa-loop-im.c (rewrite_bittest): Propagate DEFs into debug stmts before replacing stmt. (move_computations_stmt): Likewise. * ira-conflicts.c (add_copies): Skip debug insns. * regstat.c (regstat_init_n_sets_and_refs): Discount debug insns. (regstat_bb_compute_ri): Skip debug insns. * tree-ssa-threadupdate.c (redirection_block_p): Skip debug stmts. * tree-ssa-loop-manip.c (find_uses_to_rename_stmt, check_loop_closed_ssa_stmt): Skip debug stmts. * tree-tailcall.c (find_tail_calls): Likewise. * tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Likewise. * tree.h (MAY_HAVE_DEBUG_STMTS): New. (build_var_debug_value_stat): Declare. (build_var_debug_value): Define. (target_for_debug_bind): Declare. * reload.c (find_equiv_reg): Skip debug insns. * rtlanal.c (reg_used_between_p): Skip debug insns. (side_effects_p): Likewise. (canonicalize_condition): Likewise. * ddg.c (create_ddg_dep_from_intra_loop_link): Check that non-debug insns never depend on debug insns. (create_ddg_dep_no_link): Likewise. (add_cross_iteration_register_deps): Use ANTI_DEP for debug insns. Don't add inter-loop dependencies for debug insns. (build_intra_loop_deps): Likewise. (create_ddg): Count debug insns. * ddg.h (struct ddg::num_debug): New. (num_backargs): Pair up with previous int field. * diagnostic.c (diagnostic_report_diagnostic): Skip notes on -fcompare-debug-second. * final.c (get_attr_length_1): Skip debug insns. (rest_of_clean-state): Don't dump CFA_RESTORE_STATE. * gcc.c (invoke_as): Call compare-debug-dump-opt. (driver_self_specs): Map -fdump-final-insns to -fdump-final-insns=.. (get_local_tick): New. (compare_debug_dump_opt_spec_function): Test for . argument and compute output name. Compute temp output spec without flag name. Compute -frandom-seed. (OPT): Undef after use. * cfgloopanal.c (num_loop_insns): Skip debug insns. (average_num_loop_insns): Likewise. * params.h (MIN_NONDEBUG_INSN_UID): New. * gimple.def (GIMPLE_DEBUG): New. * ipa-reference.c (scan_stmt_for_static_refs): Skip debug stmts. * auto-inc-dec.c (merge_in_block): Skip debug insns. (merge_in_block): Fix whitespace. * toplev.c (flag_var_tracking): Update comment. (flag_var_tracking_assignments): New. (flag_var_tracking_assignments_toggle): New. (process_options): Don't open final insns dump file if we're not going to write to it. Compute defaults for var_tracking. * df-scan.c (df_insn_rescan_debug_internal): New. (df_uses_record): Handle debug insns. * haifa-sched.c (ready): Initialize n_debug. (contributes_to_priority): Skip debug insns. (dep_list_size): New. (priority): Use it. (rank_for_schedule): Likewise. Schedule debug insns as soon as they're ready. Disregard previous debug insns to make decisions. (queue_insn): Never queue debug insns. (ready_add, ready_remove_first, ready_remove): Count debug insns. (schedule_insn): Don't reject debug insns because of issue rate. (get_ebb_head_tail, no_real_insns_p): Skip boundary debug insns. (queue_to_ready): Skip and discount debug insns. (choose_ready): Let debug insns through. (schedule_block): Check boundary debug insns. Discount debug insns, schedule them early. Adjust whitespace. (set_priorities): Check for boundary debug insns. (add_jump_dependencies): Use dep_list_size. (prev_non_location_insn): New. (check_cfg): Use it. * tree-ssa-loop-ivopts.c (find-interesting_users): Skip debug stmts. (remove_unused_ivs): Reset debug stmts. * modulo-sched.c (const_iteration_count): Skip debug insns. (res_MII): Discount debug insns. (loop_single_full_bb_p): Skip debug insns. (sms_schedule): Likewise. (sms_schedule_by_order): Likewise. (ps_has_conflicts): Likewise. * caller-save.c (refmarker_fn): New. (save_call_clobbered_regs): Replace regs with saved mem in debug insns. (mark_referenced_regs): Take pointer, mark and arg. Adjust. Call refmarker_fn mark for hardregnos. (mark_reg_as_referenced): New. (replace_reg_with_saved_mem): New. * ipa-pure-const.c (check_stmt): Skip debug stmts. * cse.c (cse_insn): Canonicalize debug insns. Skip them when searching back. (cse_extended_basic_block): Skip debug insns. (count_reg_usage): Likewise. (is_dead_reg): New, split out of... (set_live_p): ... here. (insn_live_p): Use it for debug insns. * tree-stdarg.c (check_all_va_list_escapes): Skip debug stmts. (execute_optimize_stdarg): Likewise. * tree-ssa-dom.c (propagate_rhs_into_lhs): Likewise. * tree-ssa-propagate.c (substitute_and_fold): Don't regard changes in debug stmts as changes. * sel-sched.c (moving_insn_creates_bookkeeping_block_p): New. (moveup_expr): Don't move across debug insns. Don't move debug insn if it would create a bookkeeping block. (moveup_expr_cached): Don't use cache for debug insns that are heads of blocks. (compute_av_set_inside_bb): Skip debug insns. (sel_rank_for_schedule): Schedule debug insns first. Remove dead code. (block_valid_for_bookkeeping_p); Support lax searches. (create_block_for_bookkeeping): Adjust block numbers when encountering debug-only blocks. (find_place_for_bookkeeping): Deal with debug-only blocks. (generate_bookkeeping_insn): Accept no place to insert. (remove_temp_moveop_nops): New argument full_tidying. (prepare_place_to_insert): Deal with debug insns. (advance_state_on_fence): Debug insns don't start cycles. (update_boundaries): Take fence as argument. Deal with debug insns. (schedule_expr_on_boundary): No full_tidying on debug insns. (fill_insns): Deal with debug insns. (track_scheduled_insns_and_blocks): Don't count debug insns. (need_nop_to_preserve_insn_bb): New, split out of... (remove_insn_from_stream): ... this. (fur_orig_expr_not_found): Skip debug insns. * rtl.def (VALUE): Move up. (DEBUG_INSN): New. * tree-ssa-sink.c (all_immediate_uses_same_place): Skip debug stmts. (nearest_common_dominator_of_uses): Take debug_stmts argument. Set it if debug stmts are found. (statement_sink_location): Skip debug stmts. Propagate moving defs into debug stmts. * ifcvt.c (first_active_insn): Skip debug insns. (last_active_insns): Likewise. (cond_exec_process_insns): Likewise. (noce_process_if_block): Likewise. (check_cond_move_block): Likewise. (cond_move_convert_if_block): Likewise. (block_jumps_and_fallthru_p): Likewise. (dead_or_predicable): Likewise. * dwarf2out.c (debug_str_hash_forced): New. (find_AT_string): Add comment. (gen_label_for_indirect_string): New. (get_debug_string_label): New. (AT_string_form): Use it. (mem_loc_descriptor): Handle non-TLS symbols. Handle MINUS , DIV, MOD, AND, IOR, XOR, NOT, ABS, NEG, and CONST_STRING. Accept but discard COMPARE, IF_THEN_ELSE, ROTATE, ROTATERT, TRUNCATE and several operations that cannot be represented with DWARF opcodes. (loc_descriptor): Ignore SIGN_EXTEND and ZERO_EXTEND. Require dwarf_version 4 for DW_OP_implicit_value and DW_OP_stack_value. (dwarf2out_var_location): Take during-call mark into account. (output_indirect_string): Update comment. Output if there are label and references. (prune_indirect_string): New. (prune_unused_types): Call it if debug_str_hash_forced. More in dwarf2out.c, from Jakub Jelinek <jakub@redhat.com>: (dw_long_long_const): Remove. (struct dw_val_struct): Change val_long_long type to rtx. (print_die, attr_checksum, same_dw_val_p, loc_descriptor): Adjust for val_long_long change to CONST_DOUBLE rtx from a long hi/lo pair. (output_die): Likewise. Use HOST_BITS_PER_WIDE_INT size of each component instead of HOST_BITS_PER_LONG. (output_loc_operands): Likewise. For const8* assert HOST_BITS_PER_WIDE_INT rather than HOST_BITS_PER_LONG is >= 64. (output_loc_operands_raw): For const8* assert HOST_BITS_PER_WIDE_INT rather than HOST_BITS_PER_LONG is >= 64. (add_AT_long_long): Remove val_hi and val_lo arguments, add val_const_double. (size_of_die): Use HOST_BITS_PER_WIDE_INT size multiplier instead of HOST_BITS_PER_LONG for dw_val_class_long_long. (add_const_value_attribute): Adjust add_AT_long_long caller. Don't handle TLS SYMBOL_REFs. If CONST wraps a constant, tail recurse. (dwarf_stack_op_name): Handle DW_OP_implicit_value and DW_OP_stack_value. (size_of_loc_descr, output_loc_operands, output_loc_operands_raw): Handle DW_OP_implicit_value. (extract_int): Move prototype earlier. (mem_loc_descriptor): For SUBREG punt if inner mode size is wider than DWARF2_ADDR_SIZE. Handle SIGN_EXTEND and ZERO_EXTEND by DW_OP_shl and DW_OP_shr{a,}. Handle EQ, NE, GT, GE, LT, LE, GTU, GEU, LTU, LEU, SMIN, SMAX, UMIN, UMAX, SIGN_EXTRACT, ZERO_EXTRACT. (loc_descriptor): Compare mode size with DWARF2_ADDR_SIZE instead of Pmode size. (loc_descriptor): Add MODE argument. Handle CONST_INT, CONST_DOUBLE, CONST_VECTOR, CONST, LABEL_REF and SYMBOL_REF if mode != VOIDmode, attempt to handle other expressions. Don't handle TLS SYMBOL_REFs. (concat_loc_descriptor, concatn_loc_descriptor, loc_descriptor_from_tree_1): Adjust loc_descriptor callers. (add_location_or_const_value_attribute): Likewise. For single location loc_lists attempt to use add_const_value_attribute for constant decls. Add DW_AT_const_value even if NOTE_VAR_LOCATION is VAR_LOCATION with CONSTANT_P or CONST_STRING in its expression. * cfgbuild.c (inside_basic_block_p): Handle debug insns. (control_flow_insn_p): Likewise. * tree-parloops.c (eliminate_local_variables_stmt): Handle debug stmt. (separate_decls_in_region_debug_bind): New. (separate_decls_in_region): Process debug bind stmts afterwards. * recog.c (verify_changes): Handle debug insns. (extract_insn): Likewise. (peephole2_optimize): Skip debug insns. * dse.c (scan_insn): Skip debug insns. * sel-sched-ir.c (return_nop_to_pool): Take full_tidying argument. Pass it on. (setup_id_for_insn): Handle debug insns. (maybe_tidy_empty_bb): Adjust whitespace. (tidy_control_flow): Skip debug insns. (sel_remove_insn): Adjust for debug insns. (sel_estimate_number_of_insns): Skip debug insns. (create_insn_rtx_from_pattern): Handle debug insns. (create_copy_of_insn_rtx): Likewise. * sel-sched-.h (sel_bb_end): Declare. (sel_bb_empty_or_nop_p): New. (get_all_loop_exits): Use it. (_eligible_successor_edge_p): Likewise. (return_nop_to_pool): Adjust. * tree-eh.c (tre_empty_eh_handler_p): Skip debug stmts. * ira-lives.c (process_bb_node_lives): Skip debug insns. * gimple-pretty-print.c (dump_gimple_debug): New. (dump_gimple_stmt): Use it. (dump_bb_header): Skip gimple debug stmts. * regmove.c (optimize_reg_copy_1): Discount debug insns. (fixup_match_2): Likewise. (regmove_backward_pass): Likewise. Simplify combined replacement. Handle debug insns. * function.c (instantiate_virtual_regs): Handle debug insns. * function.h (struct emit_status): Add x_cur_debug_insn_uid. * print-rtl.h: Include cselib.h. (print_rtx): Print VALUEs. Split out and recurse for VAR_LOCATIONs. * df.h (df_inns_rescan_debug_internal): Declare. * gcse.c (alloc_hash_table): Estimate n_insns. (cprop_insn): Don't regard debug insns as changes. (bypass_conditional_jumps): Skip debug insns. (one_pre_gcse_pass): Adjust. (one_code_hoisting_pass): Likewise. (compute_ld_motion_mems): Skip debug insns. (one_cprop_pass): Adjust. * tree-if-conv.c (tree_if_convert_stmt): Reset debug stmts. (if_convertible_stmt_p): Handle debug stmts. * init-regs.c (initialize_uninitialized_regs): Skip debug insns. * tree-vect-loop.c (vect_is_simple_reduction): Skip debug stmts. * ira-build.c (create_bb_allocnos): Skip debug insns. * tree-flow-inline.h (has_zero_uses): Discount debug stmts. (has_single_use): Likewise. (single_imm_use): Likewise. (num_imm_uses): Likewise. * tree-ssa-phiopt.c (empty_block_p): Skip debug stmts. * tree-ssa-coalesce.c (build_ssa_conflict_graph): Skip debug stmts. (create_outofssa_var_map): Likewise. * lower-subreg.c (adjust_decomposed_uses): New. (resolve_debug): New. (decompose_multiword_subregs): Use it. * tree-dfa.c (find_referenced_vars): Skip debug stmts. * emit-rtl.c: Include params.h. (cur_debug_insn_uid): Define. (set_new_first_and_last_insn): Set cur_debug_insn_uid too. (copy_rtx_if_shared_1): Handle debug insns. (reset_used_flags): Likewise. (set_used_flags): LIkewise. (get_max_insn_count): New. (next_nondebug_insn): New. (prev_nondebug_insn): New. (make_debug_insn_raw): New. (emit_insn_before_noloc): Handle debug insns. (emit_jump_insn_before_noloc): Likewise. (emit_call_insn_before_noloc): Likewise. (emit_debug_insn_before_noloc): New. (emit_insn_after_noloc): Handle debug insns. (emit_jump_insn_after_noloc): Likewise. (emit_call_insn_after_noloc): Likewise. (emit_debug_insn_after_noloc): Likewise. (emit_insn_after): Take loc from earlier non-debug insn. (emit_jump_insn_after): Likewise. (emit_call_insn_after): Likewise. (emit_debug_insn_after_setloc): New. (emit_debug_insn_after): New. (emit_insn_before): Take loc from later non-debug insn. (emit_jump_insn_before): Likewise. (emit_call_insn_before): Likewise. (emit_debug_insn_before_setloc): New. (emit_debug_insn_before): New. (emit_insn): Handle debug insns. (emit_debug_insn): New. (emit_jump_insn): Handle debug insns. (emit_call_insn): Likewise. (emit): Likewise. (init_emit): Take min-nondebug-insn-uid into account. Initialize cur_debug_insn_uid. (emit_copy_of_insn_after): Handle debug insns. * cfgexpand.c (gimple_assign_rhs_to_tree): Do not overwrite location of single rhs in place. (maybe_dump_rtl_for_gimple_stmt): Dump lineno. (floor_sdiv_adjust): New. (cell_sdiv_adjust): New. (cell_udiv_adjust): New. (round_sdiv_adjust): New. (round_udiv_adjust): New. (wrap_constant): Moved from cselib. (unwrap_constant): New. (expand_debug_expr): New. (expand_debug_locations): New. (expand_gimple_basic_block): Drop hiding redeclaration. Expand debug bind stmts. (gimple_expand_cfg): Expand debug locations. * cselib.c: Include tree-pass.h. (struct expand_value_data): New. (cselib_record_sets_hook): New. (PRESERVED_VALUE_P, LONG_TERM_PRESERVED_VALUE_P): New. (cselib_clear_table): Move, and implemnet in terms of... (cselib_reset_table_with_next_value): ... this. (cselib_get_next_unknown_value): New. (discard_useless_locs): Don't discard preserved values. (cselib_preserve_value): New. (cselib_preserved_value_p): New. (cselib_preserve_definitely): New. (cselib_clear_preserve): New. (cselib_preserve_only_values): New. (new_cselib_val): Take rtx argument. Dump it in details. (cselib_lookup_mem): Adjust. (expand_loc): Take regs_active in struct. Adjust. Silence dumps unless details are requested. (cselib_expand_value_rtx_cb): New. (cselib_expand_value_rtx): Rename and reimplment in terms of... (cselib_expand_value_rtx_1): ... this. Adjust. Silence dumps without details. Copy more subregs. Try to resolve values using a callback. Wrap constants. (cselib_subst_to_values): Adjust. (cselib_log_lookup): New. (cselib_lookup): Call it. (cselib_invalidate_regno): Don't count preserved values as useless. (cselib_invalidate_mem): Likewise. (cselib_record_set): Likewise. (struct set): Renamed to cselib_set, moved to cselib.h. (cselib_record_sets): Adjust. Call hook. (cselib_process_insn): Reset table when it would be cleared. (dump_cselib_val): New. (dump_cselib_table): New. * tree-cfgcleanup.c (tree_forwarded_block_p): Skip debug stmts. (remove_forwarder_block): Support moving debug stmts. * cselib.h (cselib_record_sets_hook): Declare. (cselib_expand_callback): New type. (cselib_expand_value_rtx_cb): Declare. (cselib_reset_table_with_next_value): Declare. (cselib_get_next_unknown_value): Declare. (cselib_preserve_value): Declare. (cselib_preserved_value_p): Declare. (cselib_preserve_only_values): Declare. (dump_cselib_table): Declare. * cfgcleanup.c (flow_find_cross_jump): Skip debug insns. (try_crossjump_to_edge): Likewise. (delete_unreachable_blocks): Remove dominant GIMPLE blocks after dominated blocks when debug stmts are present. * simplify-rtx.c (delegitimize_mem_from_attrs): New. * tree-ssa-live.c (remove_unused_locals): Skip debug stmts. (set_var_live_on_entry): Likewise. * loop-invariant.c (find_invariants_bb): Skip debug insns. * cfglayout.c (curr_location, last_location): Make static. (set_curr_insn_source_location): Don't avoid bouncing. (get_curr_insn_source_location): New. (get_curr_insn_block): New. (duplicate_insn_chain): Handle debug insns. * tree-ssa-forwprop.c (forward_propagate_addr_expr): Propagate into debug stmts. * common.opt (fcompare-debug): Move to sort order. (fdump-unnumbered-links): Likewise. (fvar-tracking-assignments): New. (fvar-tracking-assignments-toggle): New. * tree-ssa-dce.c (mark_stmt_necessary): Don't mark blocks because of debug stmts. (mark_stmt_if_obviously_necessary): Mark debug stmts. (eliminate_unnecessary_stmts): Walk dominated blocks before dominators. * tree-ssa-ter.c (find_replaceable_in_bb): Skip debug stmts. * ira.c (memref_used_between_p): Skip debug insns. (update_equiv_regs): Likewise. * sched-deps.c (sd_lists_size): Accept empty list. (sd_init_insn): Mark debug insns. (sd_finish_insn): Unmark them. (sd_add_dep): Reject non-debug deps on debug insns. (fixup_sched_groups): Give debug insns group treatment. Skip debug insns. (sched_analyze_reg): Don't mark debug insns for sched before call. (sched_analyze_2): Handle debug insns. (sched_analyze_insn): Compute next non-debug insn. Handle debug insns. (deps_analyze_insn): Handle debug insns. (deps_start_bb): Skip debug insns. (init_deps): Initialize last_debug_insn. * tree-ssa.c (target_for_debug_bind): New. (find_released_ssa_name): New. (propagate_var_def_into_debug_stmts): New. (propagate_defs_into_debug_stmts): New. (verify_ssa): Skip debug bind stmts without values. (warn_uninialized_vars): Skip debug stmts. * target-def.h (TARGET_DELEGITIMIZE_ADDRESS): Set default. * rtl.c (rtx_equal_p_cb): Handle VALUEs. (rtx_equal_p): Likewise. * ira-costs.c (scan_one_insn): Skip debug insns. (process_bb_node_for_hard_reg_moves): Likewise. * rtl.h (DEBUG_INSN_P): New. (NONDEBUG_INSN_P): New. (MAY_HAVE_DEBUG_INSNS): New. (INSN_P): Accept debug insns. (RTX_FRAME_RELATED_P): Likewise. (INSN_DELETED_P): Likewise (PAT_VAR_LOCATION_DECL): New. (PAT_VAR_LOCATION_LOC): New. (PAT_VAR_OCATION_STATUS): New. (NOTE_VAR_LOCATION_DECL): Reimplement. (NOTE_VAR_LOCATION_LOC): Likewise. (NOTE_VAR_LOCATION_STATUS): Likewise. (INSN_VAR_LOCATION): New. (INSN_VAR_LOCATION_DECL): New. (INSN_VAR_LOCATION_LOC): New. (INSN_VAR_LOCATION_STATUS): New. (gen_rtx_UNKNOWN_VAR_LOC): New. (VAR_LOC_UNKNOWN_P): New. (NOTE_DURING_CALL_P): New. (SCHED_GROUP_P): Accept debug insns. (emit_debug_insn_before): Declare. (emit_debug_insn_before_noloc): Declare. (emit_debug_insn_beore_setloc): Declare. (emit_debug_insn_after): Declare. (emit_debug_insn_after_noloc): Declare. (emit_debug_insn_after_setloc): Declare. (emit_debug_insn): Declare. (make_debug_insn_raw): Declare. (prev_nondebug_insn): Declare. (next_nondebug_insn): Declare. (delegitimize_mem_from_attrs): Declare. (get_max_insn_count): Declare. (wrap_constant): Declare. (unwrap_constant): Declare. (get_curr_insn_source_location): Declare. (get_curr_insn_block): Declare. * tree-inline.c (insert_debug_decl_map): New. (processing_debug_stmt): New. (remap_decl): Don't create new mappings in debug stmts. (remap_gimple_op_r): Don't add references in debug stmts. (copy_tree_body_r): Likewise. (remap_gimple_stmt): Handle debug bind stmts. (copy_bb): Skip debug stmts. (copy_edges_for_bb): Likewise. (copy_debug_stmt): New. (copy_debug_stmts): New. (copy_body): Copy debug stmts at the end. (insert_init_debug_bind): New. (insert_init_stmt): Take id. Skip and emit debug stmts. (setup_one_parameter): Remap variable earlier, register debug mapping. (estimate_num_insns): Skip debug stmts. (expand_call_inline): Preserve debug_map. (optimize_inline_calls): Check for no debug_stmts left-overs. (unsave_expr_now): Preserve debug_map. (copy_gimple_seq_and_replace_locals): Likewise. (tree_function_versioning): Check for no debug_stmts left-overs. Init and destroy debug_map as needed. Split edges unconditionally. (build_duplicate_type): Init and destroy debug_map as needed. * tree-inline.h: Include gimple.h instead of pointer-set.h. (struct copy_body_data): Add debug_stmts and debug_map. * sched-int.h (struct ready_list): Add n_debug. (struct deps): Add last_debug_insn. (DEBUG_INSN_SCHED_P): New. (BOUNDARY_DEBUG_INSN_P): New. (SCHEDULE_DEBUG_INSN_P): New. (sd_iterator_cond): Accept empty list. * combine.c (create_log_links): Skip debug insns. (combine_instructions): Likewise. (cleanup_auto_inc_dec): New. From Jakub Jelinek: Make sure the return value is always unshared. (struct rtx_subst_pair): New. (auto_adjust_pair): New. (propagate_for_debug_subst): New. (propagate_for_debug): New. (try_combine): Skip debug insns. Propagate removed defs into debug insns. (next_nonnote_nondebug_insn): New. (distribute_notes): Use it. Skip debug insns. (distribute_links): Skip debug insns. * tree-outof-ssa.c (set_location_for_edge): Likewise. * resource.c (mark_target_live_regs): Likewise. * var-tracking.c: Include cselib.h and target.h. (enum micro_operation_type): Add MO_VAL_USE, MO_VAL_LOC, and MO_VAL_SET. (micro_operation_type_name): New. (enum emit_note_where): Add EMIT_NOTE_AFTER_CALL_INSN. (struct micro_operation_def): Update comments. (decl_or_value): New type. Use instead of decls. (struct emit_note_data_def): Add vars. (struct attrs_def): Use decl_or_value. (struct variable_tracking_info_def): Add permp, flooded. (struct location_chain_def): Update comment. (struct variable_part_def): Use decl_or_value. (struct variable_def): Make var_part a variable length array. (valvar_pool): New. (scratch_regs): New. (cselib_hook_called): New. (dv_is_decl_p): New. (dv_is_value_p): New. (dv_as_decl): New. (dv_as_value): New. (dv_as_opaque): New. (dv_onepart_p): New. (dv_pool): New. (IS_DECL_CODE): New. (check_value_is_not_decl): New. (dv_from_decl): New. (dv_from_value): New. (dv_htab_hash): New. (variable_htab_hash): Use it. (variable_htab_eq): Support values. (variable_htab_free): Free from the right pool. (attrs_list_member, attrs_list_insert): Use decl_or_value. (attrs_list_union): Adjust. (attrs_list_mpdv_union): New. (tie_break_pointers): New. (canon_value_cmp): New. (unshare_variable): Return possibly-modified slot. (vars_copy_1): Adjust. (var_reg_decl_set): Adjust. Split out of... (var_reg_set): ... this. (get_init_value): Adjust. (var_reg_delete_and_set): Adjust. (var_reg_delete): Adjust. (var_regno_delete): Adjust. (var_mem_decl_set): Split out of... (var_mem_set): ... this. (var_mem_delete_and_set): Adjust. (var_mem_delete): Adjust. (val_store): New. (val_reset): New. (val_resolve): New. (variable_union): Adjust. Speed up merge of 1-part vars. (variable_canonicalize): Use unshared slot. (VALUED_RECURSED_INTO): New. (find_loc_in_1pdv): New. (struct dfset_merge): New. (insert_into_intersection): New. (intersect_loc_chains): New. (loc_cmp): New. (canonicalize_loc_order_check): New. (canonicalize_values_mark): New. (canonicalize_values_star): New. (variable_merge_over_cur): New. (variable_merge_over_src): New. (dataflow_set_merge): New. (dataflow_set_equiv_regs): New. (remove_duplicate_values): New. (struct dfset_post_merge): New. (variable_post_merge_new_vals): New. (variable_post_merge_perm_vals): New. (dataflow_post_merge_adjust): New. (find_mem_expr_in_1pdv): New. (dataflow_set_preserve_mem_locs): New. (dataflow_set_remove_mem_locs): New. (dataflow_set_clear_at_call): New. (onepart_variable_different_p): New. (variable_different_p): Use it. (dataflow_set_different_1): Adjust. Make detailed dump more verbose. (track_expr_p): Add need_rtl parameter. Don't generate rtl if not needed. (track_loc_p): Pass it true. (struct count_use_info): New. (find_use_val): New. (replace_expr_with_values): New. (log_op_type): New. (use_type): New, partially split out of... (count_uses): ... this. Count new micro-ops. (count_uses_1): Adjust. (count_stores): Adjust. (count_with_sets): New. (VAL_NEEDS_RESOLUTION): New. (VAL_HOLDS_TRACK_EXPR): New. (VAL_EXPR_IS_COPIED): New. (VAL_EXPR_IS_CLOBBERED): New. (add_uses): Adjust. Generate new micro-ops. (add_uses_1): Adjust. (add_stores): Generate new micro-ops. (add_with_sets): New. (find_src_status): Adjust. (find_src_set_src): Adjust. (compute_bb_dataflow): Use dataflow_set_clear_at_call. Handle new micro-ops. Canonicalize value equivalances. (vt_find_locations): Compute total size of hash tables for dumping. Perform merge for var-tracking-assignments. Don't disregard single-block loops. (dump_attrs_list): Handle decl_or_value. (dump_variable): Take variable. Deal with decl_or_value. (dump_variable_slot): New. (dump_vars): Use it. (dump_dataflow_sets): Adjust. (set_slot_part): New, extended to support one-part variables after splitting out of... (set_variable_part): ... this. (clobber_slot_part): New, split out of... (clobber_variable_part): ... this. (delete_slot_part): New, split out of... (delete_variable_part): .... this. (check_wrap_constant): New. (vt_expand_loc_callback): New. (vt_expand_loc): New. (emit_note_insn_var_location): Adjust. Handle values. Handle EMIT_NOTE_AFTER_CALL_INSN. (emit_notes_for_differences_1): Adjust. Handle values. (emit_notes_for_differences_2): Likewise. (emit_notes_for_differences): Adjust. (emit_notes_in_bb): Take pointer to set. Emit AFTER_CALL_INSN notes. Adjust. Handle new micro-ops. (vt_add_function_parameters): Adjust. Create and bind values. (vt_initialize): Adjust. Initialize scratch_regs and valvar_pool, flooded and perm.. Initialize and use cselib. Log operations. Move some code to count_with_sets and add_with_sets. (delete_debug_insns): New. (vt_debug_insns_local): New. (vt_finalize): Release permp, valvar_pool, scratch_regs. Finish cselib. (var_tracking_main): If var-tracking-assignments is enabled but var-tracking isn't, delete debug insns and leave. Likewise if we exceed limits or fail the stack adjustments tests, and after all var-tracking processing. More in var-tracking, from Jakub Jelinek <jakub@redhat.com>: (dataflow_set): Add traversed_vars. (value_chain, const_value_chain): New typedefs. (value_chain_pool, value_chains): New variables. (value_chain_htab_hash, value_chain_htab_eq, add_value_chain, add_value_chains, add_cselib_value_chains, remove_value_chain, remove_value_chains, remove_cselib_value_chains): New functions. (shared_hash_find_slot_unshare_1, shared_hash_find_slot_1, shared_hash_find_slot_noinsert_1, shared_hash_find_1): New static inlines. (shared_hash_find_slot_unshare, shared_hash_find_slot, shared_hash_find_slot_noinsert, shared_hash_find): Update. (dst_can_be_shared): New variable. (unshare_variable): Unshare set->vars if shared, use shared_hash_*. Clear dst_can_be_shared. If set->traversed_vars is non-NULL and different from set->vars, look up slot again instead of using the passed in slot. (dataflow_set_init): Initialize traversed_vars. (variable_union): Use shared_hash_*. Use initially NO_INSERT lookup if set->vars is shared. Don't keep slot cleared before calling unshare_variable. Unshare set->vars if needed. Adjust unshare_variable callers. Clear dst_can_be_shared if needed. Even ->refcount == 1 vars must be unshared if set->vars is shared and var needs to be modified. (dataflow_set_union): Set traversed_vars during canonicalization. (VALUE_CHANGED, DECL_CHANGED): Define. (set_dv_changed, dv_changed_p): New static inlines. (track_expr_p): Clear DECL_CHANGED. (dump_dataflow_sets): Set it. (variable_was_changed): Call set_dv_changed. (emit_note_insn_var_location): Likewise. (changed_variables_stack): New variable. (check_changed_vars_1, check_changed_vars_2): New functions. (emit_notes_for_changes): Do nothing if changed_variables is empty. Traverse changed_variables with check_changed_vars_1, call check_changed_vars_2 on each changed_variables_stack entry. (emit_notes_in_bb): Add SET argument. Just clear it at the beginning, use it instead of local &set, don't destroy it at the end. (vt_emit_notes): Call dataflow_set_clear early on all VTI(bb)->out sets, never use them, instead use emit_notes_in_bb computed set, dataflow_set_clear also VTI(bb)->in when we are done with the basic block. Initialize changed_variables_stack, free it afterwards. If ENABLE_CHECKING verify that after noting differences to an empty set value_chains hash table is empty. (vt_initialize): Initialize value_chains and value_chain_pool. (vt_finalize): Delete value_chains htab, free value_chain_pool. (variable_tracking_main): Call dump_dataflow_sets before calling vt_emit_notes, not after it. * tree-flow.h (propagate_defs_into_debug_stmts): Declare. (propagate_var_def_into_debug_stmts): Declare. * df-problems.c (df_lr_bb_local_compute): Skip debug insns. (df_set_note): Reject debug insns. (df_whole_mw_reg_dead_p): Take added_notes_p argument. Don't add notes to debug insns. (df_note_bb_compute): Adjust. Likewise. (df_simulate_uses): Skip debug insns. (df_simulate_initialize_backwards): Likewise. * reg-stack.c (subst_stack_regs_in_debug_insn): New. (subst_stack_regs_pat): Reject debug insns. (convert_regs_1): Handle debug insns. * Makefile.in (TREE_INLINE_H): Take pointer-set.h from GIMPLE_H. (print-rtl.o): Depend on cselib.h. (cselib.o): Depend on TREE_PASS_H. (var-tracking.o): Depend on cselib.h and TARGET_H. * sched-rgn.c (rgn_estimate_number_of_insns): Discount debug insns. (init_ready_list): Skip boundary debug insns. (add_branch_dependences): Skip debug insns. (free_block_dependencies): Check for blocks with only debug insns. (compute_priorities): Likewise. * gimple.c (gss_for_code): Handle GIMPLE_DEBUG. (gimple_build_with_ops_stat): Take subcode as unsigned. Adjust all callers. (gimple_build_debug_bind_stat): New. (empty_body_p): Skip debug stmts. (gimple_has_side_effects): Likewise. (gimple_rhs_has_side_effects): Likewise. * gimple.h (enum gimple_debug_subcode, GIMPLE_DEBUG_BIND): New. (gimple_build_debug_bind_stat): Declare. (gimple_build_debug_bind): Define. (is_gimple_debug): New. (gimple_debug_bind_p): New. (gimple_debug_bind_get_var): New. (gimple_debug_bind_get_value): New. (gimple_debug_bind_get_value_ptr): New. (gimple_debug_bind_set_var): New. (gimple_debug_bind_set_value): New. (GIMPLE_DEBUG_BIND_NOVALUE): New internal temporary macro. (gimple_debug_bind_reset_value): New. (gimple_debug_bind_has_value_p): New. (gsi_next_nondebug): New. (gsi_prev_nondebug): New. (gsi_start_nondebug_bb): New. (gsi_last_nondebug_bb): New. * sched-vis.c (print_pattern): Handle VAR_LOCATION. (print_insn): Handle DEBUG_INSN. * tree-cfg.c (remove_bb): Walk stmts backwards. Let loc of first insn prevail. (first_stmt): Skip debug stmts. (first_non_label_stmt): Likewise. (last_stmt): Likewise. (has_zero_uses_1): New. (single_imm_use_1): New. (verify_gimple_debug): New. (verify_types_in_gimple_stmt): Handle debug stmts. (verify_stmt): Likewise. (debug_loop_num): Skip debug stmts. (remove_edge_and_dominated_blocks): Remove dominators last. * tree-ssa-reasssoc.c (rewrite_expr_tree): Propagate into debug stmts. (linearize_expr): Likewise. * config/i386/i386.c (ix86_delegitimize_address): Call default implementation. * config/ia64/ia64.c (ia64_safe_itanium_class): Handle debug insns. (group_barrier_needed): Skip debug insns. (emit_insn_group_barriers): Likewise. (emit_all_insn_group_barriers): Likewise. (ia64_variable_issue): Handle debug insns. (ia64_dfa_new_cycle): Likewise. (final_emit_insn_group_barriers): Skip debug insns. (ia64_dwarf2out_def_steady_cfa): Take frame argument. Don't def cfa without frame. (process_set): Likewise. (process_for_unwind_directive): Pass frame on. * config/rs6000/rs6000.c (TARGET_DELEGITIMIZE_ADDRESS): Define. (rs6000_delegitimize_address): New. (rs6000_debug_adjust_cost): Handle debug insns. (is_microcoded_insn): Likewise. (is_cracked_insn): Likewise. (is_nonpipeline_insn): Likewise. (insn_must_be_first_in_group): Likewise. (insn_must_be_last_in_group): Likewise. (force_new_group): Likewise. * cfgrtl.c (rtl_split_block): Emit INSN_DELETED note if block contains only debug insns. (rtl_merge_blocks): Skip debug insns. (purge_dead_edges): Likewise. (rtl_block_ends_with_call_p): Skip debug insns. * dce.c (deletable_insn_p): Handle VAR_LOCATION. (mark_reg_dependencies): Skip debug insns. * params.def (PARAM_MIN_NONDEBUG_INSN_UID): New. * tree-ssanames.c (release_ssa_name): Propagate def into debug stmts. * tree-ssa-threadedge.c (record_temporary_equivalences_from_stmts): Skip debug stmts. * regcprop.c (replace_oldest_value_addr): Skip debug insns. (replace_oldest_value_mem): Use ALL_REGS for debug insns. (copyprop_hardreg_forward_1): Handle debug insns. * reload1.c (reload): Skip debug insns. Replace unassigned pseudos in debug insns with their equivalences. (eliminate_regs_in_insn): Skip debug insns. (emit_input_reload_insns): Skip debug insns at first, adjust them later. * tree-ssa-operands.c (add_virtual_operand): Reject debug stmts. (get_indirect_ref_operands): Pass opf_no_vops on. (get_expr_operands): Likewise. Skip debug stmts. (parse_ssa_operands): Scan debug insns with opf_no_vops. gcc/testsuite/ChangeLog: * gcc.dg/guality/guality.c: New. * gcc.dg/guality/guality.h: New. * gcc.dg/guality/guality.exp: New. * gcc.dg/guality/example.c: New. * lib/gcc-dg.exp (cleanup-dump): Remove .gk files. (cleanup-saved-temps): Likewise, .gkd files too. gcc/cp/ChangeLog: * cp-tree.h (TFF_NO_OMIT_DEFAULT_TEMPLATE_ARGUMENTS): New. * cp-lang.c (cxx_dwarf_name): Pass it. * error.c (count_non_default_template_args): Take flags as argument. Adjust all callers. Skip counting of default arguments if the new flag is given. ChangeLog: * Makefile.tpl (BUILD_CONFIG): Default to bootstrap-debug. * Makefile.in: Rebuilt. contrib/ChangeLog: * compare-debug: Look for .gkd files and compare them. config/ChangeLog: * bootstrap-debug.mk: Add comments. * bootstrap-debug-big.mk: New. * bootstrap-debug-lean.mk: New. * bootstrap-debug-ckovw.mk: Add comments. * bootstrap-debug-lib.mk: Drop CFLAGS for stages. Use -g0 for TFLAGS in stage1. Drop -fvar-tracking-assignments-toggle. From-SVN: r151312
2009-09-02 04:42:21 +02:00
if (is_gimple_debug (stmt))
continue;
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
/* Register USE and DEF operands in each statement. */
FOR_EACH_SSA_TREE_OPERAND (var, stmt, iter, (SSA_OP_DEF|SSA_OP_USE))
register_ssa_partition (map, var);
/* Check for copy coalesces. */
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
switch (gimple_code (stmt))
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
{
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
case GIMPLE_ASSIGN:
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
{
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
tree lhs = gimple_assign_lhs (stmt);
tree rhs1 = gimple_assign_rhs1 (stmt);
if (gimple_assign_ssa_name_copy_p (stmt)
&& gimple_can_coalesce_p (lhs, rhs1))
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
{
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
v1 = SSA_NAME_VERSION (lhs);
v2 = SSA_NAME_VERSION (rhs1);
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
cost = coalesce_cost_bb (bb);
add_coalesce (cl, v1, v2, cost);
bitmap_set_bit (used_in_copy, v1);
bitmap_set_bit (used_in_copy, v2);
}
}
break;
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
case GIMPLE_ASM:
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
{
Merger of git branch "gimple-classes-v2-option-3" gcc/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * coretypes.h (struct gcond): Add forward decl. (struct gdebug): Likewise. (struct ggoto): Likewise. (struct glabel): Likewise. (struct gswitch): Likewise. (struct gassign): Likewise. (struct gasm): Likewise. (struct gcall): Likewise. (struct gtransaction): Likewise. (struct greturn): Likewise. (struct gbind): Likewise. (struct gcatch): Likewise. (struct geh_filter): Likewise. (struct geh_mnt): Likewise. (struct geh_else): Likewise. (struct gresx): Likewise. (struct geh_dispatch): Likewise. (struct gphi): Likewise. (struct gtry): Likewise. (struct gomp_atomic_load): Likewise. (struct gomp_atomic_store): Likewise. (struct gomp_continue): Likewise. (struct gomp_critical): Likewise. (struct gomp_for): Likewise. (struct gomp_parallel): Likewise. (struct gomp_task): Likewise. (struct gomp_sections): Likewise. (struct gomp_single): Likewise. (struct gomp_target): Likewise. (struct gomp_teams): Likewise. * doc/gimple.texi (Class hierarchy of GIMPLE statements): Update for renaming of gimple subclasses. * gdbhooks.py: Update. * gimple-iterator.c (gsi_for_phi): New. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. * gimple-iterator.h (struct gphi_iterator): New subclass of gimple_stmt_iterator. (gsi_for_phi): New prototype. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. (gsi_next_nonvirtual_phi): Strengthen param from gimple_stmt_iterator * to gphi_iterator *, and local "phi" from gimple to gphi *. * gsstruct.def: Update for renamings of classes. * gimple.c (gimple_build_return): Strengthen return type from gimple to greturn *. (gimple_call_reset_alias_info): Strengthen param to gcall *. (gimple_build_call_1): Strengthen return type from gimple to gcall *. (gimple_build_call_vec): Likewise. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal_1): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Strengthen return type from gimple to gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Strengthen return type from gimple to gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Strengthen return type from gimple to glabel *. (gimple_build_goto): Strengthen return type from gimple to ggoto *. (gimple_build_bind): Strengthen return type from gimple to gbind *. (gimple_build_asm_1): Strengthen return type from gimple to gasm *. (gimple_build_asm_vec): Likewise. (gimple_build_catch): Strengthen return type from gimple to gcatch *. (gimple_build_eh_filter): Strengthen return type from gimple to geh_filter *. (gimple_build_eh_must_not_throw): Strengthen return type from gimple to geh_mnt *. (gimple_build_eh_else): Strengthen return type from gimple to geh_else *. (gimple_build_try): Update for renaming of gimple_statement_try to gtry. (gimple_build_resx): Strengthen return type from gimple to gresx *. (gimple_build_switch_nlabels): Strengthen return type from gimple to gswitch *. (gimple_build_switch): Likewise. (gimple_build_eh_dispatch): Strengthen return type from gimple to geh_dispatch *. (gimple_build_debug_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_debug_source_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_omp_critical): Strengthen return type from gimple to gomp_critical *. (gimple_build_omp_for): Strengthen return type from gimple to gomp_for *. (gimple_build_omp_parallel): Strengthen return type from gimple to gomp_parallel *. (gimple_build_omp_task): Strengthen return type from gimple to gomp_task *. (gimple_build_omp_continue): Strengthen return type from gimple to gomp_continue *. (gimple_build_omp_sections): Strengthen return type from gimple to gomp_sections *. (gimple_build_omp_single): Strengthen return type from gimple to gomp_single *. (gimple_build_omp_target): Strengthen return type from gimple to gomp_target *. (gimple_build_omp_teams): Strengthen return type from gimple to gomp_teams *. (gimple_build_omp_atomic_load): Strengthen return type from gimple to gomp_atomic_load *. (gimple_build_omp_atomic_store): Strengthen return type from gimple to gomp_atomic_store *. (gimple_build_transaction): Strengthen return type from gimple to gtransaction *. (empty_stmt_p): Replace check for GIMPLE_BIND with a dyn_cast. (gimple_call_fnspec): Require a const gcall *. (gimple_call_arg_flags): Likewise. (gimple_call_return_flags): Likewise. (gimple_set_bb): Add a checked cast. (gimple_copy): Within the cases, add locals of the appropriate subclass and use in place of "stmt" and "copy" for typesafety. (gimple_has_side_effects): Add a checked cast. (gimple_could_trap_p_1): Likewise. (gimple_call_copy_skip_args): Require a gcall *, and return one. (gimple_asm_clobbers_memory_p): Require a const gasm *. (infer_nonnull_range): Replace a check for GIMPLE_RETURN with a dyn_cast, introducing local "return_stmt" and using ti in place of "stmt". * gimple.h (gimple_vec): Eliminate this typedef. (struct gimple_statement_call): Rename to... (struct gcall): ...this. (struct gimple_statement_bind): Rename to... (struct gbind): ...this. (struct gimple_statement_catch): Rename to... (struct gcatch): ...this. (struct gimple_statement_eh_filter): Rename to... (struct geh_filter): ...this. (struct gimple_statement_eh_else): Rename to... (struct geh_else): ...this. (struct gimple_statement_eh_mnt): Rename to... (struct geh_mnt): ...this. (struct gimple_statement_phi): Rename to... (struct gphi): ...this. (struct gimple_statement_resx): Rename to... (struct gresx): ...this. (struct gimple_statement_eh_dispatch): Rename to... (struct geh_dispatch): ...this. (struct gimple_statement_try): Rename to... (struct gtry): ...this. (struct gimple_statement_asm): Rename to... (struct gasm): ...this. (struct gimple_statement_omp_critical): Rename to... (struct gomp_critical): ...this. (struct gimple_statement_omp_for): Rename to... (struct gomp_for): ...this. (struct gimple_statement_omp_parallel): Rename to... (struct gomp_parallel): ...this. (struct gimple_statement_omp_target): Rename to... (struct gomp_target): ...this. (struct gimple_statement_omp_task): Rename to... (struct gomp_task): ...this. (struct gimple_statement_omp_sections): Rename to... (struct gomp_sections): ...this. (struct gimple_statement_omp_continue): Rename to... (struct gomp_continue): ...this. (struct gimple_statement_omp_single): Rename to... (struct gomp_single): ...this. (struct gimple_statement_omp_teams): Rename to... (struct gomp_teams): ...this. (struct gimple_statement_omp_atomic_load): Rename to... (struct gomp_atomic_load): ...this. (struct gimple_statement_omp_atomic_store :): Rename to... (struct gomp_atomic_store :): ...this. (struct gimple_statement_transaction): Rename to... (struct gtransaction): ...this. (struct gcond): New subclass. (struct gdebug): New subclass. (struct ggoto): New subclass. (struct glabel): New subclass. (struct gswitch): New subclass. (struct gassign): New subclass. (struct greturn): New subclass. (is_a_helper <gimple_statement_asm *>::test): Rename to... (is_a_helper <gasm *>::test): ...this. (is_a_helper <gimple_statement_bind *>::test): Rename to... (is_a_helper <gbind *>::test): ...this. (is_a_helper <gassign *>::test): New. (is_a_helper <gimple_statement_call *>::test): Rename to... (is_a_helper <gcall *>::test): ...this. (is_a_helper <gimple_statement_catch *>::test): Rename to... (is_a_helper <gcatch *>::test): ...this. (is_a_helper <gimple_statement_resx *>::test): Rename to... (is_a_helper <gresx *>::test): ...this. (is_a_helper <gcond *>::test): New. (is_a_helper <gdebug *>::test): New. (is_a_helper <ggoto *>::test): New. (is_a_helper <glabel *>::test): New. (is_a_helper <gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <geh_dispatch *>::test): ...this. (is_a_helper <gimple_statement_eh_else *>::test): Rename to... (is_a_helper <geh_else *>::test): ...this. (is_a_helper <gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <geh_filter *>::test): ...this. (is_a_helper <gimple_statement_eh_mnt *>::test): Rename to... (is_a_helper <geh_mnt *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <gomp_atomic_load *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <gomp_atomic_store *>::test): ...this. (is_a_helper <gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <gomp_continue *>::test): ...this. (is_a_helper <gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <gomp_critical *>::test): ...this. (is_a_helper <gimple_statement_omp_for *>::test): Rename to... (is_a_helper <gomp_for *>::test): ...this. (is_a_helper <gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <gomp_parallel *>::test): ...this. (is_a_helper <gimple_statement_omp_target *>::test): Rename to... (is_a_helper <gomp_target *>::test): ...this. (is_a_helper <gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <gomp_sections *>::test): ...this. (is_a_helper <gimple_statement_omp_single *>::test): Rename to... (is_a_helper <gomp_single *>::test): ...this. (is_a_helper <gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <gomp_teams *>::test): ...this. (is_a_helper <gimple_statement_omp_task *>::test): Rename to... (is_a_helper <gomp_task *>::test): ...this. (is_a_helper <gimple_statement_phi *>::test): Rename to... (is_a_helper <gphi *>::test): ...this. (is_a_helper <gimple_statement_transaction *>::test): Rename to... (is_a_helper <gtransaction *>::test): ...this. (is_a_helper <greturn *>::test): New. (is_a_helper <gswitch *>::test): New. (is_a_helper <gimple_statement_try *>::test): Rename to... (is_a_helper <gtry *>::test): ...this. (is_a_helper <const gimple_statement_asm *>::test): Rename to... (is_a_helper <const gasm *>::test): ...this. (is_a_helper <const gimple_statement_bind *>::test): Rename to... (is_a_helper <const gbind *>::test): ...this. (is_a_helper <const gimple_statement_call *>::test): Rename to... (is_a_helper <const gcall *>::test): ...this. (is_a_helper <const gimple_statement_catch *>::test): Rename to... (is_a_helper <const gcatch *>::test): ...this. (is_a_helper <const gimple_statement_resx *>::test): Rename to... (is_a_helper <const gresx *>::test): ...this. (is_a_helper <const gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <const geh_dispatch *>::test): ...this. (is_a_helper <const gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <const geh_filter *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <const gomp_atomic_load *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <const gomp_atomic_store *>::test): ...this. (is_a_helper <const gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <const gomp_continue *>::test): ...this. (is_a_helper <const gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <const gomp_critical *>::test): ...this. (is_a_helper <const gimple_statement_omp_for *>::test): Rename to... (is_a_helper <const gomp_for *>::test): ...this. (is_a_helper <const gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <const gomp_parallel *>::test): ...this. (is_a_helper <const gimple_statement_omp_target *>::test): Rename to... (is_a_helper <const gomp_target *>::test): ...this. (is_a_helper <const gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <const gomp_sections *>::test): ...this. (is_a_helper <const gimple_statement_omp_single *>::test): Rename to... (is_a_helper <const gomp_single *>::test): ...this. (is_a_helper <const gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <const gomp_teams *>::test): ...this. (is_a_helper <const gimple_statement_omp_task *>::test): Rename to... (is_a_helper <const gomp_task *>::test): ...this. (is_a_helper <const gimple_statement_phi *>::test): Rename to... (is_a_helper <const gphi *>::test): ...this. (is_a_helper <const gimple_statement_transaction *>::test): Rename to... (is_a_helper <const gtransaction *>::test): ...this. (gimple_build_return): Strengthen return type to greturn *. (gimple_call_reset_alias_info): Require a gcall *. (gimple_build_call_vec): Return a gcall *. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Return a gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Return a gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Return a glabel *. (gimple_build_goto): Return a ggoto *. (gimple_build_bind): Return a gbind *. (gimple_build_asm_vec): Return a gasm *. (gimple_build_catch): Return a gcatch *. (gimple_build_eh_filter): Return a geh_filter *. (gimple_build_eh_must_not_throw): Return a geh_mnt *. (gimple_build_eh_else): Return a geh_else *. (gimple_build_try): Return a gtry *. (gimple_build_resx): Return a gresx *. (gimple_build_switch_nlabels): Return a gswitch *. (gimple_build_switch): Return a gswitch *. (gimple_build_eh_dispatch): Return a geh_dispatch *. (gimple_build_debug_bind_stat): Return a gdebug *. (gimple_build_debug_source_bind_stat): Return a gdebug *. (gimple_build_omp_critical): Return a gomp_critical *. (gimple_build_omp_for): Return a gomp_for *. (gimple_build_omp_parallel): Return a gomp_parallel *. (gimple_build_omp_task): Return a gomp_task *. (gimple_build_omp_continue): Return a gomp_continue *. (gimple_build_omp_sections): Return a gomp_sections *. (gimple_build_omp_single): Return a gomp_single *. (gimple_build_omp_target): Return a gomp_target *. (gimple_build_omp_teams): Return a gomp_teams *. (gimple_build_omp_atomic_load): Return a gomp_atomic_load *. (gimple_build_omp_atomic_store): Return a gomp_atomic_store *. (gimple_build_transaction): Return a gtransaction *. (gimple_call_arg_flags): Require a const gcall *. (gimple_call_return_flags): Likewise. (gimple_call_copy_skip_args): Require and return a gcall *. (gimple_asm_clobbers_memory_p): Require a const gasm *. (gimple_seq_first_stmt_as_a_bind): New. (gimple_assign_nontemporal_move_p): Require a const gassign * rather than a const_gimple. (gimple_call_internal_fn): Update for renaming to gcall. (gimple_call_fntype): Likewise. (gimple_call_set_fntype): Require a gcall * rather than a gimple. (gimple_call_set_fn): Likewise. (gimple_call_set_internal_fn): Likewise. (gimple_call_set_chain): Likewise. (gimple_call_set_tail): Likewise. (gimple_call_tail_p): Likewise. (gimple_call_set_return_slot_opt): Likewise. (gimple_call_return_slot_opt_p): Likewise. (gimple_call_set_from_thunk): Likewise. (gimple_call_from_thunk_p): Likewise. (gimple_call_set_va_arg_pack): Likewise. (gimple_call_va_arg_pack_p): Likewise. (gimple_call_set_nothrow): Likewise. (gimple_call_nothrow_p): Likewise. (gimple_call_set_alloca_for_var): Likewise. (gimple_call_alloca_for_var_p): Likewise. (gimple_call_use_set): Likewise. (gimple_call_clobber_set): Likewise. (gimple_call_return_type): Require a const gcall * rather than a const_gimple. (gimple_call_chain_ptr): Likewise. (gimple_call_copy_flags): Require a pair of gcall *. (gimple_cond_set_code): Require a gcond * rather than a gimple (gimple_cond_set_lhs): Likewise. (gimple_cond_set_rhs): Likewise. (gimple_cond_set_true_label): Likewise. (gimple_cond_set_false_label): Likewise. (gimple_cond_make_false): Likewise. (gimple_cond_make_true): Likewise. (gimple_cond_lhs_ptr): Require a const gcond * rather than a const_gimple. (gimple_cond_rhs_ptr): Likewise. (gimple_cond_true_label): Likewise. (gimple_cond_false_label): Likewise. (gimple_cond_true_p): Likewise. (gimple_cond_false_p): Likewise. (gimple_cond_set_condition): Likewise. (gimple_label_label): Require a const glabel *. (gimple_label_set_label): Require a glabel *. (gimple_goto_set_dest): Require a ggoto *. (gimple_bind_vars): Require a const gbind *. (gimple_bind_block): Likewise. (gimple_bind_set_vars): Require a gbind *. (gimple_bind_append_vars): Likewise. (gimple_bind_body_ptr): Likewise. (gimple_bind_body): Likewise. (gimple_bind_set_body): Likewise. (gimple_bind_add_stmt): Likewise. (gimple_bind_add_seq): Likewise. (gimple_bind_set_block): Likewise. (gimple_asm_ninputs): Require a const gasm *. (gimple_asm_noutputs): Likewise. (gimple_asm_nclobbers): Likewise. (gimple_asm_nlabels): Likewise. (gimple_asm_input_op): Likewise. (gimple_asm_input_op_ptr): Likewise. (gimple_asm_output_op): Likewise. (gimple_asm_output_op_ptr): Likewise. (gimple_asm_clobber_op): Likewise. (gimple_asm_label_op): Likewise. (gimple_asm_string): Likewise. (gimple_asm_volatile_p): Likewise. (gimple_asm_input_p): Likewise. (gimple_asm_set_input_op): Require a gasm *. (gimple_asm_set_output_op): Likewise. (gimple_asm_set_clobber_op): Likewise. (gimple_asm_set_label_op): Likewise. (gimple_asm_set_volatile): Likewise. (gimple_asm_set_input): Likewise. (gimple_catch_types): Require a const gcatch *. (gimple_catch_types_ptr): Require a gcatch *. (gimple_catch_handler_ptr): Likewise. (gimple_catch_handler): Likewise. (gimple_catch_set_types): Likewise. (gimple_catch_set_handler): Likewise. (gimple_eh_filter_types): Update for renaming of subclass to geh_filter. (gimple_eh_filter_types_ptr): Likewise. (gimple_eh_filter_failure_ptr): Likewise. (gimple_eh_filter_set_types): Require a geh_filter *. (gimple_eh_filter_set_failure): Likewise. (gimple_eh_must_not_throw_fndecl): Require a geh_mnt *. (gimple_eh_must_not_throw_set_fndecl): Likewise. (gimple_eh_else_n_body_ptr): Require a geh_else *. (gimple_eh_else_n_body): Likewise. (gimple_eh_else_e_body_ptr): Likewise. (gimple_eh_else_e_body): Likewise. (gimple_eh_else_set_n_body): Likewise. (gimple_eh_else_set_e_body): Likewise. (gimple_try_set_kind): Require a gtry *. (gimple_try_set_catch_is_cleanup): Likewise. (gimple_try_set_eval): Likewise. (gimple_try_set_cleanup): Likewise. (gimple_try_eval_ptr): Update for renaming of subclass to gtry. (gimple_try_cleanup_ptr): Likewise. (gimple_phi_capacity): Update for renaming of subclass to gphi. (gimple_phi_num_args): Likewise. (gimple_phi_result): Likewise. (gimple_phi_result_ptr): Likewise. (gimple_phi_arg): Likewise. (gimple_phi_set_result): Require a gphi *. (gimple_phi_set_arg): Likewise. (gimple_phi_arg_def_ptr): Likewise. (gimple_phi_arg_edge): Likewise. (gimple_phi_arg_location): Likewise. (gimple_phi_arg_location_from_edge): Likewise. (gimple_phi_arg_set_location): Likewise. (gimple_phi_arg_has_location): Likewise. (gimple_resx_region): Require a const gresx *. (gimple_resx_set_region): Require a gresx *. (gimple_eh_dispatch_region): Require a const geh_dispatch *. (gimple_eh_dispatch_set_region): Require a geh_dispatch *. (gimple_switch_num_labels): Require a const gswitch *. (gimple_switch_set_num_labels): Likewise. (gimple_switch_index): Likewise. (gimple_switch_index_ptr): Likewise. (gimple_switch_label): Likewise. (gimple_switch_default_label): Likewise. (gimple_switch_set_index): Require a gswitch *. (gimple_switch_set_label): Likewise. (gimple_switch_set_default_label): Likewise. (gimple_omp_critical_name): Require a const gomp_critical *. (gimple_omp_critical_name_ptr): Require a gomp_critical *. (gimple_omp_critical_set_name): Likewise. (gimple_omp_for_set_kind): Require a gomp_for *. (gimple_omp_for_set_combined_p): Likewise. (gimple_omp_for_set_combined_into_p): Likewise. (gimple_omp_for_clauses): Update for renaming of subclass to gomp_for. (gimple_omp_for_clauses_ptr): Likewise. (gimple_omp_for_set_clauses): Likewise. (gimple_omp_for_collapse): Likewise. (gimple_omp_for_index): Likewise. (gimple_omp_for_index_ptr): Likewise. (gimple_omp_for_set_index): Likewise. (gimple_omp_for_initial): Likewise. (gimple_omp_for_initial_ptr): Likewise. (gimple_omp_for_set_initial): Likewise. (gimple_omp_for_final): Likewise. (gimple_omp_for_final_ptr): Likewise. (gimple_omp_for_set_final): Likewise. (gimple_omp_for_incr): Likewise. (gimple_omp_for_incr_ptr): Likewise. (gimple_omp_for_set_incr): Likewise. (gimple_omp_for_pre_body): Likewise. (gimple_omp_for_set_pre_body): Likewise. (gimple_omp_parallel_clauses): Update for renaming of subclass to gomp_parallel. (gimple_omp_parallel_clauses_ptr): Require a gomp_parallel *. (gimple_omp_parallel_set_clauses): Likewise. (gimple_omp_parallel_child_fn_ptr): Likewise. (gimple_omp_parallel_set_child_fn): Likewise. (gimple_omp_parallel_data_arg_ptr): Likewise. (gimple_omp_parallel_set_data_arg): Likewise. (gimple_omp_parallel_child_fn): Require a const gomp_parallel *. (gimple_omp_parallel_data_arg): Likewise. (gimple_omp_task_clauses): Update for renaming of subclass to gomp_task. (gimple_omp_task_clauses_ptr): Likewise. (gimple_omp_task_set_clauses): Likewise. (gimple_omp_task_child_fn): Likewise. (gimple_omp_task_child_fn_ptr): Likewise. (gimple_omp_task_set_child_fn): Likewise. (gimple_omp_task_data_arg): Likewise. (gimple_omp_task_data_arg_ptr): Likewise. (gimple_omp_task_set_data_arg): Likewise. (gimple_omp_taskreg_clauses): Whitespace fixes. (gimple_omp_taskreg_clauses_ptr): Likewise. (gimple_omp_taskreg_set_clauses): Likewise. (gimple_omp_taskreg_child_fn): Likewise. (gimple_omp_taskreg_child_fn_ptr): Likewise. (gimple_omp_taskreg_set_child_fn): Likewise. (gimple_omp_taskreg_data_arg): Likewise. (gimple_omp_taskreg_data_arg_ptr): Likewise. (gimple_omp_taskreg_set_data_arg): Likewise. (gimple_omp_task_copy_fn): Update for renaming of subclass to gomp_task. (gimple_omp_task_copy_fn_ptr): Likewise. (gimple_omp_task_set_copy_fn): Likewise. (gimple_omp_task_arg_size): Likewise. (gimple_omp_task_arg_size_ptr): Likewise. (gimple_omp_task_set_arg_size): Likewise. (gimple_omp_task_arg_align): Likewise. (gimple_omp_task_arg_align_ptr): Likewise. (gimple_omp_task_set_arg_align): Likewise. (gimple_omp_single_clauses): Update for renaming of subclass to gomp_single. (gimple_omp_single_clauses_ptr): Likewise. (gimple_omp_single_set_clauses): Likewise. (gimple_omp_target_clauses): Update for renaming of subclass to gomp_target. (gimple_omp_target_clauses_ptr): Likewise. (gimple_omp_target_set_clauses): Require a gomp_target *. (gimple_omp_target_set_kind): Likewise. (gimple_omp_target_child_fn_ptr): Likewise. (gimple_omp_target_set_child_fn): Likewise. (gimple_omp_target_data_arg_ptr): Likewise. (gimple_omp_target_set_data_arg): Likewise. (gimple_omp_target_child_fn): Require a const gomp_target *. (gimple_omp_target_data_arg): Likewise. (gimple_omp_teams_clauses): Update for renaming of subclass to gomp_teams. (gimple_omp_teams_clauses_ptr): Likewise. (gimple_omp_teams_set_clauses): Require a gomp_teams *. (gimple_omp_sections_clauses): Update for renaming of subclass to gomp_sections. (gimple_omp_sections_clauses_ptr): Likewise. (gimple_omp_sections_set_clauses): Likewise. (gimple_omp_sections_control): Likewise. (gimple_omp_sections_control_ptr): Likewise. (gimple_omp_sections_set_control): Likewise. (gimple_omp_for_set_cond): Likewise. (gimple_omp_for_cond): Likewise. (gimple_omp_atomic_store_set_val): Require a gomp_atomic_store *. (gimple_omp_atomic_store_val_ptr): Likewise. (gimple_omp_atomic_load_set_lhs): Likewise. (gimple_omp_atomic_store_val): Require a const gomp_atomic_store *. (gimple_omp_atomic_load_lhs): Likewise. (gimple_omp_atomic_load_rhs): Likewise. (gimple_omp_atomic_load_lhs_ptr): Require a gomp_atomic_load *. (gimple_omp_atomic_load_set_rhs): Likewise. (gimple_omp_atomic_load_rhs_ptr): Likewise. (gimple_omp_continue_control_def): Require a const gomp_continue *. (gimple_omp_continue_control_use): Likewise. (gimple_omp_continue_control_def_ptr): Require a gomp_continue *. (gimple_omp_continue_set_control_def): Likewise. (gimple_omp_continue_control_use_ptr): Likewise. (gimple_omp_continue_set_control_use): Likewise. (gimple_transaction_body_ptr): Require a gtransaction *. (gimple_transaction_body): Likewise. (gimple_transaction_label_ptr): Likewise. (gimple_transaction_label): Require a const gtransaction *. (gimple_transaction_subcode): Likewise. (gimple_transaction_set_body): Require a gtransaction *. (gimple_transaction_set_label): Likewise. (gimple_transaction_set_subcode): Likewise. (gimple_return_retval_ptr): Require a const greturn *. (gimple_return_retval): Likewise. (gimple_return_set_retval): Require a greturn *. (gimple_expr_type): Introduce local "call_stmt" and use in place of "stmt" for typesafety. * asan.c: Use gimple subclasses. * auto-profile.c: Likewise. * builtins.c: Likewise. * builtins.h: Likewise. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * expr.h: Likewise. * gimple-builder.c: Likewise. * gimple-builder.h: Likewise. * gimple-fold.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimple-walk.c: Likewise. * gimplify-me.c: Likewise. * gimplify.c: Likewise. * gimplify.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * internal-fn.c: Likewise. * internal-fn.def:: Likewise. * internal-fn.h: Likewise. * ipa-icf-gimple.c: Likewise. * ipa-icf-gimple.h: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-split.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * omp-low.c: Likewise. * predict.c: Likewise. * sanopt.c: Likewise. * sese.c: Likewise. * ssa-iterators.h: Likewise. * stmt.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfg.h: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chkp.c: Likewise. * tree-chkp.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-eh.c: Likewise. * tree-eh.h: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-into-ssa.h: Likewise. * tree-loop-distribution.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-phinodes.h: Likewise. * tree-predcom.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h * tree-sra.cn_function): * tree-ssa-alias.c: Likewise. * tree-ssa-alias.h: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c * tree-ssa-structalias.c * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadedge.h: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-stdarg.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * ubsan.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * vtable-verify.c: Likewise. gcc/c-family/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * c-gimplify.c (add_block_to_enclosing): Strengthen local "stack" from being just a vec<gimple> to a vec<gbind *>. gcc/java/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * java-gimplify.c (java_gimplify_block): Strengthen local "outer" from gimple to gbind *. From-SVN: r217787
2014-11-19 18:00:54 +01:00
gasm *asm_stmt = as_a <gasm *> (stmt);
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
unsigned long noutputs, i;
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
unsigned long ninputs;
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
tree *outputs, link;
Merger of git branch "gimple-classes-v2-option-3" gcc/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * coretypes.h (struct gcond): Add forward decl. (struct gdebug): Likewise. (struct ggoto): Likewise. (struct glabel): Likewise. (struct gswitch): Likewise. (struct gassign): Likewise. (struct gasm): Likewise. (struct gcall): Likewise. (struct gtransaction): Likewise. (struct greturn): Likewise. (struct gbind): Likewise. (struct gcatch): Likewise. (struct geh_filter): Likewise. (struct geh_mnt): Likewise. (struct geh_else): Likewise. (struct gresx): Likewise. (struct geh_dispatch): Likewise. (struct gphi): Likewise. (struct gtry): Likewise. (struct gomp_atomic_load): Likewise. (struct gomp_atomic_store): Likewise. (struct gomp_continue): Likewise. (struct gomp_critical): Likewise. (struct gomp_for): Likewise. (struct gomp_parallel): Likewise. (struct gomp_task): Likewise. (struct gomp_sections): Likewise. (struct gomp_single): Likewise. (struct gomp_target): Likewise. (struct gomp_teams): Likewise. * doc/gimple.texi (Class hierarchy of GIMPLE statements): Update for renaming of gimple subclasses. * gdbhooks.py: Update. * gimple-iterator.c (gsi_for_phi): New. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. * gimple-iterator.h (struct gphi_iterator): New subclass of gimple_stmt_iterator. (gsi_for_phi): New prototype. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. (gsi_next_nonvirtual_phi): Strengthen param from gimple_stmt_iterator * to gphi_iterator *, and local "phi" from gimple to gphi *. * gsstruct.def: Update for renamings of classes. * gimple.c (gimple_build_return): Strengthen return type from gimple to greturn *. (gimple_call_reset_alias_info): Strengthen param to gcall *. (gimple_build_call_1): Strengthen return type from gimple to gcall *. (gimple_build_call_vec): Likewise. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal_1): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Strengthen return type from gimple to gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Strengthen return type from gimple to gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Strengthen return type from gimple to glabel *. (gimple_build_goto): Strengthen return type from gimple to ggoto *. (gimple_build_bind): Strengthen return type from gimple to gbind *. (gimple_build_asm_1): Strengthen return type from gimple to gasm *. (gimple_build_asm_vec): Likewise. (gimple_build_catch): Strengthen return type from gimple to gcatch *. (gimple_build_eh_filter): Strengthen return type from gimple to geh_filter *. (gimple_build_eh_must_not_throw): Strengthen return type from gimple to geh_mnt *. (gimple_build_eh_else): Strengthen return type from gimple to geh_else *. (gimple_build_try): Update for renaming of gimple_statement_try to gtry. (gimple_build_resx): Strengthen return type from gimple to gresx *. (gimple_build_switch_nlabels): Strengthen return type from gimple to gswitch *. (gimple_build_switch): Likewise. (gimple_build_eh_dispatch): Strengthen return type from gimple to geh_dispatch *. (gimple_build_debug_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_debug_source_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_omp_critical): Strengthen return type from gimple to gomp_critical *. (gimple_build_omp_for): Strengthen return type from gimple to gomp_for *. (gimple_build_omp_parallel): Strengthen return type from gimple to gomp_parallel *. (gimple_build_omp_task): Strengthen return type from gimple to gomp_task *. (gimple_build_omp_continue): Strengthen return type from gimple to gomp_continue *. (gimple_build_omp_sections): Strengthen return type from gimple to gomp_sections *. (gimple_build_omp_single): Strengthen return type from gimple to gomp_single *. (gimple_build_omp_target): Strengthen return type from gimple to gomp_target *. (gimple_build_omp_teams): Strengthen return type from gimple to gomp_teams *. (gimple_build_omp_atomic_load): Strengthen return type from gimple to gomp_atomic_load *. (gimple_build_omp_atomic_store): Strengthen return type from gimple to gomp_atomic_store *. (gimple_build_transaction): Strengthen return type from gimple to gtransaction *. (empty_stmt_p): Replace check for GIMPLE_BIND with a dyn_cast. (gimple_call_fnspec): Require a const gcall *. (gimple_call_arg_flags): Likewise. (gimple_call_return_flags): Likewise. (gimple_set_bb): Add a checked cast. (gimple_copy): Within the cases, add locals of the appropriate subclass and use in place of "stmt" and "copy" for typesafety. (gimple_has_side_effects): Add a checked cast. (gimple_could_trap_p_1): Likewise. (gimple_call_copy_skip_args): Require a gcall *, and return one. (gimple_asm_clobbers_memory_p): Require a const gasm *. (infer_nonnull_range): Replace a check for GIMPLE_RETURN with a dyn_cast, introducing local "return_stmt" and using ti in place of "stmt". * gimple.h (gimple_vec): Eliminate this typedef. (struct gimple_statement_call): Rename to... (struct gcall): ...this. (struct gimple_statement_bind): Rename to... (struct gbind): ...this. (struct gimple_statement_catch): Rename to... (struct gcatch): ...this. (struct gimple_statement_eh_filter): Rename to... (struct geh_filter): ...this. (struct gimple_statement_eh_else): Rename to... (struct geh_else): ...this. (struct gimple_statement_eh_mnt): Rename to... (struct geh_mnt): ...this. (struct gimple_statement_phi): Rename to... (struct gphi): ...this. (struct gimple_statement_resx): Rename to... (struct gresx): ...this. (struct gimple_statement_eh_dispatch): Rename to... (struct geh_dispatch): ...this. (struct gimple_statement_try): Rename to... (struct gtry): ...this. (struct gimple_statement_asm): Rename to... (struct gasm): ...this. (struct gimple_statement_omp_critical): Rename to... (struct gomp_critical): ...this. (struct gimple_statement_omp_for): Rename to... (struct gomp_for): ...this. (struct gimple_statement_omp_parallel): Rename to... (struct gomp_parallel): ...this. (struct gimple_statement_omp_target): Rename to... (struct gomp_target): ...this. (struct gimple_statement_omp_task): Rename to... (struct gomp_task): ...this. (struct gimple_statement_omp_sections): Rename to... (struct gomp_sections): ...this. (struct gimple_statement_omp_continue): Rename to... (struct gomp_continue): ...this. (struct gimple_statement_omp_single): Rename to... (struct gomp_single): ...this. (struct gimple_statement_omp_teams): Rename to... (struct gomp_teams): ...this. (struct gimple_statement_omp_atomic_load): Rename to... (struct gomp_atomic_load): ...this. (struct gimple_statement_omp_atomic_store :): Rename to... (struct gomp_atomic_store :): ...this. (struct gimple_statement_transaction): Rename to... (struct gtransaction): ...this. (struct gcond): New subclass. (struct gdebug): New subclass. (struct ggoto): New subclass. (struct glabel): New subclass. (struct gswitch): New subclass. (struct gassign): New subclass. (struct greturn): New subclass. (is_a_helper <gimple_statement_asm *>::test): Rename to... (is_a_helper <gasm *>::test): ...this. (is_a_helper <gimple_statement_bind *>::test): Rename to... (is_a_helper <gbind *>::test): ...this. (is_a_helper <gassign *>::test): New. (is_a_helper <gimple_statement_call *>::test): Rename to... (is_a_helper <gcall *>::test): ...this. (is_a_helper <gimple_statement_catch *>::test): Rename to... (is_a_helper <gcatch *>::test): ...this. (is_a_helper <gimple_statement_resx *>::test): Rename to... (is_a_helper <gresx *>::test): ...this. (is_a_helper <gcond *>::test): New. (is_a_helper <gdebug *>::test): New. (is_a_helper <ggoto *>::test): New. (is_a_helper <glabel *>::test): New. (is_a_helper <gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <geh_dispatch *>::test): ...this. (is_a_helper <gimple_statement_eh_else *>::test): Rename to... (is_a_helper <geh_else *>::test): ...this. (is_a_helper <gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <geh_filter *>::test): ...this. (is_a_helper <gimple_statement_eh_mnt *>::test): Rename to... (is_a_helper <geh_mnt *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <gomp_atomic_load *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <gomp_atomic_store *>::test): ...this. (is_a_helper <gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <gomp_continue *>::test): ...this. (is_a_helper <gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <gomp_critical *>::test): ...this. (is_a_helper <gimple_statement_omp_for *>::test): Rename to... (is_a_helper <gomp_for *>::test): ...this. (is_a_helper <gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <gomp_parallel *>::test): ...this. (is_a_helper <gimple_statement_omp_target *>::test): Rename to... (is_a_helper <gomp_target *>::test): ...this. (is_a_helper <gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <gomp_sections *>::test): ...this. (is_a_helper <gimple_statement_omp_single *>::test): Rename to... (is_a_helper <gomp_single *>::test): ...this. (is_a_helper <gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <gomp_teams *>::test): ...this. (is_a_helper <gimple_statement_omp_task *>::test): Rename to... (is_a_helper <gomp_task *>::test): ...this. (is_a_helper <gimple_statement_phi *>::test): Rename to... (is_a_helper <gphi *>::test): ...this. (is_a_helper <gimple_statement_transaction *>::test): Rename to... (is_a_helper <gtransaction *>::test): ...this. (is_a_helper <greturn *>::test): New. (is_a_helper <gswitch *>::test): New. (is_a_helper <gimple_statement_try *>::test): Rename to... (is_a_helper <gtry *>::test): ...this. (is_a_helper <const gimple_statement_asm *>::test): Rename to... (is_a_helper <const gasm *>::test): ...this. (is_a_helper <const gimple_statement_bind *>::test): Rename to... (is_a_helper <const gbind *>::test): ...this. (is_a_helper <const gimple_statement_call *>::test): Rename to... (is_a_helper <const gcall *>::test): ...this. (is_a_helper <const gimple_statement_catch *>::test): Rename to... (is_a_helper <const gcatch *>::test): ...this. (is_a_helper <const gimple_statement_resx *>::test): Rename to... (is_a_helper <const gresx *>::test): ...this. (is_a_helper <const gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <const geh_dispatch *>::test): ...this. (is_a_helper <const gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <const geh_filter *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <const gomp_atomic_load *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <const gomp_atomic_store *>::test): ...this. (is_a_helper <const gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <const gomp_continue *>::test): ...this. (is_a_helper <const gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <const gomp_critical *>::test): ...this. (is_a_helper <const gimple_statement_omp_for *>::test): Rename to... (is_a_helper <const gomp_for *>::test): ...this. (is_a_helper <const gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <const gomp_parallel *>::test): ...this. (is_a_helper <const gimple_statement_omp_target *>::test): Rename to... (is_a_helper <const gomp_target *>::test): ...this. (is_a_helper <const gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <const gomp_sections *>::test): ...this. (is_a_helper <const gimple_statement_omp_single *>::test): Rename to... (is_a_helper <const gomp_single *>::test): ...this. (is_a_helper <const gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <const gomp_teams *>::test): ...this. (is_a_helper <const gimple_statement_omp_task *>::test): Rename to... (is_a_helper <const gomp_task *>::test): ...this. (is_a_helper <const gimple_statement_phi *>::test): Rename to... (is_a_helper <const gphi *>::test): ...this. (is_a_helper <const gimple_statement_transaction *>::test): Rename to... (is_a_helper <const gtransaction *>::test): ...this. (gimple_build_return): Strengthen return type to greturn *. (gimple_call_reset_alias_info): Require a gcall *. (gimple_build_call_vec): Return a gcall *. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Return a gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Return a gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Return a glabel *. (gimple_build_goto): Return a ggoto *. (gimple_build_bind): Return a gbind *. (gimple_build_asm_vec): Return a gasm *. (gimple_build_catch): Return a gcatch *. (gimple_build_eh_filter): Return a geh_filter *. (gimple_build_eh_must_not_throw): Return a geh_mnt *. (gimple_build_eh_else): Return a geh_else *. (gimple_build_try): Return a gtry *. (gimple_build_resx): Return a gresx *. (gimple_build_switch_nlabels): Return a gswitch *. (gimple_build_switch): Return a gswitch *. (gimple_build_eh_dispatch): Return a geh_dispatch *. (gimple_build_debug_bind_stat): Return a gdebug *. (gimple_build_debug_source_bind_stat): Return a gdebug *. (gimple_build_omp_critical): Return a gomp_critical *. (gimple_build_omp_for): Return a gomp_for *. (gimple_build_omp_parallel): Return a gomp_parallel *. (gimple_build_omp_task): Return a gomp_task *. (gimple_build_omp_continue): Return a gomp_continue *. (gimple_build_omp_sections): Return a gomp_sections *. (gimple_build_omp_single): Return a gomp_single *. (gimple_build_omp_target): Return a gomp_target *. (gimple_build_omp_teams): Return a gomp_teams *. (gimple_build_omp_atomic_load): Return a gomp_atomic_load *. (gimple_build_omp_atomic_store): Return a gomp_atomic_store *. (gimple_build_transaction): Return a gtransaction *. (gimple_call_arg_flags): Require a const gcall *. (gimple_call_return_flags): Likewise. (gimple_call_copy_skip_args): Require and return a gcall *. (gimple_asm_clobbers_memory_p): Require a const gasm *. (gimple_seq_first_stmt_as_a_bind): New. (gimple_assign_nontemporal_move_p): Require a const gassign * rather than a const_gimple. (gimple_call_internal_fn): Update for renaming to gcall. (gimple_call_fntype): Likewise. (gimple_call_set_fntype): Require a gcall * rather than a gimple. (gimple_call_set_fn): Likewise. (gimple_call_set_internal_fn): Likewise. (gimple_call_set_chain): Likewise. (gimple_call_set_tail): Likewise. (gimple_call_tail_p): Likewise. (gimple_call_set_return_slot_opt): Likewise. (gimple_call_return_slot_opt_p): Likewise. (gimple_call_set_from_thunk): Likewise. (gimple_call_from_thunk_p): Likewise. (gimple_call_set_va_arg_pack): Likewise. (gimple_call_va_arg_pack_p): Likewise. (gimple_call_set_nothrow): Likewise. (gimple_call_nothrow_p): Likewise. (gimple_call_set_alloca_for_var): Likewise. (gimple_call_alloca_for_var_p): Likewise. (gimple_call_use_set): Likewise. (gimple_call_clobber_set): Likewise. (gimple_call_return_type): Require a const gcall * rather than a const_gimple. (gimple_call_chain_ptr): Likewise. (gimple_call_copy_flags): Require a pair of gcall *. (gimple_cond_set_code): Require a gcond * rather than a gimple (gimple_cond_set_lhs): Likewise. (gimple_cond_set_rhs): Likewise. (gimple_cond_set_true_label): Likewise. (gimple_cond_set_false_label): Likewise. (gimple_cond_make_false): Likewise. (gimple_cond_make_true): Likewise. (gimple_cond_lhs_ptr): Require a const gcond * rather than a const_gimple. (gimple_cond_rhs_ptr): Likewise. (gimple_cond_true_label): Likewise. (gimple_cond_false_label): Likewise. (gimple_cond_true_p): Likewise. (gimple_cond_false_p): Likewise. (gimple_cond_set_condition): Likewise. (gimple_label_label): Require a const glabel *. (gimple_label_set_label): Require a glabel *. (gimple_goto_set_dest): Require a ggoto *. (gimple_bind_vars): Require a const gbind *. (gimple_bind_block): Likewise. (gimple_bind_set_vars): Require a gbind *. (gimple_bind_append_vars): Likewise. (gimple_bind_body_ptr): Likewise. (gimple_bind_body): Likewise. (gimple_bind_set_body): Likewise. (gimple_bind_add_stmt): Likewise. (gimple_bind_add_seq): Likewise. (gimple_bind_set_block): Likewise. (gimple_asm_ninputs): Require a const gasm *. (gimple_asm_noutputs): Likewise. (gimple_asm_nclobbers): Likewise. (gimple_asm_nlabels): Likewise. (gimple_asm_input_op): Likewise. (gimple_asm_input_op_ptr): Likewise. (gimple_asm_output_op): Likewise. (gimple_asm_output_op_ptr): Likewise. (gimple_asm_clobber_op): Likewise. (gimple_asm_label_op): Likewise. (gimple_asm_string): Likewise. (gimple_asm_volatile_p): Likewise. (gimple_asm_input_p): Likewise. (gimple_asm_set_input_op): Require a gasm *. (gimple_asm_set_output_op): Likewise. (gimple_asm_set_clobber_op): Likewise. (gimple_asm_set_label_op): Likewise. (gimple_asm_set_volatile): Likewise. (gimple_asm_set_input): Likewise. (gimple_catch_types): Require a const gcatch *. (gimple_catch_types_ptr): Require a gcatch *. (gimple_catch_handler_ptr): Likewise. (gimple_catch_handler): Likewise. (gimple_catch_set_types): Likewise. (gimple_catch_set_handler): Likewise. (gimple_eh_filter_types): Update for renaming of subclass to geh_filter. (gimple_eh_filter_types_ptr): Likewise. (gimple_eh_filter_failure_ptr): Likewise. (gimple_eh_filter_set_types): Require a geh_filter *. (gimple_eh_filter_set_failure): Likewise. (gimple_eh_must_not_throw_fndecl): Require a geh_mnt *. (gimple_eh_must_not_throw_set_fndecl): Likewise. (gimple_eh_else_n_body_ptr): Require a geh_else *. (gimple_eh_else_n_body): Likewise. (gimple_eh_else_e_body_ptr): Likewise. (gimple_eh_else_e_body): Likewise. (gimple_eh_else_set_n_body): Likewise. (gimple_eh_else_set_e_body): Likewise. (gimple_try_set_kind): Require a gtry *. (gimple_try_set_catch_is_cleanup): Likewise. (gimple_try_set_eval): Likewise. (gimple_try_set_cleanup): Likewise. (gimple_try_eval_ptr): Update for renaming of subclass to gtry. (gimple_try_cleanup_ptr): Likewise. (gimple_phi_capacity): Update for renaming of subclass to gphi. (gimple_phi_num_args): Likewise. (gimple_phi_result): Likewise. (gimple_phi_result_ptr): Likewise. (gimple_phi_arg): Likewise. (gimple_phi_set_result): Require a gphi *. (gimple_phi_set_arg): Likewise. (gimple_phi_arg_def_ptr): Likewise. (gimple_phi_arg_edge): Likewise. (gimple_phi_arg_location): Likewise. (gimple_phi_arg_location_from_edge): Likewise. (gimple_phi_arg_set_location): Likewise. (gimple_phi_arg_has_location): Likewise. (gimple_resx_region): Require a const gresx *. (gimple_resx_set_region): Require a gresx *. (gimple_eh_dispatch_region): Require a const geh_dispatch *. (gimple_eh_dispatch_set_region): Require a geh_dispatch *. (gimple_switch_num_labels): Require a const gswitch *. (gimple_switch_set_num_labels): Likewise. (gimple_switch_index): Likewise. (gimple_switch_index_ptr): Likewise. (gimple_switch_label): Likewise. (gimple_switch_default_label): Likewise. (gimple_switch_set_index): Require a gswitch *. (gimple_switch_set_label): Likewise. (gimple_switch_set_default_label): Likewise. (gimple_omp_critical_name): Require a const gomp_critical *. (gimple_omp_critical_name_ptr): Require a gomp_critical *. (gimple_omp_critical_set_name): Likewise. (gimple_omp_for_set_kind): Require a gomp_for *. (gimple_omp_for_set_combined_p): Likewise. (gimple_omp_for_set_combined_into_p): Likewise. (gimple_omp_for_clauses): Update for renaming of subclass to gomp_for. (gimple_omp_for_clauses_ptr): Likewise. (gimple_omp_for_set_clauses): Likewise. (gimple_omp_for_collapse): Likewise. (gimple_omp_for_index): Likewise. (gimple_omp_for_index_ptr): Likewise. (gimple_omp_for_set_index): Likewise. (gimple_omp_for_initial): Likewise. (gimple_omp_for_initial_ptr): Likewise. (gimple_omp_for_set_initial): Likewise. (gimple_omp_for_final): Likewise. (gimple_omp_for_final_ptr): Likewise. (gimple_omp_for_set_final): Likewise. (gimple_omp_for_incr): Likewise. (gimple_omp_for_incr_ptr): Likewise. (gimple_omp_for_set_incr): Likewise. (gimple_omp_for_pre_body): Likewise. (gimple_omp_for_set_pre_body): Likewise. (gimple_omp_parallel_clauses): Update for renaming of subclass to gomp_parallel. (gimple_omp_parallel_clauses_ptr): Require a gomp_parallel *. (gimple_omp_parallel_set_clauses): Likewise. (gimple_omp_parallel_child_fn_ptr): Likewise. (gimple_omp_parallel_set_child_fn): Likewise. (gimple_omp_parallel_data_arg_ptr): Likewise. (gimple_omp_parallel_set_data_arg): Likewise. (gimple_omp_parallel_child_fn): Require a const gomp_parallel *. (gimple_omp_parallel_data_arg): Likewise. (gimple_omp_task_clauses): Update for renaming of subclass to gomp_task. (gimple_omp_task_clauses_ptr): Likewise. (gimple_omp_task_set_clauses): Likewise. (gimple_omp_task_child_fn): Likewise. (gimple_omp_task_child_fn_ptr): Likewise. (gimple_omp_task_set_child_fn): Likewise. (gimple_omp_task_data_arg): Likewise. (gimple_omp_task_data_arg_ptr): Likewise. (gimple_omp_task_set_data_arg): Likewise. (gimple_omp_taskreg_clauses): Whitespace fixes. (gimple_omp_taskreg_clauses_ptr): Likewise. (gimple_omp_taskreg_set_clauses): Likewise. (gimple_omp_taskreg_child_fn): Likewise. (gimple_omp_taskreg_child_fn_ptr): Likewise. (gimple_omp_taskreg_set_child_fn): Likewise. (gimple_omp_taskreg_data_arg): Likewise. (gimple_omp_taskreg_data_arg_ptr): Likewise. (gimple_omp_taskreg_set_data_arg): Likewise. (gimple_omp_task_copy_fn): Update for renaming of subclass to gomp_task. (gimple_omp_task_copy_fn_ptr): Likewise. (gimple_omp_task_set_copy_fn): Likewise. (gimple_omp_task_arg_size): Likewise. (gimple_omp_task_arg_size_ptr): Likewise. (gimple_omp_task_set_arg_size): Likewise. (gimple_omp_task_arg_align): Likewise. (gimple_omp_task_arg_align_ptr): Likewise. (gimple_omp_task_set_arg_align): Likewise. (gimple_omp_single_clauses): Update for renaming of subclass to gomp_single. (gimple_omp_single_clauses_ptr): Likewise. (gimple_omp_single_set_clauses): Likewise. (gimple_omp_target_clauses): Update for renaming of subclass to gomp_target. (gimple_omp_target_clauses_ptr): Likewise. (gimple_omp_target_set_clauses): Require a gomp_target *. (gimple_omp_target_set_kind): Likewise. (gimple_omp_target_child_fn_ptr): Likewise. (gimple_omp_target_set_child_fn): Likewise. (gimple_omp_target_data_arg_ptr): Likewise. (gimple_omp_target_set_data_arg): Likewise. (gimple_omp_target_child_fn): Require a const gomp_target *. (gimple_omp_target_data_arg): Likewise. (gimple_omp_teams_clauses): Update for renaming of subclass to gomp_teams. (gimple_omp_teams_clauses_ptr): Likewise. (gimple_omp_teams_set_clauses): Require a gomp_teams *. (gimple_omp_sections_clauses): Update for renaming of subclass to gomp_sections. (gimple_omp_sections_clauses_ptr): Likewise. (gimple_omp_sections_set_clauses): Likewise. (gimple_omp_sections_control): Likewise. (gimple_omp_sections_control_ptr): Likewise. (gimple_omp_sections_set_control): Likewise. (gimple_omp_for_set_cond): Likewise. (gimple_omp_for_cond): Likewise. (gimple_omp_atomic_store_set_val): Require a gomp_atomic_store *. (gimple_omp_atomic_store_val_ptr): Likewise. (gimple_omp_atomic_load_set_lhs): Likewise. (gimple_omp_atomic_store_val): Require a const gomp_atomic_store *. (gimple_omp_atomic_load_lhs): Likewise. (gimple_omp_atomic_load_rhs): Likewise. (gimple_omp_atomic_load_lhs_ptr): Require a gomp_atomic_load *. (gimple_omp_atomic_load_set_rhs): Likewise. (gimple_omp_atomic_load_rhs_ptr): Likewise. (gimple_omp_continue_control_def): Require a const gomp_continue *. (gimple_omp_continue_control_use): Likewise. (gimple_omp_continue_control_def_ptr): Require a gomp_continue *. (gimple_omp_continue_set_control_def): Likewise. (gimple_omp_continue_control_use_ptr): Likewise. (gimple_omp_continue_set_control_use): Likewise. (gimple_transaction_body_ptr): Require a gtransaction *. (gimple_transaction_body): Likewise. (gimple_transaction_label_ptr): Likewise. (gimple_transaction_label): Require a const gtransaction *. (gimple_transaction_subcode): Likewise. (gimple_transaction_set_body): Require a gtransaction *. (gimple_transaction_set_label): Likewise. (gimple_transaction_set_subcode): Likewise. (gimple_return_retval_ptr): Require a const greturn *. (gimple_return_retval): Likewise. (gimple_return_set_retval): Require a greturn *. (gimple_expr_type): Introduce local "call_stmt" and use in place of "stmt" for typesafety. * asan.c: Use gimple subclasses. * auto-profile.c: Likewise. * builtins.c: Likewise. * builtins.h: Likewise. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * expr.h: Likewise. * gimple-builder.c: Likewise. * gimple-builder.h: Likewise. * gimple-fold.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimple-walk.c: Likewise. * gimplify-me.c: Likewise. * gimplify.c: Likewise. * gimplify.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * internal-fn.c: Likewise. * internal-fn.def:: Likewise. * internal-fn.h: Likewise. * ipa-icf-gimple.c: Likewise. * ipa-icf-gimple.h: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-split.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * omp-low.c: Likewise. * predict.c: Likewise. * sanopt.c: Likewise. * sese.c: Likewise. * ssa-iterators.h: Likewise. * stmt.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfg.h: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chkp.c: Likewise. * tree-chkp.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-eh.c: Likewise. * tree-eh.h: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-into-ssa.h: Likewise. * tree-loop-distribution.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-phinodes.h: Likewise. * tree-predcom.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h * tree-sra.cn_function): * tree-ssa-alias.c: Likewise. * tree-ssa-alias.h: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c * tree-ssa-structalias.c * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadedge.h: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-stdarg.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * ubsan.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * vtable-verify.c: Likewise. gcc/c-family/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * c-gimplify.c (add_block_to_enclosing): Strengthen local "stack" from being just a vec<gimple> to a vec<gbind *>. gcc/java/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * java-gimplify.c (java_gimplify_block): Strengthen local "outer" from gimple to gbind *. From-SVN: r217787
2014-11-19 18:00:54 +01:00
noutputs = gimple_asm_noutputs (asm_stmt);
ninputs = gimple_asm_ninputs (asm_stmt);
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
outputs = (tree *) alloca (noutputs * sizeof (tree));
for (i = 0; i < noutputs; ++i)
{
Merger of git branch "gimple-classes-v2-option-3" gcc/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * coretypes.h (struct gcond): Add forward decl. (struct gdebug): Likewise. (struct ggoto): Likewise. (struct glabel): Likewise. (struct gswitch): Likewise. (struct gassign): Likewise. (struct gasm): Likewise. (struct gcall): Likewise. (struct gtransaction): Likewise. (struct greturn): Likewise. (struct gbind): Likewise. (struct gcatch): Likewise. (struct geh_filter): Likewise. (struct geh_mnt): Likewise. (struct geh_else): Likewise. (struct gresx): Likewise. (struct geh_dispatch): Likewise. (struct gphi): Likewise. (struct gtry): Likewise. (struct gomp_atomic_load): Likewise. (struct gomp_atomic_store): Likewise. (struct gomp_continue): Likewise. (struct gomp_critical): Likewise. (struct gomp_for): Likewise. (struct gomp_parallel): Likewise. (struct gomp_task): Likewise. (struct gomp_sections): Likewise. (struct gomp_single): Likewise. (struct gomp_target): Likewise. (struct gomp_teams): Likewise. * doc/gimple.texi (Class hierarchy of GIMPLE statements): Update for renaming of gimple subclasses. * gdbhooks.py: Update. * gimple-iterator.c (gsi_for_phi): New. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. * gimple-iterator.h (struct gphi_iterator): New subclass of gimple_stmt_iterator. (gsi_for_phi): New prototype. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. (gsi_next_nonvirtual_phi): Strengthen param from gimple_stmt_iterator * to gphi_iterator *, and local "phi" from gimple to gphi *. * gsstruct.def: Update for renamings of classes. * gimple.c (gimple_build_return): Strengthen return type from gimple to greturn *. (gimple_call_reset_alias_info): Strengthen param to gcall *. (gimple_build_call_1): Strengthen return type from gimple to gcall *. (gimple_build_call_vec): Likewise. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal_1): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Strengthen return type from gimple to gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Strengthen return type from gimple to gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Strengthen return type from gimple to glabel *. (gimple_build_goto): Strengthen return type from gimple to ggoto *. (gimple_build_bind): Strengthen return type from gimple to gbind *. (gimple_build_asm_1): Strengthen return type from gimple to gasm *. (gimple_build_asm_vec): Likewise. (gimple_build_catch): Strengthen return type from gimple to gcatch *. (gimple_build_eh_filter): Strengthen return type from gimple to geh_filter *. (gimple_build_eh_must_not_throw): Strengthen return type from gimple to geh_mnt *. (gimple_build_eh_else): Strengthen return type from gimple to geh_else *. (gimple_build_try): Update for renaming of gimple_statement_try to gtry. (gimple_build_resx): Strengthen return type from gimple to gresx *. (gimple_build_switch_nlabels): Strengthen return type from gimple to gswitch *. (gimple_build_switch): Likewise. (gimple_build_eh_dispatch): Strengthen return type from gimple to geh_dispatch *. (gimple_build_debug_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_debug_source_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_omp_critical): Strengthen return type from gimple to gomp_critical *. (gimple_build_omp_for): Strengthen return type from gimple to gomp_for *. (gimple_build_omp_parallel): Strengthen return type from gimple to gomp_parallel *. (gimple_build_omp_task): Strengthen return type from gimple to gomp_task *. (gimple_build_omp_continue): Strengthen return type from gimple to gomp_continue *. (gimple_build_omp_sections): Strengthen return type from gimple to gomp_sections *. (gimple_build_omp_single): Strengthen return type from gimple to gomp_single *. (gimple_build_omp_target): Strengthen return type from gimple to gomp_target *. (gimple_build_omp_teams): Strengthen return type from gimple to gomp_teams *. (gimple_build_omp_atomic_load): Strengthen return type from gimple to gomp_atomic_load *. (gimple_build_omp_atomic_store): Strengthen return type from gimple to gomp_atomic_store *. (gimple_build_transaction): Strengthen return type from gimple to gtransaction *. (empty_stmt_p): Replace check for GIMPLE_BIND with a dyn_cast. (gimple_call_fnspec): Require a const gcall *. (gimple_call_arg_flags): Likewise. (gimple_call_return_flags): Likewise. (gimple_set_bb): Add a checked cast. (gimple_copy): Within the cases, add locals of the appropriate subclass and use in place of "stmt" and "copy" for typesafety. (gimple_has_side_effects): Add a checked cast. (gimple_could_trap_p_1): Likewise. (gimple_call_copy_skip_args): Require a gcall *, and return one. (gimple_asm_clobbers_memory_p): Require a const gasm *. (infer_nonnull_range): Replace a check for GIMPLE_RETURN with a dyn_cast, introducing local "return_stmt" and using ti in place of "stmt". * gimple.h (gimple_vec): Eliminate this typedef. (struct gimple_statement_call): Rename to... (struct gcall): ...this. (struct gimple_statement_bind): Rename to... (struct gbind): ...this. (struct gimple_statement_catch): Rename to... (struct gcatch): ...this. (struct gimple_statement_eh_filter): Rename to... (struct geh_filter): ...this. (struct gimple_statement_eh_else): Rename to... (struct geh_else): ...this. (struct gimple_statement_eh_mnt): Rename to... (struct geh_mnt): ...this. (struct gimple_statement_phi): Rename to... (struct gphi): ...this. (struct gimple_statement_resx): Rename to... (struct gresx): ...this. (struct gimple_statement_eh_dispatch): Rename to... (struct geh_dispatch): ...this. (struct gimple_statement_try): Rename to... (struct gtry): ...this. (struct gimple_statement_asm): Rename to... (struct gasm): ...this. (struct gimple_statement_omp_critical): Rename to... (struct gomp_critical): ...this. (struct gimple_statement_omp_for): Rename to... (struct gomp_for): ...this. (struct gimple_statement_omp_parallel): Rename to... (struct gomp_parallel): ...this. (struct gimple_statement_omp_target): Rename to... (struct gomp_target): ...this. (struct gimple_statement_omp_task): Rename to... (struct gomp_task): ...this. (struct gimple_statement_omp_sections): Rename to... (struct gomp_sections): ...this. (struct gimple_statement_omp_continue): Rename to... (struct gomp_continue): ...this. (struct gimple_statement_omp_single): Rename to... (struct gomp_single): ...this. (struct gimple_statement_omp_teams): Rename to... (struct gomp_teams): ...this. (struct gimple_statement_omp_atomic_load): Rename to... (struct gomp_atomic_load): ...this. (struct gimple_statement_omp_atomic_store :): Rename to... (struct gomp_atomic_store :): ...this. (struct gimple_statement_transaction): Rename to... (struct gtransaction): ...this. (struct gcond): New subclass. (struct gdebug): New subclass. (struct ggoto): New subclass. (struct glabel): New subclass. (struct gswitch): New subclass. (struct gassign): New subclass. (struct greturn): New subclass. (is_a_helper <gimple_statement_asm *>::test): Rename to... (is_a_helper <gasm *>::test): ...this. (is_a_helper <gimple_statement_bind *>::test): Rename to... (is_a_helper <gbind *>::test): ...this. (is_a_helper <gassign *>::test): New. (is_a_helper <gimple_statement_call *>::test): Rename to... (is_a_helper <gcall *>::test): ...this. (is_a_helper <gimple_statement_catch *>::test): Rename to... (is_a_helper <gcatch *>::test): ...this. (is_a_helper <gimple_statement_resx *>::test): Rename to... (is_a_helper <gresx *>::test): ...this. (is_a_helper <gcond *>::test): New. (is_a_helper <gdebug *>::test): New. (is_a_helper <ggoto *>::test): New. (is_a_helper <glabel *>::test): New. (is_a_helper <gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <geh_dispatch *>::test): ...this. (is_a_helper <gimple_statement_eh_else *>::test): Rename to... (is_a_helper <geh_else *>::test): ...this. (is_a_helper <gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <geh_filter *>::test): ...this. (is_a_helper <gimple_statement_eh_mnt *>::test): Rename to... (is_a_helper <geh_mnt *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <gomp_atomic_load *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <gomp_atomic_store *>::test): ...this. (is_a_helper <gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <gomp_continue *>::test): ...this. (is_a_helper <gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <gomp_critical *>::test): ...this. (is_a_helper <gimple_statement_omp_for *>::test): Rename to... (is_a_helper <gomp_for *>::test): ...this. (is_a_helper <gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <gomp_parallel *>::test): ...this. (is_a_helper <gimple_statement_omp_target *>::test): Rename to... (is_a_helper <gomp_target *>::test): ...this. (is_a_helper <gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <gomp_sections *>::test): ...this. (is_a_helper <gimple_statement_omp_single *>::test): Rename to... (is_a_helper <gomp_single *>::test): ...this. (is_a_helper <gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <gomp_teams *>::test): ...this. (is_a_helper <gimple_statement_omp_task *>::test): Rename to... (is_a_helper <gomp_task *>::test): ...this. (is_a_helper <gimple_statement_phi *>::test): Rename to... (is_a_helper <gphi *>::test): ...this. (is_a_helper <gimple_statement_transaction *>::test): Rename to... (is_a_helper <gtransaction *>::test): ...this. (is_a_helper <greturn *>::test): New. (is_a_helper <gswitch *>::test): New. (is_a_helper <gimple_statement_try *>::test): Rename to... (is_a_helper <gtry *>::test): ...this. (is_a_helper <const gimple_statement_asm *>::test): Rename to... (is_a_helper <const gasm *>::test): ...this. (is_a_helper <const gimple_statement_bind *>::test): Rename to... (is_a_helper <const gbind *>::test): ...this. (is_a_helper <const gimple_statement_call *>::test): Rename to... (is_a_helper <const gcall *>::test): ...this. (is_a_helper <const gimple_statement_catch *>::test): Rename to... (is_a_helper <const gcatch *>::test): ...this. (is_a_helper <const gimple_statement_resx *>::test): Rename to... (is_a_helper <const gresx *>::test): ...this. (is_a_helper <const gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <const geh_dispatch *>::test): ...this. (is_a_helper <const gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <const geh_filter *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <const gomp_atomic_load *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <const gomp_atomic_store *>::test): ...this. (is_a_helper <const gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <const gomp_continue *>::test): ...this. (is_a_helper <const gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <const gomp_critical *>::test): ...this. (is_a_helper <const gimple_statement_omp_for *>::test): Rename to... (is_a_helper <const gomp_for *>::test): ...this. (is_a_helper <const gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <const gomp_parallel *>::test): ...this. (is_a_helper <const gimple_statement_omp_target *>::test): Rename to... (is_a_helper <const gomp_target *>::test): ...this. (is_a_helper <const gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <const gomp_sections *>::test): ...this. (is_a_helper <const gimple_statement_omp_single *>::test): Rename to... (is_a_helper <const gomp_single *>::test): ...this. (is_a_helper <const gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <const gomp_teams *>::test): ...this. (is_a_helper <const gimple_statement_omp_task *>::test): Rename to... (is_a_helper <const gomp_task *>::test): ...this. (is_a_helper <const gimple_statement_phi *>::test): Rename to... (is_a_helper <const gphi *>::test): ...this. (is_a_helper <const gimple_statement_transaction *>::test): Rename to... (is_a_helper <const gtransaction *>::test): ...this. (gimple_build_return): Strengthen return type to greturn *. (gimple_call_reset_alias_info): Require a gcall *. (gimple_build_call_vec): Return a gcall *. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Return a gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Return a gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Return a glabel *. (gimple_build_goto): Return a ggoto *. (gimple_build_bind): Return a gbind *. (gimple_build_asm_vec): Return a gasm *. (gimple_build_catch): Return a gcatch *. (gimple_build_eh_filter): Return a geh_filter *. (gimple_build_eh_must_not_throw): Return a geh_mnt *. (gimple_build_eh_else): Return a geh_else *. (gimple_build_try): Return a gtry *. (gimple_build_resx): Return a gresx *. (gimple_build_switch_nlabels): Return a gswitch *. (gimple_build_switch): Return a gswitch *. (gimple_build_eh_dispatch): Return a geh_dispatch *. (gimple_build_debug_bind_stat): Return a gdebug *. (gimple_build_debug_source_bind_stat): Return a gdebug *. (gimple_build_omp_critical): Return a gomp_critical *. (gimple_build_omp_for): Return a gomp_for *. (gimple_build_omp_parallel): Return a gomp_parallel *. (gimple_build_omp_task): Return a gomp_task *. (gimple_build_omp_continue): Return a gomp_continue *. (gimple_build_omp_sections): Return a gomp_sections *. (gimple_build_omp_single): Return a gomp_single *. (gimple_build_omp_target): Return a gomp_target *. (gimple_build_omp_teams): Return a gomp_teams *. (gimple_build_omp_atomic_load): Return a gomp_atomic_load *. (gimple_build_omp_atomic_store): Return a gomp_atomic_store *. (gimple_build_transaction): Return a gtransaction *. (gimple_call_arg_flags): Require a const gcall *. (gimple_call_return_flags): Likewise. (gimple_call_copy_skip_args): Require and return a gcall *. (gimple_asm_clobbers_memory_p): Require a const gasm *. (gimple_seq_first_stmt_as_a_bind): New. (gimple_assign_nontemporal_move_p): Require a const gassign * rather than a const_gimple. (gimple_call_internal_fn): Update for renaming to gcall. (gimple_call_fntype): Likewise. (gimple_call_set_fntype): Require a gcall * rather than a gimple. (gimple_call_set_fn): Likewise. (gimple_call_set_internal_fn): Likewise. (gimple_call_set_chain): Likewise. (gimple_call_set_tail): Likewise. (gimple_call_tail_p): Likewise. (gimple_call_set_return_slot_opt): Likewise. (gimple_call_return_slot_opt_p): Likewise. (gimple_call_set_from_thunk): Likewise. (gimple_call_from_thunk_p): Likewise. (gimple_call_set_va_arg_pack): Likewise. (gimple_call_va_arg_pack_p): Likewise. (gimple_call_set_nothrow): Likewise. (gimple_call_nothrow_p): Likewise. (gimple_call_set_alloca_for_var): Likewise. (gimple_call_alloca_for_var_p): Likewise. (gimple_call_use_set): Likewise. (gimple_call_clobber_set): Likewise. (gimple_call_return_type): Require a const gcall * rather than a const_gimple. (gimple_call_chain_ptr): Likewise. (gimple_call_copy_flags): Require a pair of gcall *. (gimple_cond_set_code): Require a gcond * rather than a gimple (gimple_cond_set_lhs): Likewise. (gimple_cond_set_rhs): Likewise. (gimple_cond_set_true_label): Likewise. (gimple_cond_set_false_label): Likewise. (gimple_cond_make_false): Likewise. (gimple_cond_make_true): Likewise. (gimple_cond_lhs_ptr): Require a const gcond * rather than a const_gimple. (gimple_cond_rhs_ptr): Likewise. (gimple_cond_true_label): Likewise. (gimple_cond_false_label): Likewise. (gimple_cond_true_p): Likewise. (gimple_cond_false_p): Likewise. (gimple_cond_set_condition): Likewise. (gimple_label_label): Require a const glabel *. (gimple_label_set_label): Require a glabel *. (gimple_goto_set_dest): Require a ggoto *. (gimple_bind_vars): Require a const gbind *. (gimple_bind_block): Likewise. (gimple_bind_set_vars): Require a gbind *. (gimple_bind_append_vars): Likewise. (gimple_bind_body_ptr): Likewise. (gimple_bind_body): Likewise. (gimple_bind_set_body): Likewise. (gimple_bind_add_stmt): Likewise. (gimple_bind_add_seq): Likewise. (gimple_bind_set_block): Likewise. (gimple_asm_ninputs): Require a const gasm *. (gimple_asm_noutputs): Likewise. (gimple_asm_nclobbers): Likewise. (gimple_asm_nlabels): Likewise. (gimple_asm_input_op): Likewise. (gimple_asm_input_op_ptr): Likewise. (gimple_asm_output_op): Likewise. (gimple_asm_output_op_ptr): Likewise. (gimple_asm_clobber_op): Likewise. (gimple_asm_label_op): Likewise. (gimple_asm_string): Likewise. (gimple_asm_volatile_p): Likewise. (gimple_asm_input_p): Likewise. (gimple_asm_set_input_op): Require a gasm *. (gimple_asm_set_output_op): Likewise. (gimple_asm_set_clobber_op): Likewise. (gimple_asm_set_label_op): Likewise. (gimple_asm_set_volatile): Likewise. (gimple_asm_set_input): Likewise. (gimple_catch_types): Require a const gcatch *. (gimple_catch_types_ptr): Require a gcatch *. (gimple_catch_handler_ptr): Likewise. (gimple_catch_handler): Likewise. (gimple_catch_set_types): Likewise. (gimple_catch_set_handler): Likewise. (gimple_eh_filter_types): Update for renaming of subclass to geh_filter. (gimple_eh_filter_types_ptr): Likewise. (gimple_eh_filter_failure_ptr): Likewise. (gimple_eh_filter_set_types): Require a geh_filter *. (gimple_eh_filter_set_failure): Likewise. (gimple_eh_must_not_throw_fndecl): Require a geh_mnt *. (gimple_eh_must_not_throw_set_fndecl): Likewise. (gimple_eh_else_n_body_ptr): Require a geh_else *. (gimple_eh_else_n_body): Likewise. (gimple_eh_else_e_body_ptr): Likewise. (gimple_eh_else_e_body): Likewise. (gimple_eh_else_set_n_body): Likewise. (gimple_eh_else_set_e_body): Likewise. (gimple_try_set_kind): Require a gtry *. (gimple_try_set_catch_is_cleanup): Likewise. (gimple_try_set_eval): Likewise. (gimple_try_set_cleanup): Likewise. (gimple_try_eval_ptr): Update for renaming of subclass to gtry. (gimple_try_cleanup_ptr): Likewise. (gimple_phi_capacity): Update for renaming of subclass to gphi. (gimple_phi_num_args): Likewise. (gimple_phi_result): Likewise. (gimple_phi_result_ptr): Likewise. (gimple_phi_arg): Likewise. (gimple_phi_set_result): Require a gphi *. (gimple_phi_set_arg): Likewise. (gimple_phi_arg_def_ptr): Likewise. (gimple_phi_arg_edge): Likewise. (gimple_phi_arg_location): Likewise. (gimple_phi_arg_location_from_edge): Likewise. (gimple_phi_arg_set_location): Likewise. (gimple_phi_arg_has_location): Likewise. (gimple_resx_region): Require a const gresx *. (gimple_resx_set_region): Require a gresx *. (gimple_eh_dispatch_region): Require a const geh_dispatch *. (gimple_eh_dispatch_set_region): Require a geh_dispatch *. (gimple_switch_num_labels): Require a const gswitch *. (gimple_switch_set_num_labels): Likewise. (gimple_switch_index): Likewise. (gimple_switch_index_ptr): Likewise. (gimple_switch_label): Likewise. (gimple_switch_default_label): Likewise. (gimple_switch_set_index): Require a gswitch *. (gimple_switch_set_label): Likewise. (gimple_switch_set_default_label): Likewise. (gimple_omp_critical_name): Require a const gomp_critical *. (gimple_omp_critical_name_ptr): Require a gomp_critical *. (gimple_omp_critical_set_name): Likewise. (gimple_omp_for_set_kind): Require a gomp_for *. (gimple_omp_for_set_combined_p): Likewise. (gimple_omp_for_set_combined_into_p): Likewise. (gimple_omp_for_clauses): Update for renaming of subclass to gomp_for. (gimple_omp_for_clauses_ptr): Likewise. (gimple_omp_for_set_clauses): Likewise. (gimple_omp_for_collapse): Likewise. (gimple_omp_for_index): Likewise. (gimple_omp_for_index_ptr): Likewise. (gimple_omp_for_set_index): Likewise. (gimple_omp_for_initial): Likewise. (gimple_omp_for_initial_ptr): Likewise. (gimple_omp_for_set_initial): Likewise. (gimple_omp_for_final): Likewise. (gimple_omp_for_final_ptr): Likewise. (gimple_omp_for_set_final): Likewise. (gimple_omp_for_incr): Likewise. (gimple_omp_for_incr_ptr): Likewise. (gimple_omp_for_set_incr): Likewise. (gimple_omp_for_pre_body): Likewise. (gimple_omp_for_set_pre_body): Likewise. (gimple_omp_parallel_clauses): Update for renaming of subclass to gomp_parallel. (gimple_omp_parallel_clauses_ptr): Require a gomp_parallel *. (gimple_omp_parallel_set_clauses): Likewise. (gimple_omp_parallel_child_fn_ptr): Likewise. (gimple_omp_parallel_set_child_fn): Likewise. (gimple_omp_parallel_data_arg_ptr): Likewise. (gimple_omp_parallel_set_data_arg): Likewise. (gimple_omp_parallel_child_fn): Require a const gomp_parallel *. (gimple_omp_parallel_data_arg): Likewise. (gimple_omp_task_clauses): Update for renaming of subclass to gomp_task. (gimple_omp_task_clauses_ptr): Likewise. (gimple_omp_task_set_clauses): Likewise. (gimple_omp_task_child_fn): Likewise. (gimple_omp_task_child_fn_ptr): Likewise. (gimple_omp_task_set_child_fn): Likewise. (gimple_omp_task_data_arg): Likewise. (gimple_omp_task_data_arg_ptr): Likewise. (gimple_omp_task_set_data_arg): Likewise. (gimple_omp_taskreg_clauses): Whitespace fixes. (gimple_omp_taskreg_clauses_ptr): Likewise. (gimple_omp_taskreg_set_clauses): Likewise. (gimple_omp_taskreg_child_fn): Likewise. (gimple_omp_taskreg_child_fn_ptr): Likewise. (gimple_omp_taskreg_set_child_fn): Likewise. (gimple_omp_taskreg_data_arg): Likewise. (gimple_omp_taskreg_data_arg_ptr): Likewise. (gimple_omp_taskreg_set_data_arg): Likewise. (gimple_omp_task_copy_fn): Update for renaming of subclass to gomp_task. (gimple_omp_task_copy_fn_ptr): Likewise. (gimple_omp_task_set_copy_fn): Likewise. (gimple_omp_task_arg_size): Likewise. (gimple_omp_task_arg_size_ptr): Likewise. (gimple_omp_task_set_arg_size): Likewise. (gimple_omp_task_arg_align): Likewise. (gimple_omp_task_arg_align_ptr): Likewise. (gimple_omp_task_set_arg_align): Likewise. (gimple_omp_single_clauses): Update for renaming of subclass to gomp_single. (gimple_omp_single_clauses_ptr): Likewise. (gimple_omp_single_set_clauses): Likewise. (gimple_omp_target_clauses): Update for renaming of subclass to gomp_target. (gimple_omp_target_clauses_ptr): Likewise. (gimple_omp_target_set_clauses): Require a gomp_target *. (gimple_omp_target_set_kind): Likewise. (gimple_omp_target_child_fn_ptr): Likewise. (gimple_omp_target_set_child_fn): Likewise. (gimple_omp_target_data_arg_ptr): Likewise. (gimple_omp_target_set_data_arg): Likewise. (gimple_omp_target_child_fn): Require a const gomp_target *. (gimple_omp_target_data_arg): Likewise. (gimple_omp_teams_clauses): Update for renaming of subclass to gomp_teams. (gimple_omp_teams_clauses_ptr): Likewise. (gimple_omp_teams_set_clauses): Require a gomp_teams *. (gimple_omp_sections_clauses): Update for renaming of subclass to gomp_sections. (gimple_omp_sections_clauses_ptr): Likewise. (gimple_omp_sections_set_clauses): Likewise. (gimple_omp_sections_control): Likewise. (gimple_omp_sections_control_ptr): Likewise. (gimple_omp_sections_set_control): Likewise. (gimple_omp_for_set_cond): Likewise. (gimple_omp_for_cond): Likewise. (gimple_omp_atomic_store_set_val): Require a gomp_atomic_store *. (gimple_omp_atomic_store_val_ptr): Likewise. (gimple_omp_atomic_load_set_lhs): Likewise. (gimple_omp_atomic_store_val): Require a const gomp_atomic_store *. (gimple_omp_atomic_load_lhs): Likewise. (gimple_omp_atomic_load_rhs): Likewise. (gimple_omp_atomic_load_lhs_ptr): Require a gomp_atomic_load *. (gimple_omp_atomic_load_set_rhs): Likewise. (gimple_omp_atomic_load_rhs_ptr): Likewise. (gimple_omp_continue_control_def): Require a const gomp_continue *. (gimple_omp_continue_control_use): Likewise. (gimple_omp_continue_control_def_ptr): Require a gomp_continue *. (gimple_omp_continue_set_control_def): Likewise. (gimple_omp_continue_control_use_ptr): Likewise. (gimple_omp_continue_set_control_use): Likewise. (gimple_transaction_body_ptr): Require a gtransaction *. (gimple_transaction_body): Likewise. (gimple_transaction_label_ptr): Likewise. (gimple_transaction_label): Require a const gtransaction *. (gimple_transaction_subcode): Likewise. (gimple_transaction_set_body): Require a gtransaction *. (gimple_transaction_set_label): Likewise. (gimple_transaction_set_subcode): Likewise. (gimple_return_retval_ptr): Require a const greturn *. (gimple_return_retval): Likewise. (gimple_return_set_retval): Require a greturn *. (gimple_expr_type): Introduce local "call_stmt" and use in place of "stmt" for typesafety. * asan.c: Use gimple subclasses. * auto-profile.c: Likewise. * builtins.c: Likewise. * builtins.h: Likewise. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * expr.h: Likewise. * gimple-builder.c: Likewise. * gimple-builder.h: Likewise. * gimple-fold.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimple-walk.c: Likewise. * gimplify-me.c: Likewise. * gimplify.c: Likewise. * gimplify.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * internal-fn.c: Likewise. * internal-fn.def:: Likewise. * internal-fn.h: Likewise. * ipa-icf-gimple.c: Likewise. * ipa-icf-gimple.h: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-split.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * omp-low.c: Likewise. * predict.c: Likewise. * sanopt.c: Likewise. * sese.c: Likewise. * ssa-iterators.h: Likewise. * stmt.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfg.h: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chkp.c: Likewise. * tree-chkp.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-eh.c: Likewise. * tree-eh.h: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-into-ssa.h: Likewise. * tree-loop-distribution.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-phinodes.h: Likewise. * tree-predcom.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h * tree-sra.cn_function): * tree-ssa-alias.c: Likewise. * tree-ssa-alias.h: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c * tree-ssa-structalias.c * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadedge.h: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-stdarg.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * ubsan.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * vtable-verify.c: Likewise. gcc/c-family/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * c-gimplify.c (add_block_to_enclosing): Strengthen local "stack" from being just a vec<gimple> to a vec<gbind *>. gcc/java/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * java-gimplify.c (java_gimplify_block): Strengthen local "outer" from gimple to gbind *. From-SVN: r217787
2014-11-19 18:00:54 +01:00
link = gimple_asm_output_op (asm_stmt, i);
outputs[i] = TREE_VALUE (link);
}
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
for (i = 0; i < ninputs; ++i)
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
{
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
const char *constraint;
tree input;
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
char *end;
unsigned long match;
Merger of git branch "gimple-classes-v2-option-3" gcc/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * coretypes.h (struct gcond): Add forward decl. (struct gdebug): Likewise. (struct ggoto): Likewise. (struct glabel): Likewise. (struct gswitch): Likewise. (struct gassign): Likewise. (struct gasm): Likewise. (struct gcall): Likewise. (struct gtransaction): Likewise. (struct greturn): Likewise. (struct gbind): Likewise. (struct gcatch): Likewise. (struct geh_filter): Likewise. (struct geh_mnt): Likewise. (struct geh_else): Likewise. (struct gresx): Likewise. (struct geh_dispatch): Likewise. (struct gphi): Likewise. (struct gtry): Likewise. (struct gomp_atomic_load): Likewise. (struct gomp_atomic_store): Likewise. (struct gomp_continue): Likewise. (struct gomp_critical): Likewise. (struct gomp_for): Likewise. (struct gomp_parallel): Likewise. (struct gomp_task): Likewise. (struct gomp_sections): Likewise. (struct gomp_single): Likewise. (struct gomp_target): Likewise. (struct gomp_teams): Likewise. * doc/gimple.texi (Class hierarchy of GIMPLE statements): Update for renaming of gimple subclasses. * gdbhooks.py: Update. * gimple-iterator.c (gsi_for_phi): New. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. * gimple-iterator.h (struct gphi_iterator): New subclass of gimple_stmt_iterator. (gsi_for_phi): New prototype. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. (gsi_next_nonvirtual_phi): Strengthen param from gimple_stmt_iterator * to gphi_iterator *, and local "phi" from gimple to gphi *. * gsstruct.def: Update for renamings of classes. * gimple.c (gimple_build_return): Strengthen return type from gimple to greturn *. (gimple_call_reset_alias_info): Strengthen param to gcall *. (gimple_build_call_1): Strengthen return type from gimple to gcall *. (gimple_build_call_vec): Likewise. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal_1): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Strengthen return type from gimple to gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Strengthen return type from gimple to gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Strengthen return type from gimple to glabel *. (gimple_build_goto): Strengthen return type from gimple to ggoto *. (gimple_build_bind): Strengthen return type from gimple to gbind *. (gimple_build_asm_1): Strengthen return type from gimple to gasm *. (gimple_build_asm_vec): Likewise. (gimple_build_catch): Strengthen return type from gimple to gcatch *. (gimple_build_eh_filter): Strengthen return type from gimple to geh_filter *. (gimple_build_eh_must_not_throw): Strengthen return type from gimple to geh_mnt *. (gimple_build_eh_else): Strengthen return type from gimple to geh_else *. (gimple_build_try): Update for renaming of gimple_statement_try to gtry. (gimple_build_resx): Strengthen return type from gimple to gresx *. (gimple_build_switch_nlabels): Strengthen return type from gimple to gswitch *. (gimple_build_switch): Likewise. (gimple_build_eh_dispatch): Strengthen return type from gimple to geh_dispatch *. (gimple_build_debug_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_debug_source_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_omp_critical): Strengthen return type from gimple to gomp_critical *. (gimple_build_omp_for): Strengthen return type from gimple to gomp_for *. (gimple_build_omp_parallel): Strengthen return type from gimple to gomp_parallel *. (gimple_build_omp_task): Strengthen return type from gimple to gomp_task *. (gimple_build_omp_continue): Strengthen return type from gimple to gomp_continue *. (gimple_build_omp_sections): Strengthen return type from gimple to gomp_sections *. (gimple_build_omp_single): Strengthen return type from gimple to gomp_single *. (gimple_build_omp_target): Strengthen return type from gimple to gomp_target *. (gimple_build_omp_teams): Strengthen return type from gimple to gomp_teams *. (gimple_build_omp_atomic_load): Strengthen return type from gimple to gomp_atomic_load *. (gimple_build_omp_atomic_store): Strengthen return type from gimple to gomp_atomic_store *. (gimple_build_transaction): Strengthen return type from gimple to gtransaction *. (empty_stmt_p): Replace check for GIMPLE_BIND with a dyn_cast. (gimple_call_fnspec): Require a const gcall *. (gimple_call_arg_flags): Likewise. (gimple_call_return_flags): Likewise. (gimple_set_bb): Add a checked cast. (gimple_copy): Within the cases, add locals of the appropriate subclass and use in place of "stmt" and "copy" for typesafety. (gimple_has_side_effects): Add a checked cast. (gimple_could_trap_p_1): Likewise. (gimple_call_copy_skip_args): Require a gcall *, and return one. (gimple_asm_clobbers_memory_p): Require a const gasm *. (infer_nonnull_range): Replace a check for GIMPLE_RETURN with a dyn_cast, introducing local "return_stmt" and using ti in place of "stmt". * gimple.h (gimple_vec): Eliminate this typedef. (struct gimple_statement_call): Rename to... (struct gcall): ...this. (struct gimple_statement_bind): Rename to... (struct gbind): ...this. (struct gimple_statement_catch): Rename to... (struct gcatch): ...this. (struct gimple_statement_eh_filter): Rename to... (struct geh_filter): ...this. (struct gimple_statement_eh_else): Rename to... (struct geh_else): ...this. (struct gimple_statement_eh_mnt): Rename to... (struct geh_mnt): ...this. (struct gimple_statement_phi): Rename to... (struct gphi): ...this. (struct gimple_statement_resx): Rename to... (struct gresx): ...this. (struct gimple_statement_eh_dispatch): Rename to... (struct geh_dispatch): ...this. (struct gimple_statement_try): Rename to... (struct gtry): ...this. (struct gimple_statement_asm): Rename to... (struct gasm): ...this. (struct gimple_statement_omp_critical): Rename to... (struct gomp_critical): ...this. (struct gimple_statement_omp_for): Rename to... (struct gomp_for): ...this. (struct gimple_statement_omp_parallel): Rename to... (struct gomp_parallel): ...this. (struct gimple_statement_omp_target): Rename to... (struct gomp_target): ...this. (struct gimple_statement_omp_task): Rename to... (struct gomp_task): ...this. (struct gimple_statement_omp_sections): Rename to... (struct gomp_sections): ...this. (struct gimple_statement_omp_continue): Rename to... (struct gomp_continue): ...this. (struct gimple_statement_omp_single): Rename to... (struct gomp_single): ...this. (struct gimple_statement_omp_teams): Rename to... (struct gomp_teams): ...this. (struct gimple_statement_omp_atomic_load): Rename to... (struct gomp_atomic_load): ...this. (struct gimple_statement_omp_atomic_store :): Rename to... (struct gomp_atomic_store :): ...this. (struct gimple_statement_transaction): Rename to... (struct gtransaction): ...this. (struct gcond): New subclass. (struct gdebug): New subclass. (struct ggoto): New subclass. (struct glabel): New subclass. (struct gswitch): New subclass. (struct gassign): New subclass. (struct greturn): New subclass. (is_a_helper <gimple_statement_asm *>::test): Rename to... (is_a_helper <gasm *>::test): ...this. (is_a_helper <gimple_statement_bind *>::test): Rename to... (is_a_helper <gbind *>::test): ...this. (is_a_helper <gassign *>::test): New. (is_a_helper <gimple_statement_call *>::test): Rename to... (is_a_helper <gcall *>::test): ...this. (is_a_helper <gimple_statement_catch *>::test): Rename to... (is_a_helper <gcatch *>::test): ...this. (is_a_helper <gimple_statement_resx *>::test): Rename to... (is_a_helper <gresx *>::test): ...this. (is_a_helper <gcond *>::test): New. (is_a_helper <gdebug *>::test): New. (is_a_helper <ggoto *>::test): New. (is_a_helper <glabel *>::test): New. (is_a_helper <gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <geh_dispatch *>::test): ...this. (is_a_helper <gimple_statement_eh_else *>::test): Rename to... (is_a_helper <geh_else *>::test): ...this. (is_a_helper <gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <geh_filter *>::test): ...this. (is_a_helper <gimple_statement_eh_mnt *>::test): Rename to... (is_a_helper <geh_mnt *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <gomp_atomic_load *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <gomp_atomic_store *>::test): ...this. (is_a_helper <gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <gomp_continue *>::test): ...this. (is_a_helper <gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <gomp_critical *>::test): ...this. (is_a_helper <gimple_statement_omp_for *>::test): Rename to... (is_a_helper <gomp_for *>::test): ...this. (is_a_helper <gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <gomp_parallel *>::test): ...this. (is_a_helper <gimple_statement_omp_target *>::test): Rename to... (is_a_helper <gomp_target *>::test): ...this. (is_a_helper <gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <gomp_sections *>::test): ...this. (is_a_helper <gimple_statement_omp_single *>::test): Rename to... (is_a_helper <gomp_single *>::test): ...this. (is_a_helper <gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <gomp_teams *>::test): ...this. (is_a_helper <gimple_statement_omp_task *>::test): Rename to... (is_a_helper <gomp_task *>::test): ...this. (is_a_helper <gimple_statement_phi *>::test): Rename to... (is_a_helper <gphi *>::test): ...this. (is_a_helper <gimple_statement_transaction *>::test): Rename to... (is_a_helper <gtransaction *>::test): ...this. (is_a_helper <greturn *>::test): New. (is_a_helper <gswitch *>::test): New. (is_a_helper <gimple_statement_try *>::test): Rename to... (is_a_helper <gtry *>::test): ...this. (is_a_helper <const gimple_statement_asm *>::test): Rename to... (is_a_helper <const gasm *>::test): ...this. (is_a_helper <const gimple_statement_bind *>::test): Rename to... (is_a_helper <const gbind *>::test): ...this. (is_a_helper <const gimple_statement_call *>::test): Rename to... (is_a_helper <const gcall *>::test): ...this. (is_a_helper <const gimple_statement_catch *>::test): Rename to... (is_a_helper <const gcatch *>::test): ...this. (is_a_helper <const gimple_statement_resx *>::test): Rename to... (is_a_helper <const gresx *>::test): ...this. (is_a_helper <const gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <const geh_dispatch *>::test): ...this. (is_a_helper <const gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <const geh_filter *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <const gomp_atomic_load *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <const gomp_atomic_store *>::test): ...this. (is_a_helper <const gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <const gomp_continue *>::test): ...this. (is_a_helper <const gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <const gomp_critical *>::test): ...this. (is_a_helper <const gimple_statement_omp_for *>::test): Rename to... (is_a_helper <const gomp_for *>::test): ...this. (is_a_helper <const gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <const gomp_parallel *>::test): ...this. (is_a_helper <const gimple_statement_omp_target *>::test): Rename to... (is_a_helper <const gomp_target *>::test): ...this. (is_a_helper <const gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <const gomp_sections *>::test): ...this. (is_a_helper <const gimple_statement_omp_single *>::test): Rename to... (is_a_helper <const gomp_single *>::test): ...this. (is_a_helper <const gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <const gomp_teams *>::test): ...this. (is_a_helper <const gimple_statement_omp_task *>::test): Rename to... (is_a_helper <const gomp_task *>::test): ...this. (is_a_helper <const gimple_statement_phi *>::test): Rename to... (is_a_helper <const gphi *>::test): ...this. (is_a_helper <const gimple_statement_transaction *>::test): Rename to... (is_a_helper <const gtransaction *>::test): ...this. (gimple_build_return): Strengthen return type to greturn *. (gimple_call_reset_alias_info): Require a gcall *. (gimple_build_call_vec): Return a gcall *. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Return a gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Return a gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Return a glabel *. (gimple_build_goto): Return a ggoto *. (gimple_build_bind): Return a gbind *. (gimple_build_asm_vec): Return a gasm *. (gimple_build_catch): Return a gcatch *. (gimple_build_eh_filter): Return a geh_filter *. (gimple_build_eh_must_not_throw): Return a geh_mnt *. (gimple_build_eh_else): Return a geh_else *. (gimple_build_try): Return a gtry *. (gimple_build_resx): Return a gresx *. (gimple_build_switch_nlabels): Return a gswitch *. (gimple_build_switch): Return a gswitch *. (gimple_build_eh_dispatch): Return a geh_dispatch *. (gimple_build_debug_bind_stat): Return a gdebug *. (gimple_build_debug_source_bind_stat): Return a gdebug *. (gimple_build_omp_critical): Return a gomp_critical *. (gimple_build_omp_for): Return a gomp_for *. (gimple_build_omp_parallel): Return a gomp_parallel *. (gimple_build_omp_task): Return a gomp_task *. (gimple_build_omp_continue): Return a gomp_continue *. (gimple_build_omp_sections): Return a gomp_sections *. (gimple_build_omp_single): Return a gomp_single *. (gimple_build_omp_target): Return a gomp_target *. (gimple_build_omp_teams): Return a gomp_teams *. (gimple_build_omp_atomic_load): Return a gomp_atomic_load *. (gimple_build_omp_atomic_store): Return a gomp_atomic_store *. (gimple_build_transaction): Return a gtransaction *. (gimple_call_arg_flags): Require a const gcall *. (gimple_call_return_flags): Likewise. (gimple_call_copy_skip_args): Require and return a gcall *. (gimple_asm_clobbers_memory_p): Require a const gasm *. (gimple_seq_first_stmt_as_a_bind): New. (gimple_assign_nontemporal_move_p): Require a const gassign * rather than a const_gimple. (gimple_call_internal_fn): Update for renaming to gcall. (gimple_call_fntype): Likewise. (gimple_call_set_fntype): Require a gcall * rather than a gimple. (gimple_call_set_fn): Likewise. (gimple_call_set_internal_fn): Likewise. (gimple_call_set_chain): Likewise. (gimple_call_set_tail): Likewise. (gimple_call_tail_p): Likewise. (gimple_call_set_return_slot_opt): Likewise. (gimple_call_return_slot_opt_p): Likewise. (gimple_call_set_from_thunk): Likewise. (gimple_call_from_thunk_p): Likewise. (gimple_call_set_va_arg_pack): Likewise. (gimple_call_va_arg_pack_p): Likewise. (gimple_call_set_nothrow): Likewise. (gimple_call_nothrow_p): Likewise. (gimple_call_set_alloca_for_var): Likewise. (gimple_call_alloca_for_var_p): Likewise. (gimple_call_use_set): Likewise. (gimple_call_clobber_set): Likewise. (gimple_call_return_type): Require a const gcall * rather than a const_gimple. (gimple_call_chain_ptr): Likewise. (gimple_call_copy_flags): Require a pair of gcall *. (gimple_cond_set_code): Require a gcond * rather than a gimple (gimple_cond_set_lhs): Likewise. (gimple_cond_set_rhs): Likewise. (gimple_cond_set_true_label): Likewise. (gimple_cond_set_false_label): Likewise. (gimple_cond_make_false): Likewise. (gimple_cond_make_true): Likewise. (gimple_cond_lhs_ptr): Require a const gcond * rather than a const_gimple. (gimple_cond_rhs_ptr): Likewise. (gimple_cond_true_label): Likewise. (gimple_cond_false_label): Likewise. (gimple_cond_true_p): Likewise. (gimple_cond_false_p): Likewise. (gimple_cond_set_condition): Likewise. (gimple_label_label): Require a const glabel *. (gimple_label_set_label): Require a glabel *. (gimple_goto_set_dest): Require a ggoto *. (gimple_bind_vars): Require a const gbind *. (gimple_bind_block): Likewise. (gimple_bind_set_vars): Require a gbind *. (gimple_bind_append_vars): Likewise. (gimple_bind_body_ptr): Likewise. (gimple_bind_body): Likewise. (gimple_bind_set_body): Likewise. (gimple_bind_add_stmt): Likewise. (gimple_bind_add_seq): Likewise. (gimple_bind_set_block): Likewise. (gimple_asm_ninputs): Require a const gasm *. (gimple_asm_noutputs): Likewise. (gimple_asm_nclobbers): Likewise. (gimple_asm_nlabels): Likewise. (gimple_asm_input_op): Likewise. (gimple_asm_input_op_ptr): Likewise. (gimple_asm_output_op): Likewise. (gimple_asm_output_op_ptr): Likewise. (gimple_asm_clobber_op): Likewise. (gimple_asm_label_op): Likewise. (gimple_asm_string): Likewise. (gimple_asm_volatile_p): Likewise. (gimple_asm_input_p): Likewise. (gimple_asm_set_input_op): Require a gasm *. (gimple_asm_set_output_op): Likewise. (gimple_asm_set_clobber_op): Likewise. (gimple_asm_set_label_op): Likewise. (gimple_asm_set_volatile): Likewise. (gimple_asm_set_input): Likewise. (gimple_catch_types): Require a const gcatch *. (gimple_catch_types_ptr): Require a gcatch *. (gimple_catch_handler_ptr): Likewise. (gimple_catch_handler): Likewise. (gimple_catch_set_types): Likewise. (gimple_catch_set_handler): Likewise. (gimple_eh_filter_types): Update for renaming of subclass to geh_filter. (gimple_eh_filter_types_ptr): Likewise. (gimple_eh_filter_failure_ptr): Likewise. (gimple_eh_filter_set_types): Require a geh_filter *. (gimple_eh_filter_set_failure): Likewise. (gimple_eh_must_not_throw_fndecl): Require a geh_mnt *. (gimple_eh_must_not_throw_set_fndecl): Likewise. (gimple_eh_else_n_body_ptr): Require a geh_else *. (gimple_eh_else_n_body): Likewise. (gimple_eh_else_e_body_ptr): Likewise. (gimple_eh_else_e_body): Likewise. (gimple_eh_else_set_n_body): Likewise. (gimple_eh_else_set_e_body): Likewise. (gimple_try_set_kind): Require a gtry *. (gimple_try_set_catch_is_cleanup): Likewise. (gimple_try_set_eval): Likewise. (gimple_try_set_cleanup): Likewise. (gimple_try_eval_ptr): Update for renaming of subclass to gtry. (gimple_try_cleanup_ptr): Likewise. (gimple_phi_capacity): Update for renaming of subclass to gphi. (gimple_phi_num_args): Likewise. (gimple_phi_result): Likewise. (gimple_phi_result_ptr): Likewise. (gimple_phi_arg): Likewise. (gimple_phi_set_result): Require a gphi *. (gimple_phi_set_arg): Likewise. (gimple_phi_arg_def_ptr): Likewise. (gimple_phi_arg_edge): Likewise. (gimple_phi_arg_location): Likewise. (gimple_phi_arg_location_from_edge): Likewise. (gimple_phi_arg_set_location): Likewise. (gimple_phi_arg_has_location): Likewise. (gimple_resx_region): Require a const gresx *. (gimple_resx_set_region): Require a gresx *. (gimple_eh_dispatch_region): Require a const geh_dispatch *. (gimple_eh_dispatch_set_region): Require a geh_dispatch *. (gimple_switch_num_labels): Require a const gswitch *. (gimple_switch_set_num_labels): Likewise. (gimple_switch_index): Likewise. (gimple_switch_index_ptr): Likewise. (gimple_switch_label): Likewise. (gimple_switch_default_label): Likewise. (gimple_switch_set_index): Require a gswitch *. (gimple_switch_set_label): Likewise. (gimple_switch_set_default_label): Likewise. (gimple_omp_critical_name): Require a const gomp_critical *. (gimple_omp_critical_name_ptr): Require a gomp_critical *. (gimple_omp_critical_set_name): Likewise. (gimple_omp_for_set_kind): Require a gomp_for *. (gimple_omp_for_set_combined_p): Likewise. (gimple_omp_for_set_combined_into_p): Likewise. (gimple_omp_for_clauses): Update for renaming of subclass to gomp_for. (gimple_omp_for_clauses_ptr): Likewise. (gimple_omp_for_set_clauses): Likewise. (gimple_omp_for_collapse): Likewise. (gimple_omp_for_index): Likewise. (gimple_omp_for_index_ptr): Likewise. (gimple_omp_for_set_index): Likewise. (gimple_omp_for_initial): Likewise. (gimple_omp_for_initial_ptr): Likewise. (gimple_omp_for_set_initial): Likewise. (gimple_omp_for_final): Likewise. (gimple_omp_for_final_ptr): Likewise. (gimple_omp_for_set_final): Likewise. (gimple_omp_for_incr): Likewise. (gimple_omp_for_incr_ptr): Likewise. (gimple_omp_for_set_incr): Likewise. (gimple_omp_for_pre_body): Likewise. (gimple_omp_for_set_pre_body): Likewise. (gimple_omp_parallel_clauses): Update for renaming of subclass to gomp_parallel. (gimple_omp_parallel_clauses_ptr): Require a gomp_parallel *. (gimple_omp_parallel_set_clauses): Likewise. (gimple_omp_parallel_child_fn_ptr): Likewise. (gimple_omp_parallel_set_child_fn): Likewise. (gimple_omp_parallel_data_arg_ptr): Likewise. (gimple_omp_parallel_set_data_arg): Likewise. (gimple_omp_parallel_child_fn): Require a const gomp_parallel *. (gimple_omp_parallel_data_arg): Likewise. (gimple_omp_task_clauses): Update for renaming of subclass to gomp_task. (gimple_omp_task_clauses_ptr): Likewise. (gimple_omp_task_set_clauses): Likewise. (gimple_omp_task_child_fn): Likewise. (gimple_omp_task_child_fn_ptr): Likewise. (gimple_omp_task_set_child_fn): Likewise. (gimple_omp_task_data_arg): Likewise. (gimple_omp_task_data_arg_ptr): Likewise. (gimple_omp_task_set_data_arg): Likewise. (gimple_omp_taskreg_clauses): Whitespace fixes. (gimple_omp_taskreg_clauses_ptr): Likewise. (gimple_omp_taskreg_set_clauses): Likewise. (gimple_omp_taskreg_child_fn): Likewise. (gimple_omp_taskreg_child_fn_ptr): Likewise. (gimple_omp_taskreg_set_child_fn): Likewise. (gimple_omp_taskreg_data_arg): Likewise. (gimple_omp_taskreg_data_arg_ptr): Likewise. (gimple_omp_taskreg_set_data_arg): Likewise. (gimple_omp_task_copy_fn): Update for renaming of subclass to gomp_task. (gimple_omp_task_copy_fn_ptr): Likewise. (gimple_omp_task_set_copy_fn): Likewise. (gimple_omp_task_arg_size): Likewise. (gimple_omp_task_arg_size_ptr): Likewise. (gimple_omp_task_set_arg_size): Likewise. (gimple_omp_task_arg_align): Likewise. (gimple_omp_task_arg_align_ptr): Likewise. (gimple_omp_task_set_arg_align): Likewise. (gimple_omp_single_clauses): Update for renaming of subclass to gomp_single. (gimple_omp_single_clauses_ptr): Likewise. (gimple_omp_single_set_clauses): Likewise. (gimple_omp_target_clauses): Update for renaming of subclass to gomp_target. (gimple_omp_target_clauses_ptr): Likewise. (gimple_omp_target_set_clauses): Require a gomp_target *. (gimple_omp_target_set_kind): Likewise. (gimple_omp_target_child_fn_ptr): Likewise. (gimple_omp_target_set_child_fn): Likewise. (gimple_omp_target_data_arg_ptr): Likewise. (gimple_omp_target_set_data_arg): Likewise. (gimple_omp_target_child_fn): Require a const gomp_target *. (gimple_omp_target_data_arg): Likewise. (gimple_omp_teams_clauses): Update for renaming of subclass to gomp_teams. (gimple_omp_teams_clauses_ptr): Likewise. (gimple_omp_teams_set_clauses): Require a gomp_teams *. (gimple_omp_sections_clauses): Update for renaming of subclass to gomp_sections. (gimple_omp_sections_clauses_ptr): Likewise. (gimple_omp_sections_set_clauses): Likewise. (gimple_omp_sections_control): Likewise. (gimple_omp_sections_control_ptr): Likewise. (gimple_omp_sections_set_control): Likewise. (gimple_omp_for_set_cond): Likewise. (gimple_omp_for_cond): Likewise. (gimple_omp_atomic_store_set_val): Require a gomp_atomic_store *. (gimple_omp_atomic_store_val_ptr): Likewise. (gimple_omp_atomic_load_set_lhs): Likewise. (gimple_omp_atomic_store_val): Require a const gomp_atomic_store *. (gimple_omp_atomic_load_lhs): Likewise. (gimple_omp_atomic_load_rhs): Likewise. (gimple_omp_atomic_load_lhs_ptr): Require a gomp_atomic_load *. (gimple_omp_atomic_load_set_rhs): Likewise. (gimple_omp_atomic_load_rhs_ptr): Likewise. (gimple_omp_continue_control_def): Require a const gomp_continue *. (gimple_omp_continue_control_use): Likewise. (gimple_omp_continue_control_def_ptr): Require a gomp_continue *. (gimple_omp_continue_set_control_def): Likewise. (gimple_omp_continue_control_use_ptr): Likewise. (gimple_omp_continue_set_control_use): Likewise. (gimple_transaction_body_ptr): Require a gtransaction *. (gimple_transaction_body): Likewise. (gimple_transaction_label_ptr): Likewise. (gimple_transaction_label): Require a const gtransaction *. (gimple_transaction_subcode): Likewise. (gimple_transaction_set_body): Require a gtransaction *. (gimple_transaction_set_label): Likewise. (gimple_transaction_set_subcode): Likewise. (gimple_return_retval_ptr): Require a const greturn *. (gimple_return_retval): Likewise. (gimple_return_set_retval): Require a greturn *. (gimple_expr_type): Introduce local "call_stmt" and use in place of "stmt" for typesafety. * asan.c: Use gimple subclasses. * auto-profile.c: Likewise. * builtins.c: Likewise. * builtins.h: Likewise. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * expr.h: Likewise. * gimple-builder.c: Likewise. * gimple-builder.h: Likewise. * gimple-fold.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimple-walk.c: Likewise. * gimplify-me.c: Likewise. * gimplify.c: Likewise. * gimplify.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * internal-fn.c: Likewise. * internal-fn.def:: Likewise. * internal-fn.h: Likewise. * ipa-icf-gimple.c: Likewise. * ipa-icf-gimple.h: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-split.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * omp-low.c: Likewise. * predict.c: Likewise. * sanopt.c: Likewise. * sese.c: Likewise. * ssa-iterators.h: Likewise. * stmt.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfg.h: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chkp.c: Likewise. * tree-chkp.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-eh.c: Likewise. * tree-eh.h: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-into-ssa.h: Likewise. * tree-loop-distribution.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-phinodes.h: Likewise. * tree-predcom.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h * tree-sra.cn_function): * tree-ssa-alias.c: Likewise. * tree-ssa-alias.h: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c * tree-ssa-structalias.c * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadedge.h: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-stdarg.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * ubsan.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * vtable-verify.c: Likewise. gcc/c-family/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * c-gimplify.c (add_block_to_enclosing): Strengthen local "stack" from being just a vec<gimple> to a vec<gbind *>. gcc/java/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * java-gimplify.c (java_gimplify_block): Strengthen local "outer" from gimple to gbind *. From-SVN: r217787
2014-11-19 18:00:54 +01:00
link = gimple_asm_input_op (asm_stmt, i);
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
constraint
= TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (link)));
input = TREE_VALUE (link);
if (TREE_CODE (input) != SSA_NAME)
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
continue;
match = strtoul (constraint, &end, 10);
if (match >= noutputs || end == constraint)
continue;
if (TREE_CODE (outputs[match]) != SSA_NAME)
continue;
v1 = SSA_NAME_VERSION (outputs[match]);
v2 = SSA_NAME_VERSION (input);
if (gimple_can_coalesce_p (outputs[match], input))
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
{
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
cost = coalesce_cost (REG_BR_PROB_BASE,
optimize_bb_for_size_p (bb));
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
add_coalesce (cl, v1, v2, cost);
bitmap_set_bit (used_in_copy, v1);
bitmap_set_bit (used_in_copy, v2);
}
}
break;
}
default:
break;
}
}
}
/* Now process result decls and live on entry variables for entry into
the coalesce list. */
first = NULL_TREE;
for (i = 1; i < num_ssa_names; i++)
{
Expand from SSA. gcc/ Expand from SSA. * builtins.c (fold_builtin_next_arg): Handle SSA names. * tree-ssa-copyrename.c (rename_ssa_copies): Use ssa_name() directly. * tree-ssa-coalesce.c (create_outofssa_var_map): Mark only useful SSA names. (compare_pairs): Swap cost comparison. (coalesce_ssa_name): Don't use change_partition_var. * tree-nrv.c (struct nrv_data): Add modified member. (finalize_nrv_r): Set it. (tree_nrv): Use it to update statements. (pass_nrv): Require PROP_ssa. * tree-mudflap.c (mf_decl_cache_locals, mf_build_check_statement_for): Use make_rename_temp. (pass_mudflap_2): Require PROP_ssa, run ssa update at finish. * alias.c (find_base_decl): Handle SSA names. * emit-rtl (set_reg_attrs_for_parm): Make non-static. (component_ref_for_mem_expr): Don't leak SSA names into RTL. * rtl.h (set_reg_attrs_for_parm): Declare. * tree-optimize.c (pass_cleanup_cfg_post_optimizing): Rename to "optimized", remove unused locals at finish. (execute_free_datastructures): Make global, call delete_tree_cfg_annotations. (execute_free_cfg_annotations): Don't call delete_tree_cfg_annotations. * ssaexpand.h: New file. * expr.c (toplevel): Include ssaexpand.h. (expand_assignment): Handle SSA names the same as register variables. (expand_expr_real_1): Expand SSA names. * cfgexpand.c (toplevel): Include ssaexpand.h. (SA): New global variable. (gimple_cond_pred_to_tree): Fold TERed comparisons into predicates. (SSAVAR): New macro. (set_rtl): New helper function. (add_stack_var): Deal with SSA names, use set_rtl. (expand_one_stack_var_at): Likewise. (expand_one_stack_var): Deal with SSA names. (stack_var_size_cmp): Use code (SSA_NAME / DECL) as tie breaker before unique numbers. (expand_stack_vars): Use set_rtl. (expand_one_var): Accept SSA names, add asserts for them, feed them to above subroutines. (expand_used_vars): Expand all partitions (without default defs), then only the local decls (ignoring those expanded already). (expand_gimple_cond): Remove edges when jumpif() expands an unconditional jump. (expand_gimple_basic_block): Don't clear EDGE_EXECUTABLE here, or remove abnormal edges. Ignore insns setting the LHS of a TERed SSA name. (gimple_expand_cfg): Call into rewrite_out_of_ssa, initialize members of SA; deal with PARM_DECL partitions here; expand all PHI nodes, free tree datastructures and SA. Commit instructions on edges, clear EDGE_EXECUTABLE and remove abnormal edges here. (pass_expand): Require and destroy PROP_ssa, verify SSA form, flow info and statements at start, collect garbage at finish. * tree-ssa-live.h (struct _var_map): Remove partition_to_var member. (VAR_ANN_PARTITION) Remove. (change_partition_var): Don't declare. (partition_to_var): Always return SSA names. (var_to_partition): Only accept SSA names. (register_ssa_partition): Only check argument. * tree-ssa-live.c (init_var_map): Don't allocate partition_to_var member. (delete_var_map): Don't free it. (var_union): Only accept SSA names, simplify. (partition_view_init): Mark only useful SSA names as used. (partition_view_fini): Only deal with SSA names. (change_partition_var): Remove. (dump_var_map): Use ssa_name instead of partition_to_var member. * tree-ssa.c (delete_tree_ssa): Don't remove PHI nodes on RTL basic blocks. * tree-outof-ssa.c (toplevel): Include ssaexpand.h and expr.h. (struct _elim_graph): New member const_dests; nodes member vector of ints. (set_location_for_edge): New static helper. (create_temp): Remove. (insert_partition_copy_on_edge, insert_part_to_rtx_on_edge, insert_value_copy_on_edge, insert_rtx_to_part_on_edge): New functions. (new_elim_graph): Allocate const_dests member. (clean_elim_graph): Truncate const_dests member. (delete_elim_graph): Free const_dests member. (elim_graph_size): Adapt to new type of nodes member. (elim_graph_add_node): Likewise. (eliminate_name): Likewise. (eliminate_build): Don't take basic block argument, deal only with partition numbers, not variables. (get_temp_reg): New static helper. (elim_create): Use it, deal with RTL temporaries instead of trees. (eliminate_phi): Adjust all calls to new signature. (assign_vars, replace_use_variable, replace_def_variable): Remove. (rewrite_trees): Only do checking. (edge_leader, stmt_list, leader_has_match, leader_match): Remove. (same_stmt_list_p, identical_copies_p, identical_stmt_lists_p, init_analyze_edges_for_bb, fini_analyze_edges_for_bb, contains_tree_r, MAX_STMTS_IN_LATCH, process_single_block_loop_latch, analyze_edges_for_bb, perform_edge_inserts): Remove. (expand_phi_nodes): New global function. (remove_ssa_form): Take ssaexpand parameter. Don't call removed functions, initialize new parameter, remember partitions having a default def. (finish_out_of_ssa): New global function. (rewrite_out_of_ssa): Make global. Adjust call to remove_ssa_form, don't reset in_ssa_p here, don't disable TER when mudflap. (pass_del_ssa): Remove. * tree-flow.h (struct var_ann_d): Remove out_of_ssa_tag and partition members. (execute_free_datastructures): Declare. * Makefile.in (SSAEXPAND_H): New variable. (tree-outof-ssa.o, expr.o, cfgexpand.o): Depend on SSAEXPAND_H. * basic-block.h (commit_one_edge_insertion): Declare. * passes.c (init_optimization_passes): Move pass_nrv and pass_mudflap2 before pass_cleanup_cfg_post_optimizing, remove pass_del_ssa, pass_free_datastructures, pass_free_cfg_annotations. * cfgrtl.c (commit_one_edge_insertion): Make global, don't declare. (redirect_branch_edge): Deal with super block when expanding, split out jump patching itself into ... (patch_jump_insn): ... here, new static helper. testsuite/ Expand from SSA. * gcc.dg/tree-ssa/20030728-1.c: Use -rtl-expand-details dump and change regexps. * gcc.target/i386/pr37248-1.c: Modified. * gcc.target/i386/pr37248-3.c: Modified. * gcc.target/i386/pr37248-2.c: Modified. * gnat.dg/aliasing1.adb: Modified. * gnat.dg/pack9.adb: Modified. * gnat.dg/aliasing2.adb: Modified. * gcc.dg/strict-overflow-2.c: Modified. * gcc.dg/autopar/reduc-1char.c: Modified. * gcc.dg/autopar/reduc-2char.c: Modified. * gcc.dg/autopar/reduc-1.c: Modified. * gcc.dg/autopar/reduc-2.c: Modified. * gcc.dg/autopar/reduc-3.c: Modified. * gcc.dg/autopar/reduc-6.c: Modified. * gcc.dg/autopar/reduc-7.c: Modified. * gcc.dg/autopar/reduc-8.c: Modified. * gcc.dg/autopar/reduc-9.c: Modified. * gcc.dg/autopar/reduc-1short.c: Modified. * gcc.dg/autopar/reduc-2short.c: Modified. * gcc.dg/autopar/parallelization-1.c: Modified. * gcc.dg/strict-overflow-4.c: Modified. * gcc.dg/strict-overflow-6.c: Modified. * gcc.dg/gomp/combined-1.c: Modified. * gcc.dg/no-strict-overflow-1.c: Modified. * gcc.dg/no-strict-overflow-3.c: Modified. * gcc.dg/no-strict-overflow-5.c: Modified. * gcc.dg/tree-ssa/reassoc-13.c: Modified. * gcc.dg/tree-ssa/pr18134.c: Modified. * gcc.dg/tree-ssa/20030824-1.c: Modified. * gcc.dg/tree-ssa/vector-2.c: Modified. * gcc.dg/tree-ssa/forwprop-9.c: Modified. * gcc.dg/tree-ssa/loop-21.c: Modified. * gcc.dg/tree-ssa/20030824-2.c: Modified. * gcc.dg/tree-ssa/vector-3.c: Modified. * gcc.dg/tree-ssa/asm-3.c: Modified. * gcc.dg/tree-ssa/pr23294.c: Modified. * gcc.dg/tree-ssa/loop-22.c: Modified. * gcc.dg/tree-ssa/loop-15.c: Modified. * gcc.dg/tree-ssa/prefetch-4.c: Modified. * gcc.dg/tree-ssa/pr22051-1.c: Modified. * gcc.dg/tree-ssa/pr20139.c: Modified. * gcc.dg/tree-ssa/scev-cast.c: Modified. * gcc.dg/tree-ssa/pr22051-2.c: Modified. * gcc.dg/tree-ssa/reassoc-1.c: Modified. * gcc.dg/tree-ssa/loop-5.c: Modified. * gcc.dg/tree-ssa/pr19431.c: Modified. * gcc.dg/tree-ssa/pr32044.c: Modified. * gcc.dg/tree-ssa/prefetch-7.c: Modified. * gcc.dg/tree-ssa/loop-19.c: Modified. * gcc.dg/tree-ssa/loop-28.c: Modified. * gcc.dg/tree-ssa/ssa-pre-15.c: Modified. * gcc.dg/tree-ssa/divide-1.c: Modified. * gcc.dg/tree-ssa/inline-1.c: Modified. * gcc.dg/tree-ssa/divide-3.c: Modified. * gcc.dg/tree-ssa/pr30978.c: Modified. * gcc.dg/tree-ssa/alias-6.c: Modified. * gcc.dg/tree-ssa/divide-4.c: Modified. * gcc.dg/tree-ssa/alias-11.c: Modified. * gcc.dg/no-strict-overflow-7.c: Modified. * gcc.dg/strict-overflow-1.c: Modified. * gcc.dg/pr15784-4.c: Modified. * gcc.dg/pr34263.c: Modified. * gcc.dg/strict-overflow-3.c: Modified. * gcc.dg/tree-prof/stringop-1.c: Modified. * gcc.dg/tree-prof/val-prof-1.c: Modified. * gcc.dg/tree-prof/val-prof-2.c: Modified. * gcc.dg/tree-prof/val-prof-3.c: Modified. * gcc.dg/tree-prof/val-prof-4.c: Modified. * gcc.dg/no-strict-overflow-2.c: Modified. * gcc.dg/no-strict-overflow-4.c: Modified. * gcc.dg/no-strict-overflow-6.c: Modified. * g++.dg/tree-ssa/pr27090.C: Modified. * g++.dg/tree-ssa/tmmti-2.C: Modified. * g++.dg/tree-ssa/ptrmemfield.C: Modified. * g++.dg/tree-ssa/pr19807.C: Modified. * g++.dg/opt/pr30965.C: Modified. * g++.dg/init/new17.C: Modified. * gfortran.dg/whole_file_6.f90: Modified. * gfortran.dg/whole_file_5.f90: Modified. * gfortran.dg/reassoc_1.f90: Modified. * gfortran.dg/reassoc_3.f90: Modified. From-SVN: r146817
2009-04-26 21:35:04 +02:00
var = ssa_name (i);
cfgexpand.c (expand_used_vars): Use virtual_operand_p. 2012-08-14 Richard Guenther <rguenther@suse.de> * cfgexpand.c (expand_used_vars): Use virtual_operand_p. * gimple-pretty-print.c (dump_phi_nodes): Likewise. * gimple-streamer-out.c (output_bb): Likewise. * graphite-sese-to-poly.c (scalar_close_phi_node_p): Likewise. (rewrite_reductions_out_of_ssa): Likewise. (rewrite_commutative_reductions_out_of_ss): Likewise. * ipa-split.c (verify_non_ssa_vars): Likewise. (consider_split): Likewise. (visit_bb): Likewise. (split_function): Likewise. * lto-streamer-out.c (output_ssa_names): Likewise. * sese.c (rename_uses): Likewise. * tree-cfg.c (replace_uses_by): Likewise. (gimple_merge_blocks): Likewise. (gimple_cfg2dot): Likewise. (verify_gimple_phi): Likewise. (replace_ssa_name): Likewise. (move_block_to_fn): Likewise. * tree-eh.c (cleanup_empty_eh_merge_phis): Likewise. * tree-if-conv.c (if_convertible_phi_p): Likewise. (predicate_scalar_phi): Likewise. * tree-inline.c (update_ssa_across_abnormal_edges): Likewise. (copy_phis_for_bb): Likewise. * tree-loop-distribution.c (generate_loops_for_partition): Likewise. (destroy_loop): Likewise. * tree-outof-ssa.c (eliminate_useless_phis): Likewise. (insert_backedge_copies): Likewise. * tree-parloops.c (transform_to_exit_first_loop): Likewise. (gather_scalar_reductions): Likewise. (try_create_reduction_list): Likewise. * tree-scalar-evolution.c (analyze_scalar_evolution_for_all_loop_ph): Likewise. (scev_const_prop): Likewise. * tree-ssa-ccp.c (debug_lattice_value): Likewise. (get_default_value): Likewise. (ccp_initialize): Likewise. * tree-ssa-coalesce.c (create_outofssa_var_map): Likewise. * tree-ssa-copy.c (may_propagate_copy): Likewise. (init_copy_prop): Likewise. * tree-ssa-dce.c (propagate_necessity): Likewise. (remove_dead_phis): Likewise. (forward_edge_to_pdom): Likewise. (eliminate_unnecessary_stmts): Likewise. * tree-ssa-live.c (partition_view_init): Likewise. (remove_unused_locals): Likewise. (register_ssa_partition_check): Likewise. * tree-ssa-loop-im.c (movement_possibility): Likewise. (move_computations_stmt): Likewise. * tree-ssa-loop-ivopts.c (determine_biv_step): Likewise. (record_invariant): Likewise. (find_interesting_uses_outside): Likewise. (determine_set_costs): Likewise. * tree-ssa-loop-manip.c (add_exit_phis_var): Likewise. (find_uses_to_rename_use): Likewise. (check_loop_closed_ssa_use): Likewise. (rewrite_phi_with_iv): Likewise. (canonicalize_loop_ivs): Likewise. * tree-ssa-math-opts.c (execute_cse_reciprocals): Likewise. * tree-ssa-phiopt.c (hoist_adjacent_loads): Likewise. * tree-ssa-pre.c (make_values_for_phi): Likewise. (compute_avail): Likewise. (eliminate): Likewise. * tree-ssa-propagate.c (substitute_and_fold): Likewise. * tree-ssa-reassoc.c (phi_rank): Likewise. * tree-ssa-strlen.c (strlen_enter_block): Likewise. * tree-ssa-structalias.c (compute_points_to_sets): Likewise. (ipa_pta_execute): Likewise. * tree-ssa-tail-merge.c (same_succ_hash): Likewise. (release_last_vdef): Likewise. (same_phi_alternatives_1): Likewise. (bb_has_non_vop_phi): Likewise. (vop_phi): Likewise. * tree-ssa-threadedge.c (record_temporary_equivalences_from_phis): Likewise. * tree-ssa-uninit.c (warn_uninitialized_phi): Likewise. (execute_late_warn_uninitialized): Likewise. * tree-ssa.c (verify_ssa_name): Likewise. (verify_phi_args): Likewise. (verify_ssa): Likewise. * tree-stdarg.c (execute_optimize_stdarg): Likewise. * tree-vect-loop-manip.c (slpeel_update_phi_nodes_for_guard1): Likewise. (slpeel_tree_peel_loop_to_edge): Likewise. (vect_can_advance_ivs_p): Likewise. (vect_update_ivs_after_vectorizer): Likewise. * tree-vect-loop.c (vect_analyze_scalar_cycles_1): Likewise. * tree-vrp.c (remove_range_assertions): Likewise. * value-prof.c (gimple_divmod_values_to_profile): Likewise. From-SVN: r190385
2012-08-14 16:16:18 +02:00
if (var != NULL_TREE && !virtual_operand_p (var))
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
{
/* Add coalesces between all the result decls. */
tree.h (SSA_NAME_VAR): Return NULL_TREE if an IDENTIFIER_NODE is recorded as var. 2012-08-10 Richard Guenther <rguenther@suse.de> * tree.h (SSA_NAME_VAR): Return NULL_TREE if an IDENTIFIER_NODE is recorded as var. (SSA_NAME_IDENTIFIER): Return the IDENTIFIER_NODE of the SSA_NAME or its SSA_NAME_VAR. (SET_SSA_NAME_VAR_OR_IDENTIFIER): New setter. * tree-ssanames.c (make_ssa_name_fn): Handle creating anonymous SSA names by passing a type instead of a variable decl. (release_ssa_name): Use SET_SSA_NAME_VAR_OR_IDENTIFIER. (copy_ssa_name_fn): Handle anonymous SSA names. (replace_ssa_name_symbol): Use SET_SSA_NAME_VAR_OR_IDENTIFIER. * tree-flow-inline.h (make_temp_ssa_name): New inline function. * tree-pretty-print.c (dump_generic_node): Use SSA_NAME_IDENTIFIER, dump SSA names without a name as <anon>. * cfgexpand.c (expand_used_vars): Assing anonymous SSA names we are going to expand a decl. (gimple_expand_cfg): Assign all SSA names of a partition the decl we created for its leader. * tree-ssa.c (target_for_debug_bind): Handle SSA_NAMEs. (verify_ssa_name): Handle anonymous SSA names. (verify_def): Likewise. * tree-predcom.c (eliminate_temp_copies): Likewise. * tree-ssa-copyrename.c (copy_rename_partition_coalesce): Likewise. * tree-ssa-live.c (var_map_base_init): Compute conflicts for anonymous SSA names with the same type. (mark_all_vars_used_1): Handle anonymous SSA names. (verify_live_on_entry): Likewise. * tree-ssa-coalesce.c (abnormal_corrupt): Remove. (create_outofssa_var_map): Adjust with respect to conflicts we compute for anonymous SSA names. Do not restrict abnormal coalescing. (coalesce_partitions): Do not restrict abnormal coalescing. Assert we only ever coalesce variables we computed conflicts for. * tree-ssa-ter.c (process_replaceable): Do not restrict TER of anonymous names. * expr.c (expand_expr_real_1): Handle anonymous SSA names expanded from IVOPTs by creating a raw REG here. * tree-cfg.c (replace_ssa_name): Handle anonymous SSA names. (dump_function_to_file): Dump anonymous SSA names alongside with their types in the variable list. (verify_gimple_return): Guard use of SSA_NAME_VAR. * tree-into-ssa.c (mark_for_renaming): Handle a NULL symbol. (rewrite_into_ssa): Make SSA names anonymous. * tree-ssa-structalias.c (alias_get_name): Rewrite. * tree-ssa-uninit.c (ssa_undefined_value_p): Handle anonymous SSA names. (warn_uninitialized_phi): Likewise. * tree-ssa-loop-ivopts.c (prepare_decl_rtl): Defer expanding anonymous SSA names to the expander. (determine_iv_cost): Anonymous SSA names are artificial. * tree-ssa-loop-manip.c (tree_transform_and_unroll_loop): Handle anonymous SSA names. * lto-streamer-out.c (output_ssa_names): Stream SSA_NAME_VAR or if NULL, the type of the SSA name. * tree-inline.c (remap_ssa_name): Handle anonymous SSA names, remap names as anonymous where appropriate. (insert_init_stmt): Pass SSA names down to insert_init_debug_bind. * tree-ssa-uncprop.c (uncprop_into_successor_phis): Adjust according to what we create conflicts for in out-of-SSA coalescing. * tree-parloops.c (separate_decls_in_region_name): Handle anonymous SSA names. (add_field_for_name): Likewise. * tree.c (get_name): Handle SSA names. * tree-ssa-loop-im.c (gen_lsm_tmp_name): Defer to get_name for SSA_NAMEs. * tree-vect-loop-manip.c (adjust_debug_stmts): Use virtual_operand_p. * tree-sra.c (create_access_replacement): Give up generating a DECL_DEBUG_EXPR for SSA names in the memory reference. (replace_removed_params_ssa_names): Guard use of SSA_NAME_VAR. * tree-complex.c (get_component_ssa_name): Handle anonymous SSA names. (set_component_ssa_name): Likewise. * tree-ssa-sccvn.c (visit_reference_op_load): Likewise. * tree-object-size.c (collect_object_sizes_for): Handle uninitialized SSA names properly. * ipa-inline-analysis.c (eliminated_by_inlining_prob): Guard use of SSA_NAME_VAR. * ipa-split.c (test_nonssa_use): Likewise. (consider_split): Likewise. (mark_nonssa_use): Likewise. c-family/ * c-pretty-print.c (pp_c_expression): Handle anonymous SSA names. cp/ * error.c (dump_expr): Likewise. * g++.dg/plugin/selfassign.c: Adjust. * gcc.dg/plugin/selfassign.c: Likewise. * gcc.dg/strlenopt-11.c: Likewise. * gcc.dg/strlenopt-13.c: Likewise. * gcc.dg/no-strict-overflow-4.c: Likewise. * gcc.dg/strict-overflow-4.c: Likewise. * gcc.dg/tree-ssa/alias-11.c: Likewise. * gcc.dg/tree-ssa/alias-6.c: Likewise. * gcc.dg/tree-ssa/asm-3.c: Likewise. * gcc.dg/tree-ssa/pr18908.c: Likewise. * gcc.dg/tree-ssa/pr19431.c: Likewise. * gcc.dg/tree-ssa/ssa-pre-21.c: Likewise. * gcc.dg/tree-ssa/phi-opt-10.c: Likewise. * gcc.dg/tree-ssa/phi-opt-7.c: Likewise. * gcc.dg/tree-ssa/slsr-27.c: Likewise. * gcc.dg/tree-ssa/slsr-28.c: Likewise. * gcc.dg/tree-ssa/slsr-29.c: Likewise. * gcc.dg/pr46309.c: Likewise. * gcc.dg/tree-ssa/loop-5.c: Likewise. From-SVN: r190284
2012-08-10 10:29:29 +02:00
if (SSA_NAME_VAR (var)
&& TREE_CODE (SSA_NAME_VAR (var)) == RESULT_DECL)
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
{
if (first == NULL_TREE)
first = var;
else
{
gcc_assert (gimple_can_coalesce_p (var, first));
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
v1 = SSA_NAME_VERSION (first);
v2 = SSA_NAME_VERSION (var);
bitmap_set_bit (used_in_copy, v1);
bitmap_set_bit (used_in_copy, v2);
Eliminate ENTRY_BLOCK_PTR and EXIT_BLOCK_PTR macros gcc/ * basic-block.h (ENTRY_BLOCK_PTR_FOR_FUNCTION): Rename macro to... (EXIT_BLOCK_PTR_FOR_FUNCTION): ...this. (ENTRY_BLOCK_PTR_FOR_FN): Renamed macro to... (EXIT_BLOCK_PTR_FOR_FN): ...this. (ENTRY_BLOCK_PTR): Eliminate macro as work towards making uses of cfun be explicit. (EXIT_BLOCK_PTR): Likewise. (FOR_ALL_BB): Rework for now to eliminate use of "ENTRY_BLOCK_PTR". (FOR_ALL_BB_FN): Update for renaming of "ENTRY_BLOCK_PTR_FOR_FUNCTION" to "ENTRY_BLOCK_PTR_FOR_FN". * cfg.c (init_flow): Likewise. (check_bb_profile): Likewise. * cfganal.c (pre_and_rev_post_order_compute_fn): Likewise. * cfgcleanup.c (walk_to_nondebug_insn): Likewise. * cfghooks.c (account_profile_record): Likewise. * cfgloop.c (init_loops_structure): Likewise. * cgraphbuild.c (record_eh_tables): Likewise. (compute_call_stmt_bb_frequency): Likewise. * ipa-inline-analysis.c (compute_bb_predicates): Likewise. * lto-streamer-in.c (input_cfg): Likewise. * predict.c (maybe_hot_frequency_p): Likewise. * tree-cfg.c (init_empty_tree_cfg_for_function): Likewise. * tree-inline.c (initialize_cfun): Likewise. (copy_cfg_body): Likewise. (copy_body): Likewise. (tree_function_versioning): Likewise. * bb-reorder.c (add_labels_and_missing_jumps): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (duplicate_computed_gotos): Remove usage of EXIT_BLOCK_PTR macro. (find_rarely_executed_basic_blocks_and_crossing_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (connect_traces): Likewise. (rest_of_handle_reorder_blocks): Remove usage of EXIT_BLOCK_PTR macro. (bb_to_key): Remove usage of ENTRY_BLOCK_PTR macro. (fix_crossing_conditional_branches): Remove usage of EXIT_BLOCK_PTR macro. (find_traces_1_round): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (fix_up_fall_thru_edges): Remove usage of EXIT_BLOCK_PTR macro. (find_traces): Remove usage of ENTRY_BLOCK_PTR macro. (fix_up_crossing_landing_pad): Remove usage of EXIT_BLOCK_PTR macro. (rotate_loop): Likewise. * bt-load.c (migrate_btr_def): Remove usage of ENTRY_BLOCK_PTR macro. * cfg.c (clear_aux_for_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (alloc_aux_for_edges): Likewise. (clear_bb_flags): Remove usage of ENTRY_BLOCK_PTR macro. (cached_make_edge): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compact_blocks): Likewise. (clear_edges): Likewise. * cfganal.c (single_pred_before_succ_order): Remove usage of ENTRY_BLOCK_PTR macro. (bitmap_union_of_succs): Remove usage of EXIT_BLOCK_PTR macro. (bitmap_union_of_preds): Remove usage of ENTRY_BLOCK_PTR macro. (bitmap_intersection_of_succs): Remove usage of EXIT_BLOCK_PTR macro. (bitmap_intersection_of_preds): Remove usage of ENTRY_BLOCK_PTR macro. (inverted_post_order_compute): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compute_dominance_frontiers_1): Remove usage of ENTRY_BLOCK_PTR macro. (post_order_compute): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (connect_infinite_loops_to_exit): Remove usage of EXIT_BLOCK_PTR macro. (remove_fake_edges): Remove usage of ENTRY_BLOCK_PTR macro. (add_noreturn_fake_exit_edges): Remove usage of EXIT_BLOCK_PTR macro. (find_pdom): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (remove_fake_exit_edges): Remove usage of EXIT_BLOCK_PTR macro. (verify_edge_list): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (print_edge_list): Likewise. (create_edge_list): Likewise. (find_unreachable_blocks): Remove usage of ENTRY_BLOCK_PTR macro. (mark_dfs_back_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * cfgbuild.c (find_bb_boundaries): Remove usage of ENTRY_BLOCK_PTR macro. (find_many_sub_basic_blocks): Remove usage of EXIT_BLOCK_PTR macro. (make_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * cfgcleanup.c (delete_unreachable_blocks): Likewise. (try_optimize_cfg): Likewise. (try_head_merge_bb): Remove usage of EXIT_BLOCK_PTR macro. (try_crossjump_to_edge): Remove usage of ENTRY_BLOCK_PTR macro. (try_crossjump_bb): Remove usage of EXIT_BLOCK_PTR macro. (merge_blocks_move): Remove usage of ENTRY_BLOCK_PTR macro. (outgoing_edges_match): Remove usage of EXIT_BLOCK_PTR macro. (try_forward_edges): Likewise. (try_simplify_condjump): Likewise. * cfgexpand.c (gimple_expand_cfg): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (construct_exit_block): Remove usage of EXIT_BLOCK_PTR macro. (construct_init_block): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (expand_gimple_basic_block): Remove usage of EXIT_BLOCK_PTR macro. (expand_gimple_tailcall): Likewise. * cfghooks.c (can_duplicate_block_p): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (tidy_fallthru_edges): Likewise. (verify_flow_info): Likewise. * cfgloop.c (flow_bb_inside_loop_p): Likewise. (num_loop_branches): Remove usage of EXIT_BLOCK_PTR macro. (disambiguate_multiple_latches): Remove usage of ENTRY_BLOCK_PTR macro. (get_loop_exit_edges): Remove usage of EXIT_BLOCK_PTR macro. (bb_loop_header_p): Remove usage of ENTRY_BLOCK_PTR macro. (get_loop_body_in_bfs_order): Remove usage of EXIT_BLOCK_PTR macro. (get_loop_body_in_dom_order): Likewise. (get_loop_body): Likewise. * cfgloopanal.c (mark_irreducible_loops): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * cfgloopmanip.c (create_preheader): Remove usage of ENTRY_BLOCK_PTR macro. (remove_path): Remove usage of EXIT_BLOCK_PTR macro. (fix_bb_placement): Likewise. * cfgrtl.c (rtl_block_empty_p): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (rtl_can_remove_branch_p): Remove usage of EXIT_BLOCK_PTR macro. (cfg_layout_split_edge): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (rtl_flow_call_edges_add): Remove usage of EXIT_BLOCK_PTR macro. (cfg_layout_can_merge_blocks_p): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (cfg_layout_redirect_edge_and_branch): Remove usage of ENTRY_BLOCK_PTR macro. (fixup_fallthru_exit_predecessor): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (fixup_reorder_chain): Likewise. (relink_block_chain): Likewise. (cfg_layout_delete_block): Remove usage of EXIT_BLOCK_PTR macro. (rtl_verify_bb_layout): Remove usage of ENTRY_BLOCK_PTR macro. (cfg_layout_duplicate_bb): Remove usage of EXIT_BLOCK_PTR macro. (force_one_exit_fallthru): Likewise. (rtl_verify_fallthru): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (rtl_verify_edges): Likewise. (commit_edge_insertions): Likewise. (commit_one_edge_insertion): Likewise. (rtl_split_edge): Likewise. (force_nonfallthru_and_redirect): Likewise. (outof_cfg_layout_mode): Remove usage of EXIT_BLOCK_PTR macro. (skip_insns_after_block): Likewise. (fixup_partition_crossing): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (purge_dead_edges): Remove usage of EXIT_BLOCK_PTR macro. (rtl_can_merge_blocks): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (contains_no_active_insn_p): Likewise. (emit_insn_at_entry): Remove usage of ENTRY_BLOCK_PTR macro. (entry_of_function): Likewise. (last_bb_in_partition): Remove usage of EXIT_BLOCK_PTR macro. (fixup_new_cold_bb): Likewise. (patch_jump_insn): Likewise. (try_redirect_by_replacing_jump): Likewise. (block_label): Likewise. (could_fall_through): Likewise. (can_fallthru): Likewise. * cgraphbuild.c (cgraph_rebuild_references): Remove usage of ENTRY_BLOCK_PTR macro. (rebuild_cgraph_edges): Likewise. * cgraphunit.c (init_lowered_empty_function): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (expand_thunk): Remove usage of EXIT_BLOCK_PTR macro. * combine.c (get_last_value): Remove usage of ENTRY_BLOCK_PTR macro. (distribute_links): Remove usage of EXIT_BLOCK_PTR macro. (get_last_value_validate): Remove usage of ENTRY_BLOCK_PTR macro. (try_combine): Remove usage of EXIT_BLOCK_PTR macro. (reg_num_sign_bit_copies_for_combine): Remove usage of ENTRY_BLOCK_PTR macro. (reg_nonzero_bits_for_combine): Likewise. (set_nonzero_bits_and_sign_copies): Likewise. (combine_instructions): Likewise. * cprop.c (one_cprop_pass): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (bypass_conditional_jumps): Likewise. (bypass_block): Remove usage of EXIT_BLOCK_PTR macro. (find_implicit_sets): Likewise. (cprop_jump): Likewise. * cse.c (cse_cc_succs): Likewise. (cse_find_path): Likewise. * df-problems.c (df_lr_confluence_0): Likewise. * df-scan.c (df_entry_block_defs_collect): Remove usage of ENTRY_BLOCK_PTR macro. (df_exit_block_uses_collect): Remove usage of EXIT_BLOCK_PTR macro. * dominance.c (iterate_fix_dominators): Remove usage of ENTRY_BLOCK_PTR macro. (calc_idoms): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (determine_dominators_for_sons): Remove usage of ENTRY_BLOCK_PTR macro. (calc_dfs_tree): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (prune_bbs_to_update_dominators): Remove usage of ENTRY_BLOCK_PTR macro. (calc_dfs_tree_nonrec): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * domwalk.c (cmp_bb_postorder): Likewise. * dse.c (dse_step1): Remove usage of EXIT_BLOCK_PTR macro. * except.c (finish_eh_generation): Remove usage of ENTRY_BLOCK_PTR macro. (sjlj_emit_function_enter): Likewise. * final.c (compute_alignments): Likewise. * function.c (thread_prologue_and_epilogue_insns): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (reposition_prologue_and_epilogue_notes): Remove usage of EXIT_BLOCK_PTR macro. (convert_jumps_to_returns): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (regno_clobbered_at_setjmp): Remove usage of ENTRY_BLOCK_PTR macro. (next_block_for_reg): Remove usage of EXIT_BLOCK_PTR macro. * gcse.c (hoist_code): Remove usage of ENTRY_BLOCK_PTR macro. (update_bb_reg_pressure): Remove usage of EXIT_BLOCK_PTR macro. (compute_code_hoist_vbeinout): Likewise. (should_hoist_expr_to_dom): Remove usage of ENTRY_BLOCK_PTR macro. (pre_expr_reaches_here_p_work): Likewise. * gimple-iterator.c (gsi_commit_edge_inserts): Likewise. (gimple_find_edge_insert_loc): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * gimple-ssa-strength-reduction.c (slsr_process_phi): Remove usage of ENTRY_BLOCK_PTR macro. * graph.c (draw_cfg_nodes_for_loop): Remove usage of EXIT_BLOCK_PTR macro. * graphite-clast-to-gimple.c (translate_clast_user): Remove usage of ENTRY_BLOCK_PTR macro. * graphite-scop-detection.c (build_scops): Likewise. (create_sese_edges): Remove usage of EXIT_BLOCK_PTR macro. (scopdet_basic_block_info): Remove usage of ENTRY_BLOCK_PTR macro. * haifa-sched.c (restore_bb_notes): Remove usage of EXIT_BLOCK_PTR macro. (unlink_bb_notes): Likewise. (create_check_block_twin): Likewise. (init_before_recovery): Likewise. (sched_extend_bb): Likewise. (priority): Likewise. * hw-doloop.c (reorder_loops): Likewise. (discover_loop): Likewise. * ifcvt.c (dead_or_predicable): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (find_if_case_1): Remove usage of EXIT_BLOCK_PTR macro. (block_has_only_trap): Likewise. (cond_exec_find_if_block): Likewise. (merge_if_block): Likewise. * ipa-inline-analysis.c (param_change_prob): Remove usage of ENTRY_BLOCK_PTR macro. (record_modified): Likewise. * ipa-pure-const.c (execute_warn_function_noreturn): Remove usage of EXIT_BLOCK_PTR macro. (local_pure_const): Likewise. * ipa-split.c (split_function): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (find_split_points): Likewise. (consider_split): Likewise. (find_return_bb): Remove usage of EXIT_BLOCK_PTR macro. (verify_non_ssa_vars): Remove usage of ENTRY_BLOCK_PTR macro. * ira-build.c (ira_loop_tree_body_rev_postorder): Likewise. * ira-color.c (print_loop_title): Remove usage of EXIT_BLOCK_PTR macro. * ira-emit.c (entered_from_non_parent_p): Remove usage of ENTRY_BLOCK_PTR macro. (ira_emit): Remove usage of EXIT_BLOCK_PTR macro. * ira-int.h (ira_assert): Remove usage of ENTRY_BLOCK_PTR macro. * ira.c (split_live_ranges_for_shrink_wrap): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * lcm.c (compute_rev_insert_delete): Remove usage of ENTRY_BLOCK_PTR macro. (compute_nearerout): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compute_farthest): Likewise. (compute_available): Likewise. (compute_insert_delete): Remove usage of EXIT_BLOCK_PTR macro. (compute_laterin): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compute_earliest): Likewise. (compute_antinout_edge): Likewise. * loop-iv.c (simplify_using_initial_values): Remove usage of ENTRY_BLOCK_PTR macro. * loop-unswitch.c (unswitch_loop): Remove usage of EXIT_BLOCK_PTR macro. * lra-assigns.c (find_hard_regno_for): Remove usage of ENTRY_BLOCK_PTR macro. * lra-constraints.c (lra_inheritance): Remove usage of EXIT_BLOCK_PTR macro. * lra-lives.c (lra_create_live_ranges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * lra.c (has_nonexceptional_receiver): Remove usage of EXIT_BLOCK_PTR macro. * lto-streamer-in.c (input_function): Remove usage of ENTRY_BLOCK_PTR macro. * lto-streamer-out.c (output_cfg): Likewise. * mcf.c (adjust_cfg_counts): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (create_fixup_graph): Remove usage of ENTRY_BLOCK_PTR macro. * mode-switching.c (optimize_mode_switching): Likewise. (create_pre_exit): Remove usage of EXIT_BLOCK_PTR macro. * modulo-sched.c (rest_of_handle_sms): Likewise. (canon_loop): Likewise. * omp-low.c (build_omp_regions): Remove usage of ENTRY_BLOCK_PTR macro. * postreload-gcse.c (eliminate_partially_redundant_loads): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * predict.c (rebuild_frequencies): Remove usage of ENTRY_BLOCK_PTR macro. (propagate_freq): Remove usage of EXIT_BLOCK_PTR macro. (estimate_bb_frequencies): Remove usage of ENTRY_BLOCK_PTR macro. (tree_estimate_probability_bb): Remove usage of EXIT_BLOCK_PTR macro. (expensive_function_p): Remove usage of ENTRY_BLOCK_PTR macro. (tree_bb_level_predictions): Remove usage of EXIT_BLOCK_PTR macro. (counts_to_freqs): Remove usage of ENTRY_BLOCK_PTR macro. (apply_return_prediction): Remove usage of EXIT_BLOCK_PTR macro. (estimate_loops): Remove usage of ENTRY_BLOCK_PTR macro. (gimple_predict_edge): Likewise. (probably_never_executed): Likewise. * profile.c (find_spanning_tree): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (branch_prob): Likewise. (compute_branch_probabilities): Likewise. (compute_frequency_overlap): Remove usage of ENTRY_BLOCK_PTR macro. (is_inconsistent): Remove usage of EXIT_BLOCK_PTR macro. (read_profile_edge_counts): Remove usage of ENTRY_BLOCK_PTR macro. (set_bb_counts): Likewise. (correct_negative_edge_counts): Likewise. (get_exec_counts): Likewise. (instrument_values): Likewise. (instrument_edges): Likewise. * reg-stack.c (convert_regs): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (compensate_edges): Remove usage of ENTRY_BLOCK_PTR macro. (convert_regs_exit): Remove usage of EXIT_BLOCK_PTR macro. (convert_regs_entry): Remove usage of ENTRY_BLOCK_PTR macro. (reg_to_stack): Likewise. * regs.h (REG_N_SETS): Likewise. * reload.c (find_dummy_reload): Likewise. (combine_reloads): Likewise. (push_reload): Likewise. * reload1.c (has_nonexceptional_receiver): Remove usage of EXIT_BLOCK_PTR macro. * resource.c (mark_target_live_regs): Remove usage of ENTRY_BLOCK_PTR macro. (find_basic_block): Likewise. * sched-ebb.c (ebb_add_block): Remove usage of EXIT_BLOCK_PTR macro. (schedule_ebbs): Likewise. * sched-int.h (sel_sched_p): Likewise. * sched-rgn.c (compute_dom_prob_ps): Remove usage of ENTRY_BLOCK_PTR macro. (rgn_add_block): Remove usage of EXIT_BLOCK_PTR macro. (haifa_find_rgns): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (propagate_deps): Remove usage of EXIT_BLOCK_PTR macro. (extend_rgns): Likewise. (find_single_block_region): Likewise. * sel-sched-ir.c (sel_remove_loop_preheader): Remove usage of ENTRY_BLOCK_PTR macro. (setup_nop_and_exit_insns): Remove usage of EXIT_BLOCK_PTR macro. (sel_create_recovery_block): Likewise. (bb_ends_ebb_p): Likewise. (sel_bb_end): Likewise. (sel_bb_head): Likewise. (free_lv_sets): Likewise. (init_lv_sets): Likewise. (tidy_control_flow): Likewise. (maybe_tidy_empty_bb): Likewise. * sel-sched-ir.h (_succ_iter_cond): Likewise. (_succ_iter_start): Likewise. (sel_bb_empty_or_nop_p): Likewise. (get_loop_exit_edges_unique_dests): Likewise. (inner_loop_header_p): Likewise. * sel-sched.c (create_block_for_bookkeeping): Likewise. (find_block_for_bookkeeping): Likewise. * store-motion.c (remove_reachable_equiv_notes): Likewise. (insert_store): Likewise. * trans-mem.c (ipa_tm_transform_clone): Remove usage of ENTRY_BLOCK_PTR macro. (tm_memopt_compute_available): Remove usage of EXIT_BLOCK_PTR macro. (ipa_tm_scan_irr_function): Remove usage of ENTRY_BLOCK_PTR macro. (gate_tm_init): Likewise. (tm_region_init): Likewise. * tree-cfg.c (execute_fixup_cfg): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (execute_warn_function_return): Remove usage of EXIT_BLOCK_PTR macro. (split_critical_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (print_loops): Remove usage of ENTRY_BLOCK_PTR macro. (move_sese_region_to_fn): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (gimple_redirect_edge_and_branch): Remove usage of ENTRY_BLOCK_PTR macro. (gimple_verify_flow_info): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (remove_edge_and_dominated_blocks): Remove usage of EXIT_BLOCK_PTR macro. (make_edges): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (gimple_flow_call_edges_add): Remove usage of EXIT_BLOCK_PTR macro. (make_blocks): Remove usage of ENTRY_BLOCK_PTR macro. (build_gimple_cfg): Likewise. (gimple_duplicate_bb): Remove usage of EXIT_BLOCK_PTR macro. (gimple_can_merge_blocks_p): Likewise. * tree-cfgcleanup.c (tree_forwarder_block_p): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * tree-complex.c (update_parameter_components): Remove usage of ENTRY_BLOCK_PTR macro. * tree-if-conv.c (get_loop_body_in_if_conv_order): Remove usage of EXIT_BLOCK_PTR macro. * tree-inline.c (tree_function_versioning): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (delete_unreachable_blocks_update_callgraph): Likewise. (initialize_cfun): Likewise. (copy_cfg_body): Remove usage of ENTRY_BLOCK_PTR macro. (copy_edges_for_bb): Remove usage of EXIT_BLOCK_PTR macro. (remap_ssa_name): Remove usage of ENTRY_BLOCK_PTR macro. * tree-into-ssa.c (update_ssa): Likewise. (maybe_register_def): Remove usage of EXIT_BLOCK_PTR macro. (insert_updated_phi_nodes_for): Remove usage of ENTRY_BLOCK_PTR macro. (rewrite_into_ssa): Likewise. (rewrite_debug_stmt_uses): Likewise. * tree-outof-ssa.c (expand_phi_nodes): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * tree-profile.c (gimple_gen_ic_func_profiler): Remove usage of ENTRY_BLOCK_PTR macro. * tree-scalar-evolution.h (block_before_loop): Likewise. * tree-sra.c (sra_ipa_reset_debug_stmts): Likewise. (dump_dereferences_table): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (analyze_caller_dereference_legality): Remove usage of ENTRY_BLOCK_PTR macro. (propagate_dereference_distances): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (initialize_parameter_reductions): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-ccp.c (gsi_prev_dom_bb_nondebug): Likewise. (optimize_stack_restore): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-coalesce.c (create_outofssa_var_map): Likewise. * tree-ssa-dce.c (eliminate_unnecessary_stmts): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (remove_dead_stmt): Remove usage of EXIT_BLOCK_PTR macro. (propagate_necessity): Remove usage of ENTRY_BLOCK_PTR macro. (mark_control_dependent_edges_necessary): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * tree-ssa-dom.c (eliminate_degenerate_phis): Remove usage of ENTRY_BLOCK_PTR macro. (tree_ssa_dominator_optimize): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-live.c (verify_live_on_entry): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (calculate_live_on_exit): Likewise. (set_var_live_on_entry): Remove usage of ENTRY_BLOCK_PTR macro. (loe_visit_block): Likewise. * tree-ssa-live.h (live_on_exit): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (live_on_entry): Likewise. * tree-ssa-loop-ivopts.c (find_interesting_uses): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-loop-manip.c (compute_live_loop_exits): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-loop-niter.c (simplify_using_initial_conditions): Likewise. (bound_difference): Likewise. * tree-ssa-loop-prefetch.c (may_use_storent_in_loop_p): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-loop-unswitch.c (simplify_using_entry_checks): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-math-opts.c (register_division_in): Likewise. * tree-ssa-phiprop.c (tree_ssa_phiprop): Likewise. * tree-ssa-pre.c (compute_avail): Likewise. (compute_antic): Remove usage of EXIT_BLOCK_PTR macro. (insert): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-propagate.c (ssa_prop_init): Likewise. (simulate_block): Remove usage of EXIT_BLOCK_PTR macro. (cfg_blocks_add): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (add_control_edge): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-reassoc.c (do_reassoc): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (build_and_add_sum): Remove usage of ENTRY_BLOCK_PTR macro. * tree-ssa-sink.c (nearest_common_dominator_of_uses): Likewise. (execute_sink_code): Remove usage of EXIT_BLOCK_PTR macro. * tree-ssa-uninit.c (find_dom): Remove usage of ENTRY_BLOCK_PTR macro. (compute_control_dep_chain): Remove usage of EXIT_BLOCK_PTR macro. (find_pdom): Likewise. (warn_uninitialized_vars): Remove usage of ENTRY_BLOCK_PTR macro. * tree-stdarg.c (reachable_at_most_once): Likewise. * tree-tailcall.c (tree_optimize_tail_calls_1): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (eliminate_tail_call): Likewise. * tsan.c (instrument_func_entry): Remove usage of ENTRY_BLOCK_PTR macro. (instrument_func_exit): Remove usage of EXIT_BLOCK_PTR macro. * var-tracking.c (vt_initialize): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. (vt_add_function_parameter): Remove usage of ENTRY_BLOCK_PTR macro. (vt_find_locations): Remove usage of EXIT_BLOCK_PTR macro. (vt_stack_adjustments): Remove uses of macros: ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR. * varasm.c (assemble_start_function): Remove usage of ENTRY_BLOCK_PTR macro. * config/bfin/bfin.c (hwloop_optimize): Likewise. * config/nds32/nds32.c (nds32_fp_as_gp_check_available): Remove usage of EXIT_BLOCK_PTR macro. * config/arm/arm.c (require_pic_register): Remove usage of ENTRY_BLOCK_PTR macro. (arm_r3_live_at_start_p): Likewise. (any_sibcall_could_use_r3): Remove usage of EXIT_BLOCK_PTR macro. * config/rs6000/rs6000.c (rs6000_emit_prologue): Likewise. * config/frv/frv.c (frv_optimize_membar_global): Likewise. * config/alpha/alpha.c (alpha_gp_save_rtx): Remove usage of ENTRY_BLOCK_PTR macro. * config/i386/i386.c (ix86_count_insn): Likewise. (ix86_seh_fixup_eh_fallthru): Remove usage of EXIT_BLOCK_PTR macro. (ix86_pad_short_function): Likewise. (ix86_compute_frame_layout): Remove usage of ENTRY_BLOCK_PTR macro. (ix86_pad_returns): Remove usage of EXIT_BLOCK_PTR macro. (ix86_eax_live_at_start_p): Remove usage of ENTRY_BLOCK_PTR macro. (add_condition_to_bb): Remove usage of EXIT_BLOCK_PTR macro. (ix86_expand_epilogue): Likewise. * config/ia64/ia64.c (ia64_asm_unwind_emit): Likewise. (ia64_expand_prologue): Likewise. From-SVN: r205055
2013-11-19 22:57:13 +01:00
cost = coalesce_cost_bb (EXIT_BLOCK_PTR_FOR_FN (cfun));
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
add_coalesce (cl, v1, v2, cost);
}
}
/* Mark any default_def variables as being in the coalesce list
since they will have to be coalesced with the base variable. If
not marked as present, they won't be in the coalesce view. */
tree-flow.h (set_default_def): Rename to ... 2012-08-02 Richard Guenther <rguenther@suse.de> * tree-flow.h (set_default_def): Rename to ... (set_ssa_default_def): ... this. Take a struct function argument. (gimple_default_def): Rename to ... (ssa_default_def): ... this. (get_or_create_ssa_default_def): New function. * tree-dfa.c: Likewise. (dump_variable): Adjust. * ipa-prop.c (ipa_analyze_params_uses): Adjust, properly check for used parameters. * ipa-split.c (consider_split): Adjust, avoid repeated default-def lookups. (split_function): Likewise. * lto-streamer-in.c (input_ssa_names): Adjust. * omp-low.c (expand_omp_taskreg): Likewise. * tree-cfg.c (replace_ssa_name): Adjust, no need to push/pop cfun. * tree-complex.c (init_parameter_lattice_values): Adjust. (get_component_ssa_name): Likewise. (update_parameter_components): Likewise. * tree-inline.c (remap_ssa_name): Likewise. (setup_one_parameter): Likewise. (initialize_inlined_parameters): Likewise. (declare_return_variable): Likewise. (expand_call_inline): Likewise. (tree_function_versioning): Likewise. * tree-into-ssa.c (get_default_def_for): Remove. (get_reaching_def): Use get_or_create_ssa_default_def instead. * tree-predcom.c (replace_ref_with): Adjust. * tree-sra.c (get_repl_default_def_ssa_name): Likewise. (is_unused_scalar_param): Likewise. (ptr_parm_has_direct_uses): Likewise. (sra_ipa_reset_debug_stmts): Likewise. * tree-ssa-coalesce.c (create_outofssa_var_map): Adjust. * tree-ssa-copyrename.c (copy_rename_partition_coalesce): Likewise. * tree-ssa-live.c (verify_live_on_entry): Likewise. * tree-ssa-math-opts.c (execute_cse_reciprocals): Likewise, avoid repeated default def lookups. * tree-ssa-sccvn.c (run_scc_vn): Likewise. * tree-tailcall.c (arg_needs_copy_p): Adjust. (tree_optimize_tail_calls_1): Likewise. From-SVN: r190073
2012-08-02 13:40:20 +02:00
if (SSA_NAME_IS_DEFAULT_DEF (var)
Expand from SSA. gcc/ Expand from SSA. * builtins.c (fold_builtin_next_arg): Handle SSA names. * tree-ssa-copyrename.c (rename_ssa_copies): Use ssa_name() directly. * tree-ssa-coalesce.c (create_outofssa_var_map): Mark only useful SSA names. (compare_pairs): Swap cost comparison. (coalesce_ssa_name): Don't use change_partition_var. * tree-nrv.c (struct nrv_data): Add modified member. (finalize_nrv_r): Set it. (tree_nrv): Use it to update statements. (pass_nrv): Require PROP_ssa. * tree-mudflap.c (mf_decl_cache_locals, mf_build_check_statement_for): Use make_rename_temp. (pass_mudflap_2): Require PROP_ssa, run ssa update at finish. * alias.c (find_base_decl): Handle SSA names. * emit-rtl (set_reg_attrs_for_parm): Make non-static. (component_ref_for_mem_expr): Don't leak SSA names into RTL. * rtl.h (set_reg_attrs_for_parm): Declare. * tree-optimize.c (pass_cleanup_cfg_post_optimizing): Rename to "optimized", remove unused locals at finish. (execute_free_datastructures): Make global, call delete_tree_cfg_annotations. (execute_free_cfg_annotations): Don't call delete_tree_cfg_annotations. * ssaexpand.h: New file. * expr.c (toplevel): Include ssaexpand.h. (expand_assignment): Handle SSA names the same as register variables. (expand_expr_real_1): Expand SSA names. * cfgexpand.c (toplevel): Include ssaexpand.h. (SA): New global variable. (gimple_cond_pred_to_tree): Fold TERed comparisons into predicates. (SSAVAR): New macro. (set_rtl): New helper function. (add_stack_var): Deal with SSA names, use set_rtl. (expand_one_stack_var_at): Likewise. (expand_one_stack_var): Deal with SSA names. (stack_var_size_cmp): Use code (SSA_NAME / DECL) as tie breaker before unique numbers. (expand_stack_vars): Use set_rtl. (expand_one_var): Accept SSA names, add asserts for them, feed them to above subroutines. (expand_used_vars): Expand all partitions (without default defs), then only the local decls (ignoring those expanded already). (expand_gimple_cond): Remove edges when jumpif() expands an unconditional jump. (expand_gimple_basic_block): Don't clear EDGE_EXECUTABLE here, or remove abnormal edges. Ignore insns setting the LHS of a TERed SSA name. (gimple_expand_cfg): Call into rewrite_out_of_ssa, initialize members of SA; deal with PARM_DECL partitions here; expand all PHI nodes, free tree datastructures and SA. Commit instructions on edges, clear EDGE_EXECUTABLE and remove abnormal edges here. (pass_expand): Require and destroy PROP_ssa, verify SSA form, flow info and statements at start, collect garbage at finish. * tree-ssa-live.h (struct _var_map): Remove partition_to_var member. (VAR_ANN_PARTITION) Remove. (change_partition_var): Don't declare. (partition_to_var): Always return SSA names. (var_to_partition): Only accept SSA names. (register_ssa_partition): Only check argument. * tree-ssa-live.c (init_var_map): Don't allocate partition_to_var member. (delete_var_map): Don't free it. (var_union): Only accept SSA names, simplify. (partition_view_init): Mark only useful SSA names as used. (partition_view_fini): Only deal with SSA names. (change_partition_var): Remove. (dump_var_map): Use ssa_name instead of partition_to_var member. * tree-ssa.c (delete_tree_ssa): Don't remove PHI nodes on RTL basic blocks. * tree-outof-ssa.c (toplevel): Include ssaexpand.h and expr.h. (struct _elim_graph): New member const_dests; nodes member vector of ints. (set_location_for_edge): New static helper. (create_temp): Remove. (insert_partition_copy_on_edge, insert_part_to_rtx_on_edge, insert_value_copy_on_edge, insert_rtx_to_part_on_edge): New functions. (new_elim_graph): Allocate const_dests member. (clean_elim_graph): Truncate const_dests member. (delete_elim_graph): Free const_dests member. (elim_graph_size): Adapt to new type of nodes member. (elim_graph_add_node): Likewise. (eliminate_name): Likewise. (eliminate_build): Don't take basic block argument, deal only with partition numbers, not variables. (get_temp_reg): New static helper. (elim_create): Use it, deal with RTL temporaries instead of trees. (eliminate_phi): Adjust all calls to new signature. (assign_vars, replace_use_variable, replace_def_variable): Remove. (rewrite_trees): Only do checking. (edge_leader, stmt_list, leader_has_match, leader_match): Remove. (same_stmt_list_p, identical_copies_p, identical_stmt_lists_p, init_analyze_edges_for_bb, fini_analyze_edges_for_bb, contains_tree_r, MAX_STMTS_IN_LATCH, process_single_block_loop_latch, analyze_edges_for_bb, perform_edge_inserts): Remove. (expand_phi_nodes): New global function. (remove_ssa_form): Take ssaexpand parameter. Don't call removed functions, initialize new parameter, remember partitions having a default def. (finish_out_of_ssa): New global function. (rewrite_out_of_ssa): Make global. Adjust call to remove_ssa_form, don't reset in_ssa_p here, don't disable TER when mudflap. (pass_del_ssa): Remove. * tree-flow.h (struct var_ann_d): Remove out_of_ssa_tag and partition members. (execute_free_datastructures): Declare. * Makefile.in (SSAEXPAND_H): New variable. (tree-outof-ssa.o, expr.o, cfgexpand.o): Depend on SSAEXPAND_H. * basic-block.h (commit_one_edge_insertion): Declare. * passes.c (init_optimization_passes): Move pass_nrv and pass_mudflap2 before pass_cleanup_cfg_post_optimizing, remove pass_del_ssa, pass_free_datastructures, pass_free_cfg_annotations. * cfgrtl.c (commit_one_edge_insertion): Make global, don't declare. (redirect_branch_edge): Deal with super block when expanding, split out jump patching itself into ... (patch_jump_insn): ... here, new static helper. testsuite/ Expand from SSA. * gcc.dg/tree-ssa/20030728-1.c: Use -rtl-expand-details dump and change regexps. * gcc.target/i386/pr37248-1.c: Modified. * gcc.target/i386/pr37248-3.c: Modified. * gcc.target/i386/pr37248-2.c: Modified. * gnat.dg/aliasing1.adb: Modified. * gnat.dg/pack9.adb: Modified. * gnat.dg/aliasing2.adb: Modified. * gcc.dg/strict-overflow-2.c: Modified. * gcc.dg/autopar/reduc-1char.c: Modified. * gcc.dg/autopar/reduc-2char.c: Modified. * gcc.dg/autopar/reduc-1.c: Modified. * gcc.dg/autopar/reduc-2.c: Modified. * gcc.dg/autopar/reduc-3.c: Modified. * gcc.dg/autopar/reduc-6.c: Modified. * gcc.dg/autopar/reduc-7.c: Modified. * gcc.dg/autopar/reduc-8.c: Modified. * gcc.dg/autopar/reduc-9.c: Modified. * gcc.dg/autopar/reduc-1short.c: Modified. * gcc.dg/autopar/reduc-2short.c: Modified. * gcc.dg/autopar/parallelization-1.c: Modified. * gcc.dg/strict-overflow-4.c: Modified. * gcc.dg/strict-overflow-6.c: Modified. * gcc.dg/gomp/combined-1.c: Modified. * gcc.dg/no-strict-overflow-1.c: Modified. * gcc.dg/no-strict-overflow-3.c: Modified. * gcc.dg/no-strict-overflow-5.c: Modified. * gcc.dg/tree-ssa/reassoc-13.c: Modified. * gcc.dg/tree-ssa/pr18134.c: Modified. * gcc.dg/tree-ssa/20030824-1.c: Modified. * gcc.dg/tree-ssa/vector-2.c: Modified. * gcc.dg/tree-ssa/forwprop-9.c: Modified. * gcc.dg/tree-ssa/loop-21.c: Modified. * gcc.dg/tree-ssa/20030824-2.c: Modified. * gcc.dg/tree-ssa/vector-3.c: Modified. * gcc.dg/tree-ssa/asm-3.c: Modified. * gcc.dg/tree-ssa/pr23294.c: Modified. * gcc.dg/tree-ssa/loop-22.c: Modified. * gcc.dg/tree-ssa/loop-15.c: Modified. * gcc.dg/tree-ssa/prefetch-4.c: Modified. * gcc.dg/tree-ssa/pr22051-1.c: Modified. * gcc.dg/tree-ssa/pr20139.c: Modified. * gcc.dg/tree-ssa/scev-cast.c: Modified. * gcc.dg/tree-ssa/pr22051-2.c: Modified. * gcc.dg/tree-ssa/reassoc-1.c: Modified. * gcc.dg/tree-ssa/loop-5.c: Modified. * gcc.dg/tree-ssa/pr19431.c: Modified. * gcc.dg/tree-ssa/pr32044.c: Modified. * gcc.dg/tree-ssa/prefetch-7.c: Modified. * gcc.dg/tree-ssa/loop-19.c: Modified. * gcc.dg/tree-ssa/loop-28.c: Modified. * gcc.dg/tree-ssa/ssa-pre-15.c: Modified. * gcc.dg/tree-ssa/divide-1.c: Modified. * gcc.dg/tree-ssa/inline-1.c: Modified. * gcc.dg/tree-ssa/divide-3.c: Modified. * gcc.dg/tree-ssa/pr30978.c: Modified. * gcc.dg/tree-ssa/alias-6.c: Modified. * gcc.dg/tree-ssa/divide-4.c: Modified. * gcc.dg/tree-ssa/alias-11.c: Modified. * gcc.dg/no-strict-overflow-7.c: Modified. * gcc.dg/strict-overflow-1.c: Modified. * gcc.dg/pr15784-4.c: Modified. * gcc.dg/pr34263.c: Modified. * gcc.dg/strict-overflow-3.c: Modified. * gcc.dg/tree-prof/stringop-1.c: Modified. * gcc.dg/tree-prof/val-prof-1.c: Modified. * gcc.dg/tree-prof/val-prof-2.c: Modified. * gcc.dg/tree-prof/val-prof-3.c: Modified. * gcc.dg/tree-prof/val-prof-4.c: Modified. * gcc.dg/no-strict-overflow-2.c: Modified. * gcc.dg/no-strict-overflow-4.c: Modified. * gcc.dg/no-strict-overflow-6.c: Modified. * g++.dg/tree-ssa/pr27090.C: Modified. * g++.dg/tree-ssa/tmmti-2.C: Modified. * g++.dg/tree-ssa/ptrmemfield.C: Modified. * g++.dg/tree-ssa/pr19807.C: Modified. * g++.dg/opt/pr30965.C: Modified. * g++.dg/init/new17.C: Modified. * gfortran.dg/whole_file_6.f90: Modified. * gfortran.dg/whole_file_5.f90: Modified. * gfortran.dg/reassoc_1.f90: Modified. * gfortran.dg/reassoc_3.f90: Modified. From-SVN: r146817
2009-04-26 21:35:04 +02:00
&& !has_zero_uses (var))
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
bitmap_set_bit (used_in_copy, SSA_NAME_VERSION (var));
}
}
return map;
}
/* Attempt to coalesce ssa versions X and Y together using the partition
mapping in MAP and checking conflicts in GRAPH. Output any debug info to
DEBUG, if it is nun-NULL. */
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
static inline bool
attempt_coalesce (var_map map, ssa_conflicts_p graph, int x, int y,
FILE *debug)
{
int z;
tree var1, var2;
int p1, p2;
p1 = var_to_partition (map, ssa_name (x));
p2 = var_to_partition (map, ssa_name (y));
if (debug)
{
fprintf (debug, "(%d)", x);
print_generic_expr (debug, partition_to_var (map, p1), TDF_SLIM);
fprintf (debug, " & (%d)", y);
print_generic_expr (debug, partition_to_var (map, p2), TDF_SLIM);
}
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
if (p1 == p2)
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
{
if (debug)
fprintf (debug, ": Already Coalesced.\n");
return true;
}
if (debug)
fprintf (debug, " [map: %d, %d] ", p1, p2);
if (!ssa_conflicts_test_p (graph, p1, p2))
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
{
var1 = partition_to_var (map, p1);
var2 = partition_to_var (map, p2);
z = var_union (map, var1, var2);
if (z == NO_PARTITION)
{
if (debug)
fprintf (debug, ": Unable to perform partition union.\n");
return false;
}
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
/* z is the new combined partition. Remove the other partition from
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
the list, and merge the conflicts. */
if (z == p1)
ssa_conflicts_merge (graph, p1, p2);
else
ssa_conflicts_merge (graph, p2, p1);
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
if (debug)
fprintf (debug, ": Success -> %d\n", z);
return true;
}
if (debug)
fprintf (debug, ": Fail due to conflict\n");
return false;
}
/* Attempt to Coalesce partitions in MAP which occur in the list CL using
GRAPH. Debug output is sent to DEBUG if it is non-NULL. */
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
static void
coalesce_partitions (var_map map, ssa_conflicts_p graph, coalesce_list_p cl,
FILE *debug)
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
{
int x = 0, y = 0;
tree var1, var2;
int cost;
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
basic_block bb;
edge e;
edge_iterator ei;
/* First, coalesce all the copies across abnormal edges. These are not placed
in the coalesce list because they do not need to be sorted, and simply
consume extra memory/compilation time in large programs. */
Eliminate FOR_EACH_BB macro. gcc/ * basic-block.h (FOR_EACH_BB): Eliminate macro. * asan.c (transform_statements, execute_sanopt): Eliminate use of FOR_EACH_BB in favor of FOR_EACH_BB_FN, to make use of cfun explicit. * auto-inc-dec.c (rest_of_handle_auto_inc_dec): Likewise. * bb-reorder.c (find_rarely_executed_basic_blocks_and_crossing_edges, set_edge_can_fallthru_flag, fix_up_fall_thru_edges, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes, insert_section_boundary_note, rest_of_handle_reorder_blocks, duplicate_computed_gotos): Likewise. * cfg.c (clear_edges, compact_blocks, brief_dump_cfg): Likewise. * cfganal.c (find_unreachable_blocks, add_noreturn_fake_exit_edges, compute_dominance_frontiers_1, single_pred_before_succ_order): Likewise. * cfgbuild.c (find_many_sub_basic_blocks): Likewise. * cfgcleanup.c (try_optimize_cfg, delete_dead_jumptables): Likewise. * cfgexpand.c (add_scope_conflicts, discover_nonconstant_array_refs): Likewise. * cfgloop.c (flow_loops_cfg_dump, get_loop_body, record_loop_exits, verify_loop_structure): Likewise. * cfgloopanal.c (mark_loop_exit_edges): Likewise. * cfgrtl.c (compute_bb_for_insn, find_partition_fixes, verify_hot_cold_block_grouping, purge_all_dead_edges, fixup_abnormal_edges, record_effective_endpoints, outof_cfg_layout_mode, fixup_reorder_chain, force_one_exit_fallthru, break_superblocks): Likewise. * cgraphbuild.c (build_cgraph_edges, rebuild_cgraph_edges, cgraph_rebuild_references): Likewise. * combine-stack-adj.c (combine_stack_adjustments): Likewise. * combine.c (delete_noop_moves, create_log_links, combine_instructions): Likewise. * config/arm/arm.c (thumb1_reorg, thumb2_reorg): Likewise. * config/bfin/bfin.c (bfin_gen_bundles, reorder_var_tracking_notes): Likewise. * config/c6x/c6x.c (c6x_gen_bundles, conditionalize_after_sched, c6x_reorg): Likewise. * config/epiphany/resolve-sw-modes.c (resolve_sw_modes): Likewise. * config/frv/frv.c (frv_optimize_membar): Likewise. * config/i386/i386.c (ix86_finalize_stack_realign_flags): Likewise. * config/ia64/ia64.c (ia64_reorg): Likewise. * config/mips/mips.c (mips_annotate_pic_calls): Likewise. * config/picochip/picochip.c (reorder_var_tracking_notes): Likewise. * config/rs6000/rs6000.c (rs6000_alloc_sdmode_stack_slot): Likewise. * config/s390/s390.c (s390_regs_ever_clobbered): Likewise. * config/sh/sh_treg_combine.cc (sh_treg_combine::execute): Likewise. * config/spu/spu.c (spu_machine_dependent_reorg): Likewise. * config/tilegx/tilegx.c (tilegx_gen_bundles, reorder_var_tracking_notes): Likewise. * config/tilepro/tilepro.c (tilepro_gen_bundles, reorder_var_tracking_notes): Likewise. * coverage.c (coverage_compute_cfg_checksum): Likewise. * cprop.c (compute_hash_table_work, compute_cprop_data, local_cprop_pass, find_implicit_sets): Likewise. * cse.c (cse_condition_code_reg): Likewise. * dce.c (prescan_insns_for_dce): Likewise. * df-core.c (df_compact_blocks): Likewise. * df-problems.c (df_word_lr_alloc): Likewise. * df-scan.c (df_scan_start_dump, df_scan_blocks, df_insn_rescan_all, df_update_entry_exit_and_calls): Likewise. * dominance.c (calculate_dominance_info, verify_dominators, debug_dominance_info): Likewise. * dse.c (dse_step5_nospill): Likewise. * except.c (finish_eh_generation): Likewise. * final.c (compute_alignments): Likewise. * function.c (thread_prologue_and_epilogue_insns, rest_of_match_asm_constraints): Likewise. * gcse.c (compute_hash_table_work, prune_expressions, compute_pre_data, compute_code_hoist_vbeinout, hoist_code, calculate_bb_reg_pressure, compute_ld_motion_mems): Likewise. * gimple-iterator.c (gsi_commit_edge_inserts): Likewise. * gimple-ssa-isolate-paths.c (find_implicit_erroneous_behaviour, find_explicit_erroneous_behaviour): Likewise. * graphite-sese-to-poly.c (rewrite_reductions_out_of_ssa, rewrite_cross_bb_scalar_deps_out_of_ssa): Likewise. * haifa-sched.c (haifa_sched_init): Likewise. * hw-doloop.c (discover_loops, set_bb_indices, reorder_loops): Likewise. * ifcvt.c (if_convert): Likewise. * init-regs.c (initialize_uninitialized_regs): Likewise. * ipa-prop.c (ipcp_transform_function): Likewise. * ipa-pure-const.c (analyze_function): Likewise. * ipa-split.c (find_split_points, execute_split_functions): Likewise. * ira-build.c (form_loop_tree): Likewise. * ira-costs.c (find_costs_and_classes): Likewise. * ira-emit.c (emit_moves, add_ranges_and_copies, ira_emit): Likewise. * ira.c (decrease_live_ranges_number, compute_regs_asm_clobbered, mark_elimination, update_equiv_regs, find_moveable_pseudos, split_live_ranges_for_shrink_wrap, allocate_initial_values): Likewise. * jump.c (mark_all_labels): Likewise. * lcm.c (compute_laterin, compute_insert_delete, compute_available, compute_nearerout, compute_rev_insert_delete): Likewise. * loop-init.c (fix_loop_structure): Likewise. * loop-invariant.c (calculate_loop_reg_pressure): Likewise. * lower-subreg.c (decompose_multiword_subregs, decompose_multiword_subregs): Likewise. * lra-assigns.c (assign_by_spills): Likewise. * lra-coalesce.c (lra_coalesce): Likewise. * lra-constraints.c (lra_inheritance, remove_inheritance_pseudos): Likewise. * lra-eliminations.c (lra_init_elimination): Likewise. * lra-spills.c (assign_spill_hard_regs, spill_pseudos, lra_final_code_change): Likewise. * lra.c (remove_scratches, check_rtl, has_nonexceptional_receiver, update_inc_notes): Likewise. * mcf.c (adjust_cfg_counts): Likewise. * mode-switching.c (optimize_mode_switching): Likewise. * modulo-sched.c (rest_of_handle_sms): Likewise. * omp-low.c (optimize_omp_library_calls, expand_omp_taskreg, expand_omp_target): Likewise. * postreload-gcse.c (alloc_mem, compute_hash_table): Likewise. * postreload.c (reload_cse_regs_1): Likewise. * predict.c (strip_predict_hints, tree_bb_level_predictions, tree_estimate_probability, expensive_function_p, estimate_bb_frequencies, compute_function_frequency): Likewise. * profile.c (is_inconsistent, compute_branch_probabilities, branch_prob): Likewise. * ree.c (find_removable_extensions): Likewise. * reg-stack.c (compensate_edges, convert_regs, reg_to_stack): Likewise. * regcprop.c (copyprop_hardreg_forward): Likewise. * reginfo.c (init_subregs_of_mode): Likewise. * regrename.c (regrename_analyze): Likewise. * regstat.c (regstat_compute_ri, regstat_compute_calls_crossed): Likewise. * reload1.c (has_nonexceptional_receiver, reload, calculate_elim_costs_all_insns): Likewise. * resource.c (init_resource_info, free_resource_info): Likewise. * sched-ebb.c (schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_single_block_region, haifa_find_rgns, sched_rgn_local_init): Likewise. * sel-sched-dump.c (sel_dump_cfg_2): Likewise. * sel-sched-ir.c (init_lv_sets, free_lv_sets, make_regions_from_the_rest): Likewise. * sese.c (build_sese_loop_nests, sese_build_liveouts): Likewise. * stack-ptr-mod.c (notice_stack_pointer_modification): Likewise. * store-motion.c (compute_store_table, build_store_vectors, one_store_motion_pass): Likewise. * tracer.c (tail_duplicate): Likewise. * trans-mem.c (compute_transaction_bits): Likewise. * tree-call-cdce.c (tree_call_cdce): Likewise. * tree-cfg.c (replace_loop_annotate, factor_computed_gotos, fold_cond_expr_cond, make_edges, assign_discriminators, make_abnormal_goto_edges, cleanup_dead_labels, group_case_labels, dump_cfg_stats, gimple_verify_flow_info, print_loop, execute_fixup_cfg): Likewise. * tree-cfgcleanup.c (cleanup_tree_cfg_1, merge_phi_nodes): Likewise. * tree-complex.c (init_dont_simulate_again, tree_lower_complex): Likewise. * tree-dfa.c (collect_dfa_stats, dump_enumerated_decls): Likewise. * tree-eh.c (execute_lower_resx, execute_lower_eh_dispatch, mark_reachable_handlers): Likewise. * tree-emutls.c (lower_emutls_function_body): Likewise. * tree-if-conv.c (main_tree_if_conversion): Likewise. * tree-inline.c (optimize_inline_calls): Likewise. * tree-into-ssa.c (rewrite_into_ssa, update_ssa): Likewise. * tree-nrv.c (tree_nrv, execute_return_slot_opt): Likewise. * tree-object-size.c (compute_object_sizes): Likewise. * tree-outof-ssa.c (eliminate_useless_phis, rewrite_trees, insert_backedge_copies, tree_profiling): Likewise. * tree-scalar-evolution.c (scev_const_prop): Likewise. * tree-sra.c (scan_function, sra_modify_function_body, propagate_dereference_distances, ipa_sra_modify_function_body, convert_callers): Likewise. * tree-ssa-ccp.c (ccp_initialize, execute_fold_all_builtins): Likewise. * tree-ssa-coalesce.c (build_ssa_conflict_graph): Likewise. create_outofssa_var_map, coalesce_partitions): Likewise. * tree-ssa-copy.c (init_copy_prop): Likewise. * tree-ssa-copyrename.c (rename_ssa_copies): Likewise. * tree-ssa-dce.c (find_obviously_necessary_stmts, eliminate_unnecessary_stmts): Likewise. * tree-ssa-dom.c (free_all_edge_infos, tree_ssa_dominator_optimize): Likewise. * tree-ssa-forwprop.c (ssa_forward_propagate_and_combine): Likewise. * tree-ssa-live.c (clear_unused_block_pointer, remove_unused_locals, new_tree_live_info, calculate_live_on_exit, dump_live_info, analyze_memory_references, fill_always_executed_in, tree_ssa_lim_finalize): Likewise. * tree-ssa-loop-manip.c (find_uses_to_rename, verify_loop_closed_ssa): Likewise. * tree-ssa-math-opts.c (execute_cse_reciprocals, execute_cse_sincos, execute_optimize_bswap, execute_optimize_widening_mul): Likewise. * tree-ssa-propagate.c (substitute_and_fold): Likewise. * tree-ssa-structalias.c (compute_points_to_sets): Likewise. * tree-ssa-tail-merge.c (find_same_succ, reset_cluster_vectors): Likewise. * tree-ssa-ter.c (find_replaceable_exprs): Likewise. * tree-ssa-threadupdate.c (thread_through_all_blocks): Likewise. * tree-ssa-uncprop.c (associate_equivalences_with_edges, tree_ssa_uncprop): Likewise. * tree-ssa-uninit.c (warn_uninitialized_vars, execute_late_warn_uninitialized): Likewise. * tree-ssa.c (verify_ssa, execute_update_addresses_taken): Likewise. * tree-stdarg.c (check_all_va_list_escapes, execute_optimize_stdarg): Likewise. * tree-switch-conversion.c (do_switchconv): Likewise. * tree-vect-generic.c (expand_vector_operations): Likewise. * tree-vectorizer.c (adjust_simduid_builtins, note_simd_array_uses, execute_vect_slp): Likewise. * tree-vrp.c (check_all_array_refs, remove_range_assertions, vrp_initialize, identify_jump_threads, instrument_memory_accesses): Likewise. * ubsan.c (ubsan_pass): Likewise. * value-prof.c (verify_histograms, gimple_value_profile_transformations, gimple_find_values_to_profile): Likewise. * var-tracking.c (vt_find_locations, dump_dataflow_sets, vt_emit_notes, vt_initialize, delete_debug_insns, vt_finalize): Likewise. gcc/testsuite/ * g++.dg/plugin/selfassign.c (execute_warn_self_assign): Eliminate use of FOR_EACH_BB in favor of FOR_EACH_BB_FN, to make use of cfun explicit. * gcc.dg/plugin/selfassign.c (execute_warn_self_assign): Likewise. From-SVN: r205828
2013-12-09 22:06:06 +01:00
FOR_EACH_BB_FN (bb, cfun)
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
{
FOR_EACH_EDGE (e, ei, bb->preds)
if (e->flags & EDGE_ABNORMAL)
{
Merger of git branch "gimple-classes-v2-option-3" gcc/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * coretypes.h (struct gcond): Add forward decl. (struct gdebug): Likewise. (struct ggoto): Likewise. (struct glabel): Likewise. (struct gswitch): Likewise. (struct gassign): Likewise. (struct gasm): Likewise. (struct gcall): Likewise. (struct gtransaction): Likewise. (struct greturn): Likewise. (struct gbind): Likewise. (struct gcatch): Likewise. (struct geh_filter): Likewise. (struct geh_mnt): Likewise. (struct geh_else): Likewise. (struct gresx): Likewise. (struct geh_dispatch): Likewise. (struct gphi): Likewise. (struct gtry): Likewise. (struct gomp_atomic_load): Likewise. (struct gomp_atomic_store): Likewise. (struct gomp_continue): Likewise. (struct gomp_critical): Likewise. (struct gomp_for): Likewise. (struct gomp_parallel): Likewise. (struct gomp_task): Likewise. (struct gomp_sections): Likewise. (struct gomp_single): Likewise. (struct gomp_target): Likewise. (struct gomp_teams): Likewise. * doc/gimple.texi (Class hierarchy of GIMPLE statements): Update for renaming of gimple subclasses. * gdbhooks.py: Update. * gimple-iterator.c (gsi_for_phi): New. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. * gimple-iterator.h (struct gphi_iterator): New subclass of gimple_stmt_iterator. (gsi_for_phi): New prototype. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. (gsi_next_nonvirtual_phi): Strengthen param from gimple_stmt_iterator * to gphi_iterator *, and local "phi" from gimple to gphi *. * gsstruct.def: Update for renamings of classes. * gimple.c (gimple_build_return): Strengthen return type from gimple to greturn *. (gimple_call_reset_alias_info): Strengthen param to gcall *. (gimple_build_call_1): Strengthen return type from gimple to gcall *. (gimple_build_call_vec): Likewise. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal_1): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Strengthen return type from gimple to gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Strengthen return type from gimple to gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Strengthen return type from gimple to glabel *. (gimple_build_goto): Strengthen return type from gimple to ggoto *. (gimple_build_bind): Strengthen return type from gimple to gbind *. (gimple_build_asm_1): Strengthen return type from gimple to gasm *. (gimple_build_asm_vec): Likewise. (gimple_build_catch): Strengthen return type from gimple to gcatch *. (gimple_build_eh_filter): Strengthen return type from gimple to geh_filter *. (gimple_build_eh_must_not_throw): Strengthen return type from gimple to geh_mnt *. (gimple_build_eh_else): Strengthen return type from gimple to geh_else *. (gimple_build_try): Update for renaming of gimple_statement_try to gtry. (gimple_build_resx): Strengthen return type from gimple to gresx *. (gimple_build_switch_nlabels): Strengthen return type from gimple to gswitch *. (gimple_build_switch): Likewise. (gimple_build_eh_dispatch): Strengthen return type from gimple to geh_dispatch *. (gimple_build_debug_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_debug_source_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_omp_critical): Strengthen return type from gimple to gomp_critical *. (gimple_build_omp_for): Strengthen return type from gimple to gomp_for *. (gimple_build_omp_parallel): Strengthen return type from gimple to gomp_parallel *. (gimple_build_omp_task): Strengthen return type from gimple to gomp_task *. (gimple_build_omp_continue): Strengthen return type from gimple to gomp_continue *. (gimple_build_omp_sections): Strengthen return type from gimple to gomp_sections *. (gimple_build_omp_single): Strengthen return type from gimple to gomp_single *. (gimple_build_omp_target): Strengthen return type from gimple to gomp_target *. (gimple_build_omp_teams): Strengthen return type from gimple to gomp_teams *. (gimple_build_omp_atomic_load): Strengthen return type from gimple to gomp_atomic_load *. (gimple_build_omp_atomic_store): Strengthen return type from gimple to gomp_atomic_store *. (gimple_build_transaction): Strengthen return type from gimple to gtransaction *. (empty_stmt_p): Replace check for GIMPLE_BIND with a dyn_cast. (gimple_call_fnspec): Require a const gcall *. (gimple_call_arg_flags): Likewise. (gimple_call_return_flags): Likewise. (gimple_set_bb): Add a checked cast. (gimple_copy): Within the cases, add locals of the appropriate subclass and use in place of "stmt" and "copy" for typesafety. (gimple_has_side_effects): Add a checked cast. (gimple_could_trap_p_1): Likewise. (gimple_call_copy_skip_args): Require a gcall *, and return one. (gimple_asm_clobbers_memory_p): Require a const gasm *. (infer_nonnull_range): Replace a check for GIMPLE_RETURN with a dyn_cast, introducing local "return_stmt" and using ti in place of "stmt". * gimple.h (gimple_vec): Eliminate this typedef. (struct gimple_statement_call): Rename to... (struct gcall): ...this. (struct gimple_statement_bind): Rename to... (struct gbind): ...this. (struct gimple_statement_catch): Rename to... (struct gcatch): ...this. (struct gimple_statement_eh_filter): Rename to... (struct geh_filter): ...this. (struct gimple_statement_eh_else): Rename to... (struct geh_else): ...this. (struct gimple_statement_eh_mnt): Rename to... (struct geh_mnt): ...this. (struct gimple_statement_phi): Rename to... (struct gphi): ...this. (struct gimple_statement_resx): Rename to... (struct gresx): ...this. (struct gimple_statement_eh_dispatch): Rename to... (struct geh_dispatch): ...this. (struct gimple_statement_try): Rename to... (struct gtry): ...this. (struct gimple_statement_asm): Rename to... (struct gasm): ...this. (struct gimple_statement_omp_critical): Rename to... (struct gomp_critical): ...this. (struct gimple_statement_omp_for): Rename to... (struct gomp_for): ...this. (struct gimple_statement_omp_parallel): Rename to... (struct gomp_parallel): ...this. (struct gimple_statement_omp_target): Rename to... (struct gomp_target): ...this. (struct gimple_statement_omp_task): Rename to... (struct gomp_task): ...this. (struct gimple_statement_omp_sections): Rename to... (struct gomp_sections): ...this. (struct gimple_statement_omp_continue): Rename to... (struct gomp_continue): ...this. (struct gimple_statement_omp_single): Rename to... (struct gomp_single): ...this. (struct gimple_statement_omp_teams): Rename to... (struct gomp_teams): ...this. (struct gimple_statement_omp_atomic_load): Rename to... (struct gomp_atomic_load): ...this. (struct gimple_statement_omp_atomic_store :): Rename to... (struct gomp_atomic_store :): ...this. (struct gimple_statement_transaction): Rename to... (struct gtransaction): ...this. (struct gcond): New subclass. (struct gdebug): New subclass. (struct ggoto): New subclass. (struct glabel): New subclass. (struct gswitch): New subclass. (struct gassign): New subclass. (struct greturn): New subclass. (is_a_helper <gimple_statement_asm *>::test): Rename to... (is_a_helper <gasm *>::test): ...this. (is_a_helper <gimple_statement_bind *>::test): Rename to... (is_a_helper <gbind *>::test): ...this. (is_a_helper <gassign *>::test): New. (is_a_helper <gimple_statement_call *>::test): Rename to... (is_a_helper <gcall *>::test): ...this. (is_a_helper <gimple_statement_catch *>::test): Rename to... (is_a_helper <gcatch *>::test): ...this. (is_a_helper <gimple_statement_resx *>::test): Rename to... (is_a_helper <gresx *>::test): ...this. (is_a_helper <gcond *>::test): New. (is_a_helper <gdebug *>::test): New. (is_a_helper <ggoto *>::test): New. (is_a_helper <glabel *>::test): New. (is_a_helper <gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <geh_dispatch *>::test): ...this. (is_a_helper <gimple_statement_eh_else *>::test): Rename to... (is_a_helper <geh_else *>::test): ...this. (is_a_helper <gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <geh_filter *>::test): ...this. (is_a_helper <gimple_statement_eh_mnt *>::test): Rename to... (is_a_helper <geh_mnt *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <gomp_atomic_load *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <gomp_atomic_store *>::test): ...this. (is_a_helper <gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <gomp_continue *>::test): ...this. (is_a_helper <gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <gomp_critical *>::test): ...this. (is_a_helper <gimple_statement_omp_for *>::test): Rename to... (is_a_helper <gomp_for *>::test): ...this. (is_a_helper <gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <gomp_parallel *>::test): ...this. (is_a_helper <gimple_statement_omp_target *>::test): Rename to... (is_a_helper <gomp_target *>::test): ...this. (is_a_helper <gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <gomp_sections *>::test): ...this. (is_a_helper <gimple_statement_omp_single *>::test): Rename to... (is_a_helper <gomp_single *>::test): ...this. (is_a_helper <gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <gomp_teams *>::test): ...this. (is_a_helper <gimple_statement_omp_task *>::test): Rename to... (is_a_helper <gomp_task *>::test): ...this. (is_a_helper <gimple_statement_phi *>::test): Rename to... (is_a_helper <gphi *>::test): ...this. (is_a_helper <gimple_statement_transaction *>::test): Rename to... (is_a_helper <gtransaction *>::test): ...this. (is_a_helper <greturn *>::test): New. (is_a_helper <gswitch *>::test): New. (is_a_helper <gimple_statement_try *>::test): Rename to... (is_a_helper <gtry *>::test): ...this. (is_a_helper <const gimple_statement_asm *>::test): Rename to... (is_a_helper <const gasm *>::test): ...this. (is_a_helper <const gimple_statement_bind *>::test): Rename to... (is_a_helper <const gbind *>::test): ...this. (is_a_helper <const gimple_statement_call *>::test): Rename to... (is_a_helper <const gcall *>::test): ...this. (is_a_helper <const gimple_statement_catch *>::test): Rename to... (is_a_helper <const gcatch *>::test): ...this. (is_a_helper <const gimple_statement_resx *>::test): Rename to... (is_a_helper <const gresx *>::test): ...this. (is_a_helper <const gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <const geh_dispatch *>::test): ...this. (is_a_helper <const gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <const geh_filter *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <const gomp_atomic_load *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <const gomp_atomic_store *>::test): ...this. (is_a_helper <const gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <const gomp_continue *>::test): ...this. (is_a_helper <const gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <const gomp_critical *>::test): ...this. (is_a_helper <const gimple_statement_omp_for *>::test): Rename to... (is_a_helper <const gomp_for *>::test): ...this. (is_a_helper <const gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <const gomp_parallel *>::test): ...this. (is_a_helper <const gimple_statement_omp_target *>::test): Rename to... (is_a_helper <const gomp_target *>::test): ...this. (is_a_helper <const gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <const gomp_sections *>::test): ...this. (is_a_helper <const gimple_statement_omp_single *>::test): Rename to... (is_a_helper <const gomp_single *>::test): ...this. (is_a_helper <const gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <const gomp_teams *>::test): ...this. (is_a_helper <const gimple_statement_omp_task *>::test): Rename to... (is_a_helper <const gomp_task *>::test): ...this. (is_a_helper <const gimple_statement_phi *>::test): Rename to... (is_a_helper <const gphi *>::test): ...this. (is_a_helper <const gimple_statement_transaction *>::test): Rename to... (is_a_helper <const gtransaction *>::test): ...this. (gimple_build_return): Strengthen return type to greturn *. (gimple_call_reset_alias_info): Require a gcall *. (gimple_build_call_vec): Return a gcall *. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Return a gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Return a gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Return a glabel *. (gimple_build_goto): Return a ggoto *. (gimple_build_bind): Return a gbind *. (gimple_build_asm_vec): Return a gasm *. (gimple_build_catch): Return a gcatch *. (gimple_build_eh_filter): Return a geh_filter *. (gimple_build_eh_must_not_throw): Return a geh_mnt *. (gimple_build_eh_else): Return a geh_else *. (gimple_build_try): Return a gtry *. (gimple_build_resx): Return a gresx *. (gimple_build_switch_nlabels): Return a gswitch *. (gimple_build_switch): Return a gswitch *. (gimple_build_eh_dispatch): Return a geh_dispatch *. (gimple_build_debug_bind_stat): Return a gdebug *. (gimple_build_debug_source_bind_stat): Return a gdebug *. (gimple_build_omp_critical): Return a gomp_critical *. (gimple_build_omp_for): Return a gomp_for *. (gimple_build_omp_parallel): Return a gomp_parallel *. (gimple_build_omp_task): Return a gomp_task *. (gimple_build_omp_continue): Return a gomp_continue *. (gimple_build_omp_sections): Return a gomp_sections *. (gimple_build_omp_single): Return a gomp_single *. (gimple_build_omp_target): Return a gomp_target *. (gimple_build_omp_teams): Return a gomp_teams *. (gimple_build_omp_atomic_load): Return a gomp_atomic_load *. (gimple_build_omp_atomic_store): Return a gomp_atomic_store *. (gimple_build_transaction): Return a gtransaction *. (gimple_call_arg_flags): Require a const gcall *. (gimple_call_return_flags): Likewise. (gimple_call_copy_skip_args): Require and return a gcall *. (gimple_asm_clobbers_memory_p): Require a const gasm *. (gimple_seq_first_stmt_as_a_bind): New. (gimple_assign_nontemporal_move_p): Require a const gassign * rather than a const_gimple. (gimple_call_internal_fn): Update for renaming to gcall. (gimple_call_fntype): Likewise. (gimple_call_set_fntype): Require a gcall * rather than a gimple. (gimple_call_set_fn): Likewise. (gimple_call_set_internal_fn): Likewise. (gimple_call_set_chain): Likewise. (gimple_call_set_tail): Likewise. (gimple_call_tail_p): Likewise. (gimple_call_set_return_slot_opt): Likewise. (gimple_call_return_slot_opt_p): Likewise. (gimple_call_set_from_thunk): Likewise. (gimple_call_from_thunk_p): Likewise. (gimple_call_set_va_arg_pack): Likewise. (gimple_call_va_arg_pack_p): Likewise. (gimple_call_set_nothrow): Likewise. (gimple_call_nothrow_p): Likewise. (gimple_call_set_alloca_for_var): Likewise. (gimple_call_alloca_for_var_p): Likewise. (gimple_call_use_set): Likewise. (gimple_call_clobber_set): Likewise. (gimple_call_return_type): Require a const gcall * rather than a const_gimple. (gimple_call_chain_ptr): Likewise. (gimple_call_copy_flags): Require a pair of gcall *. (gimple_cond_set_code): Require a gcond * rather than a gimple (gimple_cond_set_lhs): Likewise. (gimple_cond_set_rhs): Likewise. (gimple_cond_set_true_label): Likewise. (gimple_cond_set_false_label): Likewise. (gimple_cond_make_false): Likewise. (gimple_cond_make_true): Likewise. (gimple_cond_lhs_ptr): Require a const gcond * rather than a const_gimple. (gimple_cond_rhs_ptr): Likewise. (gimple_cond_true_label): Likewise. (gimple_cond_false_label): Likewise. (gimple_cond_true_p): Likewise. (gimple_cond_false_p): Likewise. (gimple_cond_set_condition): Likewise. (gimple_label_label): Require a const glabel *. (gimple_label_set_label): Require a glabel *. (gimple_goto_set_dest): Require a ggoto *. (gimple_bind_vars): Require a const gbind *. (gimple_bind_block): Likewise. (gimple_bind_set_vars): Require a gbind *. (gimple_bind_append_vars): Likewise. (gimple_bind_body_ptr): Likewise. (gimple_bind_body): Likewise. (gimple_bind_set_body): Likewise. (gimple_bind_add_stmt): Likewise. (gimple_bind_add_seq): Likewise. (gimple_bind_set_block): Likewise. (gimple_asm_ninputs): Require a const gasm *. (gimple_asm_noutputs): Likewise. (gimple_asm_nclobbers): Likewise. (gimple_asm_nlabels): Likewise. (gimple_asm_input_op): Likewise. (gimple_asm_input_op_ptr): Likewise. (gimple_asm_output_op): Likewise. (gimple_asm_output_op_ptr): Likewise. (gimple_asm_clobber_op): Likewise. (gimple_asm_label_op): Likewise. (gimple_asm_string): Likewise. (gimple_asm_volatile_p): Likewise. (gimple_asm_input_p): Likewise. (gimple_asm_set_input_op): Require a gasm *. (gimple_asm_set_output_op): Likewise. (gimple_asm_set_clobber_op): Likewise. (gimple_asm_set_label_op): Likewise. (gimple_asm_set_volatile): Likewise. (gimple_asm_set_input): Likewise. (gimple_catch_types): Require a const gcatch *. (gimple_catch_types_ptr): Require a gcatch *. (gimple_catch_handler_ptr): Likewise. (gimple_catch_handler): Likewise. (gimple_catch_set_types): Likewise. (gimple_catch_set_handler): Likewise. (gimple_eh_filter_types): Update for renaming of subclass to geh_filter. (gimple_eh_filter_types_ptr): Likewise. (gimple_eh_filter_failure_ptr): Likewise. (gimple_eh_filter_set_types): Require a geh_filter *. (gimple_eh_filter_set_failure): Likewise. (gimple_eh_must_not_throw_fndecl): Require a geh_mnt *. (gimple_eh_must_not_throw_set_fndecl): Likewise. (gimple_eh_else_n_body_ptr): Require a geh_else *. (gimple_eh_else_n_body): Likewise. (gimple_eh_else_e_body_ptr): Likewise. (gimple_eh_else_e_body): Likewise. (gimple_eh_else_set_n_body): Likewise. (gimple_eh_else_set_e_body): Likewise. (gimple_try_set_kind): Require a gtry *. (gimple_try_set_catch_is_cleanup): Likewise. (gimple_try_set_eval): Likewise. (gimple_try_set_cleanup): Likewise. (gimple_try_eval_ptr): Update for renaming of subclass to gtry. (gimple_try_cleanup_ptr): Likewise. (gimple_phi_capacity): Update for renaming of subclass to gphi. (gimple_phi_num_args): Likewise. (gimple_phi_result): Likewise. (gimple_phi_result_ptr): Likewise. (gimple_phi_arg): Likewise. (gimple_phi_set_result): Require a gphi *. (gimple_phi_set_arg): Likewise. (gimple_phi_arg_def_ptr): Likewise. (gimple_phi_arg_edge): Likewise. (gimple_phi_arg_location): Likewise. (gimple_phi_arg_location_from_edge): Likewise. (gimple_phi_arg_set_location): Likewise. (gimple_phi_arg_has_location): Likewise. (gimple_resx_region): Require a const gresx *. (gimple_resx_set_region): Require a gresx *. (gimple_eh_dispatch_region): Require a const geh_dispatch *. (gimple_eh_dispatch_set_region): Require a geh_dispatch *. (gimple_switch_num_labels): Require a const gswitch *. (gimple_switch_set_num_labels): Likewise. (gimple_switch_index): Likewise. (gimple_switch_index_ptr): Likewise. (gimple_switch_label): Likewise. (gimple_switch_default_label): Likewise. (gimple_switch_set_index): Require a gswitch *. (gimple_switch_set_label): Likewise. (gimple_switch_set_default_label): Likewise. (gimple_omp_critical_name): Require a const gomp_critical *. (gimple_omp_critical_name_ptr): Require a gomp_critical *. (gimple_omp_critical_set_name): Likewise. (gimple_omp_for_set_kind): Require a gomp_for *. (gimple_omp_for_set_combined_p): Likewise. (gimple_omp_for_set_combined_into_p): Likewise. (gimple_omp_for_clauses): Update for renaming of subclass to gomp_for. (gimple_omp_for_clauses_ptr): Likewise. (gimple_omp_for_set_clauses): Likewise. (gimple_omp_for_collapse): Likewise. (gimple_omp_for_index): Likewise. (gimple_omp_for_index_ptr): Likewise. (gimple_omp_for_set_index): Likewise. (gimple_omp_for_initial): Likewise. (gimple_omp_for_initial_ptr): Likewise. (gimple_omp_for_set_initial): Likewise. (gimple_omp_for_final): Likewise. (gimple_omp_for_final_ptr): Likewise. (gimple_omp_for_set_final): Likewise. (gimple_omp_for_incr): Likewise. (gimple_omp_for_incr_ptr): Likewise. (gimple_omp_for_set_incr): Likewise. (gimple_omp_for_pre_body): Likewise. (gimple_omp_for_set_pre_body): Likewise. (gimple_omp_parallel_clauses): Update for renaming of subclass to gomp_parallel. (gimple_omp_parallel_clauses_ptr): Require a gomp_parallel *. (gimple_omp_parallel_set_clauses): Likewise. (gimple_omp_parallel_child_fn_ptr): Likewise. (gimple_omp_parallel_set_child_fn): Likewise. (gimple_omp_parallel_data_arg_ptr): Likewise. (gimple_omp_parallel_set_data_arg): Likewise. (gimple_omp_parallel_child_fn): Require a const gomp_parallel *. (gimple_omp_parallel_data_arg): Likewise. (gimple_omp_task_clauses): Update for renaming of subclass to gomp_task. (gimple_omp_task_clauses_ptr): Likewise. (gimple_omp_task_set_clauses): Likewise. (gimple_omp_task_child_fn): Likewise. (gimple_omp_task_child_fn_ptr): Likewise. (gimple_omp_task_set_child_fn): Likewise. (gimple_omp_task_data_arg): Likewise. (gimple_omp_task_data_arg_ptr): Likewise. (gimple_omp_task_set_data_arg): Likewise. (gimple_omp_taskreg_clauses): Whitespace fixes. (gimple_omp_taskreg_clauses_ptr): Likewise. (gimple_omp_taskreg_set_clauses): Likewise. (gimple_omp_taskreg_child_fn): Likewise. (gimple_omp_taskreg_child_fn_ptr): Likewise. (gimple_omp_taskreg_set_child_fn): Likewise. (gimple_omp_taskreg_data_arg): Likewise. (gimple_omp_taskreg_data_arg_ptr): Likewise. (gimple_omp_taskreg_set_data_arg): Likewise. (gimple_omp_task_copy_fn): Update for renaming of subclass to gomp_task. (gimple_omp_task_copy_fn_ptr): Likewise. (gimple_omp_task_set_copy_fn): Likewise. (gimple_omp_task_arg_size): Likewise. (gimple_omp_task_arg_size_ptr): Likewise. (gimple_omp_task_set_arg_size): Likewise. (gimple_omp_task_arg_align): Likewise. (gimple_omp_task_arg_align_ptr): Likewise. (gimple_omp_task_set_arg_align): Likewise. (gimple_omp_single_clauses): Update for renaming of subclass to gomp_single. (gimple_omp_single_clauses_ptr): Likewise. (gimple_omp_single_set_clauses): Likewise. (gimple_omp_target_clauses): Update for renaming of subclass to gomp_target. (gimple_omp_target_clauses_ptr): Likewise. (gimple_omp_target_set_clauses): Require a gomp_target *. (gimple_omp_target_set_kind): Likewise. (gimple_omp_target_child_fn_ptr): Likewise. (gimple_omp_target_set_child_fn): Likewise. (gimple_omp_target_data_arg_ptr): Likewise. (gimple_omp_target_set_data_arg): Likewise. (gimple_omp_target_child_fn): Require a const gomp_target *. (gimple_omp_target_data_arg): Likewise. (gimple_omp_teams_clauses): Update for renaming of subclass to gomp_teams. (gimple_omp_teams_clauses_ptr): Likewise. (gimple_omp_teams_set_clauses): Require a gomp_teams *. (gimple_omp_sections_clauses): Update for renaming of subclass to gomp_sections. (gimple_omp_sections_clauses_ptr): Likewise. (gimple_omp_sections_set_clauses): Likewise. (gimple_omp_sections_control): Likewise. (gimple_omp_sections_control_ptr): Likewise. (gimple_omp_sections_set_control): Likewise. (gimple_omp_for_set_cond): Likewise. (gimple_omp_for_cond): Likewise. (gimple_omp_atomic_store_set_val): Require a gomp_atomic_store *. (gimple_omp_atomic_store_val_ptr): Likewise. (gimple_omp_atomic_load_set_lhs): Likewise. (gimple_omp_atomic_store_val): Require a const gomp_atomic_store *. (gimple_omp_atomic_load_lhs): Likewise. (gimple_omp_atomic_load_rhs): Likewise. (gimple_omp_atomic_load_lhs_ptr): Require a gomp_atomic_load *. (gimple_omp_atomic_load_set_rhs): Likewise. (gimple_omp_atomic_load_rhs_ptr): Likewise. (gimple_omp_continue_control_def): Require a const gomp_continue *. (gimple_omp_continue_control_use): Likewise. (gimple_omp_continue_control_def_ptr): Require a gomp_continue *. (gimple_omp_continue_set_control_def): Likewise. (gimple_omp_continue_control_use_ptr): Likewise. (gimple_omp_continue_set_control_use): Likewise. (gimple_transaction_body_ptr): Require a gtransaction *. (gimple_transaction_body): Likewise. (gimple_transaction_label_ptr): Likewise. (gimple_transaction_label): Require a const gtransaction *. (gimple_transaction_subcode): Likewise. (gimple_transaction_set_body): Require a gtransaction *. (gimple_transaction_set_label): Likewise. (gimple_transaction_set_subcode): Likewise. (gimple_return_retval_ptr): Require a const greturn *. (gimple_return_retval): Likewise. (gimple_return_set_retval): Require a greturn *. (gimple_expr_type): Introduce local "call_stmt" and use in place of "stmt" for typesafety. * asan.c: Use gimple subclasses. * auto-profile.c: Likewise. * builtins.c: Likewise. * builtins.h: Likewise. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * expr.h: Likewise. * gimple-builder.c: Likewise. * gimple-builder.h: Likewise. * gimple-fold.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimple-walk.c: Likewise. * gimplify-me.c: Likewise. * gimplify.c: Likewise. * gimplify.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * internal-fn.c: Likewise. * internal-fn.def:: Likewise. * internal-fn.h: Likewise. * ipa-icf-gimple.c: Likewise. * ipa-icf-gimple.h: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-split.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * omp-low.c: Likewise. * predict.c: Likewise. * sanopt.c: Likewise. * sese.c: Likewise. * ssa-iterators.h: Likewise. * stmt.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfg.h: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chkp.c: Likewise. * tree-chkp.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-eh.c: Likewise. * tree-eh.h: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-into-ssa.h: Likewise. * tree-loop-distribution.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-phinodes.h: Likewise. * tree-predcom.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h * tree-sra.cn_function): * tree-ssa-alias.c: Likewise. * tree-ssa-alias.h: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c * tree-ssa-structalias.c * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadedge.h: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-stdarg.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * ubsan.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * vtable-verify.c: Likewise. gcc/c-family/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * c-gimplify.c (add_block_to_enclosing): Strengthen local "stack" from being just a vec<gimple> to a vec<gbind *>. gcc/java/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * java-gimplify.c (java_gimplify_block): Strengthen local "outer" from gimple to gbind *. From-SVN: r217787
2014-11-19 18:00:54 +01:00
gphi_iterator gsi;
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi);
gsi_next (&gsi))
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
{
Merger of git branch "gimple-classes-v2-option-3" gcc/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * coretypes.h (struct gcond): Add forward decl. (struct gdebug): Likewise. (struct ggoto): Likewise. (struct glabel): Likewise. (struct gswitch): Likewise. (struct gassign): Likewise. (struct gasm): Likewise. (struct gcall): Likewise. (struct gtransaction): Likewise. (struct greturn): Likewise. (struct gbind): Likewise. (struct gcatch): Likewise. (struct geh_filter): Likewise. (struct geh_mnt): Likewise. (struct geh_else): Likewise. (struct gresx): Likewise. (struct geh_dispatch): Likewise. (struct gphi): Likewise. (struct gtry): Likewise. (struct gomp_atomic_load): Likewise. (struct gomp_atomic_store): Likewise. (struct gomp_continue): Likewise. (struct gomp_critical): Likewise. (struct gomp_for): Likewise. (struct gomp_parallel): Likewise. (struct gomp_task): Likewise. (struct gomp_sections): Likewise. (struct gomp_single): Likewise. (struct gomp_target): Likewise. (struct gomp_teams): Likewise. * doc/gimple.texi (Class hierarchy of GIMPLE statements): Update for renaming of gimple subclasses. * gdbhooks.py: Update. * gimple-iterator.c (gsi_for_phi): New. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. * gimple-iterator.h (struct gphi_iterator): New subclass of gimple_stmt_iterator. (gsi_for_phi): New prototype. (gsi_start_phis): Strengthen return type from gimple_stmt_iterator to gphi_iterator. (gsi_next_nonvirtual_phi): Strengthen param from gimple_stmt_iterator * to gphi_iterator *, and local "phi" from gimple to gphi *. * gsstruct.def: Update for renamings of classes. * gimple.c (gimple_build_return): Strengthen return type from gimple to greturn *. (gimple_call_reset_alias_info): Strengthen param to gcall *. (gimple_build_call_1): Strengthen return type from gimple to gcall *. (gimple_build_call_vec): Likewise. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal_1): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Strengthen return type from gimple to gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Strengthen return type from gimple to gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Strengthen return type from gimple to glabel *. (gimple_build_goto): Strengthen return type from gimple to ggoto *. (gimple_build_bind): Strengthen return type from gimple to gbind *. (gimple_build_asm_1): Strengthen return type from gimple to gasm *. (gimple_build_asm_vec): Likewise. (gimple_build_catch): Strengthen return type from gimple to gcatch *. (gimple_build_eh_filter): Strengthen return type from gimple to geh_filter *. (gimple_build_eh_must_not_throw): Strengthen return type from gimple to geh_mnt *. (gimple_build_eh_else): Strengthen return type from gimple to geh_else *. (gimple_build_try): Update for renaming of gimple_statement_try to gtry. (gimple_build_resx): Strengthen return type from gimple to gresx *. (gimple_build_switch_nlabels): Strengthen return type from gimple to gswitch *. (gimple_build_switch): Likewise. (gimple_build_eh_dispatch): Strengthen return type from gimple to geh_dispatch *. (gimple_build_debug_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_debug_source_bind_stat): Strengthen return type from gimple to gdebug *. (gimple_build_omp_critical): Strengthen return type from gimple to gomp_critical *. (gimple_build_omp_for): Strengthen return type from gimple to gomp_for *. (gimple_build_omp_parallel): Strengthen return type from gimple to gomp_parallel *. (gimple_build_omp_task): Strengthen return type from gimple to gomp_task *. (gimple_build_omp_continue): Strengthen return type from gimple to gomp_continue *. (gimple_build_omp_sections): Strengthen return type from gimple to gomp_sections *. (gimple_build_omp_single): Strengthen return type from gimple to gomp_single *. (gimple_build_omp_target): Strengthen return type from gimple to gomp_target *. (gimple_build_omp_teams): Strengthen return type from gimple to gomp_teams *. (gimple_build_omp_atomic_load): Strengthen return type from gimple to gomp_atomic_load *. (gimple_build_omp_atomic_store): Strengthen return type from gimple to gomp_atomic_store *. (gimple_build_transaction): Strengthen return type from gimple to gtransaction *. (empty_stmt_p): Replace check for GIMPLE_BIND with a dyn_cast. (gimple_call_fnspec): Require a const gcall *. (gimple_call_arg_flags): Likewise. (gimple_call_return_flags): Likewise. (gimple_set_bb): Add a checked cast. (gimple_copy): Within the cases, add locals of the appropriate subclass and use in place of "stmt" and "copy" for typesafety. (gimple_has_side_effects): Add a checked cast. (gimple_could_trap_p_1): Likewise. (gimple_call_copy_skip_args): Require a gcall *, and return one. (gimple_asm_clobbers_memory_p): Require a const gasm *. (infer_nonnull_range): Replace a check for GIMPLE_RETURN with a dyn_cast, introducing local "return_stmt" and using ti in place of "stmt". * gimple.h (gimple_vec): Eliminate this typedef. (struct gimple_statement_call): Rename to... (struct gcall): ...this. (struct gimple_statement_bind): Rename to... (struct gbind): ...this. (struct gimple_statement_catch): Rename to... (struct gcatch): ...this. (struct gimple_statement_eh_filter): Rename to... (struct geh_filter): ...this. (struct gimple_statement_eh_else): Rename to... (struct geh_else): ...this. (struct gimple_statement_eh_mnt): Rename to... (struct geh_mnt): ...this. (struct gimple_statement_phi): Rename to... (struct gphi): ...this. (struct gimple_statement_resx): Rename to... (struct gresx): ...this. (struct gimple_statement_eh_dispatch): Rename to... (struct geh_dispatch): ...this. (struct gimple_statement_try): Rename to... (struct gtry): ...this. (struct gimple_statement_asm): Rename to... (struct gasm): ...this. (struct gimple_statement_omp_critical): Rename to... (struct gomp_critical): ...this. (struct gimple_statement_omp_for): Rename to... (struct gomp_for): ...this. (struct gimple_statement_omp_parallel): Rename to... (struct gomp_parallel): ...this. (struct gimple_statement_omp_target): Rename to... (struct gomp_target): ...this. (struct gimple_statement_omp_task): Rename to... (struct gomp_task): ...this. (struct gimple_statement_omp_sections): Rename to... (struct gomp_sections): ...this. (struct gimple_statement_omp_continue): Rename to... (struct gomp_continue): ...this. (struct gimple_statement_omp_single): Rename to... (struct gomp_single): ...this. (struct gimple_statement_omp_teams): Rename to... (struct gomp_teams): ...this. (struct gimple_statement_omp_atomic_load): Rename to... (struct gomp_atomic_load): ...this. (struct gimple_statement_omp_atomic_store :): Rename to... (struct gomp_atomic_store :): ...this. (struct gimple_statement_transaction): Rename to... (struct gtransaction): ...this. (struct gcond): New subclass. (struct gdebug): New subclass. (struct ggoto): New subclass. (struct glabel): New subclass. (struct gswitch): New subclass. (struct gassign): New subclass. (struct greturn): New subclass. (is_a_helper <gimple_statement_asm *>::test): Rename to... (is_a_helper <gasm *>::test): ...this. (is_a_helper <gimple_statement_bind *>::test): Rename to... (is_a_helper <gbind *>::test): ...this. (is_a_helper <gassign *>::test): New. (is_a_helper <gimple_statement_call *>::test): Rename to... (is_a_helper <gcall *>::test): ...this. (is_a_helper <gimple_statement_catch *>::test): Rename to... (is_a_helper <gcatch *>::test): ...this. (is_a_helper <gimple_statement_resx *>::test): Rename to... (is_a_helper <gresx *>::test): ...this. (is_a_helper <gcond *>::test): New. (is_a_helper <gdebug *>::test): New. (is_a_helper <ggoto *>::test): New. (is_a_helper <glabel *>::test): New. (is_a_helper <gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <geh_dispatch *>::test): ...this. (is_a_helper <gimple_statement_eh_else *>::test): Rename to... (is_a_helper <geh_else *>::test): ...this. (is_a_helper <gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <geh_filter *>::test): ...this. (is_a_helper <gimple_statement_eh_mnt *>::test): Rename to... (is_a_helper <geh_mnt *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <gomp_atomic_load *>::test): ...this. (is_a_helper <gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <gomp_atomic_store *>::test): ...this. (is_a_helper <gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <gomp_continue *>::test): ...this. (is_a_helper <gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <gomp_critical *>::test): ...this. (is_a_helper <gimple_statement_omp_for *>::test): Rename to... (is_a_helper <gomp_for *>::test): ...this. (is_a_helper <gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <gomp_parallel *>::test): ...this. (is_a_helper <gimple_statement_omp_target *>::test): Rename to... (is_a_helper <gomp_target *>::test): ...this. (is_a_helper <gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <gomp_sections *>::test): ...this. (is_a_helper <gimple_statement_omp_single *>::test): Rename to... (is_a_helper <gomp_single *>::test): ...this. (is_a_helper <gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <gomp_teams *>::test): ...this. (is_a_helper <gimple_statement_omp_task *>::test): Rename to... (is_a_helper <gomp_task *>::test): ...this. (is_a_helper <gimple_statement_phi *>::test): Rename to... (is_a_helper <gphi *>::test): ...this. (is_a_helper <gimple_statement_transaction *>::test): Rename to... (is_a_helper <gtransaction *>::test): ...this. (is_a_helper <greturn *>::test): New. (is_a_helper <gswitch *>::test): New. (is_a_helper <gimple_statement_try *>::test): Rename to... (is_a_helper <gtry *>::test): ...this. (is_a_helper <const gimple_statement_asm *>::test): Rename to... (is_a_helper <const gasm *>::test): ...this. (is_a_helper <const gimple_statement_bind *>::test): Rename to... (is_a_helper <const gbind *>::test): ...this. (is_a_helper <const gimple_statement_call *>::test): Rename to... (is_a_helper <const gcall *>::test): ...this. (is_a_helper <const gimple_statement_catch *>::test): Rename to... (is_a_helper <const gcatch *>::test): ...this. (is_a_helper <const gimple_statement_resx *>::test): Rename to... (is_a_helper <const gresx *>::test): ...this. (is_a_helper <const gimple_statement_eh_dispatch *>::test): Rename to... (is_a_helper <const geh_dispatch *>::test): ...this. (is_a_helper <const gimple_statement_eh_filter *>::test): Rename to... (is_a_helper <const geh_filter *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_load *>::test): Rename to... (is_a_helper <const gomp_atomic_load *>::test): ...this. (is_a_helper <const gimple_statement_omp_atomic_store *>::test): Rename to... (is_a_helper <const gomp_atomic_store *>::test): ...this. (is_a_helper <const gimple_statement_omp_continue *>::test): Rename to... (is_a_helper <const gomp_continue *>::test): ...this. (is_a_helper <const gimple_statement_omp_critical *>::test): Rename to... (is_a_helper <const gomp_critical *>::test): ...this. (is_a_helper <const gimple_statement_omp_for *>::test): Rename to... (is_a_helper <const gomp_for *>::test): ...this. (is_a_helper <const gimple_statement_omp_parallel *>::test): Rename to... (is_a_helper <const gomp_parallel *>::test): ...this. (is_a_helper <const gimple_statement_omp_target *>::test): Rename to... (is_a_helper <const gomp_target *>::test): ...this. (is_a_helper <const gimple_statement_omp_sections *>::test): Rename to... (is_a_helper <const gomp_sections *>::test): ...this. (is_a_helper <const gimple_statement_omp_single *>::test): Rename to... (is_a_helper <const gomp_single *>::test): ...this. (is_a_helper <const gimple_statement_omp_teams *>::test): Rename to... (is_a_helper <const gomp_teams *>::test): ...this. (is_a_helper <const gimple_statement_omp_task *>::test): Rename to... (is_a_helper <const gomp_task *>::test): ...this. (is_a_helper <const gimple_statement_phi *>::test): Rename to... (is_a_helper <const gphi *>::test): ...this. (is_a_helper <const gimple_statement_transaction *>::test): Rename to... (is_a_helper <const gtransaction *>::test): ...this. (gimple_build_return): Strengthen return type to greturn *. (gimple_call_reset_alias_info): Require a gcall *. (gimple_build_call_vec): Return a gcall *. (gimple_build_call): Likewise. (gimple_build_call_valist): Likewise. (gimple_build_call_internal): Likewise. (gimple_build_call_internal_vec): Likewise. (gimple_build_call_from_tree): Likewise. (gimple_build_assign_stat): Return a gassign *. (gimple_build_assign_with_ops): Likewise. (gimple_build_cond): Return a gcond *. (gimple_build_cond_from_tree): Likewise. (gimple_cond_set_condition_from_tree): Require a gcond *. (gimple_build_label): Return a glabel *. (gimple_build_goto): Return a ggoto *. (gimple_build_bind): Return a gbind *. (gimple_build_asm_vec): Return a gasm *. (gimple_build_catch): Return a gcatch *. (gimple_build_eh_filter): Return a geh_filter *. (gimple_build_eh_must_not_throw): Return a geh_mnt *. (gimple_build_eh_else): Return a geh_else *. (gimple_build_try): Return a gtry *. (gimple_build_resx): Return a gresx *. (gimple_build_switch_nlabels): Return a gswitch *. (gimple_build_switch): Return a gswitch *. (gimple_build_eh_dispatch): Return a geh_dispatch *. (gimple_build_debug_bind_stat): Return a gdebug *. (gimple_build_debug_source_bind_stat): Return a gdebug *. (gimple_build_omp_critical): Return a gomp_critical *. (gimple_build_omp_for): Return a gomp_for *. (gimple_build_omp_parallel): Return a gomp_parallel *. (gimple_build_omp_task): Return a gomp_task *. (gimple_build_omp_continue): Return a gomp_continue *. (gimple_build_omp_sections): Return a gomp_sections *. (gimple_build_omp_single): Return a gomp_single *. (gimple_build_omp_target): Return a gomp_target *. (gimple_build_omp_teams): Return a gomp_teams *. (gimple_build_omp_atomic_load): Return a gomp_atomic_load *. (gimple_build_omp_atomic_store): Return a gomp_atomic_store *. (gimple_build_transaction): Return a gtransaction *. (gimple_call_arg_flags): Require a const gcall *. (gimple_call_return_flags): Likewise. (gimple_call_copy_skip_args): Require and return a gcall *. (gimple_asm_clobbers_memory_p): Require a const gasm *. (gimple_seq_first_stmt_as_a_bind): New. (gimple_assign_nontemporal_move_p): Require a const gassign * rather than a const_gimple. (gimple_call_internal_fn): Update for renaming to gcall. (gimple_call_fntype): Likewise. (gimple_call_set_fntype): Require a gcall * rather than a gimple. (gimple_call_set_fn): Likewise. (gimple_call_set_internal_fn): Likewise. (gimple_call_set_chain): Likewise. (gimple_call_set_tail): Likewise. (gimple_call_tail_p): Likewise. (gimple_call_set_return_slot_opt): Likewise. (gimple_call_return_slot_opt_p): Likewise. (gimple_call_set_from_thunk): Likewise. (gimple_call_from_thunk_p): Likewise. (gimple_call_set_va_arg_pack): Likewise. (gimple_call_va_arg_pack_p): Likewise. (gimple_call_set_nothrow): Likewise. (gimple_call_nothrow_p): Likewise. (gimple_call_set_alloca_for_var): Likewise. (gimple_call_alloca_for_var_p): Likewise. (gimple_call_use_set): Likewise. (gimple_call_clobber_set): Likewise. (gimple_call_return_type): Require a const gcall * rather than a const_gimple. (gimple_call_chain_ptr): Likewise. (gimple_call_copy_flags): Require a pair of gcall *. (gimple_cond_set_code): Require a gcond * rather than a gimple (gimple_cond_set_lhs): Likewise. (gimple_cond_set_rhs): Likewise. (gimple_cond_set_true_label): Likewise. (gimple_cond_set_false_label): Likewise. (gimple_cond_make_false): Likewise. (gimple_cond_make_true): Likewise. (gimple_cond_lhs_ptr): Require a const gcond * rather than a const_gimple. (gimple_cond_rhs_ptr): Likewise. (gimple_cond_true_label): Likewise. (gimple_cond_false_label): Likewise. (gimple_cond_true_p): Likewise. (gimple_cond_false_p): Likewise. (gimple_cond_set_condition): Likewise. (gimple_label_label): Require a const glabel *. (gimple_label_set_label): Require a glabel *. (gimple_goto_set_dest): Require a ggoto *. (gimple_bind_vars): Require a const gbind *. (gimple_bind_block): Likewise. (gimple_bind_set_vars): Require a gbind *. (gimple_bind_append_vars): Likewise. (gimple_bind_body_ptr): Likewise. (gimple_bind_body): Likewise. (gimple_bind_set_body): Likewise. (gimple_bind_add_stmt): Likewise. (gimple_bind_add_seq): Likewise. (gimple_bind_set_block): Likewise. (gimple_asm_ninputs): Require a const gasm *. (gimple_asm_noutputs): Likewise. (gimple_asm_nclobbers): Likewise. (gimple_asm_nlabels): Likewise. (gimple_asm_input_op): Likewise. (gimple_asm_input_op_ptr): Likewise. (gimple_asm_output_op): Likewise. (gimple_asm_output_op_ptr): Likewise. (gimple_asm_clobber_op): Likewise. (gimple_asm_label_op): Likewise. (gimple_asm_string): Likewise. (gimple_asm_volatile_p): Likewise. (gimple_asm_input_p): Likewise. (gimple_asm_set_input_op): Require a gasm *. (gimple_asm_set_output_op): Likewise. (gimple_asm_set_clobber_op): Likewise. (gimple_asm_set_label_op): Likewise. (gimple_asm_set_volatile): Likewise. (gimple_asm_set_input): Likewise. (gimple_catch_types): Require a const gcatch *. (gimple_catch_types_ptr): Require a gcatch *. (gimple_catch_handler_ptr): Likewise. (gimple_catch_handler): Likewise. (gimple_catch_set_types): Likewise. (gimple_catch_set_handler): Likewise. (gimple_eh_filter_types): Update for renaming of subclass to geh_filter. (gimple_eh_filter_types_ptr): Likewise. (gimple_eh_filter_failure_ptr): Likewise. (gimple_eh_filter_set_types): Require a geh_filter *. (gimple_eh_filter_set_failure): Likewise. (gimple_eh_must_not_throw_fndecl): Require a geh_mnt *. (gimple_eh_must_not_throw_set_fndecl): Likewise. (gimple_eh_else_n_body_ptr): Require a geh_else *. (gimple_eh_else_n_body): Likewise. (gimple_eh_else_e_body_ptr): Likewise. (gimple_eh_else_e_body): Likewise. (gimple_eh_else_set_n_body): Likewise. (gimple_eh_else_set_e_body): Likewise. (gimple_try_set_kind): Require a gtry *. (gimple_try_set_catch_is_cleanup): Likewise. (gimple_try_set_eval): Likewise. (gimple_try_set_cleanup): Likewise. (gimple_try_eval_ptr): Update for renaming of subclass to gtry. (gimple_try_cleanup_ptr): Likewise. (gimple_phi_capacity): Update for renaming of subclass to gphi. (gimple_phi_num_args): Likewise. (gimple_phi_result): Likewise. (gimple_phi_result_ptr): Likewise. (gimple_phi_arg): Likewise. (gimple_phi_set_result): Require a gphi *. (gimple_phi_set_arg): Likewise. (gimple_phi_arg_def_ptr): Likewise. (gimple_phi_arg_edge): Likewise. (gimple_phi_arg_location): Likewise. (gimple_phi_arg_location_from_edge): Likewise. (gimple_phi_arg_set_location): Likewise. (gimple_phi_arg_has_location): Likewise. (gimple_resx_region): Require a const gresx *. (gimple_resx_set_region): Require a gresx *. (gimple_eh_dispatch_region): Require a const geh_dispatch *. (gimple_eh_dispatch_set_region): Require a geh_dispatch *. (gimple_switch_num_labels): Require a const gswitch *. (gimple_switch_set_num_labels): Likewise. (gimple_switch_index): Likewise. (gimple_switch_index_ptr): Likewise. (gimple_switch_label): Likewise. (gimple_switch_default_label): Likewise. (gimple_switch_set_index): Require a gswitch *. (gimple_switch_set_label): Likewise. (gimple_switch_set_default_label): Likewise. (gimple_omp_critical_name): Require a const gomp_critical *. (gimple_omp_critical_name_ptr): Require a gomp_critical *. (gimple_omp_critical_set_name): Likewise. (gimple_omp_for_set_kind): Require a gomp_for *. (gimple_omp_for_set_combined_p): Likewise. (gimple_omp_for_set_combined_into_p): Likewise. (gimple_omp_for_clauses): Update for renaming of subclass to gomp_for. (gimple_omp_for_clauses_ptr): Likewise. (gimple_omp_for_set_clauses): Likewise. (gimple_omp_for_collapse): Likewise. (gimple_omp_for_index): Likewise. (gimple_omp_for_index_ptr): Likewise. (gimple_omp_for_set_index): Likewise. (gimple_omp_for_initial): Likewise. (gimple_omp_for_initial_ptr): Likewise. (gimple_omp_for_set_initial): Likewise. (gimple_omp_for_final): Likewise. (gimple_omp_for_final_ptr): Likewise. (gimple_omp_for_set_final): Likewise. (gimple_omp_for_incr): Likewise. (gimple_omp_for_incr_ptr): Likewise. (gimple_omp_for_set_incr): Likewise. (gimple_omp_for_pre_body): Likewise. (gimple_omp_for_set_pre_body): Likewise. (gimple_omp_parallel_clauses): Update for renaming of subclass to gomp_parallel. (gimple_omp_parallel_clauses_ptr): Require a gomp_parallel *. (gimple_omp_parallel_set_clauses): Likewise. (gimple_omp_parallel_child_fn_ptr): Likewise. (gimple_omp_parallel_set_child_fn): Likewise. (gimple_omp_parallel_data_arg_ptr): Likewise. (gimple_omp_parallel_set_data_arg): Likewise. (gimple_omp_parallel_child_fn): Require a const gomp_parallel *. (gimple_omp_parallel_data_arg): Likewise. (gimple_omp_task_clauses): Update for renaming of subclass to gomp_task. (gimple_omp_task_clauses_ptr): Likewise. (gimple_omp_task_set_clauses): Likewise. (gimple_omp_task_child_fn): Likewise. (gimple_omp_task_child_fn_ptr): Likewise. (gimple_omp_task_set_child_fn): Likewise. (gimple_omp_task_data_arg): Likewise. (gimple_omp_task_data_arg_ptr): Likewise. (gimple_omp_task_set_data_arg): Likewise. (gimple_omp_taskreg_clauses): Whitespace fixes. (gimple_omp_taskreg_clauses_ptr): Likewise. (gimple_omp_taskreg_set_clauses): Likewise. (gimple_omp_taskreg_child_fn): Likewise. (gimple_omp_taskreg_child_fn_ptr): Likewise. (gimple_omp_taskreg_set_child_fn): Likewise. (gimple_omp_taskreg_data_arg): Likewise. (gimple_omp_taskreg_data_arg_ptr): Likewise. (gimple_omp_taskreg_set_data_arg): Likewise. (gimple_omp_task_copy_fn): Update for renaming of subclass to gomp_task. (gimple_omp_task_copy_fn_ptr): Likewise. (gimple_omp_task_set_copy_fn): Likewise. (gimple_omp_task_arg_size): Likewise. (gimple_omp_task_arg_size_ptr): Likewise. (gimple_omp_task_set_arg_size): Likewise. (gimple_omp_task_arg_align): Likewise. (gimple_omp_task_arg_align_ptr): Likewise. (gimple_omp_task_set_arg_align): Likewise. (gimple_omp_single_clauses): Update for renaming of subclass to gomp_single. (gimple_omp_single_clauses_ptr): Likewise. (gimple_omp_single_set_clauses): Likewise. (gimple_omp_target_clauses): Update for renaming of subclass to gomp_target. (gimple_omp_target_clauses_ptr): Likewise. (gimple_omp_target_set_clauses): Require a gomp_target *. (gimple_omp_target_set_kind): Likewise. (gimple_omp_target_child_fn_ptr): Likewise. (gimple_omp_target_set_child_fn): Likewise. (gimple_omp_target_data_arg_ptr): Likewise. (gimple_omp_target_set_data_arg): Likewise. (gimple_omp_target_child_fn): Require a const gomp_target *. (gimple_omp_target_data_arg): Likewise. (gimple_omp_teams_clauses): Update for renaming of subclass to gomp_teams. (gimple_omp_teams_clauses_ptr): Likewise. (gimple_omp_teams_set_clauses): Require a gomp_teams *. (gimple_omp_sections_clauses): Update for renaming of subclass to gomp_sections. (gimple_omp_sections_clauses_ptr): Likewise. (gimple_omp_sections_set_clauses): Likewise. (gimple_omp_sections_control): Likewise. (gimple_omp_sections_control_ptr): Likewise. (gimple_omp_sections_set_control): Likewise. (gimple_omp_for_set_cond): Likewise. (gimple_omp_for_cond): Likewise. (gimple_omp_atomic_store_set_val): Require a gomp_atomic_store *. (gimple_omp_atomic_store_val_ptr): Likewise. (gimple_omp_atomic_load_set_lhs): Likewise. (gimple_omp_atomic_store_val): Require a const gomp_atomic_store *. (gimple_omp_atomic_load_lhs): Likewise. (gimple_omp_atomic_load_rhs): Likewise. (gimple_omp_atomic_load_lhs_ptr): Require a gomp_atomic_load *. (gimple_omp_atomic_load_set_rhs): Likewise. (gimple_omp_atomic_load_rhs_ptr): Likewise. (gimple_omp_continue_control_def): Require a const gomp_continue *. (gimple_omp_continue_control_use): Likewise. (gimple_omp_continue_control_def_ptr): Require a gomp_continue *. (gimple_omp_continue_set_control_def): Likewise. (gimple_omp_continue_control_use_ptr): Likewise. (gimple_omp_continue_set_control_use): Likewise. (gimple_transaction_body_ptr): Require a gtransaction *. (gimple_transaction_body): Likewise. (gimple_transaction_label_ptr): Likewise. (gimple_transaction_label): Require a const gtransaction *. (gimple_transaction_subcode): Likewise. (gimple_transaction_set_body): Require a gtransaction *. (gimple_transaction_set_label): Likewise. (gimple_transaction_set_subcode): Likewise. (gimple_return_retval_ptr): Require a const greturn *. (gimple_return_retval): Likewise. (gimple_return_set_retval): Require a greturn *. (gimple_expr_type): Introduce local "call_stmt" and use in place of "stmt" for typesafety. * asan.c: Use gimple subclasses. * auto-profile.c: Likewise. * builtins.c: Likewise. * builtins.h: Likewise. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * expr.h: Likewise. * gimple-builder.c: Likewise. * gimple-builder.h: Likewise. * gimple-fold.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimple-walk.c: Likewise. * gimplify-me.c: Likewise. * gimplify.c: Likewise. * gimplify.h: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * internal-fn.c: Likewise. * internal-fn.def:: Likewise. * internal-fn.h: Likewise. * ipa-icf-gimple.c: Likewise. * ipa-icf-gimple.h: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-prop.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-split.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * omp-low.c: Likewise. * predict.c: Likewise. * sanopt.c: Likewise. * sese.c: Likewise. * ssa-iterators.h: Likewise. * stmt.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfg.h: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chkp.c: Likewise. * tree-chkp.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-eh.c: Likewise. * tree-eh.h: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-into-ssa.c: Likewise. * tree-into-ssa.h: Likewise. * tree-loop-distribution.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-phinodes.h: Likewise. * tree-predcom.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h * tree-sra.cn_function): * tree-ssa-alias.c: Likewise. * tree-ssa-alias.h: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c * tree-ssa-structalias.c * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadedge.h: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-stdarg.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * ubsan.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * vtable-verify.c: Likewise. gcc/c-family/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * c-gimplify.c (add_block_to_enclosing): Strengthen local "stack" from being just a vec<gimple> to a vec<gbind *>. gcc/java/ChangeLog: Merger of git branch "gimple-classes-v2-option-3". * ChangeLog.gimple-classes: New. * java-gimplify.c (java_gimplify_block): Strengthen local "outer" from gimple to gbind *. From-SVN: r217787
2014-11-19 18:00:54 +01:00
gphi *phi = gsi.phi ();
tree arg = PHI_ARG_DEF (phi, e->dest_idx);
if (SSA_NAME_IS_DEFAULT_DEF (arg)
&& (!SSA_NAME_VAR (arg)
|| TREE_CODE (SSA_NAME_VAR (arg)) != PARM_DECL))
continue;
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
tree res = PHI_RESULT (phi);
int v1 = SSA_NAME_VERSION (res);
int v2 = SSA_NAME_VERSION (arg);
if (debug)
fprintf (debug, "Abnormal coalesce: ");
if (!attempt_coalesce (map, graph, v1, v2, debug))
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
fail_abnormal_edge_coalesce (v1, v2);
}
}
}
/* Now process the items in the coalesce list. */
while ((cost = pop_best_coalesce (cl, &x, &y)) != NO_BEST_COALESCE)
{
var1 = ssa_name (x);
var2 = ssa_name (y);
/* Assert the coalesces have the same base variable. */
gcc_assert (gimple_can_coalesce_p (var1, var2));
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
if (debug)
fprintf (debug, "Coalesce list: ");
attempt_coalesce (map, graph, x, y, debug);
}
}
/* Hashtable support for storing SSA names hashed by their SSA_NAME_VAR. */
hash-table.h: Update comments. gcc/ * hash-table.h: Update comments. * hash-traits.h (pointer_hash): Don't inherit from typed_noop_remove. (nofree_ptr_hash): New class. * asan.c (asan_mem_ref_hasher): Inherit from nofree_ptr_hash rather than typed_noop_remove. Remove redudant typedefs. * attribs.c (attribute_hasher): Likewise. * cfg.c (bb_copy_hasher): Likewise. * cselib.c (cselib_hasher): Likewise. * dse.c (invariant_group_base_hasher): Likewise. * dwarf2cfi.c (trace_info_hasher): Likewise. * dwarf2out.c (macinfo_entry_hasher): Likewise. (comdat_type_hasher, loc_list_hasher): Likewise. * gcse.c (pre_ldst_expr_hasher): Likewise. * genmatch.c (id_base): Likewise. * genrecog.c (test_pattern_hasher): Likewise. * gimple-ssa-strength-reduction.c (cand_chain_hasher): Likewise. * haifa-sched.c (delay_i1_hasher): Likewise. * hard-reg-set.h (simplifiable_subregs_hasher): Likewise. * ipa-icf.h (congruence_class_group_hash): Likewise. * ipa-profile.c (histogram_hash): Likewise. * ira-color.c (allocno_hard_regs_hasher): Likewise. * lto-streamer.h (string_slot_hasher): Likewise. * lto-streamer.c (tree_entry_hasher): Likewise. * plugin.c (event_hasher): Likewise. * postreload-gcse.c (expr_hasher): Likewise. * store-motion.c (st_expr_hasher): Likewise. * tree-sra.c (uid_decl_hasher): Likewise. * tree-ssa-coalesce.c (coalesce_pair_hasher): Likewise. (ssa_name_var_hash): Likewise. * tree-ssa-live.c (tree_int_map_hasher): Likewise. * tree-ssa-loop-im.c (mem_ref_hasher): Likewise. * tree-ssa-pre.c (pre_expr_d): Likewise. * tree-ssa-sccvn.c (vn_nary_op_hasher): Likewise. * vtable-verify.h (registration_hasher): Likewise. * vtable-verify.c (vtbl_map_hasher): Likewise. * config/arm/arm.c (libcall_hasher): Likewise. * config/i386/winnt.c (wrapped_symbol_hasher): Likewise. * config/ia64/ia64.c (bundle_state_hasher): Likewise. * config/sol2.c (comdat_entry_hasher): Likewise. * fold-const.c (fold): Use nofree_ptr_hash instead of pointer_hash. (print_fold_checksum, fold_checksum_tree): Likewise. (debug_fold_checksum, fold_build1_stat_loc): Likewise. (fold_build2_stat_loc, fold_build3_stat_loc): Likewise. (fold_build_call_array_loc): Likewise. * tree-ssa-ccp.c (gimple_htab): Likewise. * tree-browser.c (tree_upper_hasher): Inherit from nofree_ptr_hash rather than pointer_type. gcc/c/ * c-decl.c (detect_field_duplicates_hash): Use nofree_ptr_hash instead of pointer_hash. (detect_field_duplicates): Likewise. gcc/cp/ * class.c (fixed_type_or_null_ref_ht): Inherit from nofree_ptr_hash rather than pointer_hash. (fixed_type_or_null): Use nofree_ptr_hash instead of pointer_hash. * semantics.c (nrv_data): Likewise. * tree.c (verify_stmt_tree_r, verify_stmt_tree): Likewise. gcc/java/ * jcf-io.c (charstar_hash): Inherit from nofree_ptr_hash rather than typed_noop_remove. Remove redudant typedefs. gcc/lto/ * lto.c (tree_scc_hasher): Inherit from nofree_ptr_hash rather than typed_noop_remove. Remove redudant typedefs. gcc/objc/ * objc-act.c (decl_name_hash): Inherit from nofree_ptr_hash rather than typed_noop_remove. Remove redudant typedefs. libcc1/ * plugin.cc (string_hasher): Inherit from nofree_ptr_hash rather than typed_noop_remove. Remove redudant typedefs. (plugin_context): Use nofree_ptr_hash rather than pointer_hash. (plugin_context::mark): Likewise. From-SVN: r224957
2015-06-25 19:06:13 +02:00
struct ssa_name_var_hash : nofree_ptr_hash <tree_node>
{
remove need for store_values_directly This switches all hash_table users to use the layout that stores elements of type value_type in the hash table instead of the one storing value_type *. Since it becomes unused support for the value_type * layout is removed. gcc/ * hash-table.h: Remove version of hash_table that stored value_type *. * asan.c, attribs.c, bitmap.c, cfg.c, cgraph.h, config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c, config/mips/mips.c, config/sol2.c, coverage.c, cselib.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c, gcse.c, genmatch.c, ggc-common.c, gimple-ssa-strength-reduction.c, gimplify.c, haifa-sched.c, hard-reg-set.h, hash-map.h, hash-set.h, ipa-devirt.c, ipa-icf.h, ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lto-streamer.h, plugin.c, postreload-gcse.c, reginfo.c, statistics.c, store-motion.c, trans-mem.c, tree-cfg.c, tree-eh.c, tree-hasher.h, tree-into-ssa.c, tree-parloops.c, tree-sra.c, tree-ssa-coalesce.c, tree-ssa-dom.c, tree-ssa-live.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-threadupdate.c, tree-vectorizer.c, tree-vectorizer.h, valtrack.h, var-tracking.c, vtable-verify.c, vtable-verify.h: Adjust. libcc1/ * plugin.cc: Adjust for hash_table changes. gcc/java/ * jcf-io.c: Adjust for hash_table changes. gcc/lto/ * lto.c: Adjust for hash_table changes. gcc/objc/ * objc-act.c: Adjust for hash_table changes. From-SVN: r222213
2015-04-18 20:13:18 +02:00
static inline hashval_t hash (const tree_node *);
static inline int equal (const tree_node *, const tree_node *);
};
backport: As described in http://gcc.gnu.org/ml/gcc/2012-08/msg00015.html... Merge from cxx-conversion branch (http://gcc.gnu.org/wiki/cxx-conversion). As described in http://gcc.gnu.org/ml/gcc/2012-08/msg00015.html, this patch changes the default bootstrap process so that stage 1 always builds with a C++ compiler. Other than the bootstrap change, the patch makes no functional changes to the compiler. Everything should build as it does now in trunk. The main changes in this patch are: 1- Configuration changes. 2- Re-write of VEC. 3- Re-write of gengtype to support C++ templates and user-provided marking functions. 4- New hash table class. 5- Re-write double_int. 6- Implement tree macros as inline functions so they can be called from gdb. As discussed before, several of these changes do not fully change the call sites to use the new APIs. The bootstrap changes have already been tested on a wide range of targets (http://gcc.gnu.org/wiki/CppBuildStatus). Additionally, I have tested the merged trunk on: x86_64-unknown-linux-gnu, mips64el-unknown-linux-gnu, powerpc64-unknown-linux-gnu, i686-pc-linux-gnu, and ia64-unknown-linux-gnu. ChangeLog 2012-08-14 Diego Novillo <dnovillo@google.com> Merge from cxx-conversion branch. * Makefile.tpl (STAGE[+id+]_CXXFLAGS): Remove POSTSTAGE1_CONFIGURE_FLAGS. * Makefile.in: Regenerate. * configure.ac (ENABLE_BUILD_WITH_CXX): Remove. Update all users. Force C++ when bootstrapping. * configure: Regenerate. libcpp/ChangeLog 2012-08-14 Diego Novillo <dnovillo@google.com> Merge from cxx-conversion branch. Configury. * Makefile.in: Remove all handlers of ENABLE_BUILD_WITH_CXX. * configure.ac: Likewise. * configure: Regenerate. 2012-08-14 Lawrence Crowl <crowl@google.com> Merge from cxx-conversion branch. New C++ hash table. * include/symtab.h (typedef struct ht hash_table): Change the typedef name to cpp_hash_table. Update all users of the typedef. gcc/ChangeLog 2012-08-14 Diego Novillo <dnovillo@google.com> Merge from cxx-conversion branch. Configury. * configure.ac (CXX_FOR_BUILD): Define and substitute. (BUILD_CXXFLAGS): Define. Remove all handlers of ENABLE_BUILD_WITH_CXX. Force all build to be with C++. * Makefile.in (BUILD_CXXFLAGS): Use it. Remove all handlers of ENABLE_BUILD_WITH_CXX. * configure: Regenerate. * config.in: Regenerate. * doc/install.texi: Remove documentation for --enable-build-with-cxx and --enable-build-poststage1-with-cxx. 2012-08-14 Diego Novillo <dnovillo@google.com> Merge from cxx-conversion branch. Re-implement VEC in C++. * vec.c (vec_heap_free): Convert into a template function. (vec_gc_o_reserve_1): Make extern. (vec_gc_p_reserve): Remove. (vec_gc_p_reserve_exact): Remove. (vec_gc_o_reserve): Remove. (vec_gc_o_reserve_exact): Remove. (vec_heap_o_reserve_1): Make extern. (vec_heap_p_reserve): Remove. (vec_heap_p_reserve_exact): Remove. (vec_heap_o_reserve): Remove. (vec_heap_o_reserve_exact): Remove. (vec_stack_p_reserve): Remove. (vec_stack_p_reserve_exact): Remove. * vec.h (VEC_CHECK_INFO, VEC_CHECK_DECL, VEC_CHECK_PASS, VEC_ASSERT, VEC_ASSERT_FAIL, vec_assert_fail): Move earlier in the file. (VEC): Define to vec_t<T>. (vec_allocation_t): Define. (struct vec_prefix): Move earlier in the file. (vec_t<T>): New template. (DEF_VEC_I, DEF_VECL_ALLOC_I, DEF_VEC_P, DEF_VEC_ALLOC_P, DEF_VEC_O, DEF_VEC_ALLOC_P, DEF_VEC_O, DEF_VEC_ALLOC_O, DEF_VEC_ALLOC_P_STACK, DEF_VEC_ALLOC_O_STACK, DEF_VEC_ALLOC_I_STACK): Expand to 'struct vec_swallow_trailing_semi'. (DEF_VEC_A): Provide template instantiations for GC/PCH markers that do not traverse the vector. (vec_stack_p_reserve): Remove. (vec_stack_p_reserve_exact): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (vec_stack_free): Re-write as a template function. (vec_reserve): New template function. (vec_reserve_exact): New template function. (vec_heap_free): New template function if GATHER_STATISTICS is defined. Otherwise, macro that expands to free(). (VEC_length_1): New template function. (VEC_length): Call it. (VEC_empty_1): New template function. (VEC_empty): Call it. (VEC_address_1): New template function. (VEC_address): Call it. (VEC_last_1): New template function. (VEC_last): Call it. Change return type to T&. Change all users that used VEC_Os. (VEC_index_1): New template function. (VEC_index): Call it. Return a T& instead of a T*. Update all callers that were using VEC_O before. (VEC_iterate_1): New template function. (VEC_iterate): Call it. (VEC_embedded_size_1): New template function. (VEC_embedded_size): Call it. (VEC_embedded_init_1): New template function. (VEC_embedded_init): Call it. (VEC_alloc_1): New template function. (VEC_alloc): Call it. If A is 'stack', call XALLOCAVAR to do the allocation. (VEC_free_1): New template function. (VEC_free): Call it. (VEC_copy_1): New template function. (VEC_copy): Call it. (VEC_space_1): New template function (VEC_space): Call it. (VEC_reserve_1): New template function. (VEC_reserve): Call it. (VEC_reserve_exact_1): New template function. (VEC_reserve_exact): Call it. (VEC_splice_1): New template function. (VEC_splice): Call it. (VEC_safe_splice_1): New template function. (VEC_safe_splice): Call it. (VEC_quick_push_1): New template function. Create two overloads, one accepting T, the other accepting T *. Update all callers where T and T * are ambiguous. (VEC_quick_push): Call it. (VEC_safe_push_1): New template function. Create two overloads, one accepting T, the other accepting T *. Update all callers where T and T * are ambiguous. (VEC_safe_push): Call it. (VEC_pop_1): New template function. (VEC_pop): Call it. (VEC_truncate_1): New template function. (VEC_truncate): Call it. (VEC_safe_grow_1): New template function. (VEC_safe_grow): Call it. (VEC_safe_grow_cleared_1): New template function. (VEC_safe_grow_cleared): Call it. (VEC_replace_1): New template function. (VEC_replace): Call it. Always accept T instead of T*. Update all callers that used VEC_Os. (VEC_quick_insert_1): New template function. (VEC_quick_insert): Call it. (VEC_safe_insert_1): New template function. (VEC_safe_insert): Call it. (VEC_ordered_remove_1): New template function. (VEC_ordered_remove): Call it. (VEC_unordered_remove_1): New template function. (VEC_unordered_remove): Call it. (VEC_block_remove_1): New template function. (VEC_block_remove): Call it. (VEC_lower_bound_1): New template function. (VEC_lower_bound): Call it. (VEC_OP): Remove. (DEF_VEC_FUNC_P): Remove. (DEF_VEC_ALLOC_FUNC_P): Remove. (DEF_VEC_NONALLOC_FUNCS_P): Remove. (DEF_VEC_FUNC_O): Remove. (DEF_VEC_ALLOC_FUNC_O): Remove. (DEF_VEC_NONALLOC_FUNCS_O): Remove. (DEF_VEC_ALLOC_FUNC_I): Remove. (DEF_VEC_NONALLOC_FUNCS_I): Remove. (DEF_VEC_ALLOC_FUNC_P_STACK): Remove. (DEF_VEC_ALLOC_FUNC_O_STACK): Remove. (DEF_VEC_ALLOC_FUNC_I_STACK): Remove. (vec_reserve_exact): New template function. * gengtype-lex.l (DEF_VEC_ALLOC_[IOP]/{EOID}): Remove. * gengtype-parse.c (token_names): Remove DEF_VEC_ALLOC_[IOP]. (typedef_name): Emit vec_t<C1> instead of VEC_C1_C2. (def_vec_alloc): Remove. Update all callers. * gengtype.c (filter_type_name): New. (output_mangled_typename): Call it. (write_func_for_structure): Likewise. (write_types): Likewise. (write_root): Likewise. (write_typed_alloc_def): Likewise. (note_def_vec): Emit vec_t<TYPE_NAME> instead of VEC_TYPE_NAME_base. (note_def_vec_alloc): Remove. * gengtype.h (note_def_vec_alloc): Remove. (DEFVEC_ALLOC): Remove token code. * df-scan.c (df_bb_verify): Remove call to df_free_collection_rec inside the insn traversal loop. * gimplify.c (gimplify_compound_lval): Rename STACK to EXPR_STACK. * ipa-inline.c (inline_small_functions): Rename HEAP to EDGE_HEAP. * reg-stack.c (stack): Rename to STACK_PTR. Update all users. * tree-vrp.c (stack): Rename to EQUIV_STACK. Update all users. * config/bfin/bfin.c (hwloop_optimize): Update some calls to VEC_* for vectors of non-pointers. * config/c6x/c6x.c (try_rename_operands): Likewise. (reshuffle_units): Likewise. * config/mips/mips.c (mips_multi_start): Likewise. (mips_multi_add): Likewise. (mips_multi_copy_insn): Likewise. (mips_multi_set_operand): Likewise. * hw-doloop.c (discover_loop): Likewise. (discover_loops): Likewise. (reorg_loops): Likewise. 2012-08-14 Diego Novillo <dnovillo@google.com> Merge from cxx-conversion branch. C++ support in gengtype. * coretypes.h (gt_pointer_operator): Move from ... * ggc.h: ... here. * doc/gty.texi: Document support for C++ templates and user-provided markers. * gcc/gengtype-lex.l: Update copyright year. Remove support for recognizing DEF_VEC_O, DEF_VEC_P and DEFVEC_I. * gengtype-parse.c: Update copyright year. (token_names): Remove DEF_VEC_O, DEF_VEC_P and DEF_VEC_I. (require_template_declaration): New. (typedef_name): Call it. (type): Replace IS_UNION with KIND. Replace all users. (def_vec): Remove. Update all users. * gengtype-state.c (type_lineloc): Handle TYPE_USER_STRUCT. (write_state_user_struct_type): New. (write_state_type): Call it. (read_state_user_struct_type): New. (read_state_type): Call it. * gengtype.c: Update copyright year. (dump_pair): Move declaration to the top. (dump_type): Likewise. (dump_type_list): Likewise. (dbgprint_count_type_at): Handle TYPE_USER_STRUCT. (create_user_defined_type): New. (resolve_typedef): Call it. (new_structure): Replace argument ISUNION with KIND. Change users to refer to KIND directly. Update all callers. (find_structure): Likewise. (set_gc_used_type): Handle TYPE_USER_STRUCT. (create_file): Update HDR to include new copyright year. (struct walk_type_data): Add field IN_PTR_FIELD. (output_mangled_typename): Handle TYPE_USER_STRUCT. (walk_type): Set D->IN_PTR_FIELD when walking a TYPE_POINTER. Clear it afterwards. Handle TYPE_USER_STRUCT. (write_types_process_field): Handle TYPE_USER_STRUCT. (get_type_specifier): Move earlier in the file. (write_type_decl): New. (write_marker_function_name): New. (write_user_func_for_structure_ptr): New. (write_user_func_for_structure_body): New. (write_user_marking_functions): New. (write_func_for_structure): Call write_marker_function_name and write_type_decl. Do not call walk_type for TYPE_USER_STRUCT. Emit a call to the user function directly. Call write_user_marking_functions on TYPE_USER_STRUCTs. (write_types_local_user_process_field): New. (write_pch_user_walking_for_structure_body): New. (write_pch_user_walking_functions): New. (write_types_local_process_field): Handle TYPE_USER_STRUCT. (write_local_func_for_structure): Do not call walk_type for TYPE_USER_STRUCT. Instead, emit the call to gt_pch_nx directly. Call write_pch_user_walking_functions for TYPE_USER_STRUCTs. (write_root): Handle TYPE_USER_STRUCT. (vec_prefix_type): Remove. Update all users. (note_def_vec): Remove. Update all users. (dump_typekind): Handle TYPE_USER_STRUCT. (dump_type): Initialize SEEN_TYPES, if needed. Handle TYPE_USER_STRUCT. (dump_everything): Do not initialize SEEN_TYPES. * gengtype.h: Update copyright year. (enum typekind): Add TYPE_USER_STRUCT. (union_or_struct_p): Rename from UNION_OR_STRUCT_P. Convert into function. Add an overload taking const_type_p. Update all callers. (new_structure): Change second field to type enum typekind. Update all users. (find_structure): Likewise. (note_def_vec): Remove. (DEFVEC_OP): Remove. (DEFVEC_I): Remove. * ggc-page.c (gt_ggc_mx): Add entry points for marking 'const char *&', 'unsigned char *&' and 'unsigned char&'. * ggc-zone.c (gt_ggc_mx): Add entry points for marking 'const char *&' and 'unsigned char *&'. * stringpool.c (gt_pch_nx): Add entry points for marking 'const char *&', 'unsigned char *&' and 'unsigned char&'. Add an entry point for the overload taking arguments 'unsigned char *', 'gt_pointer_operator' and 'void *'. * vec.h (struct vec_prefix): Remove GTY marker. (struct vec_t): Remove GTY((length)) attribute from field 'vec'. (gt_ggc_mx (vec_t<T> *)): New template function. (gt_pch_nx (vec_t<T> *)): New template function. (gt_pch_nx (vec_t<T *> *, gt_pointer_operator, void *)): New template function. (gt_pch_nx (vec_t<T> *, gt_pointer_operator, void *)): New template function. * basic-block.h (struct edge_def): Mark GTY((user)). Remove all GTY markers from fields. (gt_ggc_mx): Declare. (gt_pch_nx): Declare. * tree-cfg.c (gt_ggc_mx): New. (gt_pch_nx): New. * gengtype-lex.l (USER_GTY): Add pattern for "user". * gengtype-parse.c (option): Handle USER_GTY. (opts_have): New. (type): Call it. If the keyword 'user' is used, do not walk the fields of the structure. * gengtype.h (USER_GTY): Add. * doc/gty.texi: Update. 2012-08-14 Lawrence Crowl <crowl@google.com> Merge cxx-conversion branch. Implement C++ hash table. * hash-table.h: New. Implementation borrowed from libiberty/hashtab.c. * hash-table.c: Likewise. * tree-ssa-tail-merge.c: Include hash-table.h instead of hashtab.h. (static htab_t same_succ_htab): Change type to hash_table; move specification of helper functions from create call to declaration. Change users to invoke member functions. (same_succ_print_traverse): Make extern ssa_.... Change callers. Remove void* casting. (same_succ_hash): Likewise. (same_succ_equal): Likewise. (same_succ_delete): Likewise. * tree-ssa-threadupdate.c: Include hash-table.h. (struct local_info): Rename to ssa_local_info_t to avoid overloading the type name local_info with the variable name local_info. (static htab_t redirection_data): Change type to hash_table. Move specification of helper functions from create call to declaration. Change users to invoke member functions. (redirection_data_hash): Make extern ssa_.... Change callers. Remove void* casting. (redirection_data_eq): Likewise. (fix_duplicate_block_edges): Likewise. (create_duplicates): Likewise. (fixup_template_block): Likewise. (redirect_edges): Likewise. (lookup_redirection_data): Change types associated with the hash table from void* to their actual type. Remove unnecessary casts. * tree-ssa-ccp.c: Include hash-table.h. (typedef gimple_htab): New. Uses hash_table. Replace specific uses of htab_t with gimple_htab. Change users to invoke member functions. Move specification of helper functions from create call to declaration. * tree-ssa-coalesce.c: Include hash-table.h instead of hashtab.h. (hash_ssa_name_by_var): Make extern. Remove void* casting. (eq_ssa_name_by_var): Likewise. (coalesce_ssa_name): Change type of local static htab_t ssa_name_hash to hash_table. Change users to invoke member functions. Move specification of helper functions from create call to declaration. * coverage.c: Include hash-table.h instead of hashtab.h. (static htab_t counts_hash): Change type to hash_table; move specification of helper functions from create call to declaration. Change users to invoke member functions. (htab_counts_entry_hash): Make extern. Rename with coverage_... instead of htab_... Remove void* casting. (htab_counts_entry_eq): Likewise. (htab_counts_entry_del): Likewise. * tree-ssa-pre.c: Include hash-table.h instead of hashtab.h. (static htab_t expression_to_id): Change type to hash_table. Move specification of helper functions from create call to declaration. Change users to invoke member functions. (static htab_t phi_translate_table): Likewise. (pre_expr_eq): Make extern ssa_.... Change callers. Remove void* casting. (pre_expr_hash): Likewise. (expr_pred_trans_hash): Likewise. (expr_pred_trans_eq): Likewise. (alloc_expression_id): Change types associated with the hash table from void* to their actual type. Remove unnecessary casts. (lookup_expression_id): Likewise. (phi_trans_lookup): Likewise. (phi_trans_add): Likewise. * stringpool.c: Rename uses of libcpp typedef hash_table to cpp_hash_table. * Makefile.in: Add hash-table.o to OBJS-libcommon-target. Add $(HASH_TABLE_H). Add new dependences on $(HASH_TABLE_H). 2012-08-14 Lawrence Crowl <crowl@google.com> Merge from cxx-conversion branch. Re-write double_int in C++. * hash-table.h (typedef double_int): Change to struct (POD). (double_int::make): New overloads for int to double-int conversion. (double_int::mask): New. (double_int::max_value): New. (double_int::min_value): New. (double_int::operator ++): New. (double_int::operator --): New. (double_int::operator *=): New. (double_int::operator +=): New. (double_int::operator -=): New. (double_int::to_signed): New. (double_int::to_unsigned): New. (double_int::fits_unsigned): New. (double_int::fits_signed): New. (double_int::fits): New. (double_int::trailing_zeros): New. (double_int::popcount): New. (double_int::multiple_of): New. (double_int::set_bit): New. (double_int::mul_with_sign): New. (double_int::operator * (binary)): New. (double_int::operator + (binary)): New. (double_int::operator - (binary)): New. (double_int::operator - (unary)): New. (double_int::operator ~ (unary)): New. (double_int::operator & (binary)): New. (double_int::operator | (binary)): New. (double_int::operator ^ (binary)): New. (double_int::and_not): New. (double_int::lshift): New. (double_int::rshift): New. (double_int::alshift): New. (double_int::arshift): New. (double_int::llshift): New. (double_int::lrshift): New. (double_int::lrotate): New. (double_int::rrotate): New. (double_int::div): New. (double_int::sdiv): New. (double_int::udiv): New. (double_int::mod): New. (double_int::smod): New. (double_int::umod): New. (double_int::divmod): New. (double_int::sdivmod): New. (double_int::udivmod): New. (double_int::ext): New. (double_int::zext): New. (double_int::sext): New. (double_int::is_zero): New. (double_int::is_one): New. (double_int::is_minus_one): New. (double_int::is_negative): New. (double_int::cmp): New. (double_int::ucmp): New. (double_int::scmp): New. (double_int::ult): New. (double_int::ugt): New. (double_int::slt): New. (double_int::sgt): New. (double_int::max): New. (double_int::smax): New. (double_int::umax): New. (double_int::min): New. (double_int::smin): New. (double_int::umin): New. (double_int::operator ==): New. (double_int::operator !=): New. (shwi_to_double_int): Change implementation to use member function. (double_int_minus_one): Likewise. (double_int_zero): Likewise. (double_int_one): Likewise. (double_int_two): Likewise. (double_int_ten): Likewise. (uhwi_to_double_int): Likewise. (double_int_to_shwi): Likewise. (double_int_to_uhwi): Likewise. (double_int_fits_in_uhwi_p): Likewise. (double_int_fits_in_shwi_p): Likewise. (double_int_fits_in_hwi_p): Likewise. (double_int_mul): Likewise. (double_int_mul_with_sign): Likewise. (double_int_add): Likewise. (double_int_sub): Likewise. (double_int_neg): Likewise. (double_int_div): Likewise. (double_int_sdiv): Likewise. (double_int_udiv): Likewise. (double_int_mod): Likewise. (double_int_smod): Likewise. (double_int_umod): Likewise. (double_int_divmod): Likewise. (double_int_sdivmod): Likewise. (double_int_udivmod): Likewise. (double_int_multiple_of): Likewise. (double_int_setbit): Likewise. (double_int_ctz): Likewise. (double_int_not): Likewise. (double_int_ior): Likewise. (double_int_and): Likewise. (double_int_and_not): Likewise. (double_int_xor): Likewise. (double_int_lshift): Likewise. (double_int_rshift): Likewise. (double_int_lrotate): Likewise. (double_int_rrotate): Likewise. (double_int_cmp): Likewise. (double_int_scmp): Likewise. (double_int_ucmp): Likewise. (double_int_max): Likewise. (double_int_smax): Likewise. (double_int_umax): Likewise. (double_int_min): Likewise. (double_int_smin): Likewise. (double_int_umin): Likewise. (double_int_ext): Likewise. (double_int_sext): Likewise. (double_int_zext): Likewise. (double_int_mask): Likewise. (double_int_max_value): Likewise. (double_int_min_value): Likewise. (double_int_zero_p): Likewise. (double_int_one_p): Likewise. (double_int_minus_one_p): Likewise. (double_int_equal_p): Likewise. (double_int_popcount): Likewise. * hash-table.c (double_int_mask): Reuse implementation for double_int::mask. (double_int_max_value): Likewise. (double_int_min_value): Likewise. (double_int_ext): Likewise. (double_int_zext): Likewise. (double_int_sext): Likewise. (double_int_mul_with_sign): Likewise. (double_int_divmod): Likewise. (double_int_sdivmod): Likewise. (double_int_udivmod): Likewise. (double_int_div): Likewise. (double_int_sdiv): Likewise. (double_int_udiv): Likewise. (double_int_mod): Likewise. (double_int_smod): Likewise. (double_int_umod): Likewise. (double_int_multiple_of): Likewise. (double_int_lshift): Likewise. (double_int_rshift): Likewise. (double_int_lrotate): Likewise. (double_int_rrotate): Likewise. (double_int_cmp): Likewise. (double_int_ucmp): Likewise. (double_int_scmp): Likewise. (double_int_max): Likewise. (double_int_smax): Likewise. (double_int_umax): Likewise. (double_int_min): Likewise. (double_int_smin): Likewise. (double_int_umin): Likewise. (double_int_min): Likewise. (double_int_min): Likewise. (double_int_min): Likewise. (double_int_min): Likewise. (double_int_min): Likewise. (double_int_min): Likewise. (double_int::alshift): New. (double_int::arshift): New. (double_int::llshift): New. (double_int::lrshift): New. (double_int::ult): New. (double_int::ugt): New. (double_int::slt): New. (double_int::sgt): New. (double_int_setbit): Reuse implementation for double_int::set_bit, which avoids a name conflict with a macro. (double_int_double_int_ctz): Reuse implementation for double_int::trailing_zeros. (double_int_fits_in_shwi_p): Reuse implementation for double_int::fits_signed. (double_int_fits_in_hwi_p): Reuse implementation for double_int::fits. (double_int_mul): Reuse implementation for binary double_int::operator *. (double_int_add): Likewise. (double_int_sub): Likewise. (double_int_neg): Reuse implementation for unary double_int::operator -. (double_int_max_value): Likewise. * fixed-value.c: Change to use member functions introduced above. 2012-08-14 Lawrence Crowl <crowl@google.com> Merge cxx-conversion branch. Support tree macro calling from gdb. * tree.h (tree_check): New. (TREE_CHECK): Use inline function above instead of __extension__. (tree_not_check): New. (TREE_NOT_CHECK): Use inline function above instead of __extension__. (tree_check2): New. (TREE_CHECK2): Use inline function above instead of __extension__. (tree_not_check2): New. (TREE_NOT_CHECK2): Use inline function above instead of __extension__. (tree_check3): New. (TREE_CHECK3): Use inline function above instead of __extension__. (tree_not_check3): New. (TREE_NOT_CHECK3): Use inline function above instead of __extension__. (tree_check4): New. (TREE_CHECK4): Use inline function above instead of __extension__. (tree_not_check4): New. (TREE_NOT_CHECK4): Use inline function above instead of __extension__. (tree_check5): New. (TREE_CHECK5): Use inline function above instead of __extension__. (tree_not_check5): New. (TREE_NOT_CHECK5): Use inline function above instead of __extension__. (contains_struct_check): New. (CONTAINS_STRUCT_CHECK): Use inline function above instead of __extension__. (tree_class_check): New. (TREE_CLASS_CHECK): Use inline function above instead of __extension__. (tree_range_check): New. (TREE_RANGE_CHECK): Use inline function above instead of __extension__. (omp_clause_subcode_check): New. (OMP_CLAUSE_SUBCODE_CHECK): Use inline function above instead of __extension__. (omp_clause_range_check): New. (OMP_CLAUSE_RANGE_CHECK): Use inline function above instead of __extension__. (expr_check): New. (EXPR_CHECK): Use inline function above instead of __extension__. (non_type_check): New. (NON_TYPE_CHECK): Use inline function above instead of __extension__. (tree_vec_elt_check): New. (TREE_VEC_ELT_CHECK): Use inline function above instead of __extension__. (omp_clause_elt_check): New. (OMP_CLAUSE_ELT_CHECK): Use inline function above instead of __extension__. (tree_operand_check): New. (TREE_OPERAND_CHECK): Use inline function above instead of __extension__. (tree_operand_check_code): New. (TREE_OPERAND_CHECK_CODE): Use inline function above instead of __extension__. (TREE_CHAIN): Simplify implementation. (TREE_TYPE): Simplify implementation. (tree_operand_length): Move for compilation dependences. * gdbinit.in: (macro define __FILE__): New. (macro define __LINE__): New. (skip "tree.h"): New. gcc/cp/ChangeLog 2012-08-14 Diego Novillo <dnovillo@google.com> Merge from cxx-conversion branch. Re-write VEC in C++. * call.c (add_function_candidate): Remove const qualifier from call to VEC_index. 2012-08-14 Diego Novillo <dnovillo@google.com> Merge from cxx-conversion branch. Configury. * go-c.h: Remove all handlers of ENABLE_BUILD_WITH_CXX. * go-gcc.cc: Likewise. * go-system.h: Likewise. From-SVN: r190402
2012-08-15 03:56:07 +02:00
inline hashval_t
ssa_name_var_hash::hash (const_tree n)
{
return DECL_UID (SSA_NAME_VAR (n));
}
backport: As described in http://gcc.gnu.org/ml/gcc/2012-08/msg00015.html... Merge from cxx-conversion branch (http://gcc.gnu.org/wiki/cxx-conversion). As described in http://gcc.gnu.org/ml/gcc/2012-08/msg00015.html, this patch changes the default bootstrap process so that stage 1 always builds with a C++ compiler. Other than the bootstrap change, the patch makes no functional changes to the compiler. Everything should build as it does now in trunk. The main changes in this patch are: 1- Configuration changes. 2- Re-write of VEC. 3- Re-write of gengtype to support C++ templates and user-provided marking functions. 4- New hash table class. 5- Re-write double_int. 6- Implement tree macros as inline functions so they can be called from gdb. As discussed before, several of these changes do not fully change the call sites to use the new APIs. The bootstrap changes have already been tested on a wide range of targets (http://gcc.gnu.org/wiki/CppBuildStatus). Additionally, I have tested the merged trunk on: x86_64-unknown-linux-gnu, mips64el-unknown-linux-gnu, powerpc64-unknown-linux-gnu, i686-pc-linux-gnu, and ia64-unknown-linux-gnu. ChangeLog 2012-08-14 Diego Novillo <dnovillo@google.com> Merge from cxx-conversion branch. * Makefile.tpl (STAGE[+id+]_CXXFLAGS): Remove POSTSTAGE1_CONFIGURE_FLAGS. * Makefile.in: Regenerate. * configure.ac (ENABLE_BUILD_WITH_CXX): Remove. Update all users. Force C++ when bootstrapping. * configure: Regenerate. libcpp/ChangeLog 2012-08-14 Diego Novillo <dnovillo@google.com> Merge from cxx-conversion branch. Configury. * Makefile.in: Remove all handlers of ENABLE_BUILD_WITH_CXX. * configure.ac: Likewise. * configure: Regenerate. 2012-08-14 Lawrence Crowl <crowl@google.com> Merge from cxx-conversion branch. New C++ hash table. * include/symtab.h (typedef struct ht hash_table): Change the typedef name to cpp_hash_table. Update all users of the typedef. gcc/ChangeLog 2012-08-14 Diego Novillo <dnovillo@google.com> Merge from cxx-conversion branch. Configury. * configure.ac (CXX_FOR_BUILD): Define and substitute. (BUILD_CXXFLAGS): Define. Remove all handlers of ENABLE_BUILD_WITH_CXX. Force all build to be with C++. * Makefile.in (BUILD_CXXFLAGS): Use it. Remove all handlers of ENABLE_BUILD_WITH_CXX. * configure: Regenerate. * config.in: Regenerate. * doc/install.texi: Remove documentation for --enable-build-with-cxx and --enable-build-poststage1-with-cxx. 2012-08-14 Diego Novillo <dnovillo@google.com> Merge from cxx-conversion branch. Re-implement VEC in C++. * vec.c (vec_heap_free): Convert into a template function. (vec_gc_o_reserve_1): Make extern. (vec_gc_p_reserve): Remove. (vec_gc_p_reserve_exact): Remove. (vec_gc_o_reserve): Remove. (vec_gc_o_reserve_exact): Remove. (vec_heap_o_reserve_1): Make extern. (vec_heap_p_reserve): Remove. (vec_heap_p_reserve_exact): Remove. (vec_heap_o_reserve): Remove. (vec_heap_o_reserve_exact): Remove. (vec_stack_p_reserve): Remove. (vec_stack_p_reserve_exact): Remove. * vec.h (VEC_CHECK_INFO, VEC_CHECK_DECL, VEC_CHECK_PASS, VEC_ASSERT, VEC_ASSERT_FAIL, vec_assert_fail): Move earlier in the file. (VEC): Define to vec_t<T>. (vec_allocation_t): Define. (struct vec_prefix): Move earlier in the file. (vec_t<T>): New template. (DEF_VEC_I, DEF_VECL_ALLOC_I, DEF_VEC_P, DEF_VEC_ALLOC_P, DEF_VEC_O, DEF_VEC_ALLOC_P, DEF_VEC_O, DEF_VEC_ALLOC_O, DEF_VEC_ALLOC_P_STACK, DEF_VEC_ALLOC_O_STACK, DEF_VEC_ALLOC_I_STACK): Expand to 'struct vec_swallow_trailing_semi'. (DEF_VEC_A): Provide template instantiations for GC/PCH markers that do not traverse the vector. (vec_stack_p_reserve): Remove. (vec_stack_p_reserve_exact): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (vec_stack_free): Re-write as a template function. (vec_reserve): New template function. (vec_reserve_exact): New template function. (vec_heap_free): New template function if GATHER_STATISTICS is defined. Otherwise, macro that expands to free(). (VEC_length_1): New template function. (VEC_length): Call it. (VEC_empty_1): New template function. (VEC_empty): Call it. (VEC_address_1): New template function. (VEC_address): Call it. (VEC_last_1): New template function. (VEC_last): Call it. Change return type to T&. Change all users that used VEC_Os. (VEC_index_1): New template function. (VEC_index): Call it. Return a T& instead of a T*. Update all callers that were using VEC_O before. (VEC_iterate_1): New template function. (VEC_iterate): Call it. (VEC_embedded_size_1): New template function. (VEC_embedded_size): Call it. (VEC_embedded_init_1): New template function. (VEC_embedded_init): Call it. (VEC_alloc_1): New template function. (VEC_alloc): Call it. If A is 'stack', call XALLOCAVAR to do the allocation. (VEC_free_1): New template function. (VEC_free): Call it. (VEC_copy_1): New template function. (VEC_copy): Call it. (VEC_space_1): New template function (VEC_space): Call it. (VEC_reserve_1): New template function. (VEC_reserve): Call it. (VEC_reserve_exact_1): New template function. (VEC_reserve_exact): Call it. (VEC_splice_1): New template function. (VEC_splice): Call it. (VEC_safe_splice_1): New template function. (VEC_safe_splice): Call it. (VEC_quick_push_1): New template function. Create two overloads, one accepting T, the other accepting T *. Update all callers where T and T * are ambiguous. (VEC_quick_push): Call it. (VEC_safe_push_1): New template function. Create two overloads, one accepting T, the other accepting T *. Update all callers where T and T * are ambiguous. (VEC_safe_push): Call it. (VEC_pop_1): New template function. (VEC_pop): Call it. (VEC_truncate_1): New template function. (VEC_truncate): Call it. (VEC_safe_grow_1): New template function. (VEC_safe_grow): Call it. (VEC_safe_grow_cleared_1): New template function. (VEC_safe_grow_cleared): Call it. (VEC_replace_1): New template function. (VEC_replace): Call it. Always accept T instead of T*. Update all callers that used VEC_Os. (VEC_quick_insert_1): New template function. (VEC_quick_insert): Call it. (VEC_safe_insert_1): New template function. (VEC_safe_insert): Call it. (VEC_ordered_remove_1): New template function. (VEC_ordered_remove): Call it. (VEC_unordered_remove_1): New template function. (VEC_unordered_remove): Call it. (VEC_block_remove_1): New template function. (VEC_block_remove): Call it. (VEC_lower_bound_1): New template function. (VEC_lower_bound): Call it. (VEC_OP): Remove. (DEF_VEC_FUNC_P): Remove. (DEF_VEC_ALLOC_FUNC_P): Remove. (DEF_VEC_NONALLOC_FUNCS_P): Remove. (DEF_VEC_FUNC_O): Remove. (DEF_VEC_ALLOC_FUNC_O): Remove. (DEF_VEC_NONALLOC_FUNCS_O): Remove. (DEF_VEC_ALLOC_FUNC_I): Remove. (DEF_VEC_NONALLOC_FUNCS_I): Remove. (DEF_VEC_ALLOC_FUNC_P_STACK): Remove. (DEF_VEC_ALLOC_FUNC_O_STACK): Remove. (DEF_VEC_ALLOC_FUNC_I_STACK): Remove. (vec_reserve_exact): New template function. * gengtype-lex.l (DEF_VEC_ALLOC_[IOP]/{EOID}): Remove. * gengtype-parse.c (token_names): Remove DEF_VEC_ALLOC_[IOP]. (typedef_name): Emit vec_t<C1> instead of VEC_C1_C2. (def_vec_alloc): Remove. Update all callers. * gengtype.c (filter_type_name): New. (output_mangled_typename): Call it. (write_func_for_structure): Likewise. (write_types): Likewise. (write_root): Likewise. (write_typed_alloc_def): Likewise. (note_def_vec): Emit vec_t<TYPE_NAME> instead of VEC_TYPE_NAME_base. (note_def_vec_alloc): Remove. * gengtype.h (note_def_vec_alloc): Remove. (DEFVEC_ALLOC): Remove token code. * df-scan.c (df_bb_verify): Remove call to df_free_collection_rec inside the insn traversal loop. * gimplify.c (gimplify_compound_lval): Rename STACK to EXPR_STACK. * ipa-inline.c (inline_small_functions): Rename HEAP to EDGE_HEAP. * reg-stack.c (stack): Rename to STACK_PTR. Update all users. * tree-vrp.c (stack): Rename to EQUIV_STACK. Update all users. * config/bfin/bfin.c (hwloop_optimize): Update some calls to VEC_* for vectors of non-pointers. * config/c6x/c6x.c (try_rename_operands): Likewise. (reshuffle_units): Likewise. * config/mips/mips.c (mips_multi_start): Likewise. (mips_multi_add): Likewise. (mips_multi_copy_insn): Likewise. (mips_multi_set_operand): Likewise. * hw-doloop.c (discover_loop): Likewise. (discover_loops): Likewise. (reorg_loops): Likewise. 2012-08-14 Diego Novillo <dnovillo@google.com> Merge from cxx-conversion branch. C++ support in gengtype. * coretypes.h (gt_pointer_operator): Move from ... * ggc.h: ... here. * doc/gty.texi: Document support for C++ templates and user-provided markers. * gcc/gengtype-lex.l: Update copyright year. Remove support for recognizing DEF_VEC_O, DEF_VEC_P and DEFVEC_I. * gengtype-parse.c: Update copyright year. (token_names): Remove DEF_VEC_O, DEF_VEC_P and DEF_VEC_I. (require_template_declaration): New. (typedef_name): Call it. (type): Replace IS_UNION with KIND. Replace all users. (def_vec): Remove. Update all users. * gengtype-state.c (type_lineloc): Handle TYPE_USER_STRUCT. (write_state_user_struct_type): New. (write_state_type): Call it. (read_state_user_struct_type): New. (read_state_type): Call it. * gengtype.c: Update copyright year. (dump_pair): Move declaration to the top. (dump_type): Likewise. (dump_type_list): Likewise. (dbgprint_count_type_at): Handle TYPE_USER_STRUCT. (create_user_defined_type): New. (resolve_typedef): Call it. (new_structure): Replace argument ISUNION with KIND. Change users to refer to KIND directly. Update all callers. (find_structure): Likewise. (set_gc_used_type): Handle TYPE_USER_STRUCT. (create_file): Update HDR to include new copyright year. (struct walk_type_data): Add field IN_PTR_FIELD. (output_mangled_typename): Handle TYPE_USER_STRUCT. (walk_type): Set D->IN_PTR_FIELD when walking a TYPE_POINTER. Clear it afterwards. Handle TYPE_USER_STRUCT. (write_types_process_field): Handle TYPE_USER_STRUCT. (get_type_specifier): Move earlier in the file. (write_type_decl): New. (write_marker_function_name): New. (write_user_func_for_structure_ptr): New. (write_user_func_for_structure_body): New. (write_user_marking_functions): New. (write_func_for_structure): Call write_marker_function_name and write_type_decl. Do not call walk_type for TYPE_USER_STRUCT. Emit a call to the user function directly. Call write_user_marking_functions on TYPE_USER_STRUCTs. (write_types_local_user_process_field): New. (write_pch_user_walking_for_structure_body): New. (write_pch_user_walking_functions): New. (write_types_local_process_field): Handle TYPE_USER_STRUCT. (write_local_func_for_structure): Do not call walk_type for TYPE_USER_STRUCT. Instead, emit the call to gt_pch_nx directly. Call write_pch_user_walking_functions for TYPE_USER_STRUCTs. (write_root): Handle TYPE_USER_STRUCT. (vec_prefix_type): Remove. Update all users. (note_def_vec): Remove. Update all users. (dump_typekind): Handle TYPE_USER_STRUCT. (dump_type): Initialize SEEN_TYPES, if needed. Handle TYPE_USER_STRUCT. (dump_everything): Do not initialize SEEN_TYPES. * gengtype.h: Update copyright year. (enum typekind): Add TYPE_USER_STRUCT. (union_or_struct_p): Rename from UNION_OR_STRUCT_P. Convert into function. Add an overload taking const_type_p. Update all callers. (new_structure): Change second field to type enum typekind. Update all users. (find_structure): Likewise. (note_def_vec): Remove. (DEFVEC_OP): Remove. (DEFVEC_I): Remove. * ggc-page.c (gt_ggc_mx): Add entry points for marking 'const char *&', 'unsigned char *&' and 'unsigned char&'. * ggc-zone.c (gt_ggc_mx): Add entry points for marking 'const char *&' and 'unsigned char *&'. * stringpool.c (gt_pch_nx): Add entry points for marking 'const char *&', 'unsigned char *&' and 'unsigned char&'. Add an entry point for the overload taking arguments 'unsigned char *', 'gt_pointer_operator' and 'void *'. * vec.h (struct vec_prefix): Remove GTY marker. (struct vec_t): Remove GTY((length)) attribute from field 'vec'. (gt_ggc_mx (vec_t<T> *)): New template function. (gt_pch_nx (vec_t<T> *)): New template function. (gt_pch_nx (vec_t<T *> *, gt_pointer_operator, void *)): New template function. (gt_pch_nx (vec_t<T> *, gt_pointer_operator, void *)): New template function. * basic-block.h (struct edge_def): Mark GTY((user)). Remove all GTY markers from fields. (gt_ggc_mx): Declare. (gt_pch_nx): Declare. * tree-cfg.c (gt_ggc_mx): New. (gt_pch_nx): New. * gengtype-lex.l (USER_GTY): Add pattern for "user". * gengtype-parse.c (option): Handle USER_GTY. (opts_have): New. (type): Call it. If the keyword 'user' is used, do not walk the fields of the structure. * gengtype.h (USER_GTY): Add. * doc/gty.texi: Update. 2012-08-14 Lawrence Crowl <crowl@google.com> Merge cxx-conversion branch. Implement C++ hash table. * hash-table.h: New. Implementation borrowed from libiberty/hashtab.c. * hash-table.c: Likewise. * tree-ssa-tail-merge.c: Include hash-table.h instead of hashtab.h. (static htab_t same_succ_htab): Change type to hash_table; move specification of helper functions from create call to declaration. Change users to invoke member functions. (same_succ_print_traverse): Make extern ssa_.... Change callers. Remove void* casting. (same_succ_hash): Likewise. (same_succ_equal): Likewise. (same_succ_delete): Likewise. * tree-ssa-threadupdate.c: Include hash-table.h. (struct local_info): Rename to ssa_local_info_t to avoid overloading the type name local_info with the variable name local_info. (static htab_t redirection_data): Change type to hash_table. Move specification of helper functions from create call to declaration. Change users to invoke member functions. (redirection_data_hash): Make extern ssa_.... Change callers. Remove void* casting. (redirection_data_eq): Likewise. (fix_duplicate_block_edges): Likewise. (create_duplicates): Likewise. (fixup_template_block): Likewise. (redirect_edges): Likewise. (lookup_redirection_data): Change types associated with the hash table from void* to their actual type. Remove unnecessary casts. * tree-ssa-ccp.c: Include hash-table.h. (typedef gimple_htab): New. Uses hash_table. Replace specific uses of htab_t with gimple_htab. Change users to invoke member functions. Move specification of helper functions from create call to declaration. * tree-ssa-coalesce.c: Include hash-table.h instead of hashtab.h. (hash_ssa_name_by_var): Make extern. Remove void* casting. (eq_ssa_name_by_var): Likewise. (coalesce_ssa_name): Change type of local static htab_t ssa_name_hash to hash_table. Change users to invoke member functions. Move specification of helper functions from create call to declaration. * coverage.c: Include hash-table.h instead of hashtab.h. (static htab_t counts_hash): Change type to hash_table; move specification of helper functions from create call to declaration. Change users to invoke member functions. (htab_counts_entry_hash): Make extern. Rename with coverage_... instead of htab_... Remove void* casting. (htab_counts_entry_eq): Likewise. (htab_counts_entry_del): Likewise. * tree-ssa-pre.c: Include hash-table.h instead of hashtab.h. (static htab_t expression_to_id): Change type to hash_table. Move specification of helper functions from create call to declaration. Change users to invoke member functions. (static htab_t phi_translate_table): Likewise. (pre_expr_eq): Make extern ssa_.... Change callers. Remove void* casting. (pre_expr_hash): Likewise. (expr_pred_trans_hash): Likewise. (expr_pred_trans_eq): Likewise. (alloc_expression_id): Change types associated with the hash table from void* to their actual type. Remove unnecessary casts. (lookup_expression_id): Likewise. (phi_trans_lookup): Likewise. (phi_trans_add): Likewise. * stringpool.c: Rename uses of libcpp typedef hash_table to cpp_hash_table. * Makefile.in: Add hash-table.o to OBJS-libcommon-target. Add $(HASH_TABLE_H). Add new dependences on $(HASH_TABLE_H). 2012-08-14 Lawrence Crowl <crowl@google.com> Merge from cxx-conversion branch. Re-write double_int in C++. * hash-table.h (typedef double_int): Change to struct (POD). (double_int::make): New overloads for int to double-int conversion. (double_int::mask): New. (double_int::max_value): New. (double_int::min_value): New. (double_int::operator ++): New. (double_int::operator --): New. (double_int::operator *=): New. (double_int::operator +=): New. (double_int::operator -=): New. (double_int::to_signed): New. (double_int::to_unsigned): New. (double_int::fits_unsigned): New. (double_int::fits_signed): New. (double_int::fits): New. (double_int::trailing_zeros): New. (double_int::popcount): New. (double_int::multiple_of): New. (double_int::set_bit): New. (double_int::mul_with_sign): New. (double_int::operator * (binary)): New. (double_int::operator + (binary)): New. (double_int::operator - (binary)): New. (double_int::operator - (unary)): New. (double_int::operator ~ (unary)): New. (double_int::operator & (binary)): New. (double_int::operator | (binary)): New. (double_int::operator ^ (binary)): New. (double_int::and_not): New. (double_int::lshift): New. (double_int::rshift): New. (double_int::alshift): New. (double_int::arshift): New. (double_int::llshift): New. (double_int::lrshift): New. (double_int::lrotate): New. (double_int::rrotate): New. (double_int::div): New. (double_int::sdiv): New. (double_int::udiv): New. (double_int::mod): New. (double_int::smod): New. (double_int::umod): New. (double_int::divmod): New. (double_int::sdivmod): New. (double_int::udivmod): New. (double_int::ext): New. (double_int::zext): New. (double_int::sext): New. (double_int::is_zero): New. (double_int::is_one): New. (double_int::is_minus_one): New. (double_int::is_negative): New. (double_int::cmp): New. (double_int::ucmp): New. (double_int::scmp): New. (double_int::ult): New. (double_int::ugt): New. (double_int::slt): New. (double_int::sgt): New. (double_int::max): New. (double_int::smax): New. (double_int::umax): New. (double_int::min): New. (double_int::smin): New. (double_int::umin): New. (double_int::operator ==): New. (double_int::operator !=): New. (shwi_to_double_int): Change implementation to use member function. (double_int_minus_one): Likewise. (double_int_zero): Likewise. (double_int_one): Likewise. (double_int_two): Likewise. (double_int_ten): Likewise. (uhwi_to_double_int): Likewise. (double_int_to_shwi): Likewise. (double_int_to_uhwi): Likewise. (double_int_fits_in_uhwi_p): Likewise. (double_int_fits_in_shwi_p): Likewise. (double_int_fits_in_hwi_p): Likewise. (double_int_mul): Likewise. (double_int_mul_with_sign): Likewise. (double_int_add): Likewise. (double_int_sub): Likewise. (double_int_neg): Likewise. (double_int_div): Likewise. (double_int_sdiv): Likewise. (double_int_udiv): Likewise. (double_int_mod): Likewise. (double_int_smod): Likewise. (double_int_umod): Likewise. (double_int_divmod): Likewise. (double_int_sdivmod): Likewise. (double_int_udivmod): Likewise. (double_int_multiple_of): Likewise. (double_int_setbit): Likewise. (double_int_ctz): Likewise. (double_int_not): Likewise. (double_int_ior): Likewise. (double_int_and): Likewise. (double_int_and_not): Likewise. (double_int_xor): Likewise. (double_int_lshift): Likewise. (double_int_rshift): Likewise. (double_int_lrotate): Likewise. (double_int_rrotate): Likewise. (double_int_cmp): Likewise. (double_int_scmp): Likewise. (double_int_ucmp): Likewise. (double_int_max): Likewise. (double_int_smax): Likewise. (double_int_umax): Likewise. (double_int_min): Likewise. (double_int_smin): Likewise. (double_int_umin): Likewise. (double_int_ext): Likewise. (double_int_sext): Likewise. (double_int_zext): Likewise. (double_int_mask): Likewise. (double_int_max_value): Likewise. (double_int_min_value): Likewise. (double_int_zero_p): Likewise. (double_int_one_p): Likewise. (double_int_minus_one_p): Likewise. (double_int_equal_p): Likewise. (double_int_popcount): Likewise. * hash-table.c (double_int_mask): Reuse implementation for double_int::mask. (double_int_max_value): Likewise. (double_int_min_value): Likewise. (double_int_ext): Likewise. (double_int_zext): Likewise. (double_int_sext): Likewise. (double_int_mul_with_sign): Likewise. (double_int_divmod): Likewise. (double_int_sdivmod): Likewise. (double_int_udivmod): Likewise. (double_int_div): Likewise. (double_int_sdiv): Likewise. (double_int_udiv): Likewise. (double_int_mod): Likewise. (double_int_smod): Likewise. (double_int_umod): Likewise. (double_int_multiple_of): Likewise. (double_int_lshift): Likewise. (double_int_rshift): Likewise. (double_int_lrotate): Likewise. (double_int_rrotate): Likewise. (double_int_cmp): Likewise. (double_int_ucmp): Likewise. (double_int_scmp): Likewise. (double_int_max): Likewise. (double_int_smax): Likewise. (double_int_umax): Likewise. (double_int_min): Likewise. (double_int_smin): Likewise. (double_int_umin): Likewise. (double_int_min): Likewise. (double_int_min): Likewise. (double_int_min): Likewise. (double_int_min): Likewise. (double_int_min): Likewise. (double_int_min): Likewise. (double_int::alshift): New. (double_int::arshift): New. (double_int::llshift): New. (double_int::lrshift): New. (double_int::ult): New. (double_int::ugt): New. (double_int::slt): New. (double_int::sgt): New. (double_int_setbit): Reuse implementation for double_int::set_bit, which avoids a name conflict with a macro. (double_int_double_int_ctz): Reuse implementation for double_int::trailing_zeros. (double_int_fits_in_shwi_p): Reuse implementation for double_int::fits_signed. (double_int_fits_in_hwi_p): Reuse implementation for double_int::fits. (double_int_mul): Reuse implementation for binary double_int::operator *. (double_int_add): Likewise. (double_int_sub): Likewise. (double_int_neg): Reuse implementation for unary double_int::operator -. (double_int_max_value): Likewise. * fixed-value.c: Change to use member functions introduced above. 2012-08-14 Lawrence Crowl <crowl@google.com> Merge cxx-conversion branch. Support tree macro calling from gdb. * tree.h (tree_check): New. (TREE_CHECK): Use inline function above instead of __extension__. (tree_not_check): New. (TREE_NOT_CHECK): Use inline function above instead of __extension__. (tree_check2): New. (TREE_CHECK2): Use inline function above instead of __extension__. (tree_not_check2): New. (TREE_NOT_CHECK2): Use inline function above instead of __extension__. (tree_check3): New. (TREE_CHECK3): Use inline function above instead of __extension__. (tree_not_check3): New. (TREE_NOT_CHECK3): Use inline function above instead of __extension__. (tree_check4): New. (TREE_CHECK4): Use inline function above instead of __extension__. (tree_not_check4): New. (TREE_NOT_CHECK4): Use inline function above instead of __extension__. (tree_check5): New. (TREE_CHECK5): Use inline function above instead of __extension__. (tree_not_check5): New. (TREE_NOT_CHECK5): Use inline function above instead of __extension__. (contains_struct_check): New. (CONTAINS_STRUCT_CHECK): Use inline function above instead of __extension__. (tree_class_check): New. (TREE_CLASS_CHECK): Use inline function above instead of __extension__. (tree_range_check): New. (TREE_RANGE_CHECK): Use inline function above instead of __extension__. (omp_clause_subcode_check): New. (OMP_CLAUSE_SUBCODE_CHECK): Use inline function above instead of __extension__. (omp_clause_range_check): New. (OMP_CLAUSE_RANGE_CHECK): Use inline function above instead of __extension__. (expr_check): New. (EXPR_CHECK): Use inline function above instead of __extension__. (non_type_check): New. (NON_TYPE_CHECK): Use inline function above instead of __extension__. (tree_vec_elt_check): New. (TREE_VEC_ELT_CHECK): Use inline function above instead of __extension__. (omp_clause_elt_check): New. (OMP_CLAUSE_ELT_CHECK): Use inline function above instead of __extension__. (tree_operand_check): New. (TREE_OPERAND_CHECK): Use inline function above instead of __extension__. (tree_operand_check_code): New. (TREE_OPERAND_CHECK_CODE): Use inline function above instead of __extension__. (TREE_CHAIN): Simplify implementation. (TREE_TYPE): Simplify implementation. (tree_operand_length): Move for compilation dependences. * gdbinit.in: (macro define __FILE__): New. (macro define __LINE__): New. (skip "tree.h"): New. gcc/cp/ChangeLog 2012-08-14 Diego Novillo <dnovillo@google.com> Merge from cxx-conversion branch. Re-write VEC in C++. * call.c (add_function_candidate): Remove const qualifier from call to VEC_index. 2012-08-14 Diego Novillo <dnovillo@google.com> Merge from cxx-conversion branch. Configury. * go-c.h: Remove all handlers of ENABLE_BUILD_WITH_CXX. * go-gcc.cc: Likewise. * go-system.h: Likewise. From-SVN: r190402
2012-08-15 03:56:07 +02:00
inline int
remove need for store_values_directly This switches all hash_table users to use the layout that stores elements of type value_type in the hash table instead of the one storing value_type *. Since it becomes unused support for the value_type * layout is removed. gcc/ * hash-table.h: Remove version of hash_table that stored value_type *. * asan.c, attribs.c, bitmap.c, cfg.c, cgraph.h, config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c, config/mips/mips.c, config/sol2.c, coverage.c, cselib.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c, gcse.c, genmatch.c, ggc-common.c, gimple-ssa-strength-reduction.c, gimplify.c, haifa-sched.c, hard-reg-set.h, hash-map.h, hash-set.h, ipa-devirt.c, ipa-icf.h, ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lto-streamer.h, plugin.c, postreload-gcse.c, reginfo.c, statistics.c, store-motion.c, trans-mem.c, tree-cfg.c, tree-eh.c, tree-hasher.h, tree-into-ssa.c, tree-parloops.c, tree-sra.c, tree-ssa-coalesce.c, tree-ssa-dom.c, tree-ssa-live.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-threadupdate.c, tree-vectorizer.c, tree-vectorizer.h, valtrack.h, var-tracking.c, vtable-verify.c, vtable-verify.h: Adjust. libcc1/ * plugin.cc: Adjust for hash_table changes. gcc/java/ * jcf-io.c: Adjust for hash_table changes. gcc/lto/ * lto.c: Adjust for hash_table changes. gcc/objc/ * objc-act.c: Adjust for hash_table changes. From-SVN: r222213
2015-04-18 20:13:18 +02:00
ssa_name_var_hash::equal (const tree_node *n1, const tree_node *n2)
{
return SSA_NAME_VAR (n1) == SSA_NAME_VAR (n2);
}
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
/* Reduce the number of copies by coalescing variables in the function. Return
a partition map with the resulting coalesces. */
extern var_map
coalesce_ssa_name (void)
{
tree_live_info_p liveinfo;
ssa_conflicts_p graph;
coalesce_list_p cl;
bitmap used_in_copies = BITMAP_ALLOC (NULL);
var_map map;
unsigned int i;
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
cl = create_coalesce_list ();
map = create_outofssa_var_map (cl, used_in_copies);
/* If optimization is disabled, we need to coalesce all the names originating
from the same SSA_NAME_VAR so debug info remains undisturbed. */
if (!optimize)
{
Remove a layer of indirection from hash_table gcc/ * hash-table.h: Remove a layer of indirection from hash_table so that it contains the hash table's data instead of a pointer to the data. * alloc-pool.c, asan.c, attribs.c, bitmap.c, cfg.c, config/arm/arm.c, config/i386/winnt.c, config/ia64/ia64.c, config/mips/mips.c, config/sol2.c, coverage.c, cselib.c, data-streamer-out.c, dse.c, dwarf2cfi.c, dwarf2out.c, except.c, fold-const.c, gcse.c, ggc-common.c, gimple-ssa-strength-reduction.c, gimplify.c, graphite-clast-to-gimple.c, graphite-dependences.c, graphite-htab.h, graphite.c, haifa-sched.c, ipa-devirt.c, ipa-profile.c, ira-color.c, ira-costs.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lto-streamer-in.c, lto-streamer-out.c, lto-streamer.c, lto-streamer.h, passes.c, plugin.c, postreload-gcse.c, sese.c, statistics.c, store-motion.c, trans-mem.c, tree-browser.c, tree-cfg.c, tree-complex.c, tree-eh.c, tree-into-ssa.c, tree-parloops.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-dom.c, tree-ssa-live.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-phiopt.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-tail-merge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.c, tree-vectorizer.h, valtrack.c, valtrack.h, var-tracking.c, vtable-verify.c, vtable-verify.h: Adjust. gcc/c/ * c-decl.c: Adjust. gcc/cp/ * class.c, semantics.c, tree.c, vtable-class-hierarchy.c: Adjust. gcc/java/ * jcf-io.c: Adjust. gcc/lto/ * lto.c: Adjust. gcc/objc/ * objc-act.c: Adjust. From-SVN: r211936
2014-06-24 15:21:35 +02:00
hash_table<ssa_name_var_hash> ssa_name_hash (10);
for (i = 1; i < num_ssa_names; i++)
{
tree a = ssa_name (i);
if (a
&& SSA_NAME_VAR (a)
&& !DECL_IGNORED_P (SSA_NAME_VAR (a))
&& (!has_zero_uses (a) || !SSA_NAME_IS_DEFAULT_DEF (a)))
{
backport: As described in http://gcc.gnu.org/ml/gcc/2012-08/msg00015.html... Merge from cxx-conversion branch (http://gcc.gnu.org/wiki/cxx-conversion). As described in http://gcc.gnu.org/ml/gcc/2012-08/msg00015.html, this patch changes the default bootstrap process so that stage 1 always builds with a C++ compiler. Other than the bootstrap change, the patch makes no functional changes to the compiler. Everything should build as it does now in trunk. The main changes in this patch are: 1- Configuration changes. 2- Re-write of VEC. 3- Re-write of gengtype to support C++ templates and user-provided marking functions. 4- New hash table class. 5- Re-write double_int. 6- Implement tree macros as inline functions so they can be called from gdb. As discussed before, several of these changes do not fully change the call sites to use the new APIs. The bootstrap changes have already been tested on a wide range of targets (http://gcc.gnu.org/wiki/CppBuildStatus). Additionally, I have tested the merged trunk on: x86_64-unknown-linux-gnu, mips64el-unknown-linux-gnu, powerpc64-unknown-linux-gnu, i686-pc-linux-gnu, and ia64-unknown-linux-gnu. ChangeLog 2012-08-14 Diego Novillo <dnovillo@google.com> Merge from cxx-conversion branch. * Makefile.tpl (STAGE[+id+]_CXXFLAGS): Remove POSTSTAGE1_CONFIGURE_FLAGS. * Makefile.in: Regenerate. * configure.ac (ENABLE_BUILD_WITH_CXX): Remove. Update all users. Force C++ when bootstrapping. * configure: Regenerate. libcpp/ChangeLog 2012-08-14 Diego Novillo <dnovillo@google.com> Merge from cxx-conversion branch. Configury. * Makefile.in: Remove all handlers of ENABLE_BUILD_WITH_CXX. * configure.ac: Likewise. * configure: Regenerate. 2012-08-14 Lawrence Crowl <crowl@google.com> Merge from cxx-conversion branch. New C++ hash table. * include/symtab.h (typedef struct ht hash_table): Change the typedef name to cpp_hash_table. Update all users of the typedef. gcc/ChangeLog 2012-08-14 Diego Novillo <dnovillo@google.com> Merge from cxx-conversion branch. Configury. * configure.ac (CXX_FOR_BUILD): Define and substitute. (BUILD_CXXFLAGS): Define. Remove all handlers of ENABLE_BUILD_WITH_CXX. Force all build to be with C++. * Makefile.in (BUILD_CXXFLAGS): Use it. Remove all handlers of ENABLE_BUILD_WITH_CXX. * configure: Regenerate. * config.in: Regenerate. * doc/install.texi: Remove documentation for --enable-build-with-cxx and --enable-build-poststage1-with-cxx. 2012-08-14 Diego Novillo <dnovillo@google.com> Merge from cxx-conversion branch. Re-implement VEC in C++. * vec.c (vec_heap_free): Convert into a template function. (vec_gc_o_reserve_1): Make extern. (vec_gc_p_reserve): Remove. (vec_gc_p_reserve_exact): Remove. (vec_gc_o_reserve): Remove. (vec_gc_o_reserve_exact): Remove. (vec_heap_o_reserve_1): Make extern. (vec_heap_p_reserve): Remove. (vec_heap_p_reserve_exact): Remove. (vec_heap_o_reserve): Remove. (vec_heap_o_reserve_exact): Remove. (vec_stack_p_reserve): Remove. (vec_stack_p_reserve_exact): Remove. * vec.h (VEC_CHECK_INFO, VEC_CHECK_DECL, VEC_CHECK_PASS, VEC_ASSERT, VEC_ASSERT_FAIL, vec_assert_fail): Move earlier in the file. (VEC): Define to vec_t<T>. (vec_allocation_t): Define. (struct vec_prefix): Move earlier in the file. (vec_t<T>): New template. (DEF_VEC_I, DEF_VECL_ALLOC_I, DEF_VEC_P, DEF_VEC_ALLOC_P, DEF_VEC_O, DEF_VEC_ALLOC_P, DEF_VEC_O, DEF_VEC_ALLOC_O, DEF_VEC_ALLOC_P_STACK, DEF_VEC_ALLOC_O_STACK, DEF_VEC_ALLOC_I_STACK): Expand to 'struct vec_swallow_trailing_semi'. (DEF_VEC_A): Provide template instantiations for GC/PCH markers that do not traverse the vector. (vec_stack_p_reserve): Remove. (vec_stack_p_reserve_exact): Remove. (vec_stack_p_reserve_exact_1): Remove. (vec_stack_o_reserve): Remove. (vec_stack_o_reserve_exact): Remove. (vec_stack_free): Re-write as a template function. (vec_reserve): New template function. (vec_reserve_exact): New template function. (vec_heap_free): New template function if GATHER_STATISTICS is defined. Otherwise, macro that expands to free(). (VEC_length_1): New template function. (VEC_length): Call it. (VEC_empty_1): New template function. (VEC_empty): Call it. (VEC_address_1): New template function. (VEC_address): Call it. (VEC_last_1): New template function. (VEC_last): Call it. Change return type to T&. Change all users that used VEC_Os. (VEC_index_1): New template function. (VEC_index): Call it. Return a T& instead of a T*. Update all callers that were using VEC_O before. (VEC_iterate_1): New template function. (VEC_iterate): Call it. (VEC_embedded_size_1): New template function. (VEC_embedded_size): Call it. (VEC_embedded_init_1): New template function. (VEC_embedded_init): Call it. (VEC_alloc_1): New template function. (VEC_alloc): Call it. If A is 'stack', call XALLOCAVAR to do the allocation. (VEC_free_1): New template function. (VEC_free): Call it. (VEC_copy_1): New template function. (VEC_copy): Call it. (VEC_space_1): New template function (VEC_space): Call it. (VEC_reserve_1): New template function. (VEC_reserve): Call it. (VEC_reserve_exact_1): New template function. (VEC_reserve_exact): Call it. (VEC_splice_1): New template function. (VEC_splice): Call it. (VEC_safe_splice_1): New template function. (VEC_safe_splice): Call it. (VEC_quick_push_1): New template function. Create two overloads, one accepting T, the other accepting T *. Update all callers where T and T * are ambiguous. (VEC_quick_push): Call it. (VEC_safe_push_1): New template function. Create two overloads, one accepting T, the other accepting T *. Update all callers where T and T * are ambiguous. (VEC_safe_push): Call it. (VEC_pop_1): New template function. (VEC_pop): Call it. (VEC_truncate_1): New template function. (VEC_truncate): Call it. (VEC_safe_grow_1): New template function. (VEC_safe_grow): Call it. (VEC_safe_grow_cleared_1): New template function. (VEC_safe_grow_cleared): Call it. (VEC_replace_1): New template function. (VEC_replace): Call it. Always accept T instead of T*. Update all callers that used VEC_Os. (VEC_quick_insert_1): New template function. (VEC_quick_insert): Call it. (VEC_safe_insert_1): New template function. (VEC_safe_insert): Call it. (VEC_ordered_remove_1): New template function. (VEC_ordered_remove): Call it. (VEC_unordered_remove_1): New template function. (VEC_unordered_remove): Call it. (VEC_block_remove_1): New template function. (VEC_block_remove): Call it. (VEC_lower_bound_1): New template function. (VEC_lower_bound): Call it. (VEC_OP): Remove. (DEF_VEC_FUNC_P): Remove. (DEF_VEC_ALLOC_FUNC_P): Remove. (DEF_VEC_NONALLOC_FUNCS_P): Remove. (DEF_VEC_FUNC_O): Remove. (DEF_VEC_ALLOC_FUNC_O): Remove. (DEF_VEC_NONALLOC_FUNCS_O): Remove. (DEF_VEC_ALLOC_FUNC_I): Remove. (DEF_VEC_NONALLOC_FUNCS_I): Remove. (DEF_VEC_ALLOC_FUNC_P_STACK): Remove. (DEF_VEC_ALLOC_FUNC_O_STACK): Remove. (DEF_VEC_ALLOC_FUNC_I_STACK): Remove. (vec_reserve_exact): New template function. * gengtype-lex.l (DEF_VEC_ALLOC_[IOP]/{EOID}): Remove. * gengtype-parse.c (token_names): Remove DEF_VEC_ALLOC_[IOP]. (typedef_name): Emit vec_t<C1> instead of VEC_C1_C2. (def_vec_alloc): Remove. Update all callers. * gengtype.c (filter_type_name): New. (output_mangled_typename): Call it. (write_func_for_structure): Likewise. (write_types): Likewise. (write_root): Likewise. (write_typed_alloc_def): Likewise. (note_def_vec): Emit vec_t<TYPE_NAME> instead of VEC_TYPE_NAME_base. (note_def_vec_alloc): Remove. * gengtype.h (note_def_vec_alloc): Remove. (DEFVEC_ALLOC): Remove token code. * df-scan.c (df_bb_verify): Remove call to df_free_collection_rec inside the insn traversal loop. * gimplify.c (gimplify_compound_lval): Rename STACK to EXPR_STACK. * ipa-inline.c (inline_small_functions): Rename HEAP to EDGE_HEAP. * reg-stack.c (stack): Rename to STACK_PTR. Update all users. * tree-vrp.c (stack): Rename to EQUIV_STACK. Update all users. * config/bfin/bfin.c (hwloop_optimize): Update some calls to VEC_* for vectors of non-pointers. * config/c6x/c6x.c (try_rename_operands): Likewise. (reshuffle_units): Likewise. * config/mips/mips.c (mips_multi_start): Likewise. (mips_multi_add): Likewise. (mips_multi_copy_insn): Likewise. (mips_multi_set_operand): Likewise. * hw-doloop.c (discover_loop): Likewise. (discover_loops): Likewise. (reorg_loops): Likewise. 2012-08-14 Diego Novillo <dnovillo@google.com> Merge from cxx-conversion branch. C++ support in gengtype. * coretypes.h (gt_pointer_operator): Move from ... * ggc.h: ... here. * doc/gty.texi: Document support for C++ templates and user-provided markers. * gcc/gengtype-lex.l: Update copyright year. Remove support for recognizing DEF_VEC_O, DEF_VEC_P and DEFVEC_I. * gengtype-parse.c: Update copyright year. (token_names): Remove DEF_VEC_O, DEF_VEC_P and DEF_VEC_I. (require_template_declaration): New. (typedef_name): Call it. (type): Replace IS_UNION with KIND. Replace all users. (def_vec): Remove. Update all users. * gengtype-state.c (type_lineloc): Handle TYPE_USER_STRUCT. (write_state_user_struct_type): New. (write_state_type): Call it. (read_state_user_struct_type): New. (read_state_type): Call it. * gengtype.c: Update copyright year. (dump_pair): Move declaration to the top. (dump_type): Likewise. (dump_type_list): Likewise. (dbgprint_count_type_at): Handle TYPE_USER_STRUCT. (create_user_defined_type): New. (resolve_typedef): Call it. (new_structure): Replace argument ISUNION with KIND. Change users to refer to KIND directly. Update all callers. (find_structure): Likewise. (set_gc_used_type): Handle TYPE_USER_STRUCT. (create_file): Update HDR to include new copyright year. (struct walk_type_data): Add field IN_PTR_FIELD. (output_mangled_typename): Handle TYPE_USER_STRUCT. (walk_type): Set D->IN_PTR_FIELD when walking a TYPE_POINTER. Clear it afterwards. Handle TYPE_USER_STRUCT. (write_types_process_field): Handle TYPE_USER_STRUCT. (get_type_specifier): Move earlier in the file. (write_type_decl): New. (write_marker_function_name): New. (write_user_func_for_structure_ptr): New. (write_user_func_for_structure_body): New. (write_user_marking_functions): New. (write_func_for_structure): Call write_marker_function_name and write_type_decl. Do not call walk_type for TYPE_USER_STRUCT. Emit a call to the user function directly. Call write_user_marking_functions on TYPE_USER_STRUCTs. (write_types_local_user_process_field): New. (write_pch_user_walking_for_structure_body): New. (write_pch_user_walking_functions): New. (write_types_local_process_field): Handle TYPE_USER_STRUCT. (write_local_func_for_structure): Do not call walk_type for TYPE_USER_STRUCT. Instead, emit the call to gt_pch_nx directly. Call write_pch_user_walking_functions for TYPE_USER_STRUCTs. (write_root): Handle TYPE_USER_STRUCT. (vec_prefix_type): Remove. Update all users. (note_def_vec): Remove. Update all users. (dump_typekind): Handle TYPE_USER_STRUCT. (dump_type): Initialize SEEN_TYPES, if needed. Handle TYPE_USER_STRUCT. (dump_everything): Do not initialize SEEN_TYPES. * gengtype.h: Update copyright year. (enum typekind): Add TYPE_USER_STRUCT. (union_or_struct_p): Rename from UNION_OR_STRUCT_P. Convert into function. Add an overload taking const_type_p. Update all callers. (new_structure): Change second field to type enum typekind. Update all users. (find_structure): Likewise. (note_def_vec): Remove. (DEFVEC_OP): Remove. (DEFVEC_I): Remove. * ggc-page.c (gt_ggc_mx): Add entry points for marking 'const char *&', 'unsigned char *&' and 'unsigned char&'. * ggc-zone.c (gt_ggc_mx): Add entry points for marking 'const char *&' and 'unsigned char *&'. * stringpool.c (gt_pch_nx): Add entry points for marking 'const char *&', 'unsigned char *&' and 'unsigned char&'. Add an entry point for the overload taking arguments 'unsigned char *', 'gt_pointer_operator' and 'void *'. * vec.h (struct vec_prefix): Remove GTY marker. (struct vec_t): Remove GTY((length)) attribute from field 'vec'. (gt_ggc_mx (vec_t<T> *)): New template function. (gt_pch_nx (vec_t<T> *)): New template function. (gt_pch_nx (vec_t<T *> *, gt_pointer_operator, void *)): New template function. (gt_pch_nx (vec_t<T> *, gt_pointer_operator, void *)): New template function. * basic-block.h (struct edge_def): Mark GTY((user)). Remove all GTY markers from fields. (gt_ggc_mx): Declare. (gt_pch_nx): Declare. * tree-cfg.c (gt_ggc_mx): New. (gt_pch_nx): New. * gengtype-lex.l (USER_GTY): Add pattern for "user". * gengtype-parse.c (option): Handle USER_GTY. (opts_have): New. (type): Call it. If the keyword 'user' is used, do not walk the fields of the structure. * gengtype.h (USER_GTY): Add. * doc/gty.texi: Update. 2012-08-14 Lawrence Crowl <crowl@google.com> Merge cxx-conversion branch. Implement C++ hash table. * hash-table.h: New. Implementation borrowed from libiberty/hashtab.c. * hash-table.c: Likewise. * tree-ssa-tail-merge.c: Include hash-table.h instead of hashtab.h. (static htab_t same_succ_htab): Change type to hash_table; move specification of helper functions from create call to declaration. Change users to invoke member functions. (same_succ_print_traverse): Make extern ssa_.... Change callers. Remove void* casting. (same_succ_hash): Likewise. (same_succ_equal): Likewise. (same_succ_delete): Likewise. * tree-ssa-threadupdate.c: Include hash-table.h. (struct local_info): Rename to ssa_local_info_t to avoid overloading the type name local_info with the variable name local_info. (static htab_t redirection_data): Change type to hash_table. Move specification of helper functions from create call to declaration. Change users to invoke member functions. (redirection_data_hash): Make extern ssa_.... Change callers. Remove void* casting. (redirection_data_eq): Likewise. (fix_duplicate_block_edges): Likewise. (create_duplicates): Likewise. (fixup_template_block): Likewise. (redirect_edges): Likewise. (lookup_redirection_data): Change types associated with the hash table from void* to their actual type. Remove unnecessary casts. * tree-ssa-ccp.c: Include hash-table.h. (typedef gimple_htab): New. Uses hash_table. Replace specific uses of htab_t with gimple_htab. Change users to invoke member functions. Move specification of helper functions from create call to declaration. * tree-ssa-coalesce.c: Include hash-table.h instead of hashtab.h. (hash_ssa_name_by_var): Make extern. Remove void* casting. (eq_ssa_name_by_var): Likewise. (coalesce_ssa_name): Change type of local static htab_t ssa_name_hash to hash_table. Change users to invoke member functions. Move specification of helper functions from create call to declaration. * coverage.c: Include hash-table.h instead of hashtab.h. (static htab_t counts_hash): Change type to hash_table; move specification of helper functions from create call to declaration. Change users to invoke member functions. (htab_counts_entry_hash): Make extern. Rename with coverage_... instead of htab_... Remove void* casting. (htab_counts_entry_eq): Likewise. (htab_counts_entry_del): Likewise. * tree-ssa-pre.c: Include hash-table.h instead of hashtab.h. (static htab_t expression_to_id): Change type to hash_table. Move specification of helper functions from create call to declaration. Change users to invoke member functions. (static htab_t phi_translate_table): Likewise. (pre_expr_eq): Make extern ssa_.... Change callers. Remove void* casting. (pre_expr_hash): Likewise. (expr_pred_trans_hash): Likewise. (expr_pred_trans_eq): Likewise. (alloc_expression_id): Change types associated with the hash table from void* to their actual type. Remove unnecessary casts. (lookup_expression_id): Likewise. (phi_trans_lookup): Likewise. (phi_trans_add): Likewise. * stringpool.c: Rename uses of libcpp typedef hash_table to cpp_hash_table. * Makefile.in: Add hash-table.o to OBJS-libcommon-target. Add $(HASH_TABLE_H). Add new dependences on $(HASH_TABLE_H). 2012-08-14 Lawrence Crowl <crowl@google.com> Merge from cxx-conversion branch. Re-write double_int in C++. * hash-table.h (typedef double_int): Change to struct (POD). (double_int::make): New overloads for int to double-int conversion. (double_int::mask): New. (double_int::max_value): New. (double_int::min_value): New. (double_int::operator ++): New. (double_int::operator --): New. (double_int::operator *=): New. (double_int::operator +=): New. (double_int::operator -=): New. (double_int::to_signed): New. (double_int::to_unsigned): New. (double_int::fits_unsigned): New. (double_int::fits_signed): New. (double_int::fits): New. (double_int::trailing_zeros): New. (double_int::popcount): New. (double_int::multiple_of): New. (double_int::set_bit): New. (double_int::mul_with_sign): New. (double_int::operator * (binary)): New. (double_int::operator + (binary)): New. (double_int::operator - (binary)): New. (double_int::operator - (unary)): New. (double_int::operator ~ (unary)): New. (double_int::operator & (binary)): New. (double_int::operator | (binary)): New. (double_int::operator ^ (binary)): New. (double_int::and_not): New. (double_int::lshift): New. (double_int::rshift): New. (double_int::alshift): New. (double_int::arshift): New. (double_int::llshift): New. (double_int::lrshift): New. (double_int::lrotate): New. (double_int::rrotate): New. (double_int::div): New. (double_int::sdiv): New. (double_int::udiv): New. (double_int::mod): New. (double_int::smod): New. (double_int::umod): New. (double_int::divmod): New. (double_int::sdivmod): New. (double_int::udivmod): New. (double_int::ext): New. (double_int::zext): New. (double_int::sext): New. (double_int::is_zero): New. (double_int::is_one): New. (double_int::is_minus_one): New. (double_int::is_negative): New. (double_int::cmp): New. (double_int::ucmp): New. (double_int::scmp): New. (double_int::ult): New. (double_int::ugt): New. (double_int::slt): New. (double_int::sgt): New. (double_int::max): New. (double_int::smax): New. (double_int::umax): New. (double_int::min): New. (double_int::smin): New. (double_int::umin): New. (double_int::operator ==): New. (double_int::operator !=): New. (shwi_to_double_int): Change implementation to use member function. (double_int_minus_one): Likewise. (double_int_zero): Likewise. (double_int_one): Likewise. (double_int_two): Likewise. (double_int_ten): Likewise. (uhwi_to_double_int): Likewise. (double_int_to_shwi): Likewise. (double_int_to_uhwi): Likewise. (double_int_fits_in_uhwi_p): Likewise. (double_int_fits_in_shwi_p): Likewise. (double_int_fits_in_hwi_p): Likewise. (double_int_mul): Likewise. (double_int_mul_with_sign): Likewise. (double_int_add): Likewise. (double_int_sub): Likewise. (double_int_neg): Likewise. (double_int_div): Likewise. (double_int_sdiv): Likewise. (double_int_udiv): Likewise. (double_int_mod): Likewise. (double_int_smod): Likewise. (double_int_umod): Likewise. (double_int_divmod): Likewise. (double_int_sdivmod): Likewise. (double_int_udivmod): Likewise. (double_int_multiple_of): Likewise. (double_int_setbit): Likewise. (double_int_ctz): Likewise. (double_int_not): Likewise. (double_int_ior): Likewise. (double_int_and): Likewise. (double_int_and_not): Likewise. (double_int_xor): Likewise. (double_int_lshift): Likewise. (double_int_rshift): Likewise. (double_int_lrotate): Likewise. (double_int_rrotate): Likewise. (double_int_cmp): Likewise. (double_int_scmp): Likewise. (double_int_ucmp): Likewise. (double_int_max): Likewise. (double_int_smax): Likewise. (double_int_umax): Likewise. (double_int_min): Likewise. (double_int_smin): Likewise. (double_int_umin): Likewise. (double_int_ext): Likewise. (double_int_sext): Likewise. (double_int_zext): Likewise. (double_int_mask): Likewise. (double_int_max_value): Likewise. (double_int_min_value): Likewise. (double_int_zero_p): Likewise. (double_int_one_p): Likewise. (double_int_minus_one_p): Likewise. (double_int_equal_p): Likewise. (double_int_popcount): Likewise. * hash-table.c (double_int_mask): Reuse implementation for double_int::mask. (double_int_max_value): Likewise. (double_int_min_value): Likewise. (double_int_ext): Likewise. (double_int_zext): Likewise. (double_int_sext): Likewise. (double_int_mul_with_sign): Likewise. (double_int_divmod): Likewise. (double_int_sdivmod): Likewise. (double_int_udivmod): Likewise. (double_int_div): Likewise. (double_int_sdiv): Likewise. (double_int_udiv): Likewise. (double_int_mod): Likewise. (double_int_smod): Likewise. (double_int_umod): Likewise. (double_int_multiple_of): Likewise. (double_int_lshift): Likewise. (double_int_rshift): Likewise. (double_int_lrotate): Likewise. (double_int_rrotate): Likewise. (double_int_cmp): Likewise. (double_int_ucmp): Likewise. (double_int_scmp): Likewise. (double_int_max): Likewise. (double_int_smax): Likewise. (double_int_umax): Likewise. (double_int_min): Likewise. (double_int_smin): Likewise. (double_int_umin): Likewise. (double_int_min): Likewise. (double_int_min): Likewise. (double_int_min): Likewise. (double_int_min): Likewise. (double_int_min): Likewise. (double_int_min): Likewise. (double_int::alshift): New. (double_int::arshift): New. (double_int::llshift): New. (double_int::lrshift): New. (double_int::ult): New. (double_int::ugt): New. (double_int::slt): New. (double_int::sgt): New. (double_int_setbit): Reuse implementation for double_int::set_bit, which avoids a name conflict with a macro. (double_int_double_int_ctz): Reuse implementation for double_int::trailing_zeros. (double_int_fits_in_shwi_p): Reuse implementation for double_int::fits_signed. (double_int_fits_in_hwi_p): Reuse implementation for double_int::fits. (double_int_mul): Reuse implementation for binary double_int::operator *. (double_int_add): Likewise. (double_int_sub): Likewise. (double_int_neg): Reuse implementation for unary double_int::operator -. (double_int_max_value): Likewise. * fixed-value.c: Change to use member functions introduced above. 2012-08-14 Lawrence Crowl <crowl@google.com> Merge cxx-conversion branch. Support tree macro calling from gdb. * tree.h (tree_check): New. (TREE_CHECK): Use inline function above instead of __extension__. (tree_not_check): New. (TREE_NOT_CHECK): Use inline function above instead of __extension__. (tree_check2): New. (TREE_CHECK2): Use inline function above instead of __extension__. (tree_not_check2): New. (TREE_NOT_CHECK2): Use inline function above instead of __extension__. (tree_check3): New. (TREE_CHECK3): Use inline function above instead of __extension__. (tree_not_check3): New. (TREE_NOT_CHECK3): Use inline function above instead of __extension__. (tree_check4): New. (TREE_CHECK4): Use inline function above instead of __extension__. (tree_not_check4): New. (TREE_NOT_CHECK4): Use inline function above instead of __extension__. (tree_check5): New. (TREE_CHECK5): Use inline function above instead of __extension__. (tree_not_check5): New. (TREE_NOT_CHECK5): Use inline function above instead of __extension__. (contains_struct_check): New. (CONTAINS_STRUCT_CHECK): Use inline function above instead of __extension__. (tree_class_check): New. (TREE_CLASS_CHECK): Use inline function above instead of __extension__. (tree_range_check): New. (TREE_RANGE_CHECK): Use inline function above instead of __extension__. (omp_clause_subcode_check): New. (OMP_CLAUSE_SUBCODE_CHECK): Use inline function above instead of __extension__. (omp_clause_range_check): New. (OMP_CLAUSE_RANGE_CHECK): Use inline function above instead of __extension__. (expr_check): New. (EXPR_CHECK): Use inline function above instead of __extension__. (non_type_check): New. (NON_TYPE_CHECK): Use inline function above instead of __extension__. (tree_vec_elt_check): New. (TREE_VEC_ELT_CHECK): Use inline function above instead of __extension__. (omp_clause_elt_check): New. (OMP_CLAUSE_ELT_CHECK): Use inline function above instead of __extension__. (tree_operand_check): New. (TREE_OPERAND_CHECK): Use inline function above instead of __extension__. (tree_operand_check_code): New. (TREE_OPERAND_CHECK_CODE): Use inline function above instead of __extension__. (TREE_CHAIN): Simplify implementation. (TREE_TYPE): Simplify implementation. (tree_operand_length): Move for compilation dependences. * gdbinit.in: (macro define __FILE__): New. (macro define __LINE__): New. (skip "tree.h"): New. gcc/cp/ChangeLog 2012-08-14 Diego Novillo <dnovillo@google.com> Merge from cxx-conversion branch. Re-write VEC in C++. * call.c (add_function_candidate): Remove const qualifier from call to VEC_index. 2012-08-14 Diego Novillo <dnovillo@google.com> Merge from cxx-conversion branch. Configury. * go-c.h: Remove all handlers of ENABLE_BUILD_WITH_CXX. * go-gcc.cc: Likewise. * go-system.h: Likewise. From-SVN: r190402
2012-08-15 03:56:07 +02:00
tree *slot = ssa_name_hash.find_slot (a, INSERT);
if (!*slot)
*slot = a;
else
{
/* If the variable is a PARM_DECL or a RESULT_DECL, we
_require_ that all the names originating from it be
coalesced, because there must be a single partition
containing all the names so that it can be assigned
the canonical RTL location of the DECL safely.
If in_lto_p, a function could have been compiled
originally with optimizations and only the link
performed at -O0, so we can't actually require it. */
const int cost
= (TREE_CODE (SSA_NAME_VAR (a)) == VAR_DECL || in_lto_p)
? MUST_COALESCE_COST - 1 : MUST_COALESCE_COST;
add_coalesce (cl, SSA_NAME_VERSION (a),
SSA_NAME_VERSION (*slot), cost);
bitmap_set_bit (used_in_copies, SSA_NAME_VERSION (a));
bitmap_set_bit (used_in_copies, SSA_NAME_VERSION (*slot));
}
}
}
}
if (dump_file && (dump_flags & TDF_DETAILS))
dump_var_map (dump_file, map);
/* Don't calculate live ranges for variables not in the coalesce list. */
partition_view_bitmap (map, used_in_copies, true);
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
BITMAP_FREE (used_in_copies);
if (num_var_partitions (map) < 1)
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
{
delete_coalesce_list (cl);
return map;
}
if (dump_file && (dump_flags & TDF_DETAILS))
dump_var_map (dump_file, map);
liveinfo = calculate_live_ranges (map, false);
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
if (dump_file && (dump_flags & TDF_DETAILS))
dump_live_info (dump_file, liveinfo, LIVEDUMP_ENTRY);
/* Build a conflict graph. */
graph = build_ssa_conflict_graph (liveinfo);
delete_tree_live_info (liveinfo);
if (dump_file && (dump_flags & TDF_DETAILS))
ssa_conflicts_dump (dump_file, graph);
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
sort_coalesce_list (cl);
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "\nAfter sorting:\n");
dump_coalesce_list (dump_file, cl);
}
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
/* First, coalesce all live on entry variables to their base variable.
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
This will ensure the first use is coming from the correct location. */
if (dump_file && (dump_flags & TDF_DETAILS))
dump_var_map (dump_file, map);
/* Now coalesce everything in the list. */
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
coalesce_partitions (map, graph, cl,
((dump_flags & TDF_DETAILS) ? dump_file
: NULL));
New out of ssa Coalescer. 2006-12-10 Andrew MacLeod <amacleod@redhat.com> * common.opt (-ftree-lrs): Remove live range splitting option. * makefile.in: Add tree-ssa-coalesce.o and reduce header dependancies. * opts.c (decode_options): Remove flag_tree_live_range_split. * tree-flow.h (struct var_ann_d): Rename fields from root_ to base_. * tree-flow-inline.h (single_imm_use_p): New. Check for single use. * tree-outof-ssa.c: Remove header files which aren't needed. (SSANORM_*): Remove flags. (print_exprs_edge, coalesce_abnormal_edges, coalesce_phi_operands, coalesce_result_decls_and_copies, coalesce_asm_operands): Remove. (coalesce_ssa_name): Move to tree-ssa-coalesce.c. (assign_vars): Use Basevar instead of root_var structure. (replace_def_variable): Dont do anything if def is replaceable. (remove_ssa_form): Integrate functional changes. (rewrite_out_of_ssa): Remove live-range_split option. * tree-ssa-coalesce.c: New File for ssa-name coalescing. (coalesce_cost): Calculate the cost of a coalesce. (coalesce_cost_bb): Calculate the coalesce cost within a BB. (coalesce_cost_edge): Calculate the coalesce cost on an edge. (pop_cost_one_pair): Remove the best coalesce with cost 1 from the list. (pop_best_coalesce): Remove the best coalesce from the list. (coalesce_pair_map_hash): Calculate coalesce pair hash. (coalesce_pair_map_eq): Compare 2 coalesce pairs for hash function. (create_coalesce_list): Create a coalesce list object. (delete_coalesce_list): Free a coalesce list object. (find_coalesce_pair): Find matching pair in the coalesce list. (add_cost_one_coalesce): Add a coalesce to the "cost one" list. (add_coalesce): Add a coalesce to the coalesce list. (compare_pairs): Comparision function to determine pair sorted order. (num_coalesce_pairs): Number of coalesced pairs. (first_coalesce_pair, end_coalesce_pair_p, next_coalesce_pair): Coalesce pair iterator functions. (sort_coalesce_list): Sort coalesce pairs in order of expense. (dump_coalesce_list): Show coalesce list. (ssa_conflicts_new): Create an SSA conflict graph. (ssa_conflicts_delete): Delete an SSA conflict graph. (ssa_conflicts_test_p): Test for conflicts. (ssa_conflicts_add_one): Add a single conflict. (ssa_conflicts_add): Add a conflict pair. (ssa_conflicts_merge): Merge conflicts. (struct live_track_d): Struct for tracking live partitions. (new_live_track): Create new live_track object. (delete_live_track): Delete a live_track object. (live_track_remove_partition): Remove a partition from the live list. (live_track_add_partition): Add a partition from the live list. (live_track_clear_var): Take VAR from the live list. (live_track_live_p): Is var live? (live_track_process_use): Make var come alive. (live_track_process_def): Make var go dead, add conflicts. (live_track_init): Initialize to a live on exit set. (live_track_clear_base_vars): Clear live partitions. (build_ssa_conflict_graph): Build a conflict graph. (print_exprs): Common debug output routine. (abnormal_corrupt): Output info about a failed coalesce across an abnormal edge. (fail_abnormal_edge_coalesce): Output info about a failed MUST_COALESCE. (create_outofssa_var_map): Create a var map and coalesce list. (attempt_coalesce): Coalesce a pair. (coalesce_partitions): Coalesce all pairs in a coalesce list. (coalesce_ssa_name): Entry point. Determine what ssa_names to coalesce. * tree-ssa-live.c: Remove header files which aren't needed. (var_map_base_init): New. Initialize a basevar list. (var_map_base_fini): New. Finish a basevar list. (init_var_map): Initialize new fields. (delete_var_map): Free new fields. (var_union): Use renamed fields. (compact_var_map): Remove. (partition_to_view_init): Use renamed fields, change order of an if. (partition_view_fini): Use renamed fields. (partition_view_normal): Create basevar list if requested. (partition_view_bitmap): Create a view based on a bitmap of partitions. (change_partition_var): Use renamed fields. (create_ssa_var_map): Remove. (tpa_init, tpa_remove_partition, tpa_delete, tpa_compact, root_var_init): Remove. (partition_pair_map_hash, partition_pair_map_eq, create_coalesce_list, delete_coalesce_list, find_partition_pair, coalesce_cost, add_coalesce, compare_pairs, num_coalesce_pairs, first_partition_pair, end_partition_pair_p, next_partition_pair, sort_coalesce_list, pop_best_coalesce, add_conflicts_if_valid, set_if_valid, build_tree_conflict_graph, coalesce_tpa_members, dump_coalesce_list, tpa_dump): Moved to tree-ssa-coalesce.c and/or renamed there. (dump_var_map): Use renamed fields. * tree-ssa-live.h (struct _var_map): Modify fields. (partition_to_var, version_to_var, var_to_partition): Use renamed fields. (basevar_index): New. Index of the base variable of a partition. (num_basevars): New. Number of unique base variables in partition map. (register_ssa_partition): Use renamed fields. (struct tree_partition_associator_d): Remove. (tpa_num_trees, tpa_tree, tpa_first_partition, tpa_next_partition, tpa_find_tree, tpa_decompact, root_var_init, root_var_num, root_var, root_var_first_partition, root_var_next_partition, root_var_dump, root_var_delete, root_var_remove_partition, root_var_find, root_var_compact, root_var_decompact): Remove. (struct partition_pair, struct coalesce_list_d): Moved to tree-ssa-coalesce.c * tree-ssa-ter.c: Remove header files which aren't needed. From-SVN: r119711
2006-12-10 22:25:40 +01:00
delete_coalesce_list (cl);
ssa_conflicts_delete (graph);
return map;
}