gcc/gcc/ira-int.h

1512 lines
54 KiB
C
Raw Normal View History

[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
/* Integrated Register Allocator (IRA) intercommunication header file.
Copyright (C) 2006-2017 Free Software Foundation, Inc.
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
Contributed by Vladimir Makarov <vmakarov@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) 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/>. */
#ifndef GCC_IRA_INT_H
#define GCC_IRA_INT_H
#include "recog.h"
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
/* To provide consistency in naming, all IRA external variables,
functions, common typedefs start with prefix ira_. */
[PATCH 7/9] ENABLE_CHECKING refactoring: middle-end, LTO FE [PATCH 7/9] ENABLE_CHECKING refactoring: middle-end, LTO FE gcc/lto/ChangeLog: 2015-10-27 Mikhail Maltsev <maltsevm@gmail.com> * lto.c (unify_scc): Use flag_checking and remove ENABLE_CHECKING conditionals. (lto_fixup_state): Likewise. (do_whole_program_analysis): Use symtab_node::checking_verify_symtab_nodes and remove ENABLE_CHECKING conditionals. gcc/ChangeLog: 2015-10-27 Mikhail Maltsev <maltsevm@gmail.com> * attribs.c (check_attribute_tables): New function, broken out from... (init_attributes): Use it. * cfgcleanup.c (try_optimize_cfg): Use flag_checking, CHECKING_P gcc_checking_assert and checking_* functions to eliminate ENABLE_CHECKING conditionals. * cfgexpand.c (expand_goto, expand_debug_expr): Likewise. (pass_expand::execute): Likewise. * cgraphclones.c (symbol_table::materialize_all_clones): Likewise. * cgraphunit.c (mark_functions_to_output): Likewise. (cgraph_node::expand_thunk): Likewise. (symbol_table::compile): Likewise. * ddg.c (add_cross_iteration_register_deps): Likewise. (create_ddg_all_sccs): Likewise. * df-core.c (df_finish_pass, df_analyze): Likewise. * diagnostic-core.h: Likewise. * diagnostic.c (diagnostic_report_diagnostic): Likewise. * dominance.c (calculate_dominance_info): Likewise. * dwarf2out.c (add_AT_die_ref): Likewise. (const_ok_for_output_1, mem_loc_descriptor): Likewise. (loc_list_from_tree, gen_lexical_block_die): Likewise. gen_type_die_with_usage, gen_type_die): Likewise. (dwarf2out_decl): Likewise. * emit-rtl.c (verify_rtx_sharing, reorder_insns_nobb): Likewise. * except.c (duplicate_eh_regions): Likewise. * fwprop.c (register_active_defs, update_df_init): Likewise. (fwprop_init, fwprop_done): Likewise. (update_uses): Likewise. * ggc-page.c (ggc_grow): Likewise. * gimplify.c (gimplify_body): Likewise. (gimplify_hasher::equal): Likewise. * graphite-isl-ast-to-gimple.c (graphite_verify): Likewise. * graphite-scop-detection.c (canonicalize_loop_closed_ssa_form): Likewise. * graphite-sese-to-poly.c (rewrite_reductions_out_of_ssa): Likewise. (rewrite_cross_bb_scalar_deps_out_of_ssa): Likwise. * hash-table.h (::find_empty_slot_for_expand): Likewise. * ifcvt.c (if_convert): Likewise. * ipa-cp.c (ipcp_propagate_stage): Likewise. * ipa-devirt.c (type_in_anonymous_namespace_p): Likewise. (odr_type_p, odr_types_equivalent_p): Likewise. (add_type_duplicate, get_odr_type): Likewise. * ipa-icf.c (sem_item_optimizer::execute): Likewise. (sem_item_optimizer::subdivide_classes_by_equality): Likewise. (sem_item_optimizer::verify_classes): Likewise. (sem_item_optimizer::traverse_congruence_split): Likewise. (sem_item_optimizer::checking_verify_classes): New. * ipa-icf.h (sem_item_optimizer::checking_verify_classes): Add new method. * cfgrtl.c (commit_edge_insertions): Likewise. (fixup_reorder_chain, cfg_layout_finalize): Likewise. (rtl_flow_call_edges_add): Likewise. * cgraph.c (symbol_table::create_edge): Likewise. (cgraph_edge::redirect_call_stmt_to_callee): Likewise. * cgraph.h (symtab_node): Likewise. (symtab_node::checking_verify_symtab_nodes): Define. (cgraph_node::checking_verify_cgraph_nodes): Define. * cfghooks.h (checking_verify_flow_info): Define. * cfgloop.h (checking_verify_loop_structure): Define. * dominance.h (checking_verify_dominators): Define. * et-forest.c: Fix comment. * ipa-inline-analysis.c (compute_inline_parameters): Use flag_checking, CHECKING_P gcc_checking_assert and checking_* functions to eliminate ENABLE_CHECKING conditionals. * ipa-inline-transform.c (save_inline_function_body): Likewise. * ipa-inline.c (inline_small_functions): Likewise. (early_inliner): Likewise. * ipa-inline.h (estimate_edge_growth): Likewise. * ipa-visibility.c (function_and_variable_visibility): Likewise. * ipa.c (symbol_table::remove_unreachable_nodes): Likewise. (ipa_single_use): Likewise. * ira-int.h: Likewise. * ira.c (ira): Likewise. * loop-doloop.c (doloop_optimize_loops): Likewise. * loop-init.c (loop_optimizer_init, fix_loop_structure): Likewise. * loop-invariant.c (move_loop_invariants): Likewise. * lra-assigns.c (lra_assign): Likewise. * lra-constraints.c (lra_constraints): Likewise. * lra-eliminations.c (lra_eliminate): Likewise. * lra-int.h (struct lra_reg): Likewise. * lra-lives.c (check_pseudos_live_through_calls): Likewise. (lra_create_live_ranges_1): Likewise. * lra-remat.c (create_remat_bb_data): Likewise. * lra.c (lra_update_insn_recog_data, restore_scratches): Likewise. (lra): Likewise. (check_rtl): Always define. Remove incorrect guard around extract_constrain_insn call. * lto-cgraph.c (input_cgraph_1: Use flag_checking, CHECKING_P gcc_checking_assert and checking_* functions to eliminate ENABLE_CHECKING conditionals. * lto-streamer-out.c (DFS::DFS): Likewise. (lto_output): Likewise. * lto-streamer.c (lto_streamer_init): Likewise. * omp-low.c (scan_omp_target, expand_omp_taskreg): Likewise. expand_omp_target, execute_expand_omp): Likewise. (lower_omp_target): Likewise. * passes.c (execute_function_todo): Likewise. (execute_todo, execute_one_pass): Likewise. (verify_curr_properties): Always define. * predict.c (tree_estimate_probability: Use flag_checking, CHECKING_P gcc_checking_assert and checking_* functions to eliminate ENABLE_CHECKING conditionals. (propagate_freq): Likewise. * pretty-print.c (pp_format): Likewise. * real.c (real_to_decimal_for_mode): Likewise. * recog.c (split_all_insns): Likewise. * regcprop.c (kill_value_one_regno): Likewise. (copy_value): Likewise. (validate_value_data): Define unconditionally. * reload.c: Fix comment. * timevar.c: Include options.h * tree-ssa.h (checking_verify_ssa): Define. * tree-ssa-loop-manip.h (checking_verify_loop_closed_ssa): Define. * sched-deps.c (CHECK): Remove unused macro. (add_or_update_dep_1, sd_add_dep: Use flag_checking, CHECKING_P gcc_checking_assert and checking_* functions to eliminate ENABLE_CHECKING conditionals. * sel-sched-ir.c (free_regset_pool, tidy_control_flow): Likewise. * sel-sched.c (struct moveop_static_params): Likewise. (find_best_reg_for_expr, move_cond_jump): Likewise. (move_op_orig_expr_not_found): Likewise. (code_motion_process_successors, move_op): Likewise. * ssa-iterators.h (first_readonly_imm_use): Likewise. (next_readonly_imm_use): Likewise. * store-motion.c (compute_store_table): Likewise. * symbol-summary.h (function_summary::function_summary): Likewise. * target.h (cumulative_args_t): Likewise. (get_cumulative_args, pack_cumulative_args): Likewise. * timevar.c: (timer::print): Likewise. * trans-mem.c (ipa_tm_execute): Likewise. * tree-cfg.c (move_stmt_op): Likewise. (move_sese_region_to_fn): Likewise. (gimple_flow_call_edges_add): Likewise. * tree-cfgcleanup.c (cleanup_tree_cfg_noloop, repair_loop_structures): Likewise. * tree-eh.c (remove_unreachable_handlers): Likewise. * tree-if-conv.c (pass_if_conversion::execute): Likewise. * tree-inline.c (expand_call_inline, optimize_inline_calls): Likewise. * tree-into-ssa.c (update_ssa): Likewise. * tree-loop-distribution.c (pass_loop_distribution::execute): Likewise. * tree-outof-ssa.c (eliminate_useless_phis, rewrite_trees): Likewise. * tree-parloops.c (pass_parallelize_loops::execute): Likewise. * tree-predcom.c (suitable_component_p): Likewise. * tree-profile.c (gimple_gen_const_delta_profiler): Likewise. * tree-ssa-alias.c (refs_may_alias_p_1): Likewise. * tree-ssa-live.c (verify_live_on_entry): Likewise. * tree-ssa-live.h (register_ssa_partition): Likewise. * tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely): Likewise. * tree-ssa-loop-manip.c (add_exit_phi): Likewise. (tree_transform_and_unroll_loop): Likewise. * tree-ssa-math-opts.c (pass_cse_reciprocals::execute): Likewise. * tree-ssa-operands.c (get_expr_operands): Likewise. * tree-ssa-propagate.c (replace_exp_1): Likewise. * tree-ssa-structalias.c (rewrite_constraints): Likewise. * tree-ssa-ter.c (free_temp_expr_table): Likewise. * tree-ssa-threadupdate.c (duplicate_thread_path): Likewise. * tree-ssanames.c (release_ssa_name_fn): Likewise. * tree-stdarg.c (expand_ifn_va_arg): Likewise. * tree-vect-loop-manip.c (slpeel_tree_duplicate_loop_to_edge_cfg): Likewise. (slpeel_checking_verify_cfg_after_peeling): Likewise. (vect_do_peeling_for_loop_bound): Likewise. (vect_do_peeling_for_alignment): Likewise. * tree-vrp.c (supports_overflow_infinity): Likewise. (set_value_range): Likewise. * tree.c (free_lang_data_in_cgraph): Likewise. * value-prof.c (gimple_remove_histogram_value): Likewise. (free_hist): Likewise. * var-tracking.c (canonicalize_values_star): Likewise. (compute_bb_dataflow, vt_find_locations, vt_emit_notes): Likewise. From-SVN: r229470
2015-10-28 02:05:53 +01:00
#if CHECKING_P
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
#define ENABLE_IRA_CHECKING
#endif
#ifdef ENABLE_IRA_CHECKING
#define ira_assert(c) gcc_assert (c)
#else
/* Always define and include C, so that warnings for empty body in an
Add uniform debug dump function names. Add some overloaded functions that provide uniform debug dump function names. These names are: debug: the general debug dumper debug_verbose: for more details debug_raw: for the gory details debug_head: for the heads of declarations, e.g. function heads debug_body: for the bodies of declarations, e.g. function bodies Not all types have the last four versions. The debug functions come in two flavors, those that take pointers to the type, and those that take references to the type. The first handles printing of '<nil>' for null pointers. The second assumes a valid reference, and prints the content. Example uses are as follows: cp_token t, *p; debug (t); debug (p); From the debugger, use call debug (t) The functions sets implemented are: debug (only) basic_block_def, const bitmap_head_def, cp_binding_level, cp_parser, cp_token, data_reference, die_struct, edge_def, gimple_statement_d, ira_allocno, ira_allocno_copy, live_range, lra_live_range, omega_pb_d, pt_solution, const rtx_def, sreal, tree_live_info_d, _var_map, vec<cp_token, va_gc>, vec<data_reference_p>, vec<ddr_p>, vec<rtx>, vec<tree, va_gc>, debug and debug_raw simple_bitmap_def debug and debug_verbose expr_def, struct loop, vinsn_def debug, debug_raw, debug_verbose, debug_head, debug_body const tree_node This patch is somewhat different from the original plan at gcc.gnu.org/wiki/cxx-conversion/debugging-dumps. The reason is that gdb has an incomplete implementation of C++ call syntax; requiring explicit specification of template arguments and explicit specification of function arguments even when they have default values. So, the original plan would have required typing call dump <cp_token> (t, 0, 0, stderr) which is undesireable. Instead instead of templates, we overload plain functions. This adds a small burden of manually adding the pointer version of dump for each type. Instead of default function arguments, we simply assume the default values. Most of the underlying dump functions did not use the options and indent parameters anyway. Several provide FILE* parameters, but we expect debugging to use stderr anyway. So, the explicit specification of arguments was not as valuable as we thought initially. Finally, a change of name from dump to debug reflect the implicit output to stderr. Index: gcc/ChangeLog 2013-03-28 Lawrence Crowl <crowl@google.com> * Makefile.in: Add several missing include dependences. (DUMPFILE_H): New. (test-dump.o): New. This object is not added to any executable, but is present for ad-hoc testing. * bitmap.c (debug (const bitmap_head_def &)): New. (debug (const bitmap_head_def *)): New. * bitmap.h (extern debug (const bitmap_head_def &)): New. (extern debug (const bitmap_head_def *)): New. * cfg.c (debug (edge_def &)): New. (debug (edge_def *)): New. * cfghooks.c (debug (basic_block_def &)): New. (debug (basic_block_def *)): New. * dumpfile.h (dump_node (const_tree, int, FILE *)): Correct source file. * dwarf2out.c (debug (die_struct &)): New. (debug (die_struct *)): New. * dwarf2out.h (extern debug (die_struct &)): New. (extern debug (die_struct *)): New. * gimple-pretty-print.c (debug (gimple_statement_d &)): New. (debug (gimple_statement_d *)): New. * gimple-pretty-print.h (extern debug (gimple_statement_d &)): New. (extern debug (gimple_statement_d *)): New. * ira-build.c (debug (ira_allocno_copy &)): New. (debug (ira_allocno_copy *)): New. (debug (ira_allocno &)): New. (debug (ira_allocno *)): New. * ira-int.h (extern debug (ira_allocno_copy &)): New. (extern debug (ira_allocno_copy *)): New. (extern debug (ira_allocno &)): New. (extern debug (ira_allocno *)): New. * ira-lives.c (debug (live_range &)): New. (debug (live_range *)): New. * lra-int.h (debug (lra_live_range &)): New. (debug (lra_live_range *)): New. * lra-lives.c (debug (lra_live_range &)): New. (debug (lra_live_range *)): New. * omega.c (debug (omega_pb_d &)): New. (debug (omega_pb_d *)): New. * omega.h (extern debug (omega_pb_d &)): New. (extern debug (omega_pb_d *)): New. * print-rtl.c (debug (const rtx_def &)): New. (debug (const rtx_def *)): New. * print-tree.c (debug_tree (tree): Move within file. (debug_raw (const tree_node &)): New. (debug_raw (const tree_node *)): New. (dump_tree_via_hooks (const tree_node *, int)): New. (debug (const tree_node &)): New. (debug (const tree_node *)): New. (debug_verbose (const tree_node &)): New. (debug_verbose (const tree_node *)): New. (debug_head (const tree_node &)): New. (debug_head (const tree_node *)): New. (debug_body (const tree_node &)): New. (debug_body (const tree_node *)): New. (debug_vec_tree (tree): Move and reimplement in terms of dump. (debug (vec<tree, va_gc> &)): New. (debug (vec<tree, va_gc> *)): New. * rtl.h (extern debug (const rtx_def &)): New. (extern debug (const rtx_def *)): New. * sbitmap.c (debug_raw (simple_bitmap_def &)): New. (debug_raw (simple_bitmap_def *)): New. (debug (simple_bitmap_def &)): New. (debug (simple_bitmap_def *)): New. * sbitmap.h (extern debug (simple_bitmap_def &)): New. (extern debug (simple_bitmap_def *)): New. (extern debug_raw (simple_bitmap_def &)): New. (extern debug_raw (simple_bitmap_def *)): New. * sel-sched-dump.c (debug (vinsn_def &)): New. (debug (vinsn_def *)): New. (debug_verbose (vinsn_def &)): New. (debug_verbose (vinsn_def *)): New. (debug (expr_def &)): New. (debug (expr_def *)): New. (debug_verbose (expr_def &)): New. (debug_verbose (expr_def *)): New. (debug (vec<rtx> &)): New. (debug (vec<rtx> *)): New. * sel-sched-dump.h (extern debug (vinsn_def &)): New. (extern debug (vinsn_def *)): New. (extern debug_verbose (vinsn_def &)): New. (extern debug_verbose (vinsn_def *)): New. (extern debug (expr_def &)): New. (extern debug (expr_def *)): New. (extern debug_verbose (expr_def &)): New. (extern debug_verbose (expr_def *)): New. (extern debug (vec<rtx> &)): New. (extern debug (vec<rtx> *)): New. * sel-sched-ir.h (_list_iter_cond_expr): Make inline instead of static. * sreal.c (debug (sreal &)): New. (debug (sreal *)): New. * sreal.h (extern debug (sreal &)): New. (extern debug (sreal *)): New. * tree.h (extern debug_raw (const tree_node &)): New. (extern debug_raw (const tree_node *)): New. (extern debug (const tree_node &)): New. (extern debug (const tree_node *)): New. (extern debug_verbose (const tree_node &)): New. (extern debug_verbose (const tree_node *)): New. (extern debug_head (const tree_node &)): New. (extern debug_head (const tree_node *)): New. (extern debug_body (const tree_node &)): New. (extern debug_body (const tree_node *)): New. (extern debug (vec<tree, va_gc> &)): New. (extern debug (vec<tree, va_gc> *)): New. * tree-cfg.c (debug (struct loop &)): New. (debug (struct loop *)): New. (debug_verbose (struct loop &)): New. (debug_verbose (struct loop *)): New. * tree-dump.c: Add header dependence. * tree-flow.h (extern debug (struct loop &)): New. (extern debug (struct loop *)): New. (extern debug_verbose (struct loop &)): New. (extern debug_verbose (struct loop *)): New. * tree-data-ref.c (debug (data_reference &)): New. (debug (data_reference *)): New. (debug (vec<data_reference_p> &)): New. (debug (vec<data_reference_p> *)): New. (debug (vec<ddr_p> &)): New. (debug (vec<ddr_p> *)): New. * tree-data-ref.h (extern debug (data_reference &)): New. (extern debug (data_reference *)): New. (extern debug (vec<data_reference_p> &)): New. (extern debug (vec<data_reference_p> *)): New. (extern debug (vec<ddr_p> &)): New. (extern debug (vec<ddr_p> *)): New. * tree-ssa-alias.c (debug (pt_solution &)): New. (debug (pt_solution *)): New. * tree-ssa-alias.h (extern debug (pt_solution &)): New. (extern debug (pt_solution *)): New. * tree-ssa-alias.c (debug (_var_map &)): New. (debug (_var_map *)): New. (debug (tree_live_info_d &)): New. (debug (tree_live_info_d *)): New. * tree-ssa-alias.h (extern debug (_var_map &)): New. (extern debug (_var_map *)): New. (extern debug (tree_live_info_d &)): New. (extern debug (tree_live_info_d *)): New. Index: gcc/cp/ChangeLog 2013-03-28 Lawrence Crowl <crowl@google.com> * Make-lang.in (CXX_PARSER_H): Add header dependence. * cp-tree.h (extern debug (cp_binding_level &)): New. (extern debug (cp_binding_level *)): New. * name-lookup.h (debug (cp_binding_level &)): New. (debug (cp_binding_level *)): New. * parser.c (debug (cp_parser &)): New. (debug (cp_parser *)): New. (debug (cp_token &)): New. (debug (cp_token *)): New. (debug (vec<cp_token, va_gc> &)): New. (debug (vec<cp_token, va_gc> *)): New. * parser.c: Add header dependence. (extern debug (cp_parser &)): New. (extern debug (cp_parser *)): New. (extern debug (cp_token &)): New. (extern debug (cp_token *)): New. (extern debug (vec<cp_token, va_gc> &)): New. (extern debug (vec<cp_token, va_gc> *)): New. From-SVN: r197224
2013-03-29 04:42:21 +01:00
'if' statement and unused variable do not occur. */
#define ira_assert(c) ((void)(0 && (c)))
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
#endif
/* Compute register frequency from edge frequency FREQ. It is
analogous to REG_FREQ_FROM_BB. When optimizing for size, or
profile driven feedback is available and the function is never
executed, frequency is always equivalent. Otherwise rescale the
edge frequency. */
#define REG_FREQ_FROM_EDGE_FREQ(freq) \
(optimize_function_for_size_p (cfun) \
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
? REG_FREQ_MAX : (freq * REG_FREQ_MAX / BB_FREQ_MAX) \
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
? (freq * REG_FREQ_MAX / BB_FREQ_MAX) : 1)
/* A modified value of flag `-fira-verbose' used internally. */
extern int internal_flag_ira_verbose;
/* Dump file of the allocator if it is not NULL. */
extern FILE *ira_dump_file;
/* Typedefs for pointers to allocno live range, allocno, and copy of
allocnos. */
typedef struct live_range *live_range_t;
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
typedef struct ira_allocno *ira_allocno_t;
regmove.c: Remove. 2013-10-30 Vladimir Makarov <vmakarov@redhat.com> * regmove.c: Remove. * tree-pass.h (make_pass_regmove): Remove. * timevar.def (TV_REGMOVE): Remove. * passes.def (pass_regmove): Remove. * opts.c (default_options_table): Remove entry for regmove. * doc/passes.texi: Remove regmove pass description. * doc/invoke.texi (-foptimize-register-move, -fregmove): Remove options. (-fdump-rtl-regmove): Ditto. * common.opt (foptimize-register-move, fregmove): Ignore. * Makefile.in (OBJS): Remove regmove.o. * regmove.c: Remove. * ira-int.h (struct ira_allocno_pref, ira_pref_t): New structure and type. (struct ira_allocno) New member allocno_prefs. (ALLOCNO_PREFS): New macro. (ira_prefs, ira_prefs_num): New external vars. (ira_setup_alts, ira_get_dup_out_num, ira_debug_pref): New prototypes. (ira_debug_prefs, ira_debug_allocno_prefs, ira_create_pref): Ditto. (ira_add_allocno_pref, ira_remove_pref, ira_remove_allocno_prefs): Ditto. (ira_add_allocno_copy_to_list): Remove prototype. (ira_swap_allocno_copy_ends_if_necessary): Ditto. (ira_pref_iterator): New type. (ira_pref_iter_init, ira_pref_iter_cond): New functions. (FOR_EACH_PREF): New macro. * ira.c (commutative_constraint_p): Move from ira-conflicts.c. (ira_get_dup_out_num): Ditto. Rename from get_dup_num. Modify the code. (ira_setup_alts): New function. (decrease_live_ranges_number): New function. (ira): Call the above function. * ira-build.c (ira_prefs, ira_prefs_num): New global vars. (ira_create_allocno): Initialize allocno prefs. (pref_pool, pref_vec): New static vars. (initiate_prefs, find_allocno_pref, ira_create_pref): New functions. (add_allocno_pref_to_list, ira_add_allocno_pref, print_pref): Ditto. (ira_debug_pref, print_prefs, ira_debug_prefs): Ditto. (print_allocno_prefs, ira_debug_allocno_prefs, finish_pref): Ditto. (ira_remove_pref, ira_remove_allocno_prefs, finish_prefs): Ditto. (ira_add_allocno_copy_to_list): Make static. Rename to add_allocno_copy_to_list. (ira_swap_allocno_copy_ends_if_necessary): Make static. Rename to swap_allocno_copy_ends_if_necessary. (remove_unnecessary_allocnos, remove_low_level_allocnos): Call ira_remove_allocno_prefs. (ira_flattening): Ditto. (ira_build): Call initiate_prefs, print_prefs. (ira_destroy): Call finish_prefs. * ira-color.c (struct update_cost_record): New. (struct allocno_color_data): Add new member update_cost_records. (update_cost_record_pool): New static var. (init_update_cost_records, get_update_cost_record): New functions. (free_update_cost_record_list, finish_update_cost_records): Ditto. (struct update_cost_queue_elem): Add member from. (initiate_cost_update): Call init_update_cost_records. (finish_cost_update): Call finish_update_cost_records. (queue_update_cost, get_next_update_cost): Add new param from. (Update_allocno_cost, update_costs_from_allocno): New functions. (update_costs_from_prefs): Ditto. (update_copy_costs): Rename to update_costs_from_copies. (restore_costs_from_copies): New function. (update_conflict_hard_regno_costs): Don't go back. (assign_hard_reg): Call restore_costs_from_copies. Add printing more debug info. (pop_allocnos): Add priniting more debug info. (color_allocnos): Remove prefs for conflicting hard regs. Call update_costs_from_prefs. * ira-conflicts.c (commutative_constraint_p): Move to ira.c (get_dup_num): Rename, modify, and move to ira.c (process_regs_for_copy): Add prefs. (add_insn_allocno_copies): Put src as first arg of process_regs_for_copy. Remove dead code. Call ira_setup_alts. * ira-costs.c (record_reg_classes): Modify and move code into record_operands_costs. (find_costs_and_classes): Create prefs for the hard reg of small reg class. (process_bb_node_for_hard_reg_moves): Add prefs. 2013-10-30 Vladimir Makarov <vmakarov@redhat.com> * gcc.target/i386/fma_double_3.c: Use pattern for scan-assembler-times instead of just one insn name. * gcc.target/i386/fma_double_5.c: Ditto. * gcc.target/i386/fma_float_3.c: Ditto. * gcc.target/i386/fma_float_5.c: Ditto. * gcc.target/i386/l_fma_double_1.c: Ditto. * gcc.target/i386/l_fma_double_2.c: Ditto. * gcc.target/i386/l_fma_double_3.c: Ditto. * gcc.target/i386/l_fma_double_4.c: Ditto. * gcc.target/i386/l_fma_double_5.c: Ditto. * gcc.target/i386/l_fma_double_6.c: Ditto. * gcc.target/i386/l_fma_float_1.c: Ditto. * gcc.target/i386/l_fma_float_2.c: Ditto. * gcc.target/i386/l_fma_float_3.c: Ditto. * gcc.target/i386/l_fma_float_4.c: Ditto. * gcc.target/i386/l_fma_float_5.c: Ditto. * gcc.target/i386/l_fma_float_6.c: Ditto. From-SVN: r204212
2013-10-30 15:27:25 +01:00
typedef struct ira_allocno_pref *ira_pref_t;
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
typedef struct ira_allocno_copy *ira_copy_t;
ira-int.h (struct ira_object): New. * ira-int.h (struct ira_object): New. (ira_object_t): New typedef. Add DEF_VEC_P and DEF_VEC_ALLOC_P for it. (struct ira_allocno): Remove members min, max, conflict_allocno_array, conflict_id, conflict_allocno_array_size, conflict_allocnos_num and conflict_vec_p. Add new member object. (OBJECT_CONFLICT_ARRAY, OBJECT_CONFLICT_VEC_P, OBJECT_NUM_CONFLICTS, OBJECT_CONFLICT_ARRAY_SIZE, OBJECT_CONFLICT_HARD_REGS, OBJECT_TOTAL_CONFLICT_HARD_REGS, OBJECT_MIN, OBJECT_MAX, OBJECT_CONFLICT_ID): Renamed from ALLOCNO_CONFLICT_ALLOCNO_ARRAY, ALLOCNO_CONFLICT_VEC_P, ALLOCNO_CONFLICT_ALLOCNOS_NUM, ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE, ALLOCNO_CONFLICT_HARD_REGS, ALLOCNO_TOTAL_CONFLICT_HARD_REGS) ALLOCNO_MIN, ALLOCNO_MAX, and ALLOCNO_CONFLICT_ID; now operate on an ira_object_t rather than ira_allocno_t. All uses changed. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_objects_num): Declare variable. (ira_create_allocno_object): Declare function. (ira_conflict_vector_profitable_p): Adjust prototype. (ira_allocate_conflict_vec): Renamed from ira_allocate_allocno_conflict_vec; first arg now ira_object_t. (ira_allocate_object_conflicts): Renamed from ira_allocate_allocno_conflicts; first arg now ira_object_t. (struct ira_object_iterator): New. (ira_object_iter_init, ira_object_iter_cond, FOR_EACH_OBJECT): New. (ira_allocno_conflict_iterator): Renamed member allocno_conflict_vec_p to conflict_vec_p. All uses changed. (ira_allocno_conflict_iter_init, ira_allocno_conflict_iter_cond): Changed to take into account that conflicts are now tracked for objects. * ira-conflicts.c (OBJECTS_CONFLICT_P): Renamed from CONFLICT_ALLOCNO_P. Args changed to accept ira_object_t. All uses changed. (allocnos_conflict_p): New static function. (collected_conflict_objects): Renamed from collected_allocno_objects; now a vector of ira_object_t. All uses changed. (build_conflict_bit_table): Changed to take into account that conflicts are now tracked for objects. (process_regs_for_copy, propagate_copies, build_allocno_conflicts) (print_allocno_conflicts, ira_build_conflicts): Likewise. * ira-color.c (assign_hard_reg, setup_allocno_available_regs_num) setup_allocno_left_conflicts_size, allocno_reload_assign, fast_allocation): Likewise. * ira-lives.c (make_hard_regno_born, make_allocno_born) process_single_reg_class_operands, process_bb_node_lives): Likewise. * ira-emit.c (modify_move_list, add_range_and_copies_from_move_list): Likewise. * ira-build.c (ira_objects_num): New variable. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_object_id_map_vec): Corresponding change. (object_pool): New static variable. (initiate_allocnos): Initialize it. (finish_allocnos): Free it. (ira_create_object, ira_create_allocno_object, create_allocno_objects): New functions. (ira_create_allocno): Don't set members that were removed. (ira_set_allocno_cover_class): Don't change conflict hard regs. (merge_hard_reg_conflicts): Changed to take into account that conflicts are now tracked for objects. (ira_conflict_vector_profitable_p, ira_allocate_conflict_vec, allocate_conflict_bit_vec, ira_allocate_object_conflicts, compress_conflict_vecs, remove_low_level_allocnos, ira_flattening, setup_min_max_allocno_live_range_point, allocno_range_compare_func, setup_min_max_conflict_allocno_ids, ): Likewise. ((add_to_conflicts): Renamed from add_to_allocno_conflicts, args changed to ira_object_t; all callers changed. (ira_add_conflict): Renamed from ira_add_allocno_conflict, args changed to ira_object_t, all callers changed. (clear_conflicts): Renamed from clear_allocno_conflicts, arg changed to ira_object_t, all callers changed. (conflict_check, curr_conflict_check_tick): Renamed from allocno_conflict_check and curr_allocno_conflict_check_tick; all uses changed. (compress_conflict_vec): Renamed from compress_allocno_conflict_vec, arg changed to ira_object_t, all callers changed. (create_cap_allocno): Call ira_create_allocno_object. (finish_allocno): Free the corresponding object. (sort_conflict_id_map): Renamed from sort_conflict_id_allocno_map; all callers changed. Adjusted for dealing with objects. (ira_build): Call create_allocno_objects after ira_costs. Adjusted for dealing with objects. * ira.c (ira_bad_reload_regno_1): Adjusted for dealing with objects. From-SVN: r162166
2010-07-14 03:53:35 +02:00
typedef struct ira_object *ira_object_t;
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
/* Definition of vector of allocnos and copies. */
/* Typedef for pointer to the subsequent structure. */
typedef struct ira_loop_tree_node *ira_loop_tree_node_t;
typedef unsigned short move_table[N_REG_CLASSES];
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
/* In general case, IRA is a regional allocator. The regions are
nested and form a tree. Currently regions are natural loops. The
following structure describes loop tree node (representing basic
block or loop). We need such tree because the loop tree from
cfgloop.h is not convenient for the optimization: basic blocks are
not a part of the tree from cfgloop.h. We also use the nodes for
storing additional information about basic blocks/loops for the
register allocation purposes. */
struct ira_loop_tree_node
{
/* The node represents basic block if children == NULL. */
basic_block bb; /* NULL for loop. */
re PR rtl-optimization/40761 (IRA memory hog for insanely nested loops) 2012-01-19 Vladimir Makarov <vmakarov@redhat.com> PR rtl-optimization/40761 * ira-int.h (struct ira_loop_tree_node): Add comment for member loop. Add new member loop_num. (IRA_LOOP_NODE_BY_INDEX): Modify the check. (ira_build): Remove the parameter. * ira.c (ira_print_disposition): Use loop_num instead of loop->num. (ira.c): Do not build CFG loops for one region allocation. Remove argument from ira_build call. * ira-build.c (init_loop_tree_node): New function. (create_loop_tree_nodes): Use it. Separate the case when CFG loops are not built. (more_one_region_p): Check current_loops. (finish_loop_tree_nodes): Separate the case when CFG loops are not built. (add_loop_to_tree): Process loop equal to NULL too. (form_loop_tree): Separate the case when CFG loops are not built. Use explicitly number for the root. (rebuild_regno_allocno_maps, create_loop_tree_node_allocnos): Add an assertion. (ira_print_expanded_allocno, loop_compare_func): Use loop_num instead of loop->num. (mark_loops_for_removal): Ditto. Use loop_num instead of loop->num. (mark_all_loops_for_removal): Ditto. (remove_unnecessary_regions): Separate the case when CFG loops are not built. (ira_build): Remove the parameter. Use explicit number of regions when CFG loops are not built. * ira-color.c (print_loop_title): Separate the case for the root node. Use loop_num instead of loop->num. (move_spill_restore): Use loop_num instead of loop->num. * ira-emit.c (setup_entered_from_non_parent_p): Add an assertion. (change_loop): Ditto. (change_loop): Use loop_num instead of loop->num. * ira-lives.c (process_bb_node_lives): Ditto. * ira-costs.c (print_allocno_costs, find_costs_and_classes): Ditto. * ira-conflicts.c (print_allocno_conflicts): Ditto. From-SVN: r183312
2012-01-19 21:46:31 +01:00
/* NULL for BB or for loop tree root if we did not build CFG loop tree. */
struct loop *loop;
/* NEXT/SUBLOOP_NEXT is the next node/loop-node of the same parent.
SUBLOOP_NEXT is always NULL for BBs. */
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
ira_loop_tree_node_t subloop_next, next;
/* CHILDREN/SUBLOOPS is the first node/loop-node immediately inside
the node. They are NULL for BBs. */
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
ira_loop_tree_node_t subloops, children;
/* The node immediately containing given node. */
ira_loop_tree_node_t parent;
/* Loop level in range [0, ira_loop_tree_height). */
int level;
/* All the following members are defined only for nodes representing
loops. */
re PR rtl-optimization/40761 (IRA memory hog for insanely nested loops) 2012-01-19 Vladimir Makarov <vmakarov@redhat.com> PR rtl-optimization/40761 * ira-int.h (struct ira_loop_tree_node): Add comment for member loop. Add new member loop_num. (IRA_LOOP_NODE_BY_INDEX): Modify the check. (ira_build): Remove the parameter. * ira.c (ira_print_disposition): Use loop_num instead of loop->num. (ira.c): Do not build CFG loops for one region allocation. Remove argument from ira_build call. * ira-build.c (init_loop_tree_node): New function. (create_loop_tree_nodes): Use it. Separate the case when CFG loops are not built. (more_one_region_p): Check current_loops. (finish_loop_tree_nodes): Separate the case when CFG loops are not built. (add_loop_to_tree): Process loop equal to NULL too. (form_loop_tree): Separate the case when CFG loops are not built. Use explicitly number for the root. (rebuild_regno_allocno_maps, create_loop_tree_node_allocnos): Add an assertion. (ira_print_expanded_allocno, loop_compare_func): Use loop_num instead of loop->num. (mark_loops_for_removal): Ditto. Use loop_num instead of loop->num. (mark_all_loops_for_removal): Ditto. (remove_unnecessary_regions): Separate the case when CFG loops are not built. (ira_build): Remove the parameter. Use explicit number of regions when CFG loops are not built. * ira-color.c (print_loop_title): Separate the case for the root node. Use loop_num instead of loop->num. (move_spill_restore): Use loop_num instead of loop->num. * ira-emit.c (setup_entered_from_non_parent_p): Add an assertion. (change_loop): Ditto. (change_loop): Use loop_num instead of loop->num. * ira-lives.c (process_bb_node_lives): Ditto. * ira-costs.c (print_allocno_costs, find_costs_and_classes): Ditto. * ira-conflicts.c (print_allocno_conflicts): Ditto. From-SVN: r183312
2012-01-19 21:46:31 +01:00
/* The loop number from CFG loop tree. The root number is 0. */
int loop_num;
/* True if the loop was marked for removal from the register
allocation. */
bool to_remove_p;
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
/* Allocnos in the loop corresponding to their regnos. If it is
NULL the loop does not form a separate register allocation region
(e.g. because it has abnormal enter/exit edges and we can not put
code for register shuffling on the edges if a different
allocation is used for a pseudo-register on different sides of
the edges). Caps are not in the map (remember we can have more
one cap with the same regno in a region). */
ira_allocno_t *regno_allocno_map;
/* True if there is an entry to given loop not from its parent (or
grandparent) basic block. For example, it is possible for two
adjacent loops inside another loop. */
bool entered_from_non_parent_p;
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
/* Maximal register pressure inside loop for given register class
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
(defined only for the pressure classes). */
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
int reg_pressure[N_REG_CLASSES];
/* Numbers of allocnos referred or living in the loop node (except
for its subloops). */
bitmap all_allocnos;
/* Numbers of allocnos living at the loop borders. */
bitmap border_allocnos;
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
/* Regnos of pseudos modified in the loop node (including its
subloops). */
bitmap modified_regnos;
/* Numbers of copies referred in the corresponding loop. */
bitmap local_copies;
};
/* The root of the loop tree corresponding to the all function. */
extern ira_loop_tree_node_t ira_loop_tree_root;
/* Height of the loop tree. */
extern int ira_loop_tree_height;
/* All nodes representing basic blocks are referred through the
following array. We can not use basic block member `aux' for this
because it is used for insertion of insns on edges. */
extern ira_loop_tree_node_t ira_bb_nodes;
/* Two access macros to the nodes representing basic blocks. */
#if defined ENABLE_IRA_CHECKING && (GCC_VERSION >= 2007)
#define IRA_BB_NODE_BY_INDEX(index) __extension__ \
re PR rtl-optimization/40761 (IRA memory hog for insanely nested loops) 2012-01-19 Vladimir Makarov <vmakarov@redhat.com> PR rtl-optimization/40761 * ira-int.h (struct ira_loop_tree_node): Add comment for member loop. Add new member loop_num. (IRA_LOOP_NODE_BY_INDEX): Modify the check. (ira_build): Remove the parameter. * ira.c (ira_print_disposition): Use loop_num instead of loop->num. (ira.c): Do not build CFG loops for one region allocation. Remove argument from ira_build call. * ira-build.c (init_loop_tree_node): New function. (create_loop_tree_nodes): Use it. Separate the case when CFG loops are not built. (more_one_region_p): Check current_loops. (finish_loop_tree_nodes): Separate the case when CFG loops are not built. (add_loop_to_tree): Process loop equal to NULL too. (form_loop_tree): Separate the case when CFG loops are not built. Use explicitly number for the root. (rebuild_regno_allocno_maps, create_loop_tree_node_allocnos): Add an assertion. (ira_print_expanded_allocno, loop_compare_func): Use loop_num instead of loop->num. (mark_loops_for_removal): Ditto. Use loop_num instead of loop->num. (mark_all_loops_for_removal): Ditto. (remove_unnecessary_regions): Separate the case when CFG loops are not built. (ira_build): Remove the parameter. Use explicit number of regions when CFG loops are not built. * ira-color.c (print_loop_title): Separate the case for the root node. Use loop_num instead of loop->num. (move_spill_restore): Use loop_num instead of loop->num. * ira-emit.c (setup_entered_from_non_parent_p): Add an assertion. (change_loop): Ditto. (change_loop): Use loop_num instead of loop->num. * ira-lives.c (process_bb_node_lives): Ditto. * ira-costs.c (print_allocno_costs, find_costs_and_classes): Ditto. * ira-conflicts.c (print_allocno_conflicts): Ditto. From-SVN: r183312
2012-01-19 21:46:31 +01:00
(({ ira_loop_tree_node_t _node = (&ira_bb_nodes[index]); \
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
if (_node->children != NULL || _node->loop != NULL || _node->bb == NULL)\
{ \
fprintf (stderr, \
"\n%s: %d: error in %s: it is not a block node\n", \
__FILE__, __LINE__, __FUNCTION__); \
gcc_unreachable (); \
} \
_node; }))
#else
#define IRA_BB_NODE_BY_INDEX(index) (&ira_bb_nodes[index])
#endif
#define IRA_BB_NODE(bb) IRA_BB_NODE_BY_INDEX ((bb)->index)
/* All nodes representing loops are referred through the following
array. */
extern ira_loop_tree_node_t ira_loop_nodes;
/* Two access macros to the nodes representing loops. */
#if defined ENABLE_IRA_CHECKING && (GCC_VERSION >= 2007)
#define IRA_LOOP_NODE_BY_INDEX(index) __extension__ \
re PR rtl-optimization/40761 (IRA memory hog for insanely nested loops) 2012-01-19 Vladimir Makarov <vmakarov@redhat.com> PR rtl-optimization/40761 * ira-int.h (struct ira_loop_tree_node): Add comment for member loop. Add new member loop_num. (IRA_LOOP_NODE_BY_INDEX): Modify the check. (ira_build): Remove the parameter. * ira.c (ira_print_disposition): Use loop_num instead of loop->num. (ira.c): Do not build CFG loops for one region allocation. Remove argument from ira_build call. * ira-build.c (init_loop_tree_node): New function. (create_loop_tree_nodes): Use it. Separate the case when CFG loops are not built. (more_one_region_p): Check current_loops. (finish_loop_tree_nodes): Separate the case when CFG loops are not built. (add_loop_to_tree): Process loop equal to NULL too. (form_loop_tree): Separate the case when CFG loops are not built. Use explicitly number for the root. (rebuild_regno_allocno_maps, create_loop_tree_node_allocnos): Add an assertion. (ira_print_expanded_allocno, loop_compare_func): Use loop_num instead of loop->num. (mark_loops_for_removal): Ditto. Use loop_num instead of loop->num. (mark_all_loops_for_removal): Ditto. (remove_unnecessary_regions): Separate the case when CFG loops are not built. (ira_build): Remove the parameter. Use explicit number of regions when CFG loops are not built. * ira-color.c (print_loop_title): Separate the case for the root node. Use loop_num instead of loop->num. (move_spill_restore): Use loop_num instead of loop->num. * ira-emit.c (setup_entered_from_non_parent_p): Add an assertion. (change_loop): Ditto. (change_loop): Use loop_num instead of loop->num. * ira-lives.c (process_bb_node_lives): Ditto. * ira-costs.c (print_allocno_costs, find_costs_and_classes): Ditto. * ira-conflicts.c (print_allocno_conflicts): Ditto. From-SVN: r183312
2012-01-19 21:46:31 +01:00
(({ ira_loop_tree_node_t const _node = (&ira_loop_nodes[index]); \
if (_node->children == NULL || _node->bb != NULL \
|| (_node->loop == NULL && current_loops != NULL)) \
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
{ \
fprintf (stderr, \
"\n%s: %d: error in %s: it is not a loop node\n", \
__FILE__, __LINE__, __FUNCTION__); \
gcc_unreachable (); \
} \
_node; }))
#else
#define IRA_LOOP_NODE_BY_INDEX(index) (&ira_loop_nodes[index])
#endif
#define IRA_LOOP_NODE(loop) IRA_LOOP_NODE_BY_INDEX ((loop)->num)
/* The structure describes program points where a given allocno lives.
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
If the live ranges of two allocnos are intersected, the allocnos
are in conflict. */
struct live_range
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
{
ira-build.c (ira_create_object): New arg SUBWORD; all callers changed. * ira-build.c (ira_create_object): New arg SUBWORD; all callers changed. Initialize OBJECT_SUBWORD. (ira_create_allocno): Clear ALLOCNO_NUM_OBJECTS. (ira_create_allocno_objects): Renamed from ira_create_allocno_object; all callers changed. (merge_hard_reg_conflicts): Iterate over allocno subobjects. (finish_allocno): Likewise. (move_allocno_live_ranges, copy_allocno_live_ranges): Likewise. (remove_low_level_allocnos): Likewise. (update_bad_spill_attribute): Likewise. (setup_min_max_allocno_live_range_point): Likewise. (sort_conflict_id_map): Likewise. (ira_flattening): Likewise. Use ior_hard_reg_conflicts. (ior_hard_reg_conflicts): New function. (ior_allocate_object_conflicts): Renamed first argument to OBJ. (compress_conflict_vecs): Iterate over objects, not allocnos. (ira_add_live_range_to_object): New function. (object_range_compare_func): Renamed from allocno_range_compare_func. All callers changed. (setup_min_max_conflict_allocno_ids): For allocnos with multiple subobjects, widen the min/max range of the lowest-order object to potentially include all other such low-order objects. * ira.c (ira_bad_reload_regno_1): Iterate over allocno subobjects. (check_allocation): Likewise. Use more fine-grained tests for register conflicts. * ira-color.c (allocnos_have_intersected_live_ranges_p): Iterate over allocno subobjects. (assign_hard_reg): Keep multiple sets of conflicts. Make finer-grained choices about which bits to set in each set. Don't use ira_hard_reg_not_in_set_p, perform a more elaborate test for conflicts using the multiple sets we computed. (push_allocno_to_stack): Iterate over allocno subobjects. (all_conflicting_hard_regs_coalesced): New static function. (setup_allocno_available_regs_num): Use it. (setup_allocno_left_conflicts_size): Likewise. Iterate over allocno subobjects. (coalesced_allocno_conflict): Test subobject 0 in each allocno. (setup_allocno_priorities): Divide ALLOCNO_EXCESS_PRESSURE_POINTS_NUM by ALLOCNO_NUM_OBJECTS. (calculate_spill_cost): Likewise. (color_pass): Express if statement in a more normal way. (ira_reassign_conflict_allocnos): Iterate over allocno subobjects. (slot_coalesced_allocno_live_ranges_intersect_p): Likewise. (setup_slot_coalesced_allocno_live_ranges): Likewise. (allocno_reload_assign): Likewise. (ira_reassign_pseudos): Likewise. (fast_allocation): Likewise. * ira-conflicts.c (build_conflict_bit_table): Likewise. (print_allocno_conflicts): Likewise. (ira_build_conflicts): Likewise. (allocnos_conflict_for_copy_p): Renamed from allocnos_conflict_p. All callers changed. Test subword 0 of each allocno for conflicts. (build_object_conflicts): Renamed from build_allocno_conflicts. All callers changed. Iterate over allocno subobjects. * ira-emit.c (modify_move_list): Iterate over allocno subobjects. * ira-int.h (struct ira_allocno): New member. num_objects. Rename object to objects and change it into an array. (ALLOCNO_OBJECT): Add new argument N. (ALLOCNO_NUM_OBJECTS, OBJECT_SUBWORD): New macros. (ira_create_allocno_objects): Renamed from ira_create_allocno_object. (ior_hard_reg_conflicts): Declare. (ira_add_live_range_to_object): Declare. (ira_allocno_object_iterator): New. (ira_allocno_object_iter_init, ira_allocno_object_iter_cond): New. (FOR_EACH_ALLOCNO_OBJECT): New macro. * ira-lives.c (objects_live): Renamed from allocnos_live; all uses changed. (allocnos_processed): New sparseset. (make_object_born): Renamed from make_allocno_born; take an ira_object_t argument. All callers changed. (make_object_dead): Renamed from make_allocno_dead; take an ira_object t argument. All callers changed. (update_allocno_pressure_excess_length): Take an ira_obejct_t argument. All callers changed. (mark_pseudo_regno_live): Iterate over allocno subobjects. (mark_pseudo_regno_dead): Likewise. (mark_pseudo_regno_subword_live, mark_pseudo_regno_subword_dead): New functions. (mark_ref_live): Detect subword accesses and call mark_pseudo_regno_subword_live as appropriate. (mark_ref_dead): Likewise for mark_pseudo_regno_subword_dead. (process_bb_nodes_live): Deal with object-related updates first; set and test bits in allocnos_processed to avoid computing allocno statistics more than once. (create_start_finish_chains): Iterate over objects, not allocnos. (print_object_live_ranges): New function. (print_allocno_live_ranges): Use it. (ira_create_allocno_live_ranges): Allocate and free allocnos_processed and objects_live. From-SVN: r162418
2010-07-22 17:48:30 +02:00
/* Object whose live range is described by given structure. */
ira-int.h (struct live_range): Rename allocno member to object and change type to ira_object_t. * ira-int.h (struct live_range): Rename allocno member to object and change type to ira_object_t. (struct ira_object): New member live_ranges. (struct ira_allocno): Remove member live_ranges. (ALLOCNO_LIVE_RANGES): Remove. (OBJECT_LIVE_RANGES): New macro. (ira_create_live_range, ira_copy_live_range_list, ira_merge_live_range_list, ira_live_ranges_intersect_p, ira_finish_live_range, ira_finish_live_range_list): Adjust declarations. * ira-build.c (ira_create_object): Initialize live ranges here. (ira_create_allocno): Not here. (ira_create_live_range): Rename from ira_create_allocno_live_range, arg changed to ira_object_t, all callers changed. (copy_live_range): Rename from copy_allocno_live_range, all callers changed. (ira_copy_live_range_list): Rename from ira_copy_allocno_live_range_list, all callers changed. (ira_merge_live_ranges): Rename from ira_merge_allocno_live_range_list, all callers changed. (ira_live_ranges_intersect_p): Rename from ira_allocno_live_ranges_intersect_p, all callers changed. (ira_finish_live_range): Rename from ira_finish_allocno_live_range, all callers changed. (ira_finish_live_range_list): Rename from ira_finish_allocno_live_range_list, all callers changed. (change_object_in_range_list): Rename from change_allocno_in_range_list, last arg changed to ira_object_t, all callers changed. (finish_allocno): Changed to expect live ranges in the allocno's object. (move_allocno_live_ranges, copy_allocno_live_ranges, update_bad_spill_attribute, setup_min_max_allocno_live_range_point, ira_flattening, ira_build): Likewise. * ira-color.c (allocnos_have_intersected_live_ranges_p, slot_coalesced_allocno_live_ranges_intersect, setup_slot_coalesced_allocno_live_ranges, fast_allocation): Likewise. * ira-conflicts.c (build_conflict_bit_table): Likewise. * ira-emit.c (add_range_and_copies_from_move_list): Likewise. * ira-lives.c (make_allocno_born, update_allocno_pressure_excess_length, make_allocno_dead, create_start_finish_chains, remove_some_program_points_and_update_live_ranges, ira_debug_live_range_list): Likewise. From-SVN: r162167
2010-07-14 03:55:02 +02:00
ira_object_t object;
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
/* Program point range. */
int start, finish;
/* Next structure describing program points where the allocno
lives. */
live_range_t next;
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
/* Pointer to structures with the same start/finish. */
live_range_t start_next, finish_next;
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
};
/* Program points are enumerated by numbers from range
0..IRA_MAX_POINT-1. There are approximately two times more program
points than insns. Program points are places in the program where
liveness info can be changed. In most general case (there are more
complicated cases too) some program points correspond to places
where input operand dies and other ones correspond to places where
output operands are born. */
extern int ira_max_point;
/* Arrays of size IRA_MAX_POINT mapping a program point to the allocno
live ranges with given start/finish point. */
extern live_range_t *ira_start_point_ranges, *ira_finish_point_ranges;
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
ira-int.h (struct ira_object): New. * ira-int.h (struct ira_object): New. (ira_object_t): New typedef. Add DEF_VEC_P and DEF_VEC_ALLOC_P for it. (struct ira_allocno): Remove members min, max, conflict_allocno_array, conflict_id, conflict_allocno_array_size, conflict_allocnos_num and conflict_vec_p. Add new member object. (OBJECT_CONFLICT_ARRAY, OBJECT_CONFLICT_VEC_P, OBJECT_NUM_CONFLICTS, OBJECT_CONFLICT_ARRAY_SIZE, OBJECT_CONFLICT_HARD_REGS, OBJECT_TOTAL_CONFLICT_HARD_REGS, OBJECT_MIN, OBJECT_MAX, OBJECT_CONFLICT_ID): Renamed from ALLOCNO_CONFLICT_ALLOCNO_ARRAY, ALLOCNO_CONFLICT_VEC_P, ALLOCNO_CONFLICT_ALLOCNOS_NUM, ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE, ALLOCNO_CONFLICT_HARD_REGS, ALLOCNO_TOTAL_CONFLICT_HARD_REGS) ALLOCNO_MIN, ALLOCNO_MAX, and ALLOCNO_CONFLICT_ID; now operate on an ira_object_t rather than ira_allocno_t. All uses changed. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_objects_num): Declare variable. (ira_create_allocno_object): Declare function. (ira_conflict_vector_profitable_p): Adjust prototype. (ira_allocate_conflict_vec): Renamed from ira_allocate_allocno_conflict_vec; first arg now ira_object_t. (ira_allocate_object_conflicts): Renamed from ira_allocate_allocno_conflicts; first arg now ira_object_t. (struct ira_object_iterator): New. (ira_object_iter_init, ira_object_iter_cond, FOR_EACH_OBJECT): New. (ira_allocno_conflict_iterator): Renamed member allocno_conflict_vec_p to conflict_vec_p. All uses changed. (ira_allocno_conflict_iter_init, ira_allocno_conflict_iter_cond): Changed to take into account that conflicts are now tracked for objects. * ira-conflicts.c (OBJECTS_CONFLICT_P): Renamed from CONFLICT_ALLOCNO_P. Args changed to accept ira_object_t. All uses changed. (allocnos_conflict_p): New static function. (collected_conflict_objects): Renamed from collected_allocno_objects; now a vector of ira_object_t. All uses changed. (build_conflict_bit_table): Changed to take into account that conflicts are now tracked for objects. (process_regs_for_copy, propagate_copies, build_allocno_conflicts) (print_allocno_conflicts, ira_build_conflicts): Likewise. * ira-color.c (assign_hard_reg, setup_allocno_available_regs_num) setup_allocno_left_conflicts_size, allocno_reload_assign, fast_allocation): Likewise. * ira-lives.c (make_hard_regno_born, make_allocno_born) process_single_reg_class_operands, process_bb_node_lives): Likewise. * ira-emit.c (modify_move_list, add_range_and_copies_from_move_list): Likewise. * ira-build.c (ira_objects_num): New variable. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_object_id_map_vec): Corresponding change. (object_pool): New static variable. (initiate_allocnos): Initialize it. (finish_allocnos): Free it. (ira_create_object, ira_create_allocno_object, create_allocno_objects): New functions. (ira_create_allocno): Don't set members that were removed. (ira_set_allocno_cover_class): Don't change conflict hard regs. (merge_hard_reg_conflicts): Changed to take into account that conflicts are now tracked for objects. (ira_conflict_vector_profitable_p, ira_allocate_conflict_vec, allocate_conflict_bit_vec, ira_allocate_object_conflicts, compress_conflict_vecs, remove_low_level_allocnos, ira_flattening, setup_min_max_allocno_live_range_point, allocno_range_compare_func, setup_min_max_conflict_allocno_ids, ): Likewise. ((add_to_conflicts): Renamed from add_to_allocno_conflicts, args changed to ira_object_t; all callers changed. (ira_add_conflict): Renamed from ira_add_allocno_conflict, args changed to ira_object_t, all callers changed. (clear_conflicts): Renamed from clear_allocno_conflicts, arg changed to ira_object_t, all callers changed. (conflict_check, curr_conflict_check_tick): Renamed from allocno_conflict_check and curr_allocno_conflict_check_tick; all uses changed. (compress_conflict_vec): Renamed from compress_allocno_conflict_vec, arg changed to ira_object_t, all callers changed. (create_cap_allocno): Call ira_create_allocno_object. (finish_allocno): Free the corresponding object. (sort_conflict_id_map): Renamed from sort_conflict_id_allocno_map; all callers changed. Adjusted for dealing with objects. (ira_build): Call create_allocno_objects after ira_costs. Adjusted for dealing with objects. * ira.c (ira_bad_reload_regno_1): Adjusted for dealing with objects. From-SVN: r162166
2010-07-14 03:53:35 +02:00
/* A structure representing conflict information for an allocno
(or one of its subwords). */
struct ira_object
{
/* The allocno associated with this record. */
ira_allocno_t allocno;
/* Vector of accumulated conflicting conflict_redords with NULL end
marker (if OBJECT_CONFLICT_VEC_P is true) or conflict bit vector
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
otherwise. */
ira-int.h (struct ira_object): New. * ira-int.h (struct ira_object): New. (ira_object_t): New typedef. Add DEF_VEC_P and DEF_VEC_ALLOC_P for it. (struct ira_allocno): Remove members min, max, conflict_allocno_array, conflict_id, conflict_allocno_array_size, conflict_allocnos_num and conflict_vec_p. Add new member object. (OBJECT_CONFLICT_ARRAY, OBJECT_CONFLICT_VEC_P, OBJECT_NUM_CONFLICTS, OBJECT_CONFLICT_ARRAY_SIZE, OBJECT_CONFLICT_HARD_REGS, OBJECT_TOTAL_CONFLICT_HARD_REGS, OBJECT_MIN, OBJECT_MAX, OBJECT_CONFLICT_ID): Renamed from ALLOCNO_CONFLICT_ALLOCNO_ARRAY, ALLOCNO_CONFLICT_VEC_P, ALLOCNO_CONFLICT_ALLOCNOS_NUM, ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE, ALLOCNO_CONFLICT_HARD_REGS, ALLOCNO_TOTAL_CONFLICT_HARD_REGS) ALLOCNO_MIN, ALLOCNO_MAX, and ALLOCNO_CONFLICT_ID; now operate on an ira_object_t rather than ira_allocno_t. All uses changed. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_objects_num): Declare variable. (ira_create_allocno_object): Declare function. (ira_conflict_vector_profitable_p): Adjust prototype. (ira_allocate_conflict_vec): Renamed from ira_allocate_allocno_conflict_vec; first arg now ira_object_t. (ira_allocate_object_conflicts): Renamed from ira_allocate_allocno_conflicts; first arg now ira_object_t. (struct ira_object_iterator): New. (ira_object_iter_init, ira_object_iter_cond, FOR_EACH_OBJECT): New. (ira_allocno_conflict_iterator): Renamed member allocno_conflict_vec_p to conflict_vec_p. All uses changed. (ira_allocno_conflict_iter_init, ira_allocno_conflict_iter_cond): Changed to take into account that conflicts are now tracked for objects. * ira-conflicts.c (OBJECTS_CONFLICT_P): Renamed from CONFLICT_ALLOCNO_P. Args changed to accept ira_object_t. All uses changed. (allocnos_conflict_p): New static function. (collected_conflict_objects): Renamed from collected_allocno_objects; now a vector of ira_object_t. All uses changed. (build_conflict_bit_table): Changed to take into account that conflicts are now tracked for objects. (process_regs_for_copy, propagate_copies, build_allocno_conflicts) (print_allocno_conflicts, ira_build_conflicts): Likewise. * ira-color.c (assign_hard_reg, setup_allocno_available_regs_num) setup_allocno_left_conflicts_size, allocno_reload_assign, fast_allocation): Likewise. * ira-lives.c (make_hard_regno_born, make_allocno_born) process_single_reg_class_operands, process_bb_node_lives): Likewise. * ira-emit.c (modify_move_list, add_range_and_copies_from_move_list): Likewise. * ira-build.c (ira_objects_num): New variable. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_object_id_map_vec): Corresponding change. (object_pool): New static variable. (initiate_allocnos): Initialize it. (finish_allocnos): Free it. (ira_create_object, ira_create_allocno_object, create_allocno_objects): New functions. (ira_create_allocno): Don't set members that were removed. (ira_set_allocno_cover_class): Don't change conflict hard regs. (merge_hard_reg_conflicts): Changed to take into account that conflicts are now tracked for objects. (ira_conflict_vector_profitable_p, ira_allocate_conflict_vec, allocate_conflict_bit_vec, ira_allocate_object_conflicts, compress_conflict_vecs, remove_low_level_allocnos, ira_flattening, setup_min_max_allocno_live_range_point, allocno_range_compare_func, setup_min_max_conflict_allocno_ids, ): Likewise. ((add_to_conflicts): Renamed from add_to_allocno_conflicts, args changed to ira_object_t; all callers changed. (ira_add_conflict): Renamed from ira_add_allocno_conflict, args changed to ira_object_t, all callers changed. (clear_conflicts): Renamed from clear_allocno_conflicts, arg changed to ira_object_t, all callers changed. (conflict_check, curr_conflict_check_tick): Renamed from allocno_conflict_check and curr_allocno_conflict_check_tick; all uses changed. (compress_conflict_vec): Renamed from compress_allocno_conflict_vec, arg changed to ira_object_t, all callers changed. (create_cap_allocno): Call ira_create_allocno_object. (finish_allocno): Free the corresponding object. (sort_conflict_id_map): Renamed from sort_conflict_id_allocno_map; all callers changed. Adjusted for dealing with objects. (ira_build): Call create_allocno_objects after ira_costs. Adjusted for dealing with objects. * ira.c (ira_bad_reload_regno_1): Adjusted for dealing with objects. From-SVN: r162166
2010-07-14 03:53:35 +02:00
void *conflicts_array;
ira-int.h (struct live_range): Rename allocno member to object and change type to ira_object_t. * ira-int.h (struct live_range): Rename allocno member to object and change type to ira_object_t. (struct ira_object): New member live_ranges. (struct ira_allocno): Remove member live_ranges. (ALLOCNO_LIVE_RANGES): Remove. (OBJECT_LIVE_RANGES): New macro. (ira_create_live_range, ira_copy_live_range_list, ira_merge_live_range_list, ira_live_ranges_intersect_p, ira_finish_live_range, ira_finish_live_range_list): Adjust declarations. * ira-build.c (ira_create_object): Initialize live ranges here. (ira_create_allocno): Not here. (ira_create_live_range): Rename from ira_create_allocno_live_range, arg changed to ira_object_t, all callers changed. (copy_live_range): Rename from copy_allocno_live_range, all callers changed. (ira_copy_live_range_list): Rename from ira_copy_allocno_live_range_list, all callers changed. (ira_merge_live_ranges): Rename from ira_merge_allocno_live_range_list, all callers changed. (ira_live_ranges_intersect_p): Rename from ira_allocno_live_ranges_intersect_p, all callers changed. (ira_finish_live_range): Rename from ira_finish_allocno_live_range, all callers changed. (ira_finish_live_range_list): Rename from ira_finish_allocno_live_range_list, all callers changed. (change_object_in_range_list): Rename from change_allocno_in_range_list, last arg changed to ira_object_t, all callers changed. (finish_allocno): Changed to expect live ranges in the allocno's object. (move_allocno_live_ranges, copy_allocno_live_ranges, update_bad_spill_attribute, setup_min_max_allocno_live_range_point, ira_flattening, ira_build): Likewise. * ira-color.c (allocnos_have_intersected_live_ranges_p, slot_coalesced_allocno_live_ranges_intersect, setup_slot_coalesced_allocno_live_ranges, fast_allocation): Likewise. * ira-conflicts.c (build_conflict_bit_table): Likewise. * ira-emit.c (add_range_and_copies_from_move_list): Likewise. * ira-lives.c (make_allocno_born, update_allocno_pressure_excess_length, make_allocno_dead, create_start_finish_chains, remove_some_program_points_and_update_live_ranges, ira_debug_live_range_list): Likewise. From-SVN: r162167
2010-07-14 03:55:02 +02:00
/* Pointer to structures describing at what program point the
object lives. We always maintain the list in such way that *the
ranges in the list are not intersected and ordered by decreasing
their program points*. */
live_range_t live_ranges;
ira-build.c (ira_create_object): New arg SUBWORD; all callers changed. * ira-build.c (ira_create_object): New arg SUBWORD; all callers changed. Initialize OBJECT_SUBWORD. (ira_create_allocno): Clear ALLOCNO_NUM_OBJECTS. (ira_create_allocno_objects): Renamed from ira_create_allocno_object; all callers changed. (merge_hard_reg_conflicts): Iterate over allocno subobjects. (finish_allocno): Likewise. (move_allocno_live_ranges, copy_allocno_live_ranges): Likewise. (remove_low_level_allocnos): Likewise. (update_bad_spill_attribute): Likewise. (setup_min_max_allocno_live_range_point): Likewise. (sort_conflict_id_map): Likewise. (ira_flattening): Likewise. Use ior_hard_reg_conflicts. (ior_hard_reg_conflicts): New function. (ior_allocate_object_conflicts): Renamed first argument to OBJ. (compress_conflict_vecs): Iterate over objects, not allocnos. (ira_add_live_range_to_object): New function. (object_range_compare_func): Renamed from allocno_range_compare_func. All callers changed. (setup_min_max_conflict_allocno_ids): For allocnos with multiple subobjects, widen the min/max range of the lowest-order object to potentially include all other such low-order objects. * ira.c (ira_bad_reload_regno_1): Iterate over allocno subobjects. (check_allocation): Likewise. Use more fine-grained tests for register conflicts. * ira-color.c (allocnos_have_intersected_live_ranges_p): Iterate over allocno subobjects. (assign_hard_reg): Keep multiple sets of conflicts. Make finer-grained choices about which bits to set in each set. Don't use ira_hard_reg_not_in_set_p, perform a more elaborate test for conflicts using the multiple sets we computed. (push_allocno_to_stack): Iterate over allocno subobjects. (all_conflicting_hard_regs_coalesced): New static function. (setup_allocno_available_regs_num): Use it. (setup_allocno_left_conflicts_size): Likewise. Iterate over allocno subobjects. (coalesced_allocno_conflict): Test subobject 0 in each allocno. (setup_allocno_priorities): Divide ALLOCNO_EXCESS_PRESSURE_POINTS_NUM by ALLOCNO_NUM_OBJECTS. (calculate_spill_cost): Likewise. (color_pass): Express if statement in a more normal way. (ira_reassign_conflict_allocnos): Iterate over allocno subobjects. (slot_coalesced_allocno_live_ranges_intersect_p): Likewise. (setup_slot_coalesced_allocno_live_ranges): Likewise. (allocno_reload_assign): Likewise. (ira_reassign_pseudos): Likewise. (fast_allocation): Likewise. * ira-conflicts.c (build_conflict_bit_table): Likewise. (print_allocno_conflicts): Likewise. (ira_build_conflicts): Likewise. (allocnos_conflict_for_copy_p): Renamed from allocnos_conflict_p. All callers changed. Test subword 0 of each allocno for conflicts. (build_object_conflicts): Renamed from build_allocno_conflicts. All callers changed. Iterate over allocno subobjects. * ira-emit.c (modify_move_list): Iterate over allocno subobjects. * ira-int.h (struct ira_allocno): New member. num_objects. Rename object to objects and change it into an array. (ALLOCNO_OBJECT): Add new argument N. (ALLOCNO_NUM_OBJECTS, OBJECT_SUBWORD): New macros. (ira_create_allocno_objects): Renamed from ira_create_allocno_object. (ior_hard_reg_conflicts): Declare. (ira_add_live_range_to_object): Declare. (ira_allocno_object_iterator): New. (ira_allocno_object_iter_init, ira_allocno_object_iter_cond): New. (FOR_EACH_ALLOCNO_OBJECT): New macro. * ira-lives.c (objects_live): Renamed from allocnos_live; all uses changed. (allocnos_processed): New sparseset. (make_object_born): Renamed from make_allocno_born; take an ira_object_t argument. All callers changed. (make_object_dead): Renamed from make_allocno_dead; take an ira_object t argument. All callers changed. (update_allocno_pressure_excess_length): Take an ira_obejct_t argument. All callers changed. (mark_pseudo_regno_live): Iterate over allocno subobjects. (mark_pseudo_regno_dead): Likewise. (mark_pseudo_regno_subword_live, mark_pseudo_regno_subword_dead): New functions. (mark_ref_live): Detect subword accesses and call mark_pseudo_regno_subword_live as appropriate. (mark_ref_dead): Likewise for mark_pseudo_regno_subword_dead. (process_bb_nodes_live): Deal with object-related updates first; set and test bits in allocnos_processed to avoid computing allocno statistics more than once. (create_start_finish_chains): Iterate over objects, not allocnos. (print_object_live_ranges): New function. (print_allocno_live_ranges): Use it. (ira_create_allocno_live_ranges): Allocate and free allocnos_processed and objects_live. From-SVN: r162418
2010-07-22 17:48:30 +02:00
/* The subword within ALLOCNO which is represented by this object.
Zero means the lowest-order subword (or the entire allocno in case
it is not being tracked in subwords). */
int subword;
ira-int.h (struct live_range): Rename allocno member to object and change type to ira_object_t. * ira-int.h (struct live_range): Rename allocno member to object and change type to ira_object_t. (struct ira_object): New member live_ranges. (struct ira_allocno): Remove member live_ranges. (ALLOCNO_LIVE_RANGES): Remove. (OBJECT_LIVE_RANGES): New macro. (ira_create_live_range, ira_copy_live_range_list, ira_merge_live_range_list, ira_live_ranges_intersect_p, ira_finish_live_range, ira_finish_live_range_list): Adjust declarations. * ira-build.c (ira_create_object): Initialize live ranges here. (ira_create_allocno): Not here. (ira_create_live_range): Rename from ira_create_allocno_live_range, arg changed to ira_object_t, all callers changed. (copy_live_range): Rename from copy_allocno_live_range, all callers changed. (ira_copy_live_range_list): Rename from ira_copy_allocno_live_range_list, all callers changed. (ira_merge_live_ranges): Rename from ira_merge_allocno_live_range_list, all callers changed. (ira_live_ranges_intersect_p): Rename from ira_allocno_live_ranges_intersect_p, all callers changed. (ira_finish_live_range): Rename from ira_finish_allocno_live_range, all callers changed. (ira_finish_live_range_list): Rename from ira_finish_allocno_live_range_list, all callers changed. (change_object_in_range_list): Rename from change_allocno_in_range_list, last arg changed to ira_object_t, all callers changed. (finish_allocno): Changed to expect live ranges in the allocno's object. (move_allocno_live_ranges, copy_allocno_live_ranges, update_bad_spill_attribute, setup_min_max_allocno_live_range_point, ira_flattening, ira_build): Likewise. * ira-color.c (allocnos_have_intersected_live_ranges_p, slot_coalesced_allocno_live_ranges_intersect, setup_slot_coalesced_allocno_live_ranges, fast_allocation): Likewise. * ira-conflicts.c (build_conflict_bit_table): Likewise. * ira-emit.c (add_range_and_copies_from_move_list): Likewise. * ira-lives.c (make_allocno_born, update_allocno_pressure_excess_length, make_allocno_dead, create_start_finish_chains, remove_some_program_points_and_update_live_ranges, ira_debug_live_range_list): Likewise. From-SVN: r162167
2010-07-14 03:55:02 +02:00
/* Allocated size of the conflicts array. */
ira-int.h (struct ira_object): New. * ira-int.h (struct ira_object): New. (ira_object_t): New typedef. Add DEF_VEC_P and DEF_VEC_ALLOC_P for it. (struct ira_allocno): Remove members min, max, conflict_allocno_array, conflict_id, conflict_allocno_array_size, conflict_allocnos_num and conflict_vec_p. Add new member object. (OBJECT_CONFLICT_ARRAY, OBJECT_CONFLICT_VEC_P, OBJECT_NUM_CONFLICTS, OBJECT_CONFLICT_ARRAY_SIZE, OBJECT_CONFLICT_HARD_REGS, OBJECT_TOTAL_CONFLICT_HARD_REGS, OBJECT_MIN, OBJECT_MAX, OBJECT_CONFLICT_ID): Renamed from ALLOCNO_CONFLICT_ALLOCNO_ARRAY, ALLOCNO_CONFLICT_VEC_P, ALLOCNO_CONFLICT_ALLOCNOS_NUM, ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE, ALLOCNO_CONFLICT_HARD_REGS, ALLOCNO_TOTAL_CONFLICT_HARD_REGS) ALLOCNO_MIN, ALLOCNO_MAX, and ALLOCNO_CONFLICT_ID; now operate on an ira_object_t rather than ira_allocno_t. All uses changed. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_objects_num): Declare variable. (ira_create_allocno_object): Declare function. (ira_conflict_vector_profitable_p): Adjust prototype. (ira_allocate_conflict_vec): Renamed from ira_allocate_allocno_conflict_vec; first arg now ira_object_t. (ira_allocate_object_conflicts): Renamed from ira_allocate_allocno_conflicts; first arg now ira_object_t. (struct ira_object_iterator): New. (ira_object_iter_init, ira_object_iter_cond, FOR_EACH_OBJECT): New. (ira_allocno_conflict_iterator): Renamed member allocno_conflict_vec_p to conflict_vec_p. All uses changed. (ira_allocno_conflict_iter_init, ira_allocno_conflict_iter_cond): Changed to take into account that conflicts are now tracked for objects. * ira-conflicts.c (OBJECTS_CONFLICT_P): Renamed from CONFLICT_ALLOCNO_P. Args changed to accept ira_object_t. All uses changed. (allocnos_conflict_p): New static function. (collected_conflict_objects): Renamed from collected_allocno_objects; now a vector of ira_object_t. All uses changed. (build_conflict_bit_table): Changed to take into account that conflicts are now tracked for objects. (process_regs_for_copy, propagate_copies, build_allocno_conflicts) (print_allocno_conflicts, ira_build_conflicts): Likewise. * ira-color.c (assign_hard_reg, setup_allocno_available_regs_num) setup_allocno_left_conflicts_size, allocno_reload_assign, fast_allocation): Likewise. * ira-lives.c (make_hard_regno_born, make_allocno_born) process_single_reg_class_operands, process_bb_node_lives): Likewise. * ira-emit.c (modify_move_list, add_range_and_copies_from_move_list): Likewise. * ira-build.c (ira_objects_num): New variable. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_object_id_map_vec): Corresponding change. (object_pool): New static variable. (initiate_allocnos): Initialize it. (finish_allocnos): Free it. (ira_create_object, ira_create_allocno_object, create_allocno_objects): New functions. (ira_create_allocno): Don't set members that were removed. (ira_set_allocno_cover_class): Don't change conflict hard regs. (merge_hard_reg_conflicts): Changed to take into account that conflicts are now tracked for objects. (ira_conflict_vector_profitable_p, ira_allocate_conflict_vec, allocate_conflict_bit_vec, ira_allocate_object_conflicts, compress_conflict_vecs, remove_low_level_allocnos, ira_flattening, setup_min_max_allocno_live_range_point, allocno_range_compare_func, setup_min_max_conflict_allocno_ids, ): Likewise. ((add_to_conflicts): Renamed from add_to_allocno_conflicts, args changed to ira_object_t; all callers changed. (ira_add_conflict): Renamed from ira_add_allocno_conflict, args changed to ira_object_t, all callers changed. (clear_conflicts): Renamed from clear_allocno_conflicts, arg changed to ira_object_t, all callers changed. (conflict_check, curr_conflict_check_tick): Renamed from allocno_conflict_check and curr_allocno_conflict_check_tick; all uses changed. (compress_conflict_vec): Renamed from compress_allocno_conflict_vec, arg changed to ira_object_t, all callers changed. (create_cap_allocno): Call ira_create_allocno_object. (finish_allocno): Free the corresponding object. (sort_conflict_id_map): Renamed from sort_conflict_id_allocno_map; all callers changed. Adjusted for dealing with objects. (ira_build): Call create_allocno_objects after ira_costs. Adjusted for dealing with objects. * ira.c (ira_bad_reload_regno_1): Adjusted for dealing with objects. From-SVN: r162166
2010-07-14 03:53:35 +02:00
unsigned int conflicts_array_size;
ira-build.c (ira_create_object): New arg SUBWORD; all callers changed. * ira-build.c (ira_create_object): New arg SUBWORD; all callers changed. Initialize OBJECT_SUBWORD. (ira_create_allocno): Clear ALLOCNO_NUM_OBJECTS. (ira_create_allocno_objects): Renamed from ira_create_allocno_object; all callers changed. (merge_hard_reg_conflicts): Iterate over allocno subobjects. (finish_allocno): Likewise. (move_allocno_live_ranges, copy_allocno_live_ranges): Likewise. (remove_low_level_allocnos): Likewise. (update_bad_spill_attribute): Likewise. (setup_min_max_allocno_live_range_point): Likewise. (sort_conflict_id_map): Likewise. (ira_flattening): Likewise. Use ior_hard_reg_conflicts. (ior_hard_reg_conflicts): New function. (ior_allocate_object_conflicts): Renamed first argument to OBJ. (compress_conflict_vecs): Iterate over objects, not allocnos. (ira_add_live_range_to_object): New function. (object_range_compare_func): Renamed from allocno_range_compare_func. All callers changed. (setup_min_max_conflict_allocno_ids): For allocnos with multiple subobjects, widen the min/max range of the lowest-order object to potentially include all other such low-order objects. * ira.c (ira_bad_reload_regno_1): Iterate over allocno subobjects. (check_allocation): Likewise. Use more fine-grained tests for register conflicts. * ira-color.c (allocnos_have_intersected_live_ranges_p): Iterate over allocno subobjects. (assign_hard_reg): Keep multiple sets of conflicts. Make finer-grained choices about which bits to set in each set. Don't use ira_hard_reg_not_in_set_p, perform a more elaborate test for conflicts using the multiple sets we computed. (push_allocno_to_stack): Iterate over allocno subobjects. (all_conflicting_hard_regs_coalesced): New static function. (setup_allocno_available_regs_num): Use it. (setup_allocno_left_conflicts_size): Likewise. Iterate over allocno subobjects. (coalesced_allocno_conflict): Test subobject 0 in each allocno. (setup_allocno_priorities): Divide ALLOCNO_EXCESS_PRESSURE_POINTS_NUM by ALLOCNO_NUM_OBJECTS. (calculate_spill_cost): Likewise. (color_pass): Express if statement in a more normal way. (ira_reassign_conflict_allocnos): Iterate over allocno subobjects. (slot_coalesced_allocno_live_ranges_intersect_p): Likewise. (setup_slot_coalesced_allocno_live_ranges): Likewise. (allocno_reload_assign): Likewise. (ira_reassign_pseudos): Likewise. (fast_allocation): Likewise. * ira-conflicts.c (build_conflict_bit_table): Likewise. (print_allocno_conflicts): Likewise. (ira_build_conflicts): Likewise. (allocnos_conflict_for_copy_p): Renamed from allocnos_conflict_p. All callers changed. Test subword 0 of each allocno for conflicts. (build_object_conflicts): Renamed from build_allocno_conflicts. All callers changed. Iterate over allocno subobjects. * ira-emit.c (modify_move_list): Iterate over allocno subobjects. * ira-int.h (struct ira_allocno): New member. num_objects. Rename object to objects and change it into an array. (ALLOCNO_OBJECT): Add new argument N. (ALLOCNO_NUM_OBJECTS, OBJECT_SUBWORD): New macros. (ira_create_allocno_objects): Renamed from ira_create_allocno_object. (ior_hard_reg_conflicts): Declare. (ira_add_live_range_to_object): Declare. (ira_allocno_object_iterator): New. (ira_allocno_object_iter_init, ira_allocno_object_iter_cond): New. (FOR_EACH_ALLOCNO_OBJECT): New macro. * ira-lives.c (objects_live): Renamed from allocnos_live; all uses changed. (allocnos_processed): New sparseset. (make_object_born): Renamed from make_allocno_born; take an ira_object_t argument. All callers changed. (make_object_dead): Renamed from make_allocno_dead; take an ira_object t argument. All callers changed. (update_allocno_pressure_excess_length): Take an ira_obejct_t argument. All callers changed. (mark_pseudo_regno_live): Iterate over allocno subobjects. (mark_pseudo_regno_dead): Likewise. (mark_pseudo_regno_subword_live, mark_pseudo_regno_subword_dead): New functions. (mark_ref_live): Detect subword accesses and call mark_pseudo_regno_subword_live as appropriate. (mark_ref_dead): Likewise for mark_pseudo_regno_subword_dead. (process_bb_nodes_live): Deal with object-related updates first; set and test bits in allocnos_processed to avoid computing allocno statistics more than once. (create_start_finish_chains): Iterate over objects, not allocnos. (print_object_live_ranges): New function. (print_allocno_live_ranges): Use it. (ira_create_allocno_live_ranges): Allocate and free allocnos_processed and objects_live. From-SVN: r162418
2010-07-22 17:48:30 +02:00
/* A unique number for every instance of this structure, which is used
ira-int.h (struct ira_object): New. * ira-int.h (struct ira_object): New. (ira_object_t): New typedef. Add DEF_VEC_P and DEF_VEC_ALLOC_P for it. (struct ira_allocno): Remove members min, max, conflict_allocno_array, conflict_id, conflict_allocno_array_size, conflict_allocnos_num and conflict_vec_p. Add new member object. (OBJECT_CONFLICT_ARRAY, OBJECT_CONFLICT_VEC_P, OBJECT_NUM_CONFLICTS, OBJECT_CONFLICT_ARRAY_SIZE, OBJECT_CONFLICT_HARD_REGS, OBJECT_TOTAL_CONFLICT_HARD_REGS, OBJECT_MIN, OBJECT_MAX, OBJECT_CONFLICT_ID): Renamed from ALLOCNO_CONFLICT_ALLOCNO_ARRAY, ALLOCNO_CONFLICT_VEC_P, ALLOCNO_CONFLICT_ALLOCNOS_NUM, ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE, ALLOCNO_CONFLICT_HARD_REGS, ALLOCNO_TOTAL_CONFLICT_HARD_REGS) ALLOCNO_MIN, ALLOCNO_MAX, and ALLOCNO_CONFLICT_ID; now operate on an ira_object_t rather than ira_allocno_t. All uses changed. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_objects_num): Declare variable. (ira_create_allocno_object): Declare function. (ira_conflict_vector_profitable_p): Adjust prototype. (ira_allocate_conflict_vec): Renamed from ira_allocate_allocno_conflict_vec; first arg now ira_object_t. (ira_allocate_object_conflicts): Renamed from ira_allocate_allocno_conflicts; first arg now ira_object_t. (struct ira_object_iterator): New. (ira_object_iter_init, ira_object_iter_cond, FOR_EACH_OBJECT): New. (ira_allocno_conflict_iterator): Renamed member allocno_conflict_vec_p to conflict_vec_p. All uses changed. (ira_allocno_conflict_iter_init, ira_allocno_conflict_iter_cond): Changed to take into account that conflicts are now tracked for objects. * ira-conflicts.c (OBJECTS_CONFLICT_P): Renamed from CONFLICT_ALLOCNO_P. Args changed to accept ira_object_t. All uses changed. (allocnos_conflict_p): New static function. (collected_conflict_objects): Renamed from collected_allocno_objects; now a vector of ira_object_t. All uses changed. (build_conflict_bit_table): Changed to take into account that conflicts are now tracked for objects. (process_regs_for_copy, propagate_copies, build_allocno_conflicts) (print_allocno_conflicts, ira_build_conflicts): Likewise. * ira-color.c (assign_hard_reg, setup_allocno_available_regs_num) setup_allocno_left_conflicts_size, allocno_reload_assign, fast_allocation): Likewise. * ira-lives.c (make_hard_regno_born, make_allocno_born) process_single_reg_class_operands, process_bb_node_lives): Likewise. * ira-emit.c (modify_move_list, add_range_and_copies_from_move_list): Likewise. * ira-build.c (ira_objects_num): New variable. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_object_id_map_vec): Corresponding change. (object_pool): New static variable. (initiate_allocnos): Initialize it. (finish_allocnos): Free it. (ira_create_object, ira_create_allocno_object, create_allocno_objects): New functions. (ira_create_allocno): Don't set members that were removed. (ira_set_allocno_cover_class): Don't change conflict hard regs. (merge_hard_reg_conflicts): Changed to take into account that conflicts are now tracked for objects. (ira_conflict_vector_profitable_p, ira_allocate_conflict_vec, allocate_conflict_bit_vec, ira_allocate_object_conflicts, compress_conflict_vecs, remove_low_level_allocnos, ira_flattening, setup_min_max_allocno_live_range_point, allocno_range_compare_func, setup_min_max_conflict_allocno_ids, ): Likewise. ((add_to_conflicts): Renamed from add_to_allocno_conflicts, args changed to ira_object_t; all callers changed. (ira_add_conflict): Renamed from ira_add_allocno_conflict, args changed to ira_object_t, all callers changed. (clear_conflicts): Renamed from clear_allocno_conflicts, arg changed to ira_object_t, all callers changed. (conflict_check, curr_conflict_check_tick): Renamed from allocno_conflict_check and curr_allocno_conflict_check_tick; all uses changed. (compress_conflict_vec): Renamed from compress_allocno_conflict_vec, arg changed to ira_object_t, all callers changed. (create_cap_allocno): Call ira_create_allocno_object. (finish_allocno): Free the corresponding object. (sort_conflict_id_map): Renamed from sort_conflict_id_allocno_map; all callers changed. Adjusted for dealing with objects. (ira_build): Call create_allocno_objects after ira_costs. Adjusted for dealing with objects. * ira.c (ira_bad_reload_regno_1): Adjusted for dealing with objects. From-SVN: r162166
2010-07-14 03:53:35 +02:00
to represent it in conflict bit vectors. */
int id;
/* Before building conflicts, MIN and MAX are initialized to
correspondingly minimal and maximal points of the accumulated
ira-build.c (ira_create_object): New arg SUBWORD; all callers changed. * ira-build.c (ira_create_object): New arg SUBWORD; all callers changed. Initialize OBJECT_SUBWORD. (ira_create_allocno): Clear ALLOCNO_NUM_OBJECTS. (ira_create_allocno_objects): Renamed from ira_create_allocno_object; all callers changed. (merge_hard_reg_conflicts): Iterate over allocno subobjects. (finish_allocno): Likewise. (move_allocno_live_ranges, copy_allocno_live_ranges): Likewise. (remove_low_level_allocnos): Likewise. (update_bad_spill_attribute): Likewise. (setup_min_max_allocno_live_range_point): Likewise. (sort_conflict_id_map): Likewise. (ira_flattening): Likewise. Use ior_hard_reg_conflicts. (ior_hard_reg_conflicts): New function. (ior_allocate_object_conflicts): Renamed first argument to OBJ. (compress_conflict_vecs): Iterate over objects, not allocnos. (ira_add_live_range_to_object): New function. (object_range_compare_func): Renamed from allocno_range_compare_func. All callers changed. (setup_min_max_conflict_allocno_ids): For allocnos with multiple subobjects, widen the min/max range of the lowest-order object to potentially include all other such low-order objects. * ira.c (ira_bad_reload_regno_1): Iterate over allocno subobjects. (check_allocation): Likewise. Use more fine-grained tests for register conflicts. * ira-color.c (allocnos_have_intersected_live_ranges_p): Iterate over allocno subobjects. (assign_hard_reg): Keep multiple sets of conflicts. Make finer-grained choices about which bits to set in each set. Don't use ira_hard_reg_not_in_set_p, perform a more elaborate test for conflicts using the multiple sets we computed. (push_allocno_to_stack): Iterate over allocno subobjects. (all_conflicting_hard_regs_coalesced): New static function. (setup_allocno_available_regs_num): Use it. (setup_allocno_left_conflicts_size): Likewise. Iterate over allocno subobjects. (coalesced_allocno_conflict): Test subobject 0 in each allocno. (setup_allocno_priorities): Divide ALLOCNO_EXCESS_PRESSURE_POINTS_NUM by ALLOCNO_NUM_OBJECTS. (calculate_spill_cost): Likewise. (color_pass): Express if statement in a more normal way. (ira_reassign_conflict_allocnos): Iterate over allocno subobjects. (slot_coalesced_allocno_live_ranges_intersect_p): Likewise. (setup_slot_coalesced_allocno_live_ranges): Likewise. (allocno_reload_assign): Likewise. (ira_reassign_pseudos): Likewise. (fast_allocation): Likewise. * ira-conflicts.c (build_conflict_bit_table): Likewise. (print_allocno_conflicts): Likewise. (ira_build_conflicts): Likewise. (allocnos_conflict_for_copy_p): Renamed from allocnos_conflict_p. All callers changed. Test subword 0 of each allocno for conflicts. (build_object_conflicts): Renamed from build_allocno_conflicts. All callers changed. Iterate over allocno subobjects. * ira-emit.c (modify_move_list): Iterate over allocno subobjects. * ira-int.h (struct ira_allocno): New member. num_objects. Rename object to objects and change it into an array. (ALLOCNO_OBJECT): Add new argument N. (ALLOCNO_NUM_OBJECTS, OBJECT_SUBWORD): New macros. (ira_create_allocno_objects): Renamed from ira_create_allocno_object. (ior_hard_reg_conflicts): Declare. (ira_add_live_range_to_object): Declare. (ira_allocno_object_iterator): New. (ira_allocno_object_iter_init, ira_allocno_object_iter_cond): New. (FOR_EACH_ALLOCNO_OBJECT): New macro. * ira-lives.c (objects_live): Renamed from allocnos_live; all uses changed. (allocnos_processed): New sparseset. (make_object_born): Renamed from make_allocno_born; take an ira_object_t argument. All callers changed. (make_object_dead): Renamed from make_allocno_dead; take an ira_object t argument. All callers changed. (update_allocno_pressure_excess_length): Take an ira_obejct_t argument. All callers changed. (mark_pseudo_regno_live): Iterate over allocno subobjects. (mark_pseudo_regno_dead): Likewise. (mark_pseudo_regno_subword_live, mark_pseudo_regno_subword_dead): New functions. (mark_ref_live): Detect subword accesses and call mark_pseudo_regno_subword_live as appropriate. (mark_ref_dead): Likewise for mark_pseudo_regno_subword_dead. (process_bb_nodes_live): Deal with object-related updates first; set and test bits in allocnos_processed to avoid computing allocno statistics more than once. (create_start_finish_chains): Iterate over objects, not allocnos. (print_object_live_ranges): New function. (print_allocno_live_ranges): Use it. (ira_create_allocno_live_ranges): Allocate and free allocnos_processed and objects_live. From-SVN: r162418
2010-07-22 17:48:30 +02:00
live ranges. Afterwards, they hold the minimal and maximal ids
of other ira_objects that this one can conflict with. */
ira-int.h (struct ira_object): New. * ira-int.h (struct ira_object): New. (ira_object_t): New typedef. Add DEF_VEC_P and DEF_VEC_ALLOC_P for it. (struct ira_allocno): Remove members min, max, conflict_allocno_array, conflict_id, conflict_allocno_array_size, conflict_allocnos_num and conflict_vec_p. Add new member object. (OBJECT_CONFLICT_ARRAY, OBJECT_CONFLICT_VEC_P, OBJECT_NUM_CONFLICTS, OBJECT_CONFLICT_ARRAY_SIZE, OBJECT_CONFLICT_HARD_REGS, OBJECT_TOTAL_CONFLICT_HARD_REGS, OBJECT_MIN, OBJECT_MAX, OBJECT_CONFLICT_ID): Renamed from ALLOCNO_CONFLICT_ALLOCNO_ARRAY, ALLOCNO_CONFLICT_VEC_P, ALLOCNO_CONFLICT_ALLOCNOS_NUM, ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE, ALLOCNO_CONFLICT_HARD_REGS, ALLOCNO_TOTAL_CONFLICT_HARD_REGS) ALLOCNO_MIN, ALLOCNO_MAX, and ALLOCNO_CONFLICT_ID; now operate on an ira_object_t rather than ira_allocno_t. All uses changed. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_objects_num): Declare variable. (ira_create_allocno_object): Declare function. (ira_conflict_vector_profitable_p): Adjust prototype. (ira_allocate_conflict_vec): Renamed from ira_allocate_allocno_conflict_vec; first arg now ira_object_t. (ira_allocate_object_conflicts): Renamed from ira_allocate_allocno_conflicts; first arg now ira_object_t. (struct ira_object_iterator): New. (ira_object_iter_init, ira_object_iter_cond, FOR_EACH_OBJECT): New. (ira_allocno_conflict_iterator): Renamed member allocno_conflict_vec_p to conflict_vec_p. All uses changed. (ira_allocno_conflict_iter_init, ira_allocno_conflict_iter_cond): Changed to take into account that conflicts are now tracked for objects. * ira-conflicts.c (OBJECTS_CONFLICT_P): Renamed from CONFLICT_ALLOCNO_P. Args changed to accept ira_object_t. All uses changed. (allocnos_conflict_p): New static function. (collected_conflict_objects): Renamed from collected_allocno_objects; now a vector of ira_object_t. All uses changed. (build_conflict_bit_table): Changed to take into account that conflicts are now tracked for objects. (process_regs_for_copy, propagate_copies, build_allocno_conflicts) (print_allocno_conflicts, ira_build_conflicts): Likewise. * ira-color.c (assign_hard_reg, setup_allocno_available_regs_num) setup_allocno_left_conflicts_size, allocno_reload_assign, fast_allocation): Likewise. * ira-lives.c (make_hard_regno_born, make_allocno_born) process_single_reg_class_operands, process_bb_node_lives): Likewise. * ira-emit.c (modify_move_list, add_range_and_copies_from_move_list): Likewise. * ira-build.c (ira_objects_num): New variable. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_object_id_map_vec): Corresponding change. (object_pool): New static variable. (initiate_allocnos): Initialize it. (finish_allocnos): Free it. (ira_create_object, ira_create_allocno_object, create_allocno_objects): New functions. (ira_create_allocno): Don't set members that were removed. (ira_set_allocno_cover_class): Don't change conflict hard regs. (merge_hard_reg_conflicts): Changed to take into account that conflicts are now tracked for objects. (ira_conflict_vector_profitable_p, ira_allocate_conflict_vec, allocate_conflict_bit_vec, ira_allocate_object_conflicts, compress_conflict_vecs, remove_low_level_allocnos, ira_flattening, setup_min_max_allocno_live_range_point, allocno_range_compare_func, setup_min_max_conflict_allocno_ids, ): Likewise. ((add_to_conflicts): Renamed from add_to_allocno_conflicts, args changed to ira_object_t; all callers changed. (ira_add_conflict): Renamed from ira_add_allocno_conflict, args changed to ira_object_t, all callers changed. (clear_conflicts): Renamed from clear_allocno_conflicts, arg changed to ira_object_t, all callers changed. (conflict_check, curr_conflict_check_tick): Renamed from allocno_conflict_check and curr_allocno_conflict_check_tick; all uses changed. (compress_conflict_vec): Renamed from compress_allocno_conflict_vec, arg changed to ira_object_t, all callers changed. (create_cap_allocno): Call ira_create_allocno_object. (finish_allocno): Free the corresponding object. (sort_conflict_id_map): Renamed from sort_conflict_id_allocno_map; all callers changed. Adjusted for dealing with objects. (ira_build): Call create_allocno_objects after ira_costs. Adjusted for dealing with objects. * ira.c (ira_bad_reload_regno_1): Adjusted for dealing with objects. From-SVN: r162166
2010-07-14 03:53:35 +02:00
int min, max;
/* Initial and accumulated hard registers conflicting with this
ira-build.c (ira_create_object): New arg SUBWORD; all callers changed. * ira-build.c (ira_create_object): New arg SUBWORD; all callers changed. Initialize OBJECT_SUBWORD. (ira_create_allocno): Clear ALLOCNO_NUM_OBJECTS. (ira_create_allocno_objects): Renamed from ira_create_allocno_object; all callers changed. (merge_hard_reg_conflicts): Iterate over allocno subobjects. (finish_allocno): Likewise. (move_allocno_live_ranges, copy_allocno_live_ranges): Likewise. (remove_low_level_allocnos): Likewise. (update_bad_spill_attribute): Likewise. (setup_min_max_allocno_live_range_point): Likewise. (sort_conflict_id_map): Likewise. (ira_flattening): Likewise. Use ior_hard_reg_conflicts. (ior_hard_reg_conflicts): New function. (ior_allocate_object_conflicts): Renamed first argument to OBJ. (compress_conflict_vecs): Iterate over objects, not allocnos. (ira_add_live_range_to_object): New function. (object_range_compare_func): Renamed from allocno_range_compare_func. All callers changed. (setup_min_max_conflict_allocno_ids): For allocnos with multiple subobjects, widen the min/max range of the lowest-order object to potentially include all other such low-order objects. * ira.c (ira_bad_reload_regno_1): Iterate over allocno subobjects. (check_allocation): Likewise. Use more fine-grained tests for register conflicts. * ira-color.c (allocnos_have_intersected_live_ranges_p): Iterate over allocno subobjects. (assign_hard_reg): Keep multiple sets of conflicts. Make finer-grained choices about which bits to set in each set. Don't use ira_hard_reg_not_in_set_p, perform a more elaborate test for conflicts using the multiple sets we computed. (push_allocno_to_stack): Iterate over allocno subobjects. (all_conflicting_hard_regs_coalesced): New static function. (setup_allocno_available_regs_num): Use it. (setup_allocno_left_conflicts_size): Likewise. Iterate over allocno subobjects. (coalesced_allocno_conflict): Test subobject 0 in each allocno. (setup_allocno_priorities): Divide ALLOCNO_EXCESS_PRESSURE_POINTS_NUM by ALLOCNO_NUM_OBJECTS. (calculate_spill_cost): Likewise. (color_pass): Express if statement in a more normal way. (ira_reassign_conflict_allocnos): Iterate over allocno subobjects. (slot_coalesced_allocno_live_ranges_intersect_p): Likewise. (setup_slot_coalesced_allocno_live_ranges): Likewise. (allocno_reload_assign): Likewise. (ira_reassign_pseudos): Likewise. (fast_allocation): Likewise. * ira-conflicts.c (build_conflict_bit_table): Likewise. (print_allocno_conflicts): Likewise. (ira_build_conflicts): Likewise. (allocnos_conflict_for_copy_p): Renamed from allocnos_conflict_p. All callers changed. Test subword 0 of each allocno for conflicts. (build_object_conflicts): Renamed from build_allocno_conflicts. All callers changed. Iterate over allocno subobjects. * ira-emit.c (modify_move_list): Iterate over allocno subobjects. * ira-int.h (struct ira_allocno): New member. num_objects. Rename object to objects and change it into an array. (ALLOCNO_OBJECT): Add new argument N. (ALLOCNO_NUM_OBJECTS, OBJECT_SUBWORD): New macros. (ira_create_allocno_objects): Renamed from ira_create_allocno_object. (ior_hard_reg_conflicts): Declare. (ira_add_live_range_to_object): Declare. (ira_allocno_object_iterator): New. (ira_allocno_object_iter_init, ira_allocno_object_iter_cond): New. (FOR_EACH_ALLOCNO_OBJECT): New macro. * ira-lives.c (objects_live): Renamed from allocnos_live; all uses changed. (allocnos_processed): New sparseset. (make_object_born): Renamed from make_allocno_born; take an ira_object_t argument. All callers changed. (make_object_dead): Renamed from make_allocno_dead; take an ira_object t argument. All callers changed. (update_allocno_pressure_excess_length): Take an ira_obejct_t argument. All callers changed. (mark_pseudo_regno_live): Iterate over allocno subobjects. (mark_pseudo_regno_dead): Likewise. (mark_pseudo_regno_subword_live, mark_pseudo_regno_subword_dead): New functions. (mark_ref_live): Detect subword accesses and call mark_pseudo_regno_subword_live as appropriate. (mark_ref_dead): Likewise for mark_pseudo_regno_subword_dead. (process_bb_nodes_live): Deal with object-related updates first; set and test bits in allocnos_processed to avoid computing allocno statistics more than once. (create_start_finish_chains): Iterate over objects, not allocnos. (print_object_live_ranges): New function. (print_allocno_live_ranges): Use it. (ira_create_allocno_live_ranges): Allocate and free allocnos_processed and objects_live. From-SVN: r162418
2010-07-22 17:48:30 +02:00
object and as a consequences can not be assigned to the allocno.
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
All non-allocatable hard regs and hard regs of register classes
ira-build.c (ira_create_object): New arg SUBWORD; all callers changed. * ira-build.c (ira_create_object): New arg SUBWORD; all callers changed. Initialize OBJECT_SUBWORD. (ira_create_allocno): Clear ALLOCNO_NUM_OBJECTS. (ira_create_allocno_objects): Renamed from ira_create_allocno_object; all callers changed. (merge_hard_reg_conflicts): Iterate over allocno subobjects. (finish_allocno): Likewise. (move_allocno_live_ranges, copy_allocno_live_ranges): Likewise. (remove_low_level_allocnos): Likewise. (update_bad_spill_attribute): Likewise. (setup_min_max_allocno_live_range_point): Likewise. (sort_conflict_id_map): Likewise. (ira_flattening): Likewise. Use ior_hard_reg_conflicts. (ior_hard_reg_conflicts): New function. (ior_allocate_object_conflicts): Renamed first argument to OBJ. (compress_conflict_vecs): Iterate over objects, not allocnos. (ira_add_live_range_to_object): New function. (object_range_compare_func): Renamed from allocno_range_compare_func. All callers changed. (setup_min_max_conflict_allocno_ids): For allocnos with multiple subobjects, widen the min/max range of the lowest-order object to potentially include all other such low-order objects. * ira.c (ira_bad_reload_regno_1): Iterate over allocno subobjects. (check_allocation): Likewise. Use more fine-grained tests for register conflicts. * ira-color.c (allocnos_have_intersected_live_ranges_p): Iterate over allocno subobjects. (assign_hard_reg): Keep multiple sets of conflicts. Make finer-grained choices about which bits to set in each set. Don't use ira_hard_reg_not_in_set_p, perform a more elaborate test for conflicts using the multiple sets we computed. (push_allocno_to_stack): Iterate over allocno subobjects. (all_conflicting_hard_regs_coalesced): New static function. (setup_allocno_available_regs_num): Use it. (setup_allocno_left_conflicts_size): Likewise. Iterate over allocno subobjects. (coalesced_allocno_conflict): Test subobject 0 in each allocno. (setup_allocno_priorities): Divide ALLOCNO_EXCESS_PRESSURE_POINTS_NUM by ALLOCNO_NUM_OBJECTS. (calculate_spill_cost): Likewise. (color_pass): Express if statement in a more normal way. (ira_reassign_conflict_allocnos): Iterate over allocno subobjects. (slot_coalesced_allocno_live_ranges_intersect_p): Likewise. (setup_slot_coalesced_allocno_live_ranges): Likewise. (allocno_reload_assign): Likewise. (ira_reassign_pseudos): Likewise. (fast_allocation): Likewise. * ira-conflicts.c (build_conflict_bit_table): Likewise. (print_allocno_conflicts): Likewise. (ira_build_conflicts): Likewise. (allocnos_conflict_for_copy_p): Renamed from allocnos_conflict_p. All callers changed. Test subword 0 of each allocno for conflicts. (build_object_conflicts): Renamed from build_allocno_conflicts. All callers changed. Iterate over allocno subobjects. * ira-emit.c (modify_move_list): Iterate over allocno subobjects. * ira-int.h (struct ira_allocno): New member. num_objects. Rename object to objects and change it into an array. (ALLOCNO_OBJECT): Add new argument N. (ALLOCNO_NUM_OBJECTS, OBJECT_SUBWORD): New macros. (ira_create_allocno_objects): Renamed from ira_create_allocno_object. (ior_hard_reg_conflicts): Declare. (ira_add_live_range_to_object): Declare. (ira_allocno_object_iterator): New. (ira_allocno_object_iter_init, ira_allocno_object_iter_cond): New. (FOR_EACH_ALLOCNO_OBJECT): New macro. * ira-lives.c (objects_live): Renamed from allocnos_live; all uses changed. (allocnos_processed): New sparseset. (make_object_born): Renamed from make_allocno_born; take an ira_object_t argument. All callers changed. (make_object_dead): Renamed from make_allocno_dead; take an ira_object t argument. All callers changed. (update_allocno_pressure_excess_length): Take an ira_obejct_t argument. All callers changed. (mark_pseudo_regno_live): Iterate over allocno subobjects. (mark_pseudo_regno_dead): Likewise. (mark_pseudo_regno_subword_live, mark_pseudo_regno_subword_dead): New functions. (mark_ref_live): Detect subword accesses and call mark_pseudo_regno_subword_live as appropriate. (mark_ref_dead): Likewise for mark_pseudo_regno_subword_dead. (process_bb_nodes_live): Deal with object-related updates first; set and test bits in allocnos_processed to avoid computing allocno statistics more than once. (create_start_finish_chains): Iterate over objects, not allocnos. (print_object_live_ranges): New function. (print_allocno_live_ranges): Use it. (ira_create_allocno_live_ranges): Allocate and free allocnos_processed and objects_live. From-SVN: r162418
2010-07-22 17:48:30 +02:00
different from given allocno one are included in the sets. */
ira-int.h (struct ira_object): New. * ira-int.h (struct ira_object): New. (ira_object_t): New typedef. Add DEF_VEC_P and DEF_VEC_ALLOC_P for it. (struct ira_allocno): Remove members min, max, conflict_allocno_array, conflict_id, conflict_allocno_array_size, conflict_allocnos_num and conflict_vec_p. Add new member object. (OBJECT_CONFLICT_ARRAY, OBJECT_CONFLICT_VEC_P, OBJECT_NUM_CONFLICTS, OBJECT_CONFLICT_ARRAY_SIZE, OBJECT_CONFLICT_HARD_REGS, OBJECT_TOTAL_CONFLICT_HARD_REGS, OBJECT_MIN, OBJECT_MAX, OBJECT_CONFLICT_ID): Renamed from ALLOCNO_CONFLICT_ALLOCNO_ARRAY, ALLOCNO_CONFLICT_VEC_P, ALLOCNO_CONFLICT_ALLOCNOS_NUM, ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE, ALLOCNO_CONFLICT_HARD_REGS, ALLOCNO_TOTAL_CONFLICT_HARD_REGS) ALLOCNO_MIN, ALLOCNO_MAX, and ALLOCNO_CONFLICT_ID; now operate on an ira_object_t rather than ira_allocno_t. All uses changed. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_objects_num): Declare variable. (ira_create_allocno_object): Declare function. (ira_conflict_vector_profitable_p): Adjust prototype. (ira_allocate_conflict_vec): Renamed from ira_allocate_allocno_conflict_vec; first arg now ira_object_t. (ira_allocate_object_conflicts): Renamed from ira_allocate_allocno_conflicts; first arg now ira_object_t. (struct ira_object_iterator): New. (ira_object_iter_init, ira_object_iter_cond, FOR_EACH_OBJECT): New. (ira_allocno_conflict_iterator): Renamed member allocno_conflict_vec_p to conflict_vec_p. All uses changed. (ira_allocno_conflict_iter_init, ira_allocno_conflict_iter_cond): Changed to take into account that conflicts are now tracked for objects. * ira-conflicts.c (OBJECTS_CONFLICT_P): Renamed from CONFLICT_ALLOCNO_P. Args changed to accept ira_object_t. All uses changed. (allocnos_conflict_p): New static function. (collected_conflict_objects): Renamed from collected_allocno_objects; now a vector of ira_object_t. All uses changed. (build_conflict_bit_table): Changed to take into account that conflicts are now tracked for objects. (process_regs_for_copy, propagate_copies, build_allocno_conflicts) (print_allocno_conflicts, ira_build_conflicts): Likewise. * ira-color.c (assign_hard_reg, setup_allocno_available_regs_num) setup_allocno_left_conflicts_size, allocno_reload_assign, fast_allocation): Likewise. * ira-lives.c (make_hard_regno_born, make_allocno_born) process_single_reg_class_operands, process_bb_node_lives): Likewise. * ira-emit.c (modify_move_list, add_range_and_copies_from_move_list): Likewise. * ira-build.c (ira_objects_num): New variable. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_object_id_map_vec): Corresponding change. (object_pool): New static variable. (initiate_allocnos): Initialize it. (finish_allocnos): Free it. (ira_create_object, ira_create_allocno_object, create_allocno_objects): New functions. (ira_create_allocno): Don't set members that were removed. (ira_set_allocno_cover_class): Don't change conflict hard regs. (merge_hard_reg_conflicts): Changed to take into account that conflicts are now tracked for objects. (ira_conflict_vector_profitable_p, ira_allocate_conflict_vec, allocate_conflict_bit_vec, ira_allocate_object_conflicts, compress_conflict_vecs, remove_low_level_allocnos, ira_flattening, setup_min_max_allocno_live_range_point, allocno_range_compare_func, setup_min_max_conflict_allocno_ids, ): Likewise. ((add_to_conflicts): Renamed from add_to_allocno_conflicts, args changed to ira_object_t; all callers changed. (ira_add_conflict): Renamed from ira_add_allocno_conflict, args changed to ira_object_t, all callers changed. (clear_conflicts): Renamed from clear_allocno_conflicts, arg changed to ira_object_t, all callers changed. (conflict_check, curr_conflict_check_tick): Renamed from allocno_conflict_check and curr_allocno_conflict_check_tick; all uses changed. (compress_conflict_vec): Renamed from compress_allocno_conflict_vec, arg changed to ira_object_t, all callers changed. (create_cap_allocno): Call ira_create_allocno_object. (finish_allocno): Free the corresponding object. (sort_conflict_id_map): Renamed from sort_conflict_id_allocno_map; all callers changed. Adjusted for dealing with objects. (ira_build): Call create_allocno_objects after ira_costs. Adjusted for dealing with objects. * ira.c (ira_bad_reload_regno_1): Adjusted for dealing with objects. From-SVN: r162166
2010-07-14 03:53:35 +02:00
HARD_REG_SET conflict_hard_regs, total_conflict_hard_regs;
/* Number of accumulated conflicts in the vector of conflicting
ira-build.c (ira_create_object): New arg SUBWORD; all callers changed. * ira-build.c (ira_create_object): New arg SUBWORD; all callers changed. Initialize OBJECT_SUBWORD. (ira_create_allocno): Clear ALLOCNO_NUM_OBJECTS. (ira_create_allocno_objects): Renamed from ira_create_allocno_object; all callers changed. (merge_hard_reg_conflicts): Iterate over allocno subobjects. (finish_allocno): Likewise. (move_allocno_live_ranges, copy_allocno_live_ranges): Likewise. (remove_low_level_allocnos): Likewise. (update_bad_spill_attribute): Likewise. (setup_min_max_allocno_live_range_point): Likewise. (sort_conflict_id_map): Likewise. (ira_flattening): Likewise. Use ior_hard_reg_conflicts. (ior_hard_reg_conflicts): New function. (ior_allocate_object_conflicts): Renamed first argument to OBJ. (compress_conflict_vecs): Iterate over objects, not allocnos. (ira_add_live_range_to_object): New function. (object_range_compare_func): Renamed from allocno_range_compare_func. All callers changed. (setup_min_max_conflict_allocno_ids): For allocnos with multiple subobjects, widen the min/max range of the lowest-order object to potentially include all other such low-order objects. * ira.c (ira_bad_reload_regno_1): Iterate over allocno subobjects. (check_allocation): Likewise. Use more fine-grained tests for register conflicts. * ira-color.c (allocnos_have_intersected_live_ranges_p): Iterate over allocno subobjects. (assign_hard_reg): Keep multiple sets of conflicts. Make finer-grained choices about which bits to set in each set. Don't use ira_hard_reg_not_in_set_p, perform a more elaborate test for conflicts using the multiple sets we computed. (push_allocno_to_stack): Iterate over allocno subobjects. (all_conflicting_hard_regs_coalesced): New static function. (setup_allocno_available_regs_num): Use it. (setup_allocno_left_conflicts_size): Likewise. Iterate over allocno subobjects. (coalesced_allocno_conflict): Test subobject 0 in each allocno. (setup_allocno_priorities): Divide ALLOCNO_EXCESS_PRESSURE_POINTS_NUM by ALLOCNO_NUM_OBJECTS. (calculate_spill_cost): Likewise. (color_pass): Express if statement in a more normal way. (ira_reassign_conflict_allocnos): Iterate over allocno subobjects. (slot_coalesced_allocno_live_ranges_intersect_p): Likewise. (setup_slot_coalesced_allocno_live_ranges): Likewise. (allocno_reload_assign): Likewise. (ira_reassign_pseudos): Likewise. (fast_allocation): Likewise. * ira-conflicts.c (build_conflict_bit_table): Likewise. (print_allocno_conflicts): Likewise. (ira_build_conflicts): Likewise. (allocnos_conflict_for_copy_p): Renamed from allocnos_conflict_p. All callers changed. Test subword 0 of each allocno for conflicts. (build_object_conflicts): Renamed from build_allocno_conflicts. All callers changed. Iterate over allocno subobjects. * ira-emit.c (modify_move_list): Iterate over allocno subobjects. * ira-int.h (struct ira_allocno): New member. num_objects. Rename object to objects and change it into an array. (ALLOCNO_OBJECT): Add new argument N. (ALLOCNO_NUM_OBJECTS, OBJECT_SUBWORD): New macros. (ira_create_allocno_objects): Renamed from ira_create_allocno_object. (ior_hard_reg_conflicts): Declare. (ira_add_live_range_to_object): Declare. (ira_allocno_object_iterator): New. (ira_allocno_object_iter_init, ira_allocno_object_iter_cond): New. (FOR_EACH_ALLOCNO_OBJECT): New macro. * ira-lives.c (objects_live): Renamed from allocnos_live; all uses changed. (allocnos_processed): New sparseset. (make_object_born): Renamed from make_allocno_born; take an ira_object_t argument. All callers changed. (make_object_dead): Renamed from make_allocno_dead; take an ira_object t argument. All callers changed. (update_allocno_pressure_excess_length): Take an ira_obejct_t argument. All callers changed. (mark_pseudo_regno_live): Iterate over allocno subobjects. (mark_pseudo_regno_dead): Likewise. (mark_pseudo_regno_subword_live, mark_pseudo_regno_subword_dead): New functions. (mark_ref_live): Detect subword accesses and call mark_pseudo_regno_subword_live as appropriate. (mark_ref_dead): Likewise for mark_pseudo_regno_subword_dead. (process_bb_nodes_live): Deal with object-related updates first; set and test bits in allocnos_processed to avoid computing allocno statistics more than once. (create_start_finish_chains): Iterate over objects, not allocnos. (print_object_live_ranges): New function. (print_allocno_live_ranges): Use it. (ira_create_allocno_live_ranges): Allocate and free allocnos_processed and objects_live. From-SVN: r162418
2010-07-22 17:48:30 +02:00
objects. */
ira-int.h (struct ira_object): New. * ira-int.h (struct ira_object): New. (ira_object_t): New typedef. Add DEF_VEC_P and DEF_VEC_ALLOC_P for it. (struct ira_allocno): Remove members min, max, conflict_allocno_array, conflict_id, conflict_allocno_array_size, conflict_allocnos_num and conflict_vec_p. Add new member object. (OBJECT_CONFLICT_ARRAY, OBJECT_CONFLICT_VEC_P, OBJECT_NUM_CONFLICTS, OBJECT_CONFLICT_ARRAY_SIZE, OBJECT_CONFLICT_HARD_REGS, OBJECT_TOTAL_CONFLICT_HARD_REGS, OBJECT_MIN, OBJECT_MAX, OBJECT_CONFLICT_ID): Renamed from ALLOCNO_CONFLICT_ALLOCNO_ARRAY, ALLOCNO_CONFLICT_VEC_P, ALLOCNO_CONFLICT_ALLOCNOS_NUM, ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE, ALLOCNO_CONFLICT_HARD_REGS, ALLOCNO_TOTAL_CONFLICT_HARD_REGS) ALLOCNO_MIN, ALLOCNO_MAX, and ALLOCNO_CONFLICT_ID; now operate on an ira_object_t rather than ira_allocno_t. All uses changed. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_objects_num): Declare variable. (ira_create_allocno_object): Declare function. (ira_conflict_vector_profitable_p): Adjust prototype. (ira_allocate_conflict_vec): Renamed from ira_allocate_allocno_conflict_vec; first arg now ira_object_t. (ira_allocate_object_conflicts): Renamed from ira_allocate_allocno_conflicts; first arg now ira_object_t. (struct ira_object_iterator): New. (ira_object_iter_init, ira_object_iter_cond, FOR_EACH_OBJECT): New. (ira_allocno_conflict_iterator): Renamed member allocno_conflict_vec_p to conflict_vec_p. All uses changed. (ira_allocno_conflict_iter_init, ira_allocno_conflict_iter_cond): Changed to take into account that conflicts are now tracked for objects. * ira-conflicts.c (OBJECTS_CONFLICT_P): Renamed from CONFLICT_ALLOCNO_P. Args changed to accept ira_object_t. All uses changed. (allocnos_conflict_p): New static function. (collected_conflict_objects): Renamed from collected_allocno_objects; now a vector of ira_object_t. All uses changed. (build_conflict_bit_table): Changed to take into account that conflicts are now tracked for objects. (process_regs_for_copy, propagate_copies, build_allocno_conflicts) (print_allocno_conflicts, ira_build_conflicts): Likewise. * ira-color.c (assign_hard_reg, setup_allocno_available_regs_num) setup_allocno_left_conflicts_size, allocno_reload_assign, fast_allocation): Likewise. * ira-lives.c (make_hard_regno_born, make_allocno_born) process_single_reg_class_operands, process_bb_node_lives): Likewise. * ira-emit.c (modify_move_list, add_range_and_copies_from_move_list): Likewise. * ira-build.c (ira_objects_num): New variable. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_object_id_map_vec): Corresponding change. (object_pool): New static variable. (initiate_allocnos): Initialize it. (finish_allocnos): Free it. (ira_create_object, ira_create_allocno_object, create_allocno_objects): New functions. (ira_create_allocno): Don't set members that were removed. (ira_set_allocno_cover_class): Don't change conflict hard regs. (merge_hard_reg_conflicts): Changed to take into account that conflicts are now tracked for objects. (ira_conflict_vector_profitable_p, ira_allocate_conflict_vec, allocate_conflict_bit_vec, ira_allocate_object_conflicts, compress_conflict_vecs, remove_low_level_allocnos, ira_flattening, setup_min_max_allocno_live_range_point, allocno_range_compare_func, setup_min_max_conflict_allocno_ids, ): Likewise. ((add_to_conflicts): Renamed from add_to_allocno_conflicts, args changed to ira_object_t; all callers changed. (ira_add_conflict): Renamed from ira_add_allocno_conflict, args changed to ira_object_t, all callers changed. (clear_conflicts): Renamed from clear_allocno_conflicts, arg changed to ira_object_t, all callers changed. (conflict_check, curr_conflict_check_tick): Renamed from allocno_conflict_check and curr_allocno_conflict_check_tick; all uses changed. (compress_conflict_vec): Renamed from compress_allocno_conflict_vec, arg changed to ira_object_t, all callers changed. (create_cap_allocno): Call ira_create_allocno_object. (finish_allocno): Free the corresponding object. (sort_conflict_id_map): Renamed from sort_conflict_id_allocno_map; all callers changed. Adjusted for dealing with objects. (ira_build): Call create_allocno_objects after ira_costs. Adjusted for dealing with objects. * ira.c (ira_bad_reload_regno_1): Adjusted for dealing with objects. From-SVN: r162166
2010-07-14 03:53:35 +02:00
int num_accumulated_conflicts;
/* TRUE if conflicts are represented by a vector of pointers to
ira_object structures. Otherwise, we use a bit vector indexed
by conflict ID numbers. */
unsigned int conflict_vec_p : 1;
};
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
/* A structure representing an allocno (allocation entity). Allocno
represents a pseudo-register in an allocation region. If
pseudo-register does not live in a region but it lives in the
nested regions, it is represented in the region by special allocno
called *cap*. There may be more one cap representing the same
pseudo-register in region. It means that the corresponding
pseudo-register lives in more one non-intersected subregion. */
struct ira_allocno
{
/* The allocno order number starting with 0. Each allocno has an
unique number and the number is never changed for the
allocno. */
int num;
/* Regno for allocno or cap. */
int regno;
/* Mode of the allocno which is the mode of the corresponding
pseudo-register. */
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
ENUM_BITFIELD (machine_mode) mode : 8;
/* Widest mode of the allocno which in at least one case could be
for paradoxical subregs where wmode > mode. */
ENUM_BITFIELD (machine_mode) wmode : 8;
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
/* Register class which should be used for allocation for given
allocno. NO_REGS means that we should use memory. */
ENUM_BITFIELD (reg_class) aclass : 16;
/* During the reload, value TRUE means that we should not reassign a
hard register to the allocno got memory earlier. It is set up
when we removed memory-memory move insn before each iteration of
the reload. */
unsigned int dont_reassign_p : 1;
#ifdef STACK_REGS
/* Set to TRUE if allocno can't be assigned to the stack hard
register correspondingly in this region and area including the
region and all its subregions recursively. */
unsigned int no_stack_reg_p : 1, total_no_stack_reg_p : 1;
#endif
/* TRUE value means that there is no sense to spill the allocno
during coloring because the spill will result in additional
reloads in reload pass. */
unsigned int bad_spill_p : 1;
/* TRUE if a hard register or memory has been assigned to the
allocno. */
unsigned int assigned_p : 1;
/* TRUE if conflicts for given allocno are represented by vector of
pointers to the conflicting allocnos. Otherwise, we use a bit
vector where a bit with given index represents allocno with the
same number. */
unsigned int conflict_vec_p : 1;
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
/* Hard register assigned to given allocno. Negative value means
that memory was allocated to the allocno. During the reload,
spilled allocno has value equal to the corresponding stack slot
number (0, ...) - 2. Value -1 is used for allocnos spilled by the
reload (at this point pseudo-register has only one allocno) which
did not get stack slot yet. */
signed int hard_regno : 16;
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
/* Allocnos with the same regno are linked by the following member.
Allocnos corresponding to inner loops are first in the list (it
corresponds to depth-first traverse of the loops). */
ira_allocno_t next_regno_allocno;
/* There may be different allocnos with the same regno in different
regions. Allocnos are bound to the corresponding loop tree node.
Pseudo-register may have only one regular allocno with given loop
tree node but more than one cap (see comments above). */
ira_loop_tree_node_t loop_tree_node;
/* Accumulated usage references of the allocno. Here and below,
word 'accumulated' means info for given region and all nested
subregions. In this case, 'accumulated' means sum of references
of the corresponding pseudo-register in this region and in all
nested subregions recursively. */
int nrefs;
/* Accumulated frequency of usage of the allocno. */
int freq;
/* Minimal accumulated and updated costs of usage register of the
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
allocno class. */
int class_cost, updated_class_cost;
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
/* Minimal accumulated, and updated costs of memory for the allocno.
At the allocation start, the original and updated costs are
equal. The updated cost may be changed after finishing
allocation in a region and starting allocation in a subregion.
The change reflects the cost of spill/restore code on the
subregion border if we assign memory to the pseudo in the
subregion. */
int memory_cost, updated_memory_cost;
/* Accumulated number of points where the allocno lives and there is
excess pressure for its class. Excess pressure for a register
class at some point means that there are more allocnos of given
register class living at the point than number of hard-registers
of the class available for the allocation. */
int excess_pressure_points_num;
regmove.c: Remove. 2013-10-30 Vladimir Makarov <vmakarov@redhat.com> * regmove.c: Remove. * tree-pass.h (make_pass_regmove): Remove. * timevar.def (TV_REGMOVE): Remove. * passes.def (pass_regmove): Remove. * opts.c (default_options_table): Remove entry for regmove. * doc/passes.texi: Remove regmove pass description. * doc/invoke.texi (-foptimize-register-move, -fregmove): Remove options. (-fdump-rtl-regmove): Ditto. * common.opt (foptimize-register-move, fregmove): Ignore. * Makefile.in (OBJS): Remove regmove.o. * regmove.c: Remove. * ira-int.h (struct ira_allocno_pref, ira_pref_t): New structure and type. (struct ira_allocno) New member allocno_prefs. (ALLOCNO_PREFS): New macro. (ira_prefs, ira_prefs_num): New external vars. (ira_setup_alts, ira_get_dup_out_num, ira_debug_pref): New prototypes. (ira_debug_prefs, ira_debug_allocno_prefs, ira_create_pref): Ditto. (ira_add_allocno_pref, ira_remove_pref, ira_remove_allocno_prefs): Ditto. (ira_add_allocno_copy_to_list): Remove prototype. (ira_swap_allocno_copy_ends_if_necessary): Ditto. (ira_pref_iterator): New type. (ira_pref_iter_init, ira_pref_iter_cond): New functions. (FOR_EACH_PREF): New macro. * ira.c (commutative_constraint_p): Move from ira-conflicts.c. (ira_get_dup_out_num): Ditto. Rename from get_dup_num. Modify the code. (ira_setup_alts): New function. (decrease_live_ranges_number): New function. (ira): Call the above function. * ira-build.c (ira_prefs, ira_prefs_num): New global vars. (ira_create_allocno): Initialize allocno prefs. (pref_pool, pref_vec): New static vars. (initiate_prefs, find_allocno_pref, ira_create_pref): New functions. (add_allocno_pref_to_list, ira_add_allocno_pref, print_pref): Ditto. (ira_debug_pref, print_prefs, ira_debug_prefs): Ditto. (print_allocno_prefs, ira_debug_allocno_prefs, finish_pref): Ditto. (ira_remove_pref, ira_remove_allocno_prefs, finish_prefs): Ditto. (ira_add_allocno_copy_to_list): Make static. Rename to add_allocno_copy_to_list. (ira_swap_allocno_copy_ends_if_necessary): Make static. Rename to swap_allocno_copy_ends_if_necessary. (remove_unnecessary_allocnos, remove_low_level_allocnos): Call ira_remove_allocno_prefs. (ira_flattening): Ditto. (ira_build): Call initiate_prefs, print_prefs. (ira_destroy): Call finish_prefs. * ira-color.c (struct update_cost_record): New. (struct allocno_color_data): Add new member update_cost_records. (update_cost_record_pool): New static var. (init_update_cost_records, get_update_cost_record): New functions. (free_update_cost_record_list, finish_update_cost_records): Ditto. (struct update_cost_queue_elem): Add member from. (initiate_cost_update): Call init_update_cost_records. (finish_cost_update): Call finish_update_cost_records. (queue_update_cost, get_next_update_cost): Add new param from. (Update_allocno_cost, update_costs_from_allocno): New functions. (update_costs_from_prefs): Ditto. (update_copy_costs): Rename to update_costs_from_copies. (restore_costs_from_copies): New function. (update_conflict_hard_regno_costs): Don't go back. (assign_hard_reg): Call restore_costs_from_copies. Add printing more debug info. (pop_allocnos): Add priniting more debug info. (color_allocnos): Remove prefs for conflicting hard regs. Call update_costs_from_prefs. * ira-conflicts.c (commutative_constraint_p): Move to ira.c (get_dup_num): Rename, modify, and move to ira.c (process_regs_for_copy): Add prefs. (add_insn_allocno_copies): Put src as first arg of process_regs_for_copy. Remove dead code. Call ira_setup_alts. * ira-costs.c (record_reg_classes): Modify and move code into record_operands_costs. (find_costs_and_classes): Create prefs for the hard reg of small reg class. (process_bb_node_for_hard_reg_moves): Add prefs. 2013-10-30 Vladimir Makarov <vmakarov@redhat.com> * gcc.target/i386/fma_double_3.c: Use pattern for scan-assembler-times instead of just one insn name. * gcc.target/i386/fma_double_5.c: Ditto. * gcc.target/i386/fma_float_3.c: Ditto. * gcc.target/i386/fma_float_5.c: Ditto. * gcc.target/i386/l_fma_double_1.c: Ditto. * gcc.target/i386/l_fma_double_2.c: Ditto. * gcc.target/i386/l_fma_double_3.c: Ditto. * gcc.target/i386/l_fma_double_4.c: Ditto. * gcc.target/i386/l_fma_double_5.c: Ditto. * gcc.target/i386/l_fma_double_6.c: Ditto. * gcc.target/i386/l_fma_float_1.c: Ditto. * gcc.target/i386/l_fma_float_2.c: Ditto. * gcc.target/i386/l_fma_float_3.c: Ditto. * gcc.target/i386/l_fma_float_4.c: Ditto. * gcc.target/i386/l_fma_float_5.c: Ditto. * gcc.target/i386/l_fma_float_6.c: Ditto. From-SVN: r204212
2013-10-30 15:27:25 +01:00
/* Allocno hard reg preferences. */
ira_pref_t allocno_prefs;
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
/* Copies to other non-conflicting allocnos. The copies can
represent move insn or potential move insn usually because of two
operand insn constraints. */
ira_copy_t allocno_copies;
/* It is a allocno (cap) representing given allocno on upper loop tree
level. */
ira_allocno_t cap;
/* It is a link to allocno (cap) on lower loop level represented by
given cap. Null if given allocno is not a cap. */
ira_allocno_t cap_member;
ira-build.c (ira_create_object): New arg SUBWORD; all callers changed. * ira-build.c (ira_create_object): New arg SUBWORD; all callers changed. Initialize OBJECT_SUBWORD. (ira_create_allocno): Clear ALLOCNO_NUM_OBJECTS. (ira_create_allocno_objects): Renamed from ira_create_allocno_object; all callers changed. (merge_hard_reg_conflicts): Iterate over allocno subobjects. (finish_allocno): Likewise. (move_allocno_live_ranges, copy_allocno_live_ranges): Likewise. (remove_low_level_allocnos): Likewise. (update_bad_spill_attribute): Likewise. (setup_min_max_allocno_live_range_point): Likewise. (sort_conflict_id_map): Likewise. (ira_flattening): Likewise. Use ior_hard_reg_conflicts. (ior_hard_reg_conflicts): New function. (ior_allocate_object_conflicts): Renamed first argument to OBJ. (compress_conflict_vecs): Iterate over objects, not allocnos. (ira_add_live_range_to_object): New function. (object_range_compare_func): Renamed from allocno_range_compare_func. All callers changed. (setup_min_max_conflict_allocno_ids): For allocnos with multiple subobjects, widen the min/max range of the lowest-order object to potentially include all other such low-order objects. * ira.c (ira_bad_reload_regno_1): Iterate over allocno subobjects. (check_allocation): Likewise. Use more fine-grained tests for register conflicts. * ira-color.c (allocnos_have_intersected_live_ranges_p): Iterate over allocno subobjects. (assign_hard_reg): Keep multiple sets of conflicts. Make finer-grained choices about which bits to set in each set. Don't use ira_hard_reg_not_in_set_p, perform a more elaborate test for conflicts using the multiple sets we computed. (push_allocno_to_stack): Iterate over allocno subobjects. (all_conflicting_hard_regs_coalesced): New static function. (setup_allocno_available_regs_num): Use it. (setup_allocno_left_conflicts_size): Likewise. Iterate over allocno subobjects. (coalesced_allocno_conflict): Test subobject 0 in each allocno. (setup_allocno_priorities): Divide ALLOCNO_EXCESS_PRESSURE_POINTS_NUM by ALLOCNO_NUM_OBJECTS. (calculate_spill_cost): Likewise. (color_pass): Express if statement in a more normal way. (ira_reassign_conflict_allocnos): Iterate over allocno subobjects. (slot_coalesced_allocno_live_ranges_intersect_p): Likewise. (setup_slot_coalesced_allocno_live_ranges): Likewise. (allocno_reload_assign): Likewise. (ira_reassign_pseudos): Likewise. (fast_allocation): Likewise. * ira-conflicts.c (build_conflict_bit_table): Likewise. (print_allocno_conflicts): Likewise. (ira_build_conflicts): Likewise. (allocnos_conflict_for_copy_p): Renamed from allocnos_conflict_p. All callers changed. Test subword 0 of each allocno for conflicts. (build_object_conflicts): Renamed from build_allocno_conflicts. All callers changed. Iterate over allocno subobjects. * ira-emit.c (modify_move_list): Iterate over allocno subobjects. * ira-int.h (struct ira_allocno): New member. num_objects. Rename object to objects and change it into an array. (ALLOCNO_OBJECT): Add new argument N. (ALLOCNO_NUM_OBJECTS, OBJECT_SUBWORD): New macros. (ira_create_allocno_objects): Renamed from ira_create_allocno_object. (ior_hard_reg_conflicts): Declare. (ira_add_live_range_to_object): Declare. (ira_allocno_object_iterator): New. (ira_allocno_object_iter_init, ira_allocno_object_iter_cond): New. (FOR_EACH_ALLOCNO_OBJECT): New macro. * ira-lives.c (objects_live): Renamed from allocnos_live; all uses changed. (allocnos_processed): New sparseset. (make_object_born): Renamed from make_allocno_born; take an ira_object_t argument. All callers changed. (make_object_dead): Renamed from make_allocno_dead; take an ira_object t argument. All callers changed. (update_allocno_pressure_excess_length): Take an ira_obejct_t argument. All callers changed. (mark_pseudo_regno_live): Iterate over allocno subobjects. (mark_pseudo_regno_dead): Likewise. (mark_pseudo_regno_subword_live, mark_pseudo_regno_subword_dead): New functions. (mark_ref_live): Detect subword accesses and call mark_pseudo_regno_subword_live as appropriate. (mark_ref_dead): Likewise for mark_pseudo_regno_subword_dead. (process_bb_nodes_live): Deal with object-related updates first; set and test bits in allocnos_processed to avoid computing allocno statistics more than once. (create_start_finish_chains): Iterate over objects, not allocnos. (print_object_live_ranges): New function. (print_allocno_live_ranges): Use it. (ira_create_allocno_live_ranges): Allocate and free allocnos_processed and objects_live. From-SVN: r162418
2010-07-22 17:48:30 +02:00
/* The number of objects tracked in the following array. */
int num_objects;
/* An array of structures describing conflict information and live
ranges for each object associated with the allocno. There may be
more than one such object in cases where the allocno represents a
multi-word register. */
ira_object_t objects[2];
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
/* Accumulated frequency of calls which given allocno
intersects. */
int call_freq;
/* Accumulated number of the intersected calls. */
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
int calls_crossed_num;
attribs.c (decl_attributes): Avoid emitting a warning if ATTR_FLAG_BUILT_IN. * attribs.c (decl_attributes): Avoid emitting a warning if ATTR_FLAG_BUILT_IN. * doc/rtl.texi (CALL_INSN_FUNCTION_USAGE): Use lowercase for rtx codes. Document meaning of sets inside CALL_INSN_FUNCTION_USAGE. * c-family/c-common.c (DEF_ATTR_STRING): Define and undefine as necessary. * builtin-attrs.def (DEF_ATTR_FOR_STRING): Define. Use it to define a string "1". (ATTR_RET1_NOTHROW_NONNULL_LEAF): New attr definition. * builtins.def (BUILT_IN_MEMCPY, BUILT_IN_MEMMOVE, BUILT_IN_MEMSET, BUILT_IN_STRCPY): Use it for these functions. * postreload.c (reload_combine): Deal with SETs inside CALL_INSN_FUNCTION_USAGE. * caller-save.c (setup_save_areas, save_call_clobbered_regs): Look for REG_RETURNED notes and use a cheap restore if possible. * ira-int.h (struct ira_allocno): New member cheap_calls_crossed_num. (ALLOCNO_CHEAP_CALLS_CROSSED_NUM): New macro. * ira-build.c (ira_create_allocno, create_cap_allocno, propagate_allocno_info, propagate_some_info_from_allocno, copy_info_to_removed_store_destination, ira_flattening): Handle it. * ira-lives.c (pseudo_regno_single_word_and_live_p, find_call_crossed_cheap_reg): New static functions. (process_bb_node_lives): Look for SETs in CALL_INSN_FUNCTION_USAGE, and set ALLOCNO_CHEAP_CALLS_CROSSED_NUM if possible. Also make a REG_RETURNED note in that case. * ira.c (setup_reg_renumber): Change assert to allow cases where allocnos only cross calls for which they are cheap to restore. * ira-costs.c (ira_tune_allocno_costs): Compare ALLOCNO_CALLS_CROSSED_NUM to ALLOCNO_CHEAP_CALLS_CROSSED_NUM rather than 0. * reg-notes.def (REG_RETURNED): New note. * cse.c (cse_insn): Likewise. * sched-deps.c (sched_analyze_insn): Likewise. * expr.c (init_block_move_fn): Set a "fn spec" attribute. * calls.c (decl_return_flags): New static function. (expand_call): Generate a SET in CALL_INSN_FUNCTION_USAGE for functions that return one of their arguments. * lto/lto-lang.c (handle_fnspec_attribute): New static function. (lto_attribute_table): Add "fn spec". (DEF_ATTR_STRING): Define and undefine along with the other macros. * regcprop.c (struct kill_set_value_data): New. (kill_set_value): Interpret data as a pointer to such a struct. Do nothing if the caller wants the register to be ignored. (copyprop_hardreg_forward_1): Handle SETs in CALL_INSN_FUNCTION_USAGE. testsuite/ * gcc.target/i386/retarg.c: New test. From-SVN: r187459
2012-05-14 14:08:31 +02:00
/* The number of calls across which it is live, but which should not
affect register preferences. */
int cheap_calls_crossed_num;
/* Registers clobbered by intersected calls. */
HARD_REG_SET crossed_calls_clobbered_regs;
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
/* Array of usage costs (accumulated and the one updated during
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
coloring) for each hard register of the allocno class. The
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
member value can be NULL if all costs are the same and equal to
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
CLASS_COST. For example, the costs of two different hard
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
registers can be different if one hard register is callee-saved
and another one is callee-used and the allocno lives through
calls. Another example can be case when for some insn the
corresponding pseudo-register value should be put in specific
register class (e.g. AREG for x86) which is a strict subset of
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
the allocno class (GENERAL_REGS for x86). We have updated costs
to reflect the situation when the usage cost of a hard register
is decreased because the allocno is connected to another allocno
by a copy and the another allocno has been assigned to the hard
register. */
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
int *hard_reg_costs, *updated_hard_reg_costs;
/* Array of decreasing costs (accumulated and the one updated during
coloring) for allocnos conflicting with given allocno for hard
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
regno of the allocno class. The member value can be NULL if all
costs are the same. These costs are used to reflect preferences
of other allocnos not assigned yet during assigning to given
allocno. */
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
int *conflict_hard_reg_costs, *updated_conflict_hard_reg_costs;
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
/* Different additional data. It is used to decrease size of
allocno data footprint. */
void *add_data;
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
};
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
/* All members of the allocno structures should be accessed only
through the following macros. */
#define ALLOCNO_NUM(A) ((A)->num)
#define ALLOCNO_REGNO(A) ((A)->regno)
#define ALLOCNO_REG(A) ((A)->reg)
#define ALLOCNO_NEXT_REGNO_ALLOCNO(A) ((A)->next_regno_allocno)
#define ALLOCNO_LOOP_TREE_NODE(A) ((A)->loop_tree_node)
#define ALLOCNO_CAP(A) ((A)->cap)
#define ALLOCNO_CAP_MEMBER(A) ((A)->cap_member)
#define ALLOCNO_NREFS(A) ((A)->nrefs)
#define ALLOCNO_FREQ(A) ((A)->freq)
#define ALLOCNO_HARD_REGNO(A) ((A)->hard_regno)
#define ALLOCNO_CALL_FREQ(A) ((A)->call_freq)
#define ALLOCNO_CALLS_CROSSED_NUM(A) ((A)->calls_crossed_num)
attribs.c (decl_attributes): Avoid emitting a warning if ATTR_FLAG_BUILT_IN. * attribs.c (decl_attributes): Avoid emitting a warning if ATTR_FLAG_BUILT_IN. * doc/rtl.texi (CALL_INSN_FUNCTION_USAGE): Use lowercase for rtx codes. Document meaning of sets inside CALL_INSN_FUNCTION_USAGE. * c-family/c-common.c (DEF_ATTR_STRING): Define and undefine as necessary. * builtin-attrs.def (DEF_ATTR_FOR_STRING): Define. Use it to define a string "1". (ATTR_RET1_NOTHROW_NONNULL_LEAF): New attr definition. * builtins.def (BUILT_IN_MEMCPY, BUILT_IN_MEMMOVE, BUILT_IN_MEMSET, BUILT_IN_STRCPY): Use it for these functions. * postreload.c (reload_combine): Deal with SETs inside CALL_INSN_FUNCTION_USAGE. * caller-save.c (setup_save_areas, save_call_clobbered_regs): Look for REG_RETURNED notes and use a cheap restore if possible. * ira-int.h (struct ira_allocno): New member cheap_calls_crossed_num. (ALLOCNO_CHEAP_CALLS_CROSSED_NUM): New macro. * ira-build.c (ira_create_allocno, create_cap_allocno, propagate_allocno_info, propagate_some_info_from_allocno, copy_info_to_removed_store_destination, ira_flattening): Handle it. * ira-lives.c (pseudo_regno_single_word_and_live_p, find_call_crossed_cheap_reg): New static functions. (process_bb_node_lives): Look for SETs in CALL_INSN_FUNCTION_USAGE, and set ALLOCNO_CHEAP_CALLS_CROSSED_NUM if possible. Also make a REG_RETURNED note in that case. * ira.c (setup_reg_renumber): Change assert to allow cases where allocnos only cross calls for which they are cheap to restore. * ira-costs.c (ira_tune_allocno_costs): Compare ALLOCNO_CALLS_CROSSED_NUM to ALLOCNO_CHEAP_CALLS_CROSSED_NUM rather than 0. * reg-notes.def (REG_RETURNED): New note. * cse.c (cse_insn): Likewise. * sched-deps.c (sched_analyze_insn): Likewise. * expr.c (init_block_move_fn): Set a "fn spec" attribute. * calls.c (decl_return_flags): New static function. (expand_call): Generate a SET in CALL_INSN_FUNCTION_USAGE for functions that return one of their arguments. * lto/lto-lang.c (handle_fnspec_attribute): New static function. (lto_attribute_table): Add "fn spec". (DEF_ATTR_STRING): Define and undefine along with the other macros. * regcprop.c (struct kill_set_value_data): New. (kill_set_value): Interpret data as a pointer to such a struct. Do nothing if the caller wants the register to be ignored. (copyprop_hardreg_forward_1): Handle SETs in CALL_INSN_FUNCTION_USAGE. testsuite/ * gcc.target/i386/retarg.c: New test. From-SVN: r187459
2012-05-14 14:08:31 +02:00
#define ALLOCNO_CHEAP_CALLS_CROSSED_NUM(A) ((A)->cheap_calls_crossed_num)
#define ALLOCNO_CROSSED_CALLS_CLOBBERED_REGS(A) \
((A)->crossed_calls_clobbered_regs)
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
#define ALLOCNO_MEM_OPTIMIZED_DEST(A) ((A)->mem_optimized_dest)
#define ALLOCNO_MEM_OPTIMIZED_DEST_P(A) ((A)->mem_optimized_dest_p)
#define ALLOCNO_SOMEWHERE_RENAMED_P(A) ((A)->somewhere_renamed_p)
#define ALLOCNO_CHILD_RENAMED_P(A) ((A)->child_renamed_p)
#define ALLOCNO_DONT_REASSIGN_P(A) ((A)->dont_reassign_p)
#ifdef STACK_REGS
#define ALLOCNO_NO_STACK_REG_P(A) ((A)->no_stack_reg_p)
#define ALLOCNO_TOTAL_NO_STACK_REG_P(A) ((A)->total_no_stack_reg_p)
#endif
#define ALLOCNO_BAD_SPILL_P(A) ((A)->bad_spill_p)
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
#define ALLOCNO_ASSIGNED_P(A) ((A)->assigned_p)
#define ALLOCNO_MODE(A) ((A)->mode)
#define ALLOCNO_WMODE(A) ((A)->wmode)
regmove.c: Remove. 2013-10-30 Vladimir Makarov <vmakarov@redhat.com> * regmove.c: Remove. * tree-pass.h (make_pass_regmove): Remove. * timevar.def (TV_REGMOVE): Remove. * passes.def (pass_regmove): Remove. * opts.c (default_options_table): Remove entry for regmove. * doc/passes.texi: Remove regmove pass description. * doc/invoke.texi (-foptimize-register-move, -fregmove): Remove options. (-fdump-rtl-regmove): Ditto. * common.opt (foptimize-register-move, fregmove): Ignore. * Makefile.in (OBJS): Remove regmove.o. * regmove.c: Remove. * ira-int.h (struct ira_allocno_pref, ira_pref_t): New structure and type. (struct ira_allocno) New member allocno_prefs. (ALLOCNO_PREFS): New macro. (ira_prefs, ira_prefs_num): New external vars. (ira_setup_alts, ira_get_dup_out_num, ira_debug_pref): New prototypes. (ira_debug_prefs, ira_debug_allocno_prefs, ira_create_pref): Ditto. (ira_add_allocno_pref, ira_remove_pref, ira_remove_allocno_prefs): Ditto. (ira_add_allocno_copy_to_list): Remove prototype. (ira_swap_allocno_copy_ends_if_necessary): Ditto. (ira_pref_iterator): New type. (ira_pref_iter_init, ira_pref_iter_cond): New functions. (FOR_EACH_PREF): New macro. * ira.c (commutative_constraint_p): Move from ira-conflicts.c. (ira_get_dup_out_num): Ditto. Rename from get_dup_num. Modify the code. (ira_setup_alts): New function. (decrease_live_ranges_number): New function. (ira): Call the above function. * ira-build.c (ira_prefs, ira_prefs_num): New global vars. (ira_create_allocno): Initialize allocno prefs. (pref_pool, pref_vec): New static vars. (initiate_prefs, find_allocno_pref, ira_create_pref): New functions. (add_allocno_pref_to_list, ira_add_allocno_pref, print_pref): Ditto. (ira_debug_pref, print_prefs, ira_debug_prefs): Ditto. (print_allocno_prefs, ira_debug_allocno_prefs, finish_pref): Ditto. (ira_remove_pref, ira_remove_allocno_prefs, finish_prefs): Ditto. (ira_add_allocno_copy_to_list): Make static. Rename to add_allocno_copy_to_list. (ira_swap_allocno_copy_ends_if_necessary): Make static. Rename to swap_allocno_copy_ends_if_necessary. (remove_unnecessary_allocnos, remove_low_level_allocnos): Call ira_remove_allocno_prefs. (ira_flattening): Ditto. (ira_build): Call initiate_prefs, print_prefs. (ira_destroy): Call finish_prefs. * ira-color.c (struct update_cost_record): New. (struct allocno_color_data): Add new member update_cost_records. (update_cost_record_pool): New static var. (init_update_cost_records, get_update_cost_record): New functions. (free_update_cost_record_list, finish_update_cost_records): Ditto. (struct update_cost_queue_elem): Add member from. (initiate_cost_update): Call init_update_cost_records. (finish_cost_update): Call finish_update_cost_records. (queue_update_cost, get_next_update_cost): Add new param from. (Update_allocno_cost, update_costs_from_allocno): New functions. (update_costs_from_prefs): Ditto. (update_copy_costs): Rename to update_costs_from_copies. (restore_costs_from_copies): New function. (update_conflict_hard_regno_costs): Don't go back. (assign_hard_reg): Call restore_costs_from_copies. Add printing more debug info. (pop_allocnos): Add priniting more debug info. (color_allocnos): Remove prefs for conflicting hard regs. Call update_costs_from_prefs. * ira-conflicts.c (commutative_constraint_p): Move to ira.c (get_dup_num): Rename, modify, and move to ira.c (process_regs_for_copy): Add prefs. (add_insn_allocno_copies): Put src as first arg of process_regs_for_copy. Remove dead code. Call ira_setup_alts. * ira-costs.c (record_reg_classes): Modify and move code into record_operands_costs. (find_costs_and_classes): Create prefs for the hard reg of small reg class. (process_bb_node_for_hard_reg_moves): Add prefs. 2013-10-30 Vladimir Makarov <vmakarov@redhat.com> * gcc.target/i386/fma_double_3.c: Use pattern for scan-assembler-times instead of just one insn name. * gcc.target/i386/fma_double_5.c: Ditto. * gcc.target/i386/fma_float_3.c: Ditto. * gcc.target/i386/fma_float_5.c: Ditto. * gcc.target/i386/l_fma_double_1.c: Ditto. * gcc.target/i386/l_fma_double_2.c: Ditto. * gcc.target/i386/l_fma_double_3.c: Ditto. * gcc.target/i386/l_fma_double_4.c: Ditto. * gcc.target/i386/l_fma_double_5.c: Ditto. * gcc.target/i386/l_fma_double_6.c: Ditto. * gcc.target/i386/l_fma_float_1.c: Ditto. * gcc.target/i386/l_fma_float_2.c: Ditto. * gcc.target/i386/l_fma_float_3.c: Ditto. * gcc.target/i386/l_fma_float_4.c: Ditto. * gcc.target/i386/l_fma_float_5.c: Ditto. * gcc.target/i386/l_fma_float_6.c: Ditto. From-SVN: r204212
2013-10-30 15:27:25 +01:00
#define ALLOCNO_PREFS(A) ((A)->allocno_prefs)
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
#define ALLOCNO_COPIES(A) ((A)->allocno_copies)
#define ALLOCNO_HARD_REG_COSTS(A) ((A)->hard_reg_costs)
#define ALLOCNO_UPDATED_HARD_REG_COSTS(A) ((A)->updated_hard_reg_costs)
#define ALLOCNO_CONFLICT_HARD_REG_COSTS(A) \
((A)->conflict_hard_reg_costs)
#define ALLOCNO_UPDATED_CONFLICT_HARD_REG_COSTS(A) \
((A)->updated_conflict_hard_reg_costs)
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
#define ALLOCNO_CLASS(A) ((A)->aclass)
#define ALLOCNO_CLASS_COST(A) ((A)->class_cost)
#define ALLOCNO_UPDATED_CLASS_COST(A) ((A)->updated_class_cost)
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
#define ALLOCNO_MEMORY_COST(A) ((A)->memory_cost)
#define ALLOCNO_UPDATED_MEMORY_COST(A) ((A)->updated_memory_cost)
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
#define ALLOCNO_EXCESS_PRESSURE_POINTS_NUM(A) \
((A)->excess_pressure_points_num)
ira-build.c (ira_create_object): New arg SUBWORD; all callers changed. * ira-build.c (ira_create_object): New arg SUBWORD; all callers changed. Initialize OBJECT_SUBWORD. (ira_create_allocno): Clear ALLOCNO_NUM_OBJECTS. (ira_create_allocno_objects): Renamed from ira_create_allocno_object; all callers changed. (merge_hard_reg_conflicts): Iterate over allocno subobjects. (finish_allocno): Likewise. (move_allocno_live_ranges, copy_allocno_live_ranges): Likewise. (remove_low_level_allocnos): Likewise. (update_bad_spill_attribute): Likewise. (setup_min_max_allocno_live_range_point): Likewise. (sort_conflict_id_map): Likewise. (ira_flattening): Likewise. Use ior_hard_reg_conflicts. (ior_hard_reg_conflicts): New function. (ior_allocate_object_conflicts): Renamed first argument to OBJ. (compress_conflict_vecs): Iterate over objects, not allocnos. (ira_add_live_range_to_object): New function. (object_range_compare_func): Renamed from allocno_range_compare_func. All callers changed. (setup_min_max_conflict_allocno_ids): For allocnos with multiple subobjects, widen the min/max range of the lowest-order object to potentially include all other such low-order objects. * ira.c (ira_bad_reload_regno_1): Iterate over allocno subobjects. (check_allocation): Likewise. Use more fine-grained tests for register conflicts. * ira-color.c (allocnos_have_intersected_live_ranges_p): Iterate over allocno subobjects. (assign_hard_reg): Keep multiple sets of conflicts. Make finer-grained choices about which bits to set in each set. Don't use ira_hard_reg_not_in_set_p, perform a more elaborate test for conflicts using the multiple sets we computed. (push_allocno_to_stack): Iterate over allocno subobjects. (all_conflicting_hard_regs_coalesced): New static function. (setup_allocno_available_regs_num): Use it. (setup_allocno_left_conflicts_size): Likewise. Iterate over allocno subobjects. (coalesced_allocno_conflict): Test subobject 0 in each allocno. (setup_allocno_priorities): Divide ALLOCNO_EXCESS_PRESSURE_POINTS_NUM by ALLOCNO_NUM_OBJECTS. (calculate_spill_cost): Likewise. (color_pass): Express if statement in a more normal way. (ira_reassign_conflict_allocnos): Iterate over allocno subobjects. (slot_coalesced_allocno_live_ranges_intersect_p): Likewise. (setup_slot_coalesced_allocno_live_ranges): Likewise. (allocno_reload_assign): Likewise. (ira_reassign_pseudos): Likewise. (fast_allocation): Likewise. * ira-conflicts.c (build_conflict_bit_table): Likewise. (print_allocno_conflicts): Likewise. (ira_build_conflicts): Likewise. (allocnos_conflict_for_copy_p): Renamed from allocnos_conflict_p. All callers changed. Test subword 0 of each allocno for conflicts. (build_object_conflicts): Renamed from build_allocno_conflicts. All callers changed. Iterate over allocno subobjects. * ira-emit.c (modify_move_list): Iterate over allocno subobjects. * ira-int.h (struct ira_allocno): New member. num_objects. Rename object to objects and change it into an array. (ALLOCNO_OBJECT): Add new argument N. (ALLOCNO_NUM_OBJECTS, OBJECT_SUBWORD): New macros. (ira_create_allocno_objects): Renamed from ira_create_allocno_object. (ior_hard_reg_conflicts): Declare. (ira_add_live_range_to_object): Declare. (ira_allocno_object_iterator): New. (ira_allocno_object_iter_init, ira_allocno_object_iter_cond): New. (FOR_EACH_ALLOCNO_OBJECT): New macro. * ira-lives.c (objects_live): Renamed from allocnos_live; all uses changed. (allocnos_processed): New sparseset. (make_object_born): Renamed from make_allocno_born; take an ira_object_t argument. All callers changed. (make_object_dead): Renamed from make_allocno_dead; take an ira_object t argument. All callers changed. (update_allocno_pressure_excess_length): Take an ira_obejct_t argument. All callers changed. (mark_pseudo_regno_live): Iterate over allocno subobjects. (mark_pseudo_regno_dead): Likewise. (mark_pseudo_regno_subword_live, mark_pseudo_regno_subword_dead): New functions. (mark_ref_live): Detect subword accesses and call mark_pseudo_regno_subword_live as appropriate. (mark_ref_dead): Likewise for mark_pseudo_regno_subword_dead. (process_bb_nodes_live): Deal with object-related updates first; set and test bits in allocnos_processed to avoid computing allocno statistics more than once. (create_start_finish_chains): Iterate over objects, not allocnos. (print_object_live_ranges): New function. (print_allocno_live_ranges): Use it. (ira_create_allocno_live_ranges): Allocate and free allocnos_processed and objects_live. From-SVN: r162418
2010-07-22 17:48:30 +02:00
#define ALLOCNO_OBJECT(A,N) ((A)->objects[N])
#define ALLOCNO_NUM_OBJECTS(A) ((A)->num_objects)
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
#define ALLOCNO_ADD_DATA(A) ((A)->add_data)
ira-int.h (struct ira_object): New. * ira-int.h (struct ira_object): New. (ira_object_t): New typedef. Add DEF_VEC_P and DEF_VEC_ALLOC_P for it. (struct ira_allocno): Remove members min, max, conflict_allocno_array, conflict_id, conflict_allocno_array_size, conflict_allocnos_num and conflict_vec_p. Add new member object. (OBJECT_CONFLICT_ARRAY, OBJECT_CONFLICT_VEC_P, OBJECT_NUM_CONFLICTS, OBJECT_CONFLICT_ARRAY_SIZE, OBJECT_CONFLICT_HARD_REGS, OBJECT_TOTAL_CONFLICT_HARD_REGS, OBJECT_MIN, OBJECT_MAX, OBJECT_CONFLICT_ID): Renamed from ALLOCNO_CONFLICT_ALLOCNO_ARRAY, ALLOCNO_CONFLICT_VEC_P, ALLOCNO_CONFLICT_ALLOCNOS_NUM, ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE, ALLOCNO_CONFLICT_HARD_REGS, ALLOCNO_TOTAL_CONFLICT_HARD_REGS) ALLOCNO_MIN, ALLOCNO_MAX, and ALLOCNO_CONFLICT_ID; now operate on an ira_object_t rather than ira_allocno_t. All uses changed. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_objects_num): Declare variable. (ira_create_allocno_object): Declare function. (ira_conflict_vector_profitable_p): Adjust prototype. (ira_allocate_conflict_vec): Renamed from ira_allocate_allocno_conflict_vec; first arg now ira_object_t. (ira_allocate_object_conflicts): Renamed from ira_allocate_allocno_conflicts; first arg now ira_object_t. (struct ira_object_iterator): New. (ira_object_iter_init, ira_object_iter_cond, FOR_EACH_OBJECT): New. (ira_allocno_conflict_iterator): Renamed member allocno_conflict_vec_p to conflict_vec_p. All uses changed. (ira_allocno_conflict_iter_init, ira_allocno_conflict_iter_cond): Changed to take into account that conflicts are now tracked for objects. * ira-conflicts.c (OBJECTS_CONFLICT_P): Renamed from CONFLICT_ALLOCNO_P. Args changed to accept ira_object_t. All uses changed. (allocnos_conflict_p): New static function. (collected_conflict_objects): Renamed from collected_allocno_objects; now a vector of ira_object_t. All uses changed. (build_conflict_bit_table): Changed to take into account that conflicts are now tracked for objects. (process_regs_for_copy, propagate_copies, build_allocno_conflicts) (print_allocno_conflicts, ira_build_conflicts): Likewise. * ira-color.c (assign_hard_reg, setup_allocno_available_regs_num) setup_allocno_left_conflicts_size, allocno_reload_assign, fast_allocation): Likewise. * ira-lives.c (make_hard_regno_born, make_allocno_born) process_single_reg_class_operands, process_bb_node_lives): Likewise. * ira-emit.c (modify_move_list, add_range_and_copies_from_move_list): Likewise. * ira-build.c (ira_objects_num): New variable. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_object_id_map_vec): Corresponding change. (object_pool): New static variable. (initiate_allocnos): Initialize it. (finish_allocnos): Free it. (ira_create_object, ira_create_allocno_object, create_allocno_objects): New functions. (ira_create_allocno): Don't set members that were removed. (ira_set_allocno_cover_class): Don't change conflict hard regs. (merge_hard_reg_conflicts): Changed to take into account that conflicts are now tracked for objects. (ira_conflict_vector_profitable_p, ira_allocate_conflict_vec, allocate_conflict_bit_vec, ira_allocate_object_conflicts, compress_conflict_vecs, remove_low_level_allocnos, ira_flattening, setup_min_max_allocno_live_range_point, allocno_range_compare_func, setup_min_max_conflict_allocno_ids, ): Likewise. ((add_to_conflicts): Renamed from add_to_allocno_conflicts, args changed to ira_object_t; all callers changed. (ira_add_conflict): Renamed from ira_add_allocno_conflict, args changed to ira_object_t, all callers changed. (clear_conflicts): Renamed from clear_allocno_conflicts, arg changed to ira_object_t, all callers changed. (conflict_check, curr_conflict_check_tick): Renamed from allocno_conflict_check and curr_allocno_conflict_check_tick; all uses changed. (compress_conflict_vec): Renamed from compress_allocno_conflict_vec, arg changed to ira_object_t, all callers changed. (create_cap_allocno): Call ira_create_allocno_object. (finish_allocno): Free the corresponding object. (sort_conflict_id_map): Renamed from sort_conflict_id_allocno_map; all callers changed. Adjusted for dealing with objects. (ira_build): Call create_allocno_objects after ira_costs. Adjusted for dealing with objects. * ira.c (ira_bad_reload_regno_1): Adjusted for dealing with objects. From-SVN: r162166
2010-07-14 03:53:35 +02:00
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
/* Typedef for pointer to the subsequent structure. */
typedef struct ira_emit_data *ira_emit_data_t;
/* Allocno bound data used for emit pseudo live range split insns and
to flattening IR. */
struct ira_emit_data
{
/* TRUE if the allocno assigned to memory was a destination of
removed move (see ira-emit.c) at loop exit because the value of
the corresponding pseudo-register is not changed inside the
loop. */
unsigned int mem_optimized_dest_p : 1;
/* TRUE if the corresponding pseudo-register has disjoint live
ranges and the other allocnos of the pseudo-register except this
one changed REG. */
unsigned int somewhere_renamed_p : 1;
/* TRUE if allocno with the same REGNO in a subregion has been
renamed, in other words, got a new pseudo-register. */
unsigned int child_renamed_p : 1;
/* Final rtx representation of the allocno. */
rtx reg;
/* Non NULL if we remove restoring value from given allocno to
MEM_OPTIMIZED_DEST at loop exit (see ira-emit.c) because the
allocno value is not changed inside the loop. */
ira_allocno_t mem_optimized_dest;
};
#define ALLOCNO_EMIT_DATA(a) ((ira_emit_data_t) ALLOCNO_ADD_DATA (a))
/* Data used to emit live range split insns and to flattening IR. */
extern ira_emit_data_t ira_allocno_emit_data;
/* Abbreviation for frequent emit data access. */
static inline rtx
allocno_emit_reg (ira_allocno_t a)
{
return ALLOCNO_EMIT_DATA (a)->reg;
}
#define OBJECT_ALLOCNO(O) ((O)->allocno)
#define OBJECT_SUBWORD(O) ((O)->subword)
#define OBJECT_CONFLICT_ARRAY(O) ((O)->conflicts_array)
#define OBJECT_CONFLICT_VEC(O) ((ira_object_t *)(O)->conflicts_array)
#define OBJECT_CONFLICT_BITVEC(O) ((IRA_INT_TYPE *)(O)->conflicts_array)
#define OBJECT_CONFLICT_ARRAY_SIZE(O) ((O)->conflicts_array_size)
#define OBJECT_CONFLICT_VEC_P(O) ((O)->conflict_vec_p)
#define OBJECT_NUM_CONFLICTS(O) ((O)->num_accumulated_conflicts)
#define OBJECT_CONFLICT_HARD_REGS(O) ((O)->conflict_hard_regs)
#define OBJECT_TOTAL_CONFLICT_HARD_REGS(O) ((O)->total_conflict_hard_regs)
#define OBJECT_MIN(O) ((O)->min)
#define OBJECT_MAX(O) ((O)->max)
#define OBJECT_CONFLICT_ID(O) ((O)->id)
#define OBJECT_LIVE_RANGES(O) ((O)->live_ranges)
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02: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
/* Map regno -> allocnos with given regno (see comments for
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
allocno member `next_regno_allocno'). */
extern ira_allocno_t *ira_regno_allocno_map;
/* Array of references to all allocnos. The order number of the
allocno corresponds to the index in the array. Removed allocnos
have NULL element value. */
extern ira_allocno_t *ira_allocnos;
ira-int.h (struct ira_object): New. * ira-int.h (struct ira_object): New. (ira_object_t): New typedef. Add DEF_VEC_P and DEF_VEC_ALLOC_P for it. (struct ira_allocno): Remove members min, max, conflict_allocno_array, conflict_id, conflict_allocno_array_size, conflict_allocnos_num and conflict_vec_p. Add new member object. (OBJECT_CONFLICT_ARRAY, OBJECT_CONFLICT_VEC_P, OBJECT_NUM_CONFLICTS, OBJECT_CONFLICT_ARRAY_SIZE, OBJECT_CONFLICT_HARD_REGS, OBJECT_TOTAL_CONFLICT_HARD_REGS, OBJECT_MIN, OBJECT_MAX, OBJECT_CONFLICT_ID): Renamed from ALLOCNO_CONFLICT_ALLOCNO_ARRAY, ALLOCNO_CONFLICT_VEC_P, ALLOCNO_CONFLICT_ALLOCNOS_NUM, ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE, ALLOCNO_CONFLICT_HARD_REGS, ALLOCNO_TOTAL_CONFLICT_HARD_REGS) ALLOCNO_MIN, ALLOCNO_MAX, and ALLOCNO_CONFLICT_ID; now operate on an ira_object_t rather than ira_allocno_t. All uses changed. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_objects_num): Declare variable. (ira_create_allocno_object): Declare function. (ira_conflict_vector_profitable_p): Adjust prototype. (ira_allocate_conflict_vec): Renamed from ira_allocate_allocno_conflict_vec; first arg now ira_object_t. (ira_allocate_object_conflicts): Renamed from ira_allocate_allocno_conflicts; first arg now ira_object_t. (struct ira_object_iterator): New. (ira_object_iter_init, ira_object_iter_cond, FOR_EACH_OBJECT): New. (ira_allocno_conflict_iterator): Renamed member allocno_conflict_vec_p to conflict_vec_p. All uses changed. (ira_allocno_conflict_iter_init, ira_allocno_conflict_iter_cond): Changed to take into account that conflicts are now tracked for objects. * ira-conflicts.c (OBJECTS_CONFLICT_P): Renamed from CONFLICT_ALLOCNO_P. Args changed to accept ira_object_t. All uses changed. (allocnos_conflict_p): New static function. (collected_conflict_objects): Renamed from collected_allocno_objects; now a vector of ira_object_t. All uses changed. (build_conflict_bit_table): Changed to take into account that conflicts are now tracked for objects. (process_regs_for_copy, propagate_copies, build_allocno_conflicts) (print_allocno_conflicts, ira_build_conflicts): Likewise. * ira-color.c (assign_hard_reg, setup_allocno_available_regs_num) setup_allocno_left_conflicts_size, allocno_reload_assign, fast_allocation): Likewise. * ira-lives.c (make_hard_regno_born, make_allocno_born) process_single_reg_class_operands, process_bb_node_lives): Likewise. * ira-emit.c (modify_move_list, add_range_and_copies_from_move_list): Likewise. * ira-build.c (ira_objects_num): New variable. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_object_id_map_vec): Corresponding change. (object_pool): New static variable. (initiate_allocnos): Initialize it. (finish_allocnos): Free it. (ira_create_object, ira_create_allocno_object, create_allocno_objects): New functions. (ira_create_allocno): Don't set members that were removed. (ira_set_allocno_cover_class): Don't change conflict hard regs. (merge_hard_reg_conflicts): Changed to take into account that conflicts are now tracked for objects. (ira_conflict_vector_profitable_p, ira_allocate_conflict_vec, allocate_conflict_bit_vec, ira_allocate_object_conflicts, compress_conflict_vecs, remove_low_level_allocnos, ira_flattening, setup_min_max_allocno_live_range_point, allocno_range_compare_func, setup_min_max_conflict_allocno_ids, ): Likewise. ((add_to_conflicts): Renamed from add_to_allocno_conflicts, args changed to ira_object_t; all callers changed. (ira_add_conflict): Renamed from ira_add_allocno_conflict, args changed to ira_object_t, all callers changed. (clear_conflicts): Renamed from clear_allocno_conflicts, arg changed to ira_object_t, all callers changed. (conflict_check, curr_conflict_check_tick): Renamed from allocno_conflict_check and curr_allocno_conflict_check_tick; all uses changed. (compress_conflict_vec): Renamed from compress_allocno_conflict_vec, arg changed to ira_object_t, all callers changed. (create_cap_allocno): Call ira_create_allocno_object. (finish_allocno): Free the corresponding object. (sort_conflict_id_map): Renamed from sort_conflict_id_allocno_map; all callers changed. Adjusted for dealing with objects. (ira_build): Call create_allocno_objects after ira_costs. Adjusted for dealing with objects. * ira.c (ira_bad_reload_regno_1): Adjusted for dealing with objects. From-SVN: r162166
2010-07-14 03:53:35 +02:00
/* The size of the previous array. */
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
extern int ira_allocnos_num;
ira-int.h (struct ira_object): New. * ira-int.h (struct ira_object): New. (ira_object_t): New typedef. Add DEF_VEC_P and DEF_VEC_ALLOC_P for it. (struct ira_allocno): Remove members min, max, conflict_allocno_array, conflict_id, conflict_allocno_array_size, conflict_allocnos_num and conflict_vec_p. Add new member object. (OBJECT_CONFLICT_ARRAY, OBJECT_CONFLICT_VEC_P, OBJECT_NUM_CONFLICTS, OBJECT_CONFLICT_ARRAY_SIZE, OBJECT_CONFLICT_HARD_REGS, OBJECT_TOTAL_CONFLICT_HARD_REGS, OBJECT_MIN, OBJECT_MAX, OBJECT_CONFLICT_ID): Renamed from ALLOCNO_CONFLICT_ALLOCNO_ARRAY, ALLOCNO_CONFLICT_VEC_P, ALLOCNO_CONFLICT_ALLOCNOS_NUM, ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE, ALLOCNO_CONFLICT_HARD_REGS, ALLOCNO_TOTAL_CONFLICT_HARD_REGS) ALLOCNO_MIN, ALLOCNO_MAX, and ALLOCNO_CONFLICT_ID; now operate on an ira_object_t rather than ira_allocno_t. All uses changed. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_objects_num): Declare variable. (ira_create_allocno_object): Declare function. (ira_conflict_vector_profitable_p): Adjust prototype. (ira_allocate_conflict_vec): Renamed from ira_allocate_allocno_conflict_vec; first arg now ira_object_t. (ira_allocate_object_conflicts): Renamed from ira_allocate_allocno_conflicts; first arg now ira_object_t. (struct ira_object_iterator): New. (ira_object_iter_init, ira_object_iter_cond, FOR_EACH_OBJECT): New. (ira_allocno_conflict_iterator): Renamed member allocno_conflict_vec_p to conflict_vec_p. All uses changed. (ira_allocno_conflict_iter_init, ira_allocno_conflict_iter_cond): Changed to take into account that conflicts are now tracked for objects. * ira-conflicts.c (OBJECTS_CONFLICT_P): Renamed from CONFLICT_ALLOCNO_P. Args changed to accept ira_object_t. All uses changed. (allocnos_conflict_p): New static function. (collected_conflict_objects): Renamed from collected_allocno_objects; now a vector of ira_object_t. All uses changed. (build_conflict_bit_table): Changed to take into account that conflicts are now tracked for objects. (process_regs_for_copy, propagate_copies, build_allocno_conflicts) (print_allocno_conflicts, ira_build_conflicts): Likewise. * ira-color.c (assign_hard_reg, setup_allocno_available_regs_num) setup_allocno_left_conflicts_size, allocno_reload_assign, fast_allocation): Likewise. * ira-lives.c (make_hard_regno_born, make_allocno_born) process_single_reg_class_operands, process_bb_node_lives): Likewise. * ira-emit.c (modify_move_list, add_range_and_copies_from_move_list): Likewise. * ira-build.c (ira_objects_num): New variable. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_object_id_map_vec): Corresponding change. (object_pool): New static variable. (initiate_allocnos): Initialize it. (finish_allocnos): Free it. (ira_create_object, ira_create_allocno_object, create_allocno_objects): New functions. (ira_create_allocno): Don't set members that were removed. (ira_set_allocno_cover_class): Don't change conflict hard regs. (merge_hard_reg_conflicts): Changed to take into account that conflicts are now tracked for objects. (ira_conflict_vector_profitable_p, ira_allocate_conflict_vec, allocate_conflict_bit_vec, ira_allocate_object_conflicts, compress_conflict_vecs, remove_low_level_allocnos, ira_flattening, setup_min_max_allocno_live_range_point, allocno_range_compare_func, setup_min_max_conflict_allocno_ids, ): Likewise. ((add_to_conflicts): Renamed from add_to_allocno_conflicts, args changed to ira_object_t; all callers changed. (ira_add_conflict): Renamed from ira_add_allocno_conflict, args changed to ira_object_t, all callers changed. (clear_conflicts): Renamed from clear_allocno_conflicts, arg changed to ira_object_t, all callers changed. (conflict_check, curr_conflict_check_tick): Renamed from allocno_conflict_check and curr_allocno_conflict_check_tick; all uses changed. (compress_conflict_vec): Renamed from compress_allocno_conflict_vec, arg changed to ira_object_t, all callers changed. (create_cap_allocno): Call ira_create_allocno_object. (finish_allocno): Free the corresponding object. (sort_conflict_id_map): Renamed from sort_conflict_id_allocno_map; all callers changed. Adjusted for dealing with objects. (ira_build): Call create_allocno_objects after ira_costs. Adjusted for dealing with objects. * ira.c (ira_bad_reload_regno_1): Adjusted for dealing with objects. From-SVN: r162166
2010-07-14 03:53:35 +02:00
/* Map a conflict id to its corresponding ira_object structure. */
extern ira_object_t *ira_object_id_map;
/* The size of the previous array. */
extern int ira_objects_num;
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
/* The following structure represents a hard register preference of
regmove.c: Remove. 2013-10-30 Vladimir Makarov <vmakarov@redhat.com> * regmove.c: Remove. * tree-pass.h (make_pass_regmove): Remove. * timevar.def (TV_REGMOVE): Remove. * passes.def (pass_regmove): Remove. * opts.c (default_options_table): Remove entry for regmove. * doc/passes.texi: Remove regmove pass description. * doc/invoke.texi (-foptimize-register-move, -fregmove): Remove options. (-fdump-rtl-regmove): Ditto. * common.opt (foptimize-register-move, fregmove): Ignore. * Makefile.in (OBJS): Remove regmove.o. * regmove.c: Remove. * ira-int.h (struct ira_allocno_pref, ira_pref_t): New structure and type. (struct ira_allocno) New member allocno_prefs. (ALLOCNO_PREFS): New macro. (ira_prefs, ira_prefs_num): New external vars. (ira_setup_alts, ira_get_dup_out_num, ira_debug_pref): New prototypes. (ira_debug_prefs, ira_debug_allocno_prefs, ira_create_pref): Ditto. (ira_add_allocno_pref, ira_remove_pref, ira_remove_allocno_prefs): Ditto. (ira_add_allocno_copy_to_list): Remove prototype. (ira_swap_allocno_copy_ends_if_necessary): Ditto. (ira_pref_iterator): New type. (ira_pref_iter_init, ira_pref_iter_cond): New functions. (FOR_EACH_PREF): New macro. * ira.c (commutative_constraint_p): Move from ira-conflicts.c. (ira_get_dup_out_num): Ditto. Rename from get_dup_num. Modify the code. (ira_setup_alts): New function. (decrease_live_ranges_number): New function. (ira): Call the above function. * ira-build.c (ira_prefs, ira_prefs_num): New global vars. (ira_create_allocno): Initialize allocno prefs. (pref_pool, pref_vec): New static vars. (initiate_prefs, find_allocno_pref, ira_create_pref): New functions. (add_allocno_pref_to_list, ira_add_allocno_pref, print_pref): Ditto. (ira_debug_pref, print_prefs, ira_debug_prefs): Ditto. (print_allocno_prefs, ira_debug_allocno_prefs, finish_pref): Ditto. (ira_remove_pref, ira_remove_allocno_prefs, finish_prefs): Ditto. (ira_add_allocno_copy_to_list): Make static. Rename to add_allocno_copy_to_list. (ira_swap_allocno_copy_ends_if_necessary): Make static. Rename to swap_allocno_copy_ends_if_necessary. (remove_unnecessary_allocnos, remove_low_level_allocnos): Call ira_remove_allocno_prefs. (ira_flattening): Ditto. (ira_build): Call initiate_prefs, print_prefs. (ira_destroy): Call finish_prefs. * ira-color.c (struct update_cost_record): New. (struct allocno_color_data): Add new member update_cost_records. (update_cost_record_pool): New static var. (init_update_cost_records, get_update_cost_record): New functions. (free_update_cost_record_list, finish_update_cost_records): Ditto. (struct update_cost_queue_elem): Add member from. (initiate_cost_update): Call init_update_cost_records. (finish_cost_update): Call finish_update_cost_records. (queue_update_cost, get_next_update_cost): Add new param from. (Update_allocno_cost, update_costs_from_allocno): New functions. (update_costs_from_prefs): Ditto. (update_copy_costs): Rename to update_costs_from_copies. (restore_costs_from_copies): New function. (update_conflict_hard_regno_costs): Don't go back. (assign_hard_reg): Call restore_costs_from_copies. Add printing more debug info. (pop_allocnos): Add priniting more debug info. (color_allocnos): Remove prefs for conflicting hard regs. Call update_costs_from_prefs. * ira-conflicts.c (commutative_constraint_p): Move to ira.c (get_dup_num): Rename, modify, and move to ira.c (process_regs_for_copy): Add prefs. (add_insn_allocno_copies): Put src as first arg of process_regs_for_copy. Remove dead code. Call ira_setup_alts. * ira-costs.c (record_reg_classes): Modify and move code into record_operands_costs. (find_costs_and_classes): Create prefs for the hard reg of small reg class. (process_bb_node_for_hard_reg_moves): Add prefs. 2013-10-30 Vladimir Makarov <vmakarov@redhat.com> * gcc.target/i386/fma_double_3.c: Use pattern for scan-assembler-times instead of just one insn name. * gcc.target/i386/fma_double_5.c: Ditto. * gcc.target/i386/fma_float_3.c: Ditto. * gcc.target/i386/fma_float_5.c: Ditto. * gcc.target/i386/l_fma_double_1.c: Ditto. * gcc.target/i386/l_fma_double_2.c: Ditto. * gcc.target/i386/l_fma_double_3.c: Ditto. * gcc.target/i386/l_fma_double_4.c: Ditto. * gcc.target/i386/l_fma_double_5.c: Ditto. * gcc.target/i386/l_fma_double_6.c: Ditto. * gcc.target/i386/l_fma_float_1.c: Ditto. * gcc.target/i386/l_fma_float_2.c: Ditto. * gcc.target/i386/l_fma_float_3.c: Ditto. * gcc.target/i386/l_fma_float_4.c: Ditto. * gcc.target/i386/l_fma_float_5.c: Ditto. * gcc.target/i386/l_fma_float_6.c: Ditto. From-SVN: r204212
2013-10-30 15:27:25 +01:00
allocno. The preference represent move insns or potential move
insns usually because of two operand insn constraints. One move
operand is a hard register. */
struct ira_allocno_pref
{
/* The unique order number of the preference node starting with 0. */
int num;
/* Preferred hard register. */
int hard_regno;
/* Accumulated execution frequency of insns from which the
preference created. */
int freq;
/* Given allocno. */
ira_allocno_t allocno;
/* All preferences with the same allocno are linked by the following
regmove.c: Remove. 2013-10-30 Vladimir Makarov <vmakarov@redhat.com> * regmove.c: Remove. * tree-pass.h (make_pass_regmove): Remove. * timevar.def (TV_REGMOVE): Remove. * passes.def (pass_regmove): Remove. * opts.c (default_options_table): Remove entry for regmove. * doc/passes.texi: Remove regmove pass description. * doc/invoke.texi (-foptimize-register-move, -fregmove): Remove options. (-fdump-rtl-regmove): Ditto. * common.opt (foptimize-register-move, fregmove): Ignore. * Makefile.in (OBJS): Remove regmove.o. * regmove.c: Remove. * ira-int.h (struct ira_allocno_pref, ira_pref_t): New structure and type. (struct ira_allocno) New member allocno_prefs. (ALLOCNO_PREFS): New macro. (ira_prefs, ira_prefs_num): New external vars. (ira_setup_alts, ira_get_dup_out_num, ira_debug_pref): New prototypes. (ira_debug_prefs, ira_debug_allocno_prefs, ira_create_pref): Ditto. (ira_add_allocno_pref, ira_remove_pref, ira_remove_allocno_prefs): Ditto. (ira_add_allocno_copy_to_list): Remove prototype. (ira_swap_allocno_copy_ends_if_necessary): Ditto. (ira_pref_iterator): New type. (ira_pref_iter_init, ira_pref_iter_cond): New functions. (FOR_EACH_PREF): New macro. * ira.c (commutative_constraint_p): Move from ira-conflicts.c. (ira_get_dup_out_num): Ditto. Rename from get_dup_num. Modify the code. (ira_setup_alts): New function. (decrease_live_ranges_number): New function. (ira): Call the above function. * ira-build.c (ira_prefs, ira_prefs_num): New global vars. (ira_create_allocno): Initialize allocno prefs. (pref_pool, pref_vec): New static vars. (initiate_prefs, find_allocno_pref, ira_create_pref): New functions. (add_allocno_pref_to_list, ira_add_allocno_pref, print_pref): Ditto. (ira_debug_pref, print_prefs, ira_debug_prefs): Ditto. (print_allocno_prefs, ira_debug_allocno_prefs, finish_pref): Ditto. (ira_remove_pref, ira_remove_allocno_prefs, finish_prefs): Ditto. (ira_add_allocno_copy_to_list): Make static. Rename to add_allocno_copy_to_list. (ira_swap_allocno_copy_ends_if_necessary): Make static. Rename to swap_allocno_copy_ends_if_necessary. (remove_unnecessary_allocnos, remove_low_level_allocnos): Call ira_remove_allocno_prefs. (ira_flattening): Ditto. (ira_build): Call initiate_prefs, print_prefs. (ira_destroy): Call finish_prefs. * ira-color.c (struct update_cost_record): New. (struct allocno_color_data): Add new member update_cost_records. (update_cost_record_pool): New static var. (init_update_cost_records, get_update_cost_record): New functions. (free_update_cost_record_list, finish_update_cost_records): Ditto. (struct update_cost_queue_elem): Add member from. (initiate_cost_update): Call init_update_cost_records. (finish_cost_update): Call finish_update_cost_records. (queue_update_cost, get_next_update_cost): Add new param from. (Update_allocno_cost, update_costs_from_allocno): New functions. (update_costs_from_prefs): Ditto. (update_copy_costs): Rename to update_costs_from_copies. (restore_costs_from_copies): New function. (update_conflict_hard_regno_costs): Don't go back. (assign_hard_reg): Call restore_costs_from_copies. Add printing more debug info. (pop_allocnos): Add priniting more debug info. (color_allocnos): Remove prefs for conflicting hard regs. Call update_costs_from_prefs. * ira-conflicts.c (commutative_constraint_p): Move to ira.c (get_dup_num): Rename, modify, and move to ira.c (process_regs_for_copy): Add prefs. (add_insn_allocno_copies): Put src as first arg of process_regs_for_copy. Remove dead code. Call ira_setup_alts. * ira-costs.c (record_reg_classes): Modify and move code into record_operands_costs. (find_costs_and_classes): Create prefs for the hard reg of small reg class. (process_bb_node_for_hard_reg_moves): Add prefs. 2013-10-30 Vladimir Makarov <vmakarov@redhat.com> * gcc.target/i386/fma_double_3.c: Use pattern for scan-assembler-times instead of just one insn name. * gcc.target/i386/fma_double_5.c: Ditto. * gcc.target/i386/fma_float_3.c: Ditto. * gcc.target/i386/fma_float_5.c: Ditto. * gcc.target/i386/l_fma_double_1.c: Ditto. * gcc.target/i386/l_fma_double_2.c: Ditto. * gcc.target/i386/l_fma_double_3.c: Ditto. * gcc.target/i386/l_fma_double_4.c: Ditto. * gcc.target/i386/l_fma_double_5.c: Ditto. * gcc.target/i386/l_fma_double_6.c: Ditto. * gcc.target/i386/l_fma_float_1.c: Ditto. * gcc.target/i386/l_fma_float_2.c: Ditto. * gcc.target/i386/l_fma_float_3.c: Ditto. * gcc.target/i386/l_fma_float_4.c: Ditto. * gcc.target/i386/l_fma_float_5.c: Ditto. * gcc.target/i386/l_fma_float_6.c: Ditto. From-SVN: r204212
2013-10-30 15:27:25 +01:00
member. */
ira_pref_t next_pref;
};
/* Array of references to all allocno preferences. The order number
of the preference corresponds to the index in the array. */
extern ira_pref_t *ira_prefs;
/* Size of the previous array. */
extern int ira_prefs_num;
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
/* The following structure represents a copy of two allocnos. The
copies represent move insns or potential move insns usually because
of two operand insn constraints. To remove register shuffle, we
also create copies between allocno which is output of an insn and
allocno becoming dead in the insn. */
struct ira_allocno_copy
{
/* The unique order number of the copy node starting with 0. */
int num;
/* Allocnos connected by the copy. The first allocno should have
smaller order number than the second one. */
ira_allocno_t first, second;
/* Execution frequency of the copy. */
int freq;
re PR rtl-optimization/37948 (IRA generates slower code) 2008-11-07 Vladimir Makarov <vmakarov@redhat.com> PR rtl-optimizations/37948 * ira-int.h (struct ira_allocno_copy): New member constraint_p. (ira_create_copy, ira_add_allocno_copy): New parameter. * ira-conflicts.c (process_regs_for_copy): New parameter. Pass it to ira_add_allocno_copy. (process_reg_shuffles, add_insn_allocno_copies): Pass a new parameter to process_regs_for_copy. (propagate_copies): Pass a new parameter to ira_add_allocno_copy. Fix typo in passing second allocno to ira_add_allocno_copy. * ira-color.c (update_conflict_hard_regno_costs): Use head of coalesced allocnos list. (assign_hard_reg): Ditto. Check that assigned allocnos are not in the graph. (add_ira_allocno_to_bucket): Rename to add_allocno_to_bucket. (add_ira_allocno_to_ordered_bucket): Rename to add_allocno_to_ordered_bucket. (push_ira_allocno_to_stack): Rename to push_allocno_to_stack. Use head of coalesced allocnos list. (push_allocnos_to_stack): Remove calculation of ALLOCNO_TEMP. Check that it is aready calculated. (push_ira_allocno_to_spill): Rename to push_ira_allocno_to_spill. (setup_allocno_left_conflicts_num): Use head of coalesced allocnos list. (coalesce_allocnos): Do extended coalescing too. * ira-emit.c (add_range_and_copies_from_move_list): Pass a new parameter to ira_add_allocno_copy. * ira-build.c (ira_create_copy, ira_add_allocno_copy): Add a new parameter. (print_copy): Print copy origination too. * ira-costs.c (scan_one_insn): Use alloc_pref for load from equivalent memory. From-SVN: r141753
2008-11-11 00:21:45 +01:00
bool constraint_p;
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
/* It is a move insn which is an origin of the copy. The member
value for the copy representing two operand insn constraints or
for the copy created to remove register shuffle is NULL. In last
case the copy frequency is smaller than the corresponding insn
execution frequency. */
ira: Use rtx_insn in various places gcc/ * ira-int.h (struct ira_allocno_copy): Strengthen field "insn" from rtx to rtx_insn *insn. (ira_create_copy): Strengthen param "insn" from rtx to rtx_insn *. (ira_add_allocno_copy): Likewise. * ira-build.c (find_allocno_copy): Strengthen param "insn" from rtx to rtx_insn *. (ira_create_copy): Likewise. (ira_add_allocno_copy): Likewise. (create_bb_allocnos): Likewise for local "insn". * ira-conflicts.c (process_regs_for_copy): Likewise for param "insn". (process_reg_shuffles): Update NULL_RTX to NULL in invocation of process_regs_for_copy for rtx_insn * param. (add_insn_allocno_copies): Strengthen param "insn" from rtx to rtx_insn *insn. Update NULL_RTX to NULL in invocation of process_regs_for_copy for rtx_insn * param. (add_copies): Strengthen local "insn" from rtx to rtx_insn *insn. * ira-costs.c (record_reg_classes): Likewise for param "insn". (record_operand_costs): Likewise. (scan_one_insn): Likewise for return type, and for param "insn". (process_bb_for_costs): Likewise for local "insn". (process_bb_node_for_hard_reg_moves): Likewise. * ira-emit.c (struct move): Likewise for field "insn". (create_move): Eliminate use of NULL_RTX when dealing with an rtx_insn *. (emit_move_list): Strengthen return type and locals "result", "insn" from rtx to rtx_insn *insn. (emit_moves): Likewise for locals "insns", "tmp". (ira_emit): Likewise for local "insn". * ira-lives.c (mark_hard_reg_early_clobbers): Likewise for param "insn". (find_call_crossed_cheap_reg): Likewise. (process_bb_node_lives): Likewise for local "insn". * ira.c (decrease_live_ranges_number): Likewise. (compute_regs_asm_clobbered): Likewise. (build_insn_chain): Likewise. (find_moveable_pseudos): Likewise, also locals "def_insn", "use_insn", "x". Also strengthen local "closest_uses" from rtx * to rtx_insn **. Add a checked cast when assigning from "closest_use" into closest_uses array in a region where we know it's a non-NULL insn. (interesting_dest_for_shprep): Strengthen param "insn" from rtx to rtx_insn *. (split_live_ranges_for_shrink_wrap): Likewise for locals "insn", "last_interesting_insn", "uin". (move_unallocated_pseudos): Likewise for locals "def_insn", "move_insn", "newinsn". From-SVN: r214339
2014-08-22 19:48:40 +02:00
rtx_insn *insn;
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
/* All copies with the same allocno as FIRST are linked by the two
following members. */
ira_copy_t prev_first_allocno_copy, next_first_allocno_copy;
/* All copies with the same allocno as SECOND are linked by the two
following members. */
ira_copy_t prev_second_allocno_copy, next_second_allocno_copy;
/* Region from which given copy is originated. */
ira_loop_tree_node_t loop_tree_node;
};
/* Array of references to all copies. The order number of the copy
corresponds to the index in the array. Removed copies have NULL
element value. */
extern ira_copy_t *ira_copies;
/* Size of the previous array. */
extern int ira_copies_num;
/* The following structure describes a stack slot used for spilled
pseudo-registers. */
struct ira_spilled_reg_stack_slot
{
/* pseudo-registers assigned to the stack slot. */
coretypes.h (struct simple_bitmap_def, [...]): New core types. gcc/ChangeLog: * coretypes.h (struct simple_bitmap_def, sbitmap, const_sbitmap): New core types. * sbitmap.h (struct sbitmap_def): Do not typedef here. * sbitmap.c: Include sbitmap.h. * basic-block.h: Do not include bitmap.h, sbitmap.h, partition.h, hard-reg-set.h. Split everything related to regsets out from here... * regset.h: ...to here. New file. * df.h: Include regset.h and sbitmap.h. * tree-flow.h: Likewise. * cfgloop.h: Likewise. * except.h: Do not include sbitmap.h. Include hashtab.h. * cgraph.h: Include vec.h and function.h. * reload.h (struct insn_chain): Change types of live_throughout and dead_or_set from regset_head to bitmap_head. (compute_use_by_pseudos): Be defined also if regset.h is not included. * ira-int.h (struct ira_spilled_reg_stack_slot): Change type of spilled_regs from regset_head to bitmap_head to avoid dependency in regset.h. * sel-sched-ir.h: Include regset.h. * reload.c: Include df.h before reload.h. * caller-save.c: Likewise. * reload1.c: Likewise. * ira.c: Likewise. (mark_elimination): Update type of r to bitmap, consistent with DF_LR_IN. * dominance.c: Include bitmap.h. * modulo-sched.c: Include df.h. * cfganal.c: Include bitmap.h and sbitmap.h. * cfgbuild.c: Include sbitmap.h. * lcm.c: Include sbitmap.h. * gcse.c (alloc_gcse_mem): Allocate regset with ALLOC_REG_SET. * domwalk.c: Include sbitmap.h, exclude ggc.h. * cfgexpand.c: Inlcude bitmap.h and sbitmap.h. * cselib.c: Include bitmap.h. * tree-optimize.c: Include regset.h. * stmt.c: Include bitmap.h. * Makefile.in: Update dependencies. cp/ChangeLog * semantics.c: Include bitmap.h. * Make-lang.in: Update dependencies. From-SVN: r159746
2010-05-23 00:24:53 +02:00
bitmap_head spilled_regs;
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
/* RTL representation of the stack slot. */
rtx mem;
/* Size of the stack slot. */
unsigned int width;
};
/* The number of elements in the following array. */
extern int ira_spilled_reg_stack_slots_num;
/* The following array contains info about spilled pseudo-registers
stack slots used in current function so far. */
extern struct ira_spilled_reg_stack_slot *ira_spilled_reg_stack_slots;
/* Correspondingly overall cost of the allocation, cost of the
allocnos assigned to hard-registers, cost of the allocnos assigned
to memory, cost of loads, stores and register move insns generated
for pseudo-register live range splitting (see ira-emit.c). */
extern int64_t ira_overall_cost;
extern int64_t ira_reg_cost, ira_mem_cost;
extern int64_t ira_load_cost, ira_store_cost, ira_shuffle_cost;
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
extern int ira_move_loops_num, ira_additional_jumps_num;
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
/* This page contains a bitset implementation called 'min/max sets' used to
record conflicts in IRA.
They are named min/maxs set since we keep track of a minimum and a maximum
bit number for each set representing the bounds of valid elements. Otherwise,
the implementation resembles sbitmaps in that we store an array of integers
whose bits directly represent the members of the set. */
/* The type used as elements in the array, and the number of bits in
this type. */
ira-build.c (ira_create_object): New arg SUBWORD; all callers changed. * ira-build.c (ira_create_object): New arg SUBWORD; all callers changed. Initialize OBJECT_SUBWORD. (ira_create_allocno): Clear ALLOCNO_NUM_OBJECTS. (ira_create_allocno_objects): Renamed from ira_create_allocno_object; all callers changed. (merge_hard_reg_conflicts): Iterate over allocno subobjects. (finish_allocno): Likewise. (move_allocno_live_ranges, copy_allocno_live_ranges): Likewise. (remove_low_level_allocnos): Likewise. (update_bad_spill_attribute): Likewise. (setup_min_max_allocno_live_range_point): Likewise. (sort_conflict_id_map): Likewise. (ira_flattening): Likewise. Use ior_hard_reg_conflicts. (ior_hard_reg_conflicts): New function. (ior_allocate_object_conflicts): Renamed first argument to OBJ. (compress_conflict_vecs): Iterate over objects, not allocnos. (ira_add_live_range_to_object): New function. (object_range_compare_func): Renamed from allocno_range_compare_func. All callers changed. (setup_min_max_conflict_allocno_ids): For allocnos with multiple subobjects, widen the min/max range of the lowest-order object to potentially include all other such low-order objects. * ira.c (ira_bad_reload_regno_1): Iterate over allocno subobjects. (check_allocation): Likewise. Use more fine-grained tests for register conflicts. * ira-color.c (allocnos_have_intersected_live_ranges_p): Iterate over allocno subobjects. (assign_hard_reg): Keep multiple sets of conflicts. Make finer-grained choices about which bits to set in each set. Don't use ira_hard_reg_not_in_set_p, perform a more elaborate test for conflicts using the multiple sets we computed. (push_allocno_to_stack): Iterate over allocno subobjects. (all_conflicting_hard_regs_coalesced): New static function. (setup_allocno_available_regs_num): Use it. (setup_allocno_left_conflicts_size): Likewise. Iterate over allocno subobjects. (coalesced_allocno_conflict): Test subobject 0 in each allocno. (setup_allocno_priorities): Divide ALLOCNO_EXCESS_PRESSURE_POINTS_NUM by ALLOCNO_NUM_OBJECTS. (calculate_spill_cost): Likewise. (color_pass): Express if statement in a more normal way. (ira_reassign_conflict_allocnos): Iterate over allocno subobjects. (slot_coalesced_allocno_live_ranges_intersect_p): Likewise. (setup_slot_coalesced_allocno_live_ranges): Likewise. (allocno_reload_assign): Likewise. (ira_reassign_pseudos): Likewise. (fast_allocation): Likewise. * ira-conflicts.c (build_conflict_bit_table): Likewise. (print_allocno_conflicts): Likewise. (ira_build_conflicts): Likewise. (allocnos_conflict_for_copy_p): Renamed from allocnos_conflict_p. All callers changed. Test subword 0 of each allocno for conflicts. (build_object_conflicts): Renamed from build_allocno_conflicts. All callers changed. Iterate over allocno subobjects. * ira-emit.c (modify_move_list): Iterate over allocno subobjects. * ira-int.h (struct ira_allocno): New member. num_objects. Rename object to objects and change it into an array. (ALLOCNO_OBJECT): Add new argument N. (ALLOCNO_NUM_OBJECTS, OBJECT_SUBWORD): New macros. (ira_create_allocno_objects): Renamed from ira_create_allocno_object. (ior_hard_reg_conflicts): Declare. (ira_add_live_range_to_object): Declare. (ira_allocno_object_iterator): New. (ira_allocno_object_iter_init, ira_allocno_object_iter_cond): New. (FOR_EACH_ALLOCNO_OBJECT): New macro. * ira-lives.c (objects_live): Renamed from allocnos_live; all uses changed. (allocnos_processed): New sparseset. (make_object_born): Renamed from make_allocno_born; take an ira_object_t argument. All callers changed. (make_object_dead): Renamed from make_allocno_dead; take an ira_object t argument. All callers changed. (update_allocno_pressure_excess_length): Take an ira_obejct_t argument. All callers changed. (mark_pseudo_regno_live): Iterate over allocno subobjects. (mark_pseudo_regno_dead): Likewise. (mark_pseudo_regno_subword_live, mark_pseudo_regno_subword_dead): New functions. (mark_ref_live): Detect subword accesses and call mark_pseudo_regno_subword_live as appropriate. (mark_ref_dead): Likewise for mark_pseudo_regno_subword_dead. (process_bb_nodes_live): Deal with object-related updates first; set and test bits in allocnos_processed to avoid computing allocno statistics more than once. (create_start_finish_chains): Iterate over objects, not allocnos. (print_object_live_ranges): New function. (print_allocno_live_ranges): Use it. (ira_create_allocno_live_ranges): Allocate and free allocnos_processed and objects_live. From-SVN: r162418
2010-07-22 17:48:30 +02:00
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
#define IRA_INT_BITS HOST_BITS_PER_WIDE_INT
#define IRA_INT_TYPE HOST_WIDE_INT
/* Set, clear or test bit number I in R, a bit vector of elements with
minimal index and maximal index equal correspondingly to MIN and
MAX. */
#if defined ENABLE_IRA_CHECKING && (GCC_VERSION >= 2007)
#define SET_MINMAX_SET_BIT(R, I, MIN, MAX) __extension__ \
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
(({ int _min = (MIN), _max = (MAX), _i = (I); \
if (_i < _min || _i > _max) \
{ \
fprintf (stderr, \
"\n%s: %d: error in %s: %d not in range [%d,%d]\n", \
__FILE__, __LINE__, __FUNCTION__, _i, _min, _max); \
gcc_unreachable (); \
} \
((R)[(unsigned) (_i - _min) / IRA_INT_BITS] \
|= ((IRA_INT_TYPE) 1 << ((unsigned) (_i - _min) % IRA_INT_BITS))); }))
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
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
#define CLEAR_MINMAX_SET_BIT(R, I, MIN, MAX) __extension__ \
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
(({ int _min = (MIN), _max = (MAX), _i = (I); \
if (_i < _min || _i > _max) \
{ \
fprintf (stderr, \
"\n%s: %d: error in %s: %d not in range [%d,%d]\n", \
__FILE__, __LINE__, __FUNCTION__, _i, _min, _max); \
gcc_unreachable (); \
} \
((R)[(unsigned) (_i - _min) / IRA_INT_BITS] \
&= ~((IRA_INT_TYPE) 1 << ((unsigned) (_i - _min) % IRA_INT_BITS))); }))
#define TEST_MINMAX_SET_BIT(R, I, MIN, MAX) __extension__ \
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
(({ int _min = (MIN), _max = (MAX), _i = (I); \
if (_i < _min || _i > _max) \
{ \
fprintf (stderr, \
"\n%s: %d: error in %s: %d not in range [%d,%d]\n", \
__FILE__, __LINE__, __FUNCTION__, _i, _min, _max); \
gcc_unreachable (); \
} \
((R)[(unsigned) (_i - _min) / IRA_INT_BITS] \
& ((IRA_INT_TYPE) 1 << ((unsigned) (_i - _min) % IRA_INT_BITS))); }))
#else
#define SET_MINMAX_SET_BIT(R, I, MIN, MAX) \
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
((R)[(unsigned) ((I) - (MIN)) / IRA_INT_BITS] \
|= ((IRA_INT_TYPE) 1 << ((unsigned) ((I) - (MIN)) % IRA_INT_BITS)))
#define CLEAR_MINMAX_SET_BIT(R, I, MIN, MAX) \
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
((R)[(unsigned) ((I) - (MIN)) / IRA_INT_BITS] \
&= ~((IRA_INT_TYPE) 1 << ((unsigned) ((I) - (MIN)) % IRA_INT_BITS)))
#define TEST_MINMAX_SET_BIT(R, I, MIN, MAX) \
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
((R)[(unsigned) ((I) - (MIN)) / IRA_INT_BITS] \
& ((IRA_INT_TYPE) 1 << ((unsigned) ((I) - (MIN)) % IRA_INT_BITS)))
#endif
/* The iterator for min/max sets. */
cgraph.h (cgraph_node_set_iterator, [...]): Remove typedef. * gcc/cgraph.h (cgraph_node_set_iterator, varpool_node_set_iterator): Remove typedef. (cgraph_inline_failed_enum, cgraph_inline_failed_t): Remove typedef and rename to cgraph_inline_failed_t. * gcc/tree-ssa-alias.h (ao_ref_s, ao_ref): Remove typedef and rename to ao_ref. * gcc/reload.h (reg_equivs_s, reg_equivs_t): Remove typedef and rename to reg_equivs_t. * gcc/conditions.h (CC_STATUS): Remove typedef. * gcc/bitmap.h (bitmap_obstack): Remove typedef. (bitmap_element_def, bitmap_element): Remove typedef and rename to bitmap_element. (bitmap_head_def, bitmap_head): Remove typedef and rename to bitmap_head. (bitmap_iterator): Remove typedef. * gcc/target.h (cumulative_args_t, print_switch_type, secondary_reload_info): Remove typedef. * gcc/dwarf2out.h (dw_cfi_oprnd_struct, dw_cfi_oprnd): Remove dw_cfi_oprnd_struct alias. (dw_cfi_struct, dw_cfi_node): Remove typedef and rename to dw_cfi_node. (dw_fde_struct, dw_fde_node): Remove typedef and rename to dw_fde_node. (cfa_loc, dw_cfa_location): Remove typedef and rename to dw_cfa_location. (dw_vec_struct, dw_vec_const): Remove typedef and rename to dw_vec_const. (dw_val_struct, dw_val_node): Remove typedef and rename to dw_val_node. (dw_loc_descr_struct, dw_loc_descr_node): Remove typedef and rename to dw_loc_descr_node. * gcc/params.h (param_info, compiler_param): Remove typedef. * gcc/opts.h (cl_deferred_param): Remove typedef. * gcc/sreal.h (sreal): Remove typedef. * gcc/ddg.h (dep_type, dep_data_type): Remove typedef. * gcc/graphite-clast-to-gimple.h (cloog_prog_clast, bb_pbb_def): Remove typedef. * gcc/lto-streamer.h (lto_decl_stream_e_t, lto_encoder_entry, lto_symtab_encoder_iterator, res_pair): Remove typedef. * gcc/tree-affine.h (affine_tree_combination, aff_tree): Remove typedef and rename to aff_tree. * gcc/sched-int.h (region): Remove typedef. * gcc/diagnostic.h (diagnostic_info, diagnostic_classification_change_t): Remove typedef. * gcc/tree-ssa-loop.h (affine_iv_d): Remove typedef and rename to affine_iv. * gcc/sbitmap.h (sbitmap_iterator): Remove typedef. * gcc/ssa-iterators.h (immediate_use_iterator_d, imm_use_iterator): Remove typedef and rename to imm_use_iterator. (ssa_operand_iterator_d, ssa_op_iter): Remove typedef and rename to ssa_op_iter. * gcc/ggc-internal.h (ggc_statistics): Remove typedef. * gcc/cselib.h (cselib_val_struct, cselib_val): Remove typedef and rename to cselib_val. * gcc/tree-core.h (alias_pair): Remove typedef. (constructor_elt_d, constructor_elt): Remove typedef and rename to constructor_elt. (ssa_use_operand_d, ssa_use_operand_t): Remove typedef and rename to ssa_use_operand_t. * gcc/graphite-sese-to-poly.h (base_alias_pair): Remove typedef. * gcc/tree-data-ref.h (conflict_function): Remove typedef. * gcc/tree-inline.h (copy_body_data): Remove typedef. * gcc/ipa-inline.h (condition, size_time_entry, inline_param_summary_t, edge_growth_cache_entry): Remove typedef. * gcc/regrename.h (operand_rr_info, insn_rr_info): Remove typedef. * gcc/gimple-iterator.h (gimple_stmt_iterator_d, gimple_stmt_iterator): Remove typedef and rename to gimple_stmt_iterator. * gcc/basic-block.h (ce_if_block, ce_if_block_t): Remove typedef and rename to ce_if_block. (edge_iterator): Remove typedef. * gcc/ipa-prop.h (ipa_agg_jf_item, ipa_agg_jf_item_t): Remove typedef and rename to ipa_agg_jf_item. (ipa_agg_jump_function_t, ipa_param_descriptor_t, ipa_node_params_t, ipa_parm_adjustment_t): Remove typedef. (ipa_jump_func, ipa_jump_func_t): Remove typedef and rename to ipa_jump_func. (ipa_edge_args, ipa_edge_args_t): Remove typedef and rename to ipa_edge_args. * gcc/gcov-io.h (gcov_bucket_type): Remove typedef. (gcov_working_set_info, gcov_working_set_t): Remove typedef and rename to gcov_working_set_t. * gcc/ira-int.h (minmax_set_iterator, ira_allocno_iterator, ira_object_iterator, ira_allocno_object_iterator, ira_pref_iterator, ira_copy_iterator, ira_object_conflict_iterator): Remove typedef. * gcc/tree-iterator.h (tree_stmt_iterator): Remove typedef. * gcc/rtl.h (addr_diff_vec_flags, mem_attrs, reg_attrs, replace_label_data): Remove typedef. (rtunion_def, rtunion): Remove typedef and rename to rtunion. * gcc/hard-reg-set.h (hard_reg_set_iterator): Remove typedef. * gcc/sel-sched-ir.h (_list_iterator, sel_global_bb_info_def, sel_region_bb_info_def, succ_iterator): Remove typedef. (deps_where_def, deps_where_t): Remove typedef and rename to deps_where_t. * gcc/coretypes.h: Adapt forward declarations. * gcc/tree-scalar-evolution.h: Likewise. * gcc/tree-ssa-address.h: Likewise. * gcc/tree-ssa-operands.h: Likewise. * gcc/function.h: Likewise. * gcc/config/frv/frv-protos.h: Likewise. * gcc/targhooks.h: Likewise. * gcc/basic_block.h: Likewise. * gcc/rtl.def: Adapt documentation. * gcc/doc/tm.texi: Likewise. * gcc/ipa-cp.c: Adapt uses. * gcc/bitmap.c: Likewise. * gcc/dwarf2out.c: Likewise. * gcc/target.def: Likewise. * gcc/ipa-inline-analysis.c: Likewise. * gcc/dwarf2cfi.c: Likewise. * gcc/tree-ssa-loop-ivopts.c: Likewise. * gcc/lto-cgraph.c: Likewise. * gcc/config/frv/frv.c: Likewise. * gcc/ifcvt.c: Likewise. * gcc/ipa-prop.c: Likewise. From-SVN: r205863
2013-12-10 17:48:44 +01:00
struct minmax_set_iterator {
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
/* Array containing the bit vector. */
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
IRA_INT_TYPE *vec;
/* The number of the current element in the vector. */
unsigned int word_num;
/* The number of bits in the bit vector. */
unsigned int nel;
/* The current bit index of the bit vector. */
unsigned int bit_num;
/* Index corresponding to the 1st bit of the bit vector. */
int start_val;
/* The word of the bit vector currently visited. */
unsigned IRA_INT_TYPE word;
cgraph.h (cgraph_node_set_iterator, [...]): Remove typedef. * gcc/cgraph.h (cgraph_node_set_iterator, varpool_node_set_iterator): Remove typedef. (cgraph_inline_failed_enum, cgraph_inline_failed_t): Remove typedef and rename to cgraph_inline_failed_t. * gcc/tree-ssa-alias.h (ao_ref_s, ao_ref): Remove typedef and rename to ao_ref. * gcc/reload.h (reg_equivs_s, reg_equivs_t): Remove typedef and rename to reg_equivs_t. * gcc/conditions.h (CC_STATUS): Remove typedef. * gcc/bitmap.h (bitmap_obstack): Remove typedef. (bitmap_element_def, bitmap_element): Remove typedef and rename to bitmap_element. (bitmap_head_def, bitmap_head): Remove typedef and rename to bitmap_head. (bitmap_iterator): Remove typedef. * gcc/target.h (cumulative_args_t, print_switch_type, secondary_reload_info): Remove typedef. * gcc/dwarf2out.h (dw_cfi_oprnd_struct, dw_cfi_oprnd): Remove dw_cfi_oprnd_struct alias. (dw_cfi_struct, dw_cfi_node): Remove typedef and rename to dw_cfi_node. (dw_fde_struct, dw_fde_node): Remove typedef and rename to dw_fde_node. (cfa_loc, dw_cfa_location): Remove typedef and rename to dw_cfa_location. (dw_vec_struct, dw_vec_const): Remove typedef and rename to dw_vec_const. (dw_val_struct, dw_val_node): Remove typedef and rename to dw_val_node. (dw_loc_descr_struct, dw_loc_descr_node): Remove typedef and rename to dw_loc_descr_node. * gcc/params.h (param_info, compiler_param): Remove typedef. * gcc/opts.h (cl_deferred_param): Remove typedef. * gcc/sreal.h (sreal): Remove typedef. * gcc/ddg.h (dep_type, dep_data_type): Remove typedef. * gcc/graphite-clast-to-gimple.h (cloog_prog_clast, bb_pbb_def): Remove typedef. * gcc/lto-streamer.h (lto_decl_stream_e_t, lto_encoder_entry, lto_symtab_encoder_iterator, res_pair): Remove typedef. * gcc/tree-affine.h (affine_tree_combination, aff_tree): Remove typedef and rename to aff_tree. * gcc/sched-int.h (region): Remove typedef. * gcc/diagnostic.h (diagnostic_info, diagnostic_classification_change_t): Remove typedef. * gcc/tree-ssa-loop.h (affine_iv_d): Remove typedef and rename to affine_iv. * gcc/sbitmap.h (sbitmap_iterator): Remove typedef. * gcc/ssa-iterators.h (immediate_use_iterator_d, imm_use_iterator): Remove typedef and rename to imm_use_iterator. (ssa_operand_iterator_d, ssa_op_iter): Remove typedef and rename to ssa_op_iter. * gcc/ggc-internal.h (ggc_statistics): Remove typedef. * gcc/cselib.h (cselib_val_struct, cselib_val): Remove typedef and rename to cselib_val. * gcc/tree-core.h (alias_pair): Remove typedef. (constructor_elt_d, constructor_elt): Remove typedef and rename to constructor_elt. (ssa_use_operand_d, ssa_use_operand_t): Remove typedef and rename to ssa_use_operand_t. * gcc/graphite-sese-to-poly.h (base_alias_pair): Remove typedef. * gcc/tree-data-ref.h (conflict_function): Remove typedef. * gcc/tree-inline.h (copy_body_data): Remove typedef. * gcc/ipa-inline.h (condition, size_time_entry, inline_param_summary_t, edge_growth_cache_entry): Remove typedef. * gcc/regrename.h (operand_rr_info, insn_rr_info): Remove typedef. * gcc/gimple-iterator.h (gimple_stmt_iterator_d, gimple_stmt_iterator): Remove typedef and rename to gimple_stmt_iterator. * gcc/basic-block.h (ce_if_block, ce_if_block_t): Remove typedef and rename to ce_if_block. (edge_iterator): Remove typedef. * gcc/ipa-prop.h (ipa_agg_jf_item, ipa_agg_jf_item_t): Remove typedef and rename to ipa_agg_jf_item. (ipa_agg_jump_function_t, ipa_param_descriptor_t, ipa_node_params_t, ipa_parm_adjustment_t): Remove typedef. (ipa_jump_func, ipa_jump_func_t): Remove typedef and rename to ipa_jump_func. (ipa_edge_args, ipa_edge_args_t): Remove typedef and rename to ipa_edge_args. * gcc/gcov-io.h (gcov_bucket_type): Remove typedef. (gcov_working_set_info, gcov_working_set_t): Remove typedef and rename to gcov_working_set_t. * gcc/ira-int.h (minmax_set_iterator, ira_allocno_iterator, ira_object_iterator, ira_allocno_object_iterator, ira_pref_iterator, ira_copy_iterator, ira_object_conflict_iterator): Remove typedef. * gcc/tree-iterator.h (tree_stmt_iterator): Remove typedef. * gcc/rtl.h (addr_diff_vec_flags, mem_attrs, reg_attrs, replace_label_data): Remove typedef. (rtunion_def, rtunion): Remove typedef and rename to rtunion. * gcc/hard-reg-set.h (hard_reg_set_iterator): Remove typedef. * gcc/sel-sched-ir.h (_list_iterator, sel_global_bb_info_def, sel_region_bb_info_def, succ_iterator): Remove typedef. (deps_where_def, deps_where_t): Remove typedef and rename to deps_where_t. * gcc/coretypes.h: Adapt forward declarations. * gcc/tree-scalar-evolution.h: Likewise. * gcc/tree-ssa-address.h: Likewise. * gcc/tree-ssa-operands.h: Likewise. * gcc/function.h: Likewise. * gcc/config/frv/frv-protos.h: Likewise. * gcc/targhooks.h: Likewise. * gcc/basic_block.h: Likewise. * gcc/rtl.def: Adapt documentation. * gcc/doc/tm.texi: Likewise. * gcc/ipa-cp.c: Adapt uses. * gcc/bitmap.c: Likewise. * gcc/dwarf2out.c: Likewise. * gcc/target.def: Likewise. * gcc/ipa-inline-analysis.c: Likewise. * gcc/dwarf2cfi.c: Likewise. * gcc/tree-ssa-loop-ivopts.c: Likewise. * gcc/lto-cgraph.c: Likewise. * gcc/config/frv/frv.c: Likewise. * gcc/ifcvt.c: Likewise. * gcc/ipa-prop.c: Likewise. From-SVN: r205863
2013-12-10 17:48:44 +01:00
};
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
/* Initialize the iterator I for bit vector VEC containing minimal and
maximal values MIN and MAX. */
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
static inline void
minmax_set_iter_init (minmax_set_iterator *i, IRA_INT_TYPE *vec, int min,
int max)
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
{
i->vec = vec;
i->word_num = 0;
i->nel = max < min ? 0 : max - min + 1;
i->start_val = min;
i->bit_num = 0;
i->word = i->nel == 0 ? 0 : vec[0];
}
ira-build.c (ira_create_object): New arg SUBWORD; all callers changed. * ira-build.c (ira_create_object): New arg SUBWORD; all callers changed. Initialize OBJECT_SUBWORD. (ira_create_allocno): Clear ALLOCNO_NUM_OBJECTS. (ira_create_allocno_objects): Renamed from ira_create_allocno_object; all callers changed. (merge_hard_reg_conflicts): Iterate over allocno subobjects. (finish_allocno): Likewise. (move_allocno_live_ranges, copy_allocno_live_ranges): Likewise. (remove_low_level_allocnos): Likewise. (update_bad_spill_attribute): Likewise. (setup_min_max_allocno_live_range_point): Likewise. (sort_conflict_id_map): Likewise. (ira_flattening): Likewise. Use ior_hard_reg_conflicts. (ior_hard_reg_conflicts): New function. (ior_allocate_object_conflicts): Renamed first argument to OBJ. (compress_conflict_vecs): Iterate over objects, not allocnos. (ira_add_live_range_to_object): New function. (object_range_compare_func): Renamed from allocno_range_compare_func. All callers changed. (setup_min_max_conflict_allocno_ids): For allocnos with multiple subobjects, widen the min/max range of the lowest-order object to potentially include all other such low-order objects. * ira.c (ira_bad_reload_regno_1): Iterate over allocno subobjects. (check_allocation): Likewise. Use more fine-grained tests for register conflicts. * ira-color.c (allocnos_have_intersected_live_ranges_p): Iterate over allocno subobjects. (assign_hard_reg): Keep multiple sets of conflicts. Make finer-grained choices about which bits to set in each set. Don't use ira_hard_reg_not_in_set_p, perform a more elaborate test for conflicts using the multiple sets we computed. (push_allocno_to_stack): Iterate over allocno subobjects. (all_conflicting_hard_regs_coalesced): New static function. (setup_allocno_available_regs_num): Use it. (setup_allocno_left_conflicts_size): Likewise. Iterate over allocno subobjects. (coalesced_allocno_conflict): Test subobject 0 in each allocno. (setup_allocno_priorities): Divide ALLOCNO_EXCESS_PRESSURE_POINTS_NUM by ALLOCNO_NUM_OBJECTS. (calculate_spill_cost): Likewise. (color_pass): Express if statement in a more normal way. (ira_reassign_conflict_allocnos): Iterate over allocno subobjects. (slot_coalesced_allocno_live_ranges_intersect_p): Likewise. (setup_slot_coalesced_allocno_live_ranges): Likewise. (allocno_reload_assign): Likewise. (ira_reassign_pseudos): Likewise. (fast_allocation): Likewise. * ira-conflicts.c (build_conflict_bit_table): Likewise. (print_allocno_conflicts): Likewise. (ira_build_conflicts): Likewise. (allocnos_conflict_for_copy_p): Renamed from allocnos_conflict_p. All callers changed. Test subword 0 of each allocno for conflicts. (build_object_conflicts): Renamed from build_allocno_conflicts. All callers changed. Iterate over allocno subobjects. * ira-emit.c (modify_move_list): Iterate over allocno subobjects. * ira-int.h (struct ira_allocno): New member. num_objects. Rename object to objects and change it into an array. (ALLOCNO_OBJECT): Add new argument N. (ALLOCNO_NUM_OBJECTS, OBJECT_SUBWORD): New macros. (ira_create_allocno_objects): Renamed from ira_create_allocno_object. (ior_hard_reg_conflicts): Declare. (ira_add_live_range_to_object): Declare. (ira_allocno_object_iterator): New. (ira_allocno_object_iter_init, ira_allocno_object_iter_cond): New. (FOR_EACH_ALLOCNO_OBJECT): New macro. * ira-lives.c (objects_live): Renamed from allocnos_live; all uses changed. (allocnos_processed): New sparseset. (make_object_born): Renamed from make_allocno_born; take an ira_object_t argument. All callers changed. (make_object_dead): Renamed from make_allocno_dead; take an ira_object t argument. All callers changed. (update_allocno_pressure_excess_length): Take an ira_obejct_t argument. All callers changed. (mark_pseudo_regno_live): Iterate over allocno subobjects. (mark_pseudo_regno_dead): Likewise. (mark_pseudo_regno_subword_live, mark_pseudo_regno_subword_dead): New functions. (mark_ref_live): Detect subword accesses and call mark_pseudo_regno_subword_live as appropriate. (mark_ref_dead): Likewise for mark_pseudo_regno_subword_dead. (process_bb_nodes_live): Deal with object-related updates first; set and test bits in allocnos_processed to avoid computing allocno statistics more than once. (create_start_finish_chains): Iterate over objects, not allocnos. (print_object_live_ranges): New function. (print_allocno_live_ranges): Use it. (ira_create_allocno_live_ranges): Allocate and free allocnos_processed and objects_live. From-SVN: r162418
2010-07-22 17:48:30 +02:00
/* Return TRUE if we have more allocnos to visit, in which case *N is
set to the number of the element to be visited. Otherwise, return
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
FALSE. */
static inline bool
minmax_set_iter_cond (minmax_set_iterator *i, int *n)
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
{
/* Skip words that are zeros. */
for (; i->word == 0; i->word = i->vec[i->word_num])
{
i->word_num++;
i->bit_num = i->word_num * IRA_INT_BITS;
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
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
/* If we have reached the end, break. */
if (i->bit_num >= i->nel)
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
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
/* Skip bits that are zero. */
for (; (i->word & 1) == 0; i->word >>= 1)
i->bit_num++;
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
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
*n = (int) i->bit_num + i->start_val;
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
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
return true;
}
/* Advance to the next element in the set. */
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
static inline void
minmax_set_iter_next (minmax_set_iterator *i)
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
{
i->word >>= 1;
i->bit_num++;
}
/* Loop over all elements of a min/max set given by bit vector VEC and
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
their minimal and maximal values MIN and MAX. In each iteration, N
is set to the number of next allocno. ITER is an instance of
minmax_set_iterator used to iterate over the set. */
#define FOR_EACH_BIT_IN_MINMAX_SET(VEC, MIN, MAX, N, ITER) \
for (minmax_set_iter_init (&(ITER), (VEC), (MIN), (MAX)); \
minmax_set_iter_cond (&(ITER), &(N)); \
minmax_set_iter_next (&(ITER)))
Makefile.in (target-globals.o): Depend on $(IRA_INT_H). gcc/ * Makefile.in (target-globals.o): Depend on $(IRA_INT_H). * ira-int.h (ira_max_nregs, ira_important_class_nums): Delete. (target_ira_int): New structure. (default_target_ira_int): Declare. (this_target_ira_int): Declare as a variable or define as a macro. (ira_reg_mode_hard_regset, ira_register_move_cost) (ira_may_move_in_cost, ira_may_move_out_cost, ira_class_subset_p) (ira_non_ordered_class_hard_regs, ira_class_hard_reg_index) (prohibited_class_mode_regs, ira_important_classes_num) (ira_important_classes, ira_reg_class_intersect) (ira_reg_classes_intersect_p, ira_reg_class_super_classes) (ira_reg_class_union): Redefine as macros. * ira.h (target_ira): New structure. (default_target_ira): Declare. (this_target_ira): Declare as a variable or define as a macro. (ira_available_class_regs, ira_hard_regno_cover_class) (ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate) (ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs) (ira_class_hard_regs_num): Redefine as macros. * ira.c (default_target_ira, default_target_ira_int): New variables. (this_target_ira, this_target_ira_int): New conditional variables. (ira_reg_mode_hard_regset, ira_memory_move_cost) (ira_register_move_cost, ira_may_move_in_cost, ira_may_move_out_cost) (ira_class_subset_p): Delete. (no_unit_alloc_regs): Redefine as a macro. (ira_class_hard_regs, ira_non_ordered_class_hard_regs) (ira_class_hard_regs_num, ira_class_hard_reg_index) (ira_available_class_regs): Delete. (alloc_reg_class_subclasses): Redefine as a macro. (ira_reg_class_cover_size, ira_reg_class_cover) (ira_important_classes_num, ira_important_classes) (ira_important_class_nums, ira_class_translate): Delete. (cover_class_order): Document the variable's lifetime. (reorder_important_classes): Don't set ira_important_class_nums. (ira_reg_class_intersect, ira_reg_classes_intersect_p) (ira_reg_class_super_classes, ira_reg_class_union) (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_max_nregs): Delete. (setup_reg_class_nregs): Don't set ira_max_regs. (prohibited_class_mode_regs): Delete. * target-globals.h (this_target_ira, this_target_ira_int): Declare. (target_globals): Add ira and ira_int fields. (restore_target_globals): Copy the ira field to this_target_ira and the ira_int field to this_target_ira_int. * target-globals.c: Include ira-int.h. (default_target_globals): Initialize the ira and ira_int fields. (save_target_globals): Likewise. From-SVN: r162102
2010-07-12 21:03:06 +02:00
struct target_ira_int {
~target_ira_int ();
void free_ira_costs ();
void free_register_move_costs ();
/* Initialized once. It is a maximal possible size of the allocated
struct costs. */
size_t x_max_struct_costs_size;
/* Allocated and initialized once, and used to initialize cost values
for each insn. */
struct costs *x_init_cost;
/* Allocated once, and used for temporary purposes. */
struct costs *x_temp_costs;
/* Allocated once, and used for the cost calculation. */
struct costs *x_op_costs[MAX_RECOG_OPERANDS];
struct costs *x_this_op_costs[MAX_RECOG_OPERANDS];
Makefile.in (target-globals.o): Depend on $(IRA_INT_H). gcc/ * Makefile.in (target-globals.o): Depend on $(IRA_INT_H). * ira-int.h (ira_max_nregs, ira_important_class_nums): Delete. (target_ira_int): New structure. (default_target_ira_int): Declare. (this_target_ira_int): Declare as a variable or define as a macro. (ira_reg_mode_hard_regset, ira_register_move_cost) (ira_may_move_in_cost, ira_may_move_out_cost, ira_class_subset_p) (ira_non_ordered_class_hard_regs, ira_class_hard_reg_index) (prohibited_class_mode_regs, ira_important_classes_num) (ira_important_classes, ira_reg_class_intersect) (ira_reg_classes_intersect_p, ira_reg_class_super_classes) (ira_reg_class_union): Redefine as macros. * ira.h (target_ira): New structure. (default_target_ira): Declare. (this_target_ira): Declare as a variable or define as a macro. (ira_available_class_regs, ira_hard_regno_cover_class) (ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate) (ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs) (ira_class_hard_regs_num): Redefine as macros. * ira.c (default_target_ira, default_target_ira_int): New variables. (this_target_ira, this_target_ira_int): New conditional variables. (ira_reg_mode_hard_regset, ira_memory_move_cost) (ira_register_move_cost, ira_may_move_in_cost, ira_may_move_out_cost) (ira_class_subset_p): Delete. (no_unit_alloc_regs): Redefine as a macro. (ira_class_hard_regs, ira_non_ordered_class_hard_regs) (ira_class_hard_regs_num, ira_class_hard_reg_index) (ira_available_class_regs): Delete. (alloc_reg_class_subclasses): Redefine as a macro. (ira_reg_class_cover_size, ira_reg_class_cover) (ira_important_classes_num, ira_important_classes) (ira_important_class_nums, ira_class_translate): Delete. (cover_class_order): Document the variable's lifetime. (reorder_important_classes): Don't set ira_important_class_nums. (ira_reg_class_intersect, ira_reg_classes_intersect_p) (ira_reg_class_super_classes, ira_reg_class_union) (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_max_nregs): Delete. (setup_reg_class_nregs): Don't set ira_max_regs. (prohibited_class_mode_regs): Delete. * target-globals.h (this_target_ira, this_target_ira_int): Declare. (target_globals): Add ira and ira_int fields. (restore_target_globals): Copy the ira field to this_target_ira and the ira_int field to this_target_ira_int. * target-globals.c: Include ira-int.h. (default_target_globals): Initialize the ira and ira_int fields. (save_target_globals): Likewise. From-SVN: r162102
2010-07-12 21:03:06 +02:00
/* Hard registers that can not be used for the register allocator for
all functions of the current compilation unit. */
HARD_REG_SET x_no_unit_alloc_regs;
/* Map: hard regs X modes -> set of hard registers for storing value
of given mode starting with given hard register. */
HARD_REG_SET (x_ira_reg_mode_hard_regset
[FIRST_PSEUDO_REGISTER][NUM_MACHINE_MODES]);
/* Maximum cost of moving from a register in one class to a register
in another class. Based on TARGET_REGISTER_MOVE_COST. */
move_table *x_ira_register_move_cost[MAX_MACHINE_MODE];
/* Similar, but here we don't have to move if the first index is a
subset of the second so in that case the cost is zero. */
move_table *x_ira_may_move_in_cost[MAX_MACHINE_MODE];
/* Similar, but here we don't have to move if the first index is a
superset of the second so in that case the cost is zero. */
move_table *x_ira_may_move_out_cost[MAX_MACHINE_MODE];
/* Keep track of the last mode we initialized move costs for. */
int x_last_mode_for_init_move_cost;
/* Array analog of the macro MEMORY_MOVE_COST but they contain maximal
cost not minimal. */
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
short int x_ira_max_memory_move_cost[MAX_MACHINE_MODE][N_REG_CLASSES][2];
/* Map class->true if class is a possible allocno class, false
otherwise. */
bool x_ira_reg_allocno_class_p[N_REG_CLASSES];
/* Map class->true if class is a pressure class, false otherwise. */
bool x_ira_reg_pressure_class_p[N_REG_CLASSES];
Makefile.in (target-globals.o): Depend on $(IRA_INT_H). gcc/ * Makefile.in (target-globals.o): Depend on $(IRA_INT_H). * ira-int.h (ira_max_nregs, ira_important_class_nums): Delete. (target_ira_int): New structure. (default_target_ira_int): Declare. (this_target_ira_int): Declare as a variable or define as a macro. (ira_reg_mode_hard_regset, ira_register_move_cost) (ira_may_move_in_cost, ira_may_move_out_cost, ira_class_subset_p) (ira_non_ordered_class_hard_regs, ira_class_hard_reg_index) (prohibited_class_mode_regs, ira_important_classes_num) (ira_important_classes, ira_reg_class_intersect) (ira_reg_classes_intersect_p, ira_reg_class_super_classes) (ira_reg_class_union): Redefine as macros. * ira.h (target_ira): New structure. (default_target_ira): Declare. (this_target_ira): Declare as a variable or define as a macro. (ira_available_class_regs, ira_hard_regno_cover_class) (ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate) (ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs) (ira_class_hard_regs_num): Redefine as macros. * ira.c (default_target_ira, default_target_ira_int): New variables. (this_target_ira, this_target_ira_int): New conditional variables. (ira_reg_mode_hard_regset, ira_memory_move_cost) (ira_register_move_cost, ira_may_move_in_cost, ira_may_move_out_cost) (ira_class_subset_p): Delete. (no_unit_alloc_regs): Redefine as a macro. (ira_class_hard_regs, ira_non_ordered_class_hard_regs) (ira_class_hard_regs_num, ira_class_hard_reg_index) (ira_available_class_regs): Delete. (alloc_reg_class_subclasses): Redefine as a macro. (ira_reg_class_cover_size, ira_reg_class_cover) (ira_important_classes_num, ira_important_classes) (ira_important_class_nums, ira_class_translate): Delete. (cover_class_order): Document the variable's lifetime. (reorder_important_classes): Don't set ira_important_class_nums. (ira_reg_class_intersect, ira_reg_classes_intersect_p) (ira_reg_class_super_classes, ira_reg_class_union) (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_max_nregs): Delete. (setup_reg_class_nregs): Don't set ira_max_regs. (prohibited_class_mode_regs): Delete. * target-globals.h (this_target_ira, this_target_ira_int): Declare. (target_globals): Add ira and ira_int fields. (restore_target_globals): Copy the ira field to this_target_ira and the ira_int field to this_target_ira_int. * target-globals.c: Include ira-int.h. (default_target_globals): Initialize the ira and ira_int fields. (save_target_globals): Likewise. From-SVN: r162102
2010-07-12 21:03:06 +02:00
/* Array of the number of hard registers of given class which are
available for allocation. The order is defined by the hard
Makefile.in (target-globals.o): Depend on $(IRA_INT_H). gcc/ * Makefile.in (target-globals.o): Depend on $(IRA_INT_H). * ira-int.h (ira_max_nregs, ira_important_class_nums): Delete. (target_ira_int): New structure. (default_target_ira_int): Declare. (this_target_ira_int): Declare as a variable or define as a macro. (ira_reg_mode_hard_regset, ira_register_move_cost) (ira_may_move_in_cost, ira_may_move_out_cost, ira_class_subset_p) (ira_non_ordered_class_hard_regs, ira_class_hard_reg_index) (prohibited_class_mode_regs, ira_important_classes_num) (ira_important_classes, ira_reg_class_intersect) (ira_reg_classes_intersect_p, ira_reg_class_super_classes) (ira_reg_class_union): Redefine as macros. * ira.h (target_ira): New structure. (default_target_ira): Declare. (this_target_ira): Declare as a variable or define as a macro. (ira_available_class_regs, ira_hard_regno_cover_class) (ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate) (ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs) (ira_class_hard_regs_num): Redefine as macros. * ira.c (default_target_ira, default_target_ira_int): New variables. (this_target_ira, this_target_ira_int): New conditional variables. (ira_reg_mode_hard_regset, ira_memory_move_cost) (ira_register_move_cost, ira_may_move_in_cost, ira_may_move_out_cost) (ira_class_subset_p): Delete. (no_unit_alloc_regs): Redefine as a macro. (ira_class_hard_regs, ira_non_ordered_class_hard_regs) (ira_class_hard_regs_num, ira_class_hard_reg_index) (ira_available_class_regs): Delete. (alloc_reg_class_subclasses): Redefine as a macro. (ira_reg_class_cover_size, ira_reg_class_cover) (ira_important_classes_num, ira_important_classes) (ira_important_class_nums, ira_class_translate): Delete. (cover_class_order): Document the variable's lifetime. (reorder_important_classes): Don't set ira_important_class_nums. (ira_reg_class_intersect, ira_reg_classes_intersect_p) (ira_reg_class_super_classes, ira_reg_class_union) (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_max_nregs): Delete. (setup_reg_class_nregs): Don't set ira_max_regs. (prohibited_class_mode_regs): Delete. * target-globals.h (this_target_ira, this_target_ira_int): Declare. (target_globals): Add ira and ira_int fields. (restore_target_globals): Copy the ira field to this_target_ira and the ira_int field to this_target_ira_int. * target-globals.c: Include ira-int.h. (default_target_globals): Initialize the ira and ira_int fields. (save_target_globals): Likewise. From-SVN: r162102
2010-07-12 21:03:06 +02:00
register numbers. */
short x_ira_non_ordered_class_hard_regs[N_REG_CLASSES][FIRST_PSEUDO_REGISTER];
/* Index (in ira_class_hard_regs; for given register class and hard
register (in general case a hard register can belong to several
register classes;. The index is negative for hard registers
unavailable for the allocation. */
short x_ira_class_hard_reg_index[N_REG_CLASSES][FIRST_PSEUDO_REGISTER];
/* Index [CL][M] contains R if R appears somewhere in a register of the form:
(reg:M R'), R' not in x_ira_prohibited_class_mode_regs[CL][M]
For example, if:
- (reg:M 2) is valid and occupies two registers;
- register 2 belongs to CL; and
- register 3 belongs to the same pressure class as CL
then (reg:M 2) contributes to [CL][M] and registers 2 and 3 will be
in the set. */
HARD_REG_SET x_ira_useful_class_mode_regs[N_REG_CLASSES][NUM_MACHINE_MODES];
Makefile.in (target-globals.o): Depend on $(IRA_INT_H). gcc/ * Makefile.in (target-globals.o): Depend on $(IRA_INT_H). * ira-int.h (ira_max_nregs, ira_important_class_nums): Delete. (target_ira_int): New structure. (default_target_ira_int): Declare. (this_target_ira_int): Declare as a variable or define as a macro. (ira_reg_mode_hard_regset, ira_register_move_cost) (ira_may_move_in_cost, ira_may_move_out_cost, ira_class_subset_p) (ira_non_ordered_class_hard_regs, ira_class_hard_reg_index) (prohibited_class_mode_regs, ira_important_classes_num) (ira_important_classes, ira_reg_class_intersect) (ira_reg_classes_intersect_p, ira_reg_class_super_classes) (ira_reg_class_union): Redefine as macros. * ira.h (target_ira): New structure. (default_target_ira): Declare. (this_target_ira): Declare as a variable or define as a macro. (ira_available_class_regs, ira_hard_regno_cover_class) (ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate) (ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs) (ira_class_hard_regs_num): Redefine as macros. * ira.c (default_target_ira, default_target_ira_int): New variables. (this_target_ira, this_target_ira_int): New conditional variables. (ira_reg_mode_hard_regset, ira_memory_move_cost) (ira_register_move_cost, ira_may_move_in_cost, ira_may_move_out_cost) (ira_class_subset_p): Delete. (no_unit_alloc_regs): Redefine as a macro. (ira_class_hard_regs, ira_non_ordered_class_hard_regs) (ira_class_hard_regs_num, ira_class_hard_reg_index) (ira_available_class_regs): Delete. (alloc_reg_class_subclasses): Redefine as a macro. (ira_reg_class_cover_size, ira_reg_class_cover) (ira_important_classes_num, ira_important_classes) (ira_important_class_nums, ira_class_translate): Delete. (cover_class_order): Document the variable's lifetime. (reorder_important_classes): Don't set ira_important_class_nums. (ira_reg_class_intersect, ira_reg_classes_intersect_p) (ira_reg_class_super_classes, ira_reg_class_union) (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_max_nregs): Delete. (setup_reg_class_nregs): Don't set ira_max_regs. (prohibited_class_mode_regs): Delete. * target-globals.h (this_target_ira, this_target_ira_int): Declare. (target_globals): Add ira and ira_int fields. (restore_target_globals): Copy the ira field to this_target_ira and the ira_int field to this_target_ira_int. * target-globals.c: Include ira-int.h. (default_target_globals): Initialize the ira and ira_int fields. (save_target_globals): Likewise. From-SVN: r162102
2010-07-12 21:03:06 +02:00
/* The value is number of elements in the subsequent array. */
int x_ira_important_classes_num;
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
/* The array containing all non-empty classes. Such classes is
Makefile.in (target-globals.o): Depend on $(IRA_INT_H). gcc/ * Makefile.in (target-globals.o): Depend on $(IRA_INT_H). * ira-int.h (ira_max_nregs, ira_important_class_nums): Delete. (target_ira_int): New structure. (default_target_ira_int): Declare. (this_target_ira_int): Declare as a variable or define as a macro. (ira_reg_mode_hard_regset, ira_register_move_cost) (ira_may_move_in_cost, ira_may_move_out_cost, ira_class_subset_p) (ira_non_ordered_class_hard_regs, ira_class_hard_reg_index) (prohibited_class_mode_regs, ira_important_classes_num) (ira_important_classes, ira_reg_class_intersect) (ira_reg_classes_intersect_p, ira_reg_class_super_classes) (ira_reg_class_union): Redefine as macros. * ira.h (target_ira): New structure. (default_target_ira): Declare. (this_target_ira): Declare as a variable or define as a macro. (ira_available_class_regs, ira_hard_regno_cover_class) (ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate) (ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs) (ira_class_hard_regs_num): Redefine as macros. * ira.c (default_target_ira, default_target_ira_int): New variables. (this_target_ira, this_target_ira_int): New conditional variables. (ira_reg_mode_hard_regset, ira_memory_move_cost) (ira_register_move_cost, ira_may_move_in_cost, ira_may_move_out_cost) (ira_class_subset_p): Delete. (no_unit_alloc_regs): Redefine as a macro. (ira_class_hard_regs, ira_non_ordered_class_hard_regs) (ira_class_hard_regs_num, ira_class_hard_reg_index) (ira_available_class_regs): Delete. (alloc_reg_class_subclasses): Redefine as a macro. (ira_reg_class_cover_size, ira_reg_class_cover) (ira_important_classes_num, ira_important_classes) (ira_important_class_nums, ira_class_translate): Delete. (cover_class_order): Document the variable's lifetime. (reorder_important_classes): Don't set ira_important_class_nums. (ira_reg_class_intersect, ira_reg_classes_intersect_p) (ira_reg_class_super_classes, ira_reg_class_union) (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_max_nregs): Delete. (setup_reg_class_nregs): Don't set ira_max_regs. (prohibited_class_mode_regs): Delete. * target-globals.h (this_target_ira, this_target_ira_int): Declare. (target_globals): Add ira and ira_int fields. (restore_target_globals): Copy the ira field to this_target_ira and the ira_int field to this_target_ira_int. * target-globals.c: Include ira-int.h. (default_target_globals): Initialize the ira and ira_int fields. (save_target_globals): Likewise. From-SVN: r162102
2010-07-12 21:03:06 +02:00
important for calculation of the hard register usage costs. */
enum reg_class x_ira_important_classes[N_REG_CLASSES];
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
/* The array containing indexes of important classes in the previous
array. The array elements are defined only for important
classes. */
int x_ira_important_class_nums[N_REG_CLASSES];
/* Map class->true if class is an uniform class, false otherwise. */
bool x_ira_uniform_class_p[N_REG_CLASSES];
Makefile.in (target-globals.o): Depend on $(IRA_INT_H). gcc/ * Makefile.in (target-globals.o): Depend on $(IRA_INT_H). * ira-int.h (ira_max_nregs, ira_important_class_nums): Delete. (target_ira_int): New structure. (default_target_ira_int): Declare. (this_target_ira_int): Declare as a variable or define as a macro. (ira_reg_mode_hard_regset, ira_register_move_cost) (ira_may_move_in_cost, ira_may_move_out_cost, ira_class_subset_p) (ira_non_ordered_class_hard_regs, ira_class_hard_reg_index) (prohibited_class_mode_regs, ira_important_classes_num) (ira_important_classes, ira_reg_class_intersect) (ira_reg_classes_intersect_p, ira_reg_class_super_classes) (ira_reg_class_union): Redefine as macros. * ira.h (target_ira): New structure. (default_target_ira): Declare. (this_target_ira): Declare as a variable or define as a macro. (ira_available_class_regs, ira_hard_regno_cover_class) (ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate) (ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs) (ira_class_hard_regs_num): Redefine as macros. * ira.c (default_target_ira, default_target_ira_int): New variables. (this_target_ira, this_target_ira_int): New conditional variables. (ira_reg_mode_hard_regset, ira_memory_move_cost) (ira_register_move_cost, ira_may_move_in_cost, ira_may_move_out_cost) (ira_class_subset_p): Delete. (no_unit_alloc_regs): Redefine as a macro. (ira_class_hard_regs, ira_non_ordered_class_hard_regs) (ira_class_hard_regs_num, ira_class_hard_reg_index) (ira_available_class_regs): Delete. (alloc_reg_class_subclasses): Redefine as a macro. (ira_reg_class_cover_size, ira_reg_class_cover) (ira_important_classes_num, ira_important_classes) (ira_important_class_nums, ira_class_translate): Delete. (cover_class_order): Document the variable's lifetime. (reorder_important_classes): Don't set ira_important_class_nums. (ira_reg_class_intersect, ira_reg_classes_intersect_p) (ira_reg_class_super_classes, ira_reg_class_union) (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_max_nregs): Delete. (setup_reg_class_nregs): Don't set ira_max_regs. (prohibited_class_mode_regs): Delete. * target-globals.h (this_target_ira, this_target_ira_int): Declare. (target_globals): Add ira and ira_int fields. (restore_target_globals): Copy the ira field to this_target_ira and the ira_int field to this_target_ira_int. * target-globals.c: Include ira-int.h. (default_target_globals): Initialize the ira and ira_int fields. (save_target_globals): Likewise. From-SVN: r162102
2010-07-12 21:03:06 +02:00
/* The biggest important class inside of intersection of the two
classes (that is calculated taking only hard registers available
for allocation into account;. If the both classes contain no hard
registers available for allocation, the value is calculated with
taking all hard-registers including fixed ones into account. */
enum reg_class x_ira_reg_class_intersect[N_REG_CLASSES][N_REG_CLASSES];
/* Classes with end marker LIM_REG_CLASSES which are intersected with
dbxout.c (dbxout_symbol_location): Pass new argument to alter_subreg. 2012-10-23 Vladimir Makarov <vmakarov@redhat.com> * dbxout.c (dbxout_symbol_location): Pass new argument to alter_subreg. * dwarf2out.c: Include ira.h and lra.h. (based_loc_descr, compute_frame_pointer_to_fb_displacement): Use lra_eliminate_regs for LRA instead of eliminate_regs. * expr.c (emit_move_insn_1): Pass an additional argument to emit_move_via_integer. Use emit_move_via_integer for LRA only if the insn is recognized. * emit-rtl.c (gen_rtx_REG): Add lra_in_progress. (validate_subreg): Don't check offset for LRA and floating point modes. * final.c (final_scan_insn, cleanup_subreg_operands): Pass new argument to alter_subreg. (walk_alter_subreg, output_operand): Ditto. (alter_subreg): Add new argument. * gcse.c (calculate_bb_reg_pressure): Add parameter to ira_setup_eliminable_regset call. * ira.c: Include lra.h. (ira_init_once, ira_init, ira_finish_once): Call lra_start_once, lra_init, lra_finish_once in anyway. (ira_setup_eliminable_regset): Add parameter. Remove need_fp. Call lra_init_elimination and mark HARD_FRAME_POINTER_REGNUM as living forever if frame_pointer_needed. (setup_reg_class_relations): Set up ira_reg_class_subset. (ira_reg_equiv_invariant_p, ira_reg_equiv_const): Remove. (find_reg_equiv_invariant_const): Ditto. (setup_reg_renumber): Use ira_equiv_no_lvalue_p instead of ira_reg_equiv_invariant_p. Skip caps for LRA. (setup_reg_equiv_init, ira_update_equiv_info_by_shuffle_insn): New functions. (ira_reg_equiv_len, ira_reg_equiv): New externals. (ira_reg_equiv): New. (ira_expand_reg_equiv, init_reg_equiv, finish_reg_equiv): New functions. (no_equiv, update_equiv_regs): Use ira_reg_equiv instead of reg_equiv_init. (setup_reg_equiv): New function. (ira_use_lra_p): New global. (ira): Set up lra_simple_p and ira_conflicts_p. Set up and restore flag_caller_saves and flag_ira_region. Move initialization of ira_obstack and ira_bitmap_obstack upper. Call init_reg_equiv, setup_reg_equiv, and setup_reg_equiv_init instead of initialization of ira_reg_equiv_len, ira_reg_equiv_invariant_p, and ira_reg_equiv_const. Call ira_setup_eliminable_regset with a new argument. Don't flatten IRA IRA for LRA. Don't reassign conflict allocnos for LRA. Call finish_reg_equiv. (do_reload): Prepare code for LRA call. Call LRA. * ira.h (ira_use_lra_p): New external. (struct target_ira): Add members x_ira_class_subset_p x_ira_reg_class_subset, and x_ira_reg_classes_intersect_p. (ira_class_subset_p, ira_reg_class_subset): New macros. (ira_reg_classes_intersect_p): New macro. (struct ira_reg_equiv): New. (ira_setup_eliminable_regset): Add an argument. (ira_expand_reg_equiv, ira_update_equiv_info_by_shuffle_insn): New prototypes. * ira-color.c (color_pass, move_spill_restore, coalesce_allocnos): Use ira_equiv_no_lvalue_p. (coalesce_spill_slots, ira_sort_regnos_for_alter_reg): Ditto. * ira-emit.c (ira_create_new_reg): Call ira_expand_reg_equiv. (generate_edge_moves, change_loop) Use ira_equiv_no_lvalue_p. (emit_move_list): Simplify code. Call ira_update_equiv_info_by_shuffle_insn. Use ira_reg_equiv instead of ira_reg_equiv_invariant_p and ira_reg_equiv_const. Change assert. * ira-int.h (struct target_ira_int): Remove x_ira_class_subset_p and x_ira_reg_classes_intersect_p. (ira_class_subset_p, ira_reg_classes_intersect_p): Remove. (ira_reg_equiv_len, ira_reg_equiv_invariant_p): Ditto. (ira_reg_equiv_const): Ditto. (ira_equiv_no_lvalue_p): New function. * jump.c (true_regnum): Always use hard_regno for subreg_get_info when lra is in progress. * haifa-sched.c (sched_init): Pass new argument to ira_setup_eliminable_regset. * loop-invariant.c (calculate_loop_reg_pressure): Pass new argument to ira_setup_eliminable_regset. * lra.h: New. * lra-int.h: Ditto. * lra.c: Ditto. * lra-assigns.c: Ditto. * lra-constraints.c: Ditto. * lra-coalesce.c: Ditto. * lra-eliminations.c: Ditto. * lra-lives.c: Ditto. * lra-spills.c: Ditto. * Makefile.in (LRA_INT_H): New. (OBJS): Add lra.o, lra-assigns.o, lra-coalesce.o, lra-constraints.o, lra-eliminations.o, lra-lives.o, and lra-spills.o. (dwarf2out.o): Add dependence on ira.h and lra.h. (ira.o): Add dependence on lra.h. (lra.o, lra-assigns.o, lra-coalesce.o, lra-constraints.o): New entries. (lra-eliminations.o, lra-lives.o, lra-spills.o): Ditto. * output.h (alter_subreg): Add new argument. * rtlanal.c (simplify_subreg_regno): Permit mode changes for LRA. Permit ARG_POINTER_REGNUM and STACK_POINTER_REGNUM for LRA. * recog.c (general_operand, register_operand): Accept paradoxical FLOAT_MODE subregs for LRA. (scratch_operand): Accept pseudos for LRA. * rtl.h (lra_in_progress): New external. (debug_bb_n_slim, debug_bb_slim, print_value_slim): New prototypes. (debug_rtl_slim, debug_insn_slim): Ditto. * sdbout.c (sdbout_symbol): Pass new argument to alter_subreg. * sched-vis.c (print_value_slim): New. * target.def (lra_p): New hook. (register_priority): Ditto. (different_addr_displacement_p): Ditto. (spill_class): Ditto. * target-globals.h (this_target_lra_int): New external. (target_globals): New member lra_int. (restore_target_globals): Restore this_target_lra_int. * target-globals.c: Include lra-int.h. (default_target_globals): Add &default_target_lra_int. * targhooks.c (default_lra_p): New function. (default_register_priority): Ditto. (default_different_addr_displacement_p): Ditto. * targhooks.h (default_lra_p): Declare. (default_register_priority): Ditto. (default_different_addr_displacement_p): Ditto. * timevar.def (TV_LRA, TV_LRA_ELIMINATE, TV_LRA_INHERITANCE): New. (TV_LRA_CREATE_LIVE_RANGES, TV_LRA_ASSIGN, TV_LRA_COALESCE): New. * config/arm/arm.c (load_multiple_sequence): Pass new argument toOB alter_subreg. (store_multiple_sequence): Ditto. * config/i386/i386.h (enum ix86_tune_indices): Add X86_TUNE_GENERAL_REGS_SSE_SPILL. (TARGET_GENERAL_REGS_SSE_SPILL): New macro. * config/i386/i386.c (initial_ix86_tune_features): Set up X86_TUNE_GENERAL_REGS_SSE_SPILL for m_COREI7 and m_CORE2I7. (ix86_lra_p, ix86_register_priority): New functions. (ix86_secondary_reload): Add NON_Q_REGS, SIREG, DIREG. (inline_secondary_memory_needed): Change assert. (ix86_spill_class): New function. (TARGET_LRA_P, TARGET_REGISTER_BANK, TARGET_SPILL_CLASS): New macros. * config/m68k/m68k.c (emit_move_sequence): Pass new argument to alter_subreg. * config/m32r/m32r.c (gen_split_move_double): Ditto. * config/pa/pa.c (pa_emit_move_sequence): Ditto. * config/sh/sh.md: Ditto. * config/v850/v850.c (v850_reorg): Ditto. * config/xtensa/xtensa.c (fixup_subreg_mem): Ditto. * doc/md.texi: Add new interpretation of hint * for LRA. * doc/passes.texi: Describe LRA pass. * doc/tm.texi.in: Add TARGET_LRA_P, TARGET_REGISTER_PRIORITY, TARGET_DIFFERENT_ADDR_DISPLACEMENT_P, and TARGET_SPILL_CLASS. * doc/tm.texi: Update. From-SVN: r192719
2012-10-23 17:51:41 +02:00
given class (the first index). That includes given class itself.
Makefile.in (target-globals.o): Depend on $(IRA_INT_H). gcc/ * Makefile.in (target-globals.o): Depend on $(IRA_INT_H). * ira-int.h (ira_max_nregs, ira_important_class_nums): Delete. (target_ira_int): New structure. (default_target_ira_int): Declare. (this_target_ira_int): Declare as a variable or define as a macro. (ira_reg_mode_hard_regset, ira_register_move_cost) (ira_may_move_in_cost, ira_may_move_out_cost, ira_class_subset_p) (ira_non_ordered_class_hard_regs, ira_class_hard_reg_index) (prohibited_class_mode_regs, ira_important_classes_num) (ira_important_classes, ira_reg_class_intersect) (ira_reg_classes_intersect_p, ira_reg_class_super_classes) (ira_reg_class_union): Redefine as macros. * ira.h (target_ira): New structure. (default_target_ira): Declare. (this_target_ira): Declare as a variable or define as a macro. (ira_available_class_regs, ira_hard_regno_cover_class) (ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate) (ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs) (ira_class_hard_regs_num): Redefine as macros. * ira.c (default_target_ira, default_target_ira_int): New variables. (this_target_ira, this_target_ira_int): New conditional variables. (ira_reg_mode_hard_regset, ira_memory_move_cost) (ira_register_move_cost, ira_may_move_in_cost, ira_may_move_out_cost) (ira_class_subset_p): Delete. (no_unit_alloc_regs): Redefine as a macro. (ira_class_hard_regs, ira_non_ordered_class_hard_regs) (ira_class_hard_regs_num, ira_class_hard_reg_index) (ira_available_class_regs): Delete. (alloc_reg_class_subclasses): Redefine as a macro. (ira_reg_class_cover_size, ira_reg_class_cover) (ira_important_classes_num, ira_important_classes) (ira_important_class_nums, ira_class_translate): Delete. (cover_class_order): Document the variable's lifetime. (reorder_important_classes): Don't set ira_important_class_nums. (ira_reg_class_intersect, ira_reg_classes_intersect_p) (ira_reg_class_super_classes, ira_reg_class_union) (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_max_nregs): Delete. (setup_reg_class_nregs): Don't set ira_max_regs. (prohibited_class_mode_regs): Delete. * target-globals.h (this_target_ira, this_target_ira_int): Declare. (target_globals): Add ira and ira_int fields. (restore_target_globals): Copy the ira field to this_target_ira and the ira_int field to this_target_ira_int. * target-globals.c: Include ira-int.h. (default_target_globals): Initialize the ira and ira_int fields. (save_target_globals): Likewise. From-SVN: r162102
2010-07-12 21:03:06 +02:00
This is calculated taking only hard registers available for
allocation into account. */
enum reg_class x_ira_reg_class_super_classes[N_REG_CLASSES][N_REG_CLASSES];
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
/* The biggest (smallest) important class inside of (covering) union
of the two classes (that is calculated taking only hard registers
available for allocation into account). If the both classes
contain no hard registers available for allocation, the value is
calculated with taking all hard-registers including fixed ones
into account. In other words, the value is the corresponding
reg_class_subunion (reg_class_superunion) value. */
enum reg_class x_ira_reg_class_subunion[N_REG_CLASSES][N_REG_CLASSES];
enum reg_class x_ira_reg_class_superunion[N_REG_CLASSES][N_REG_CLASSES];
Makefile.in (target-globals.o): Depend on $(IRA_INT_H). gcc/ * Makefile.in (target-globals.o): Depend on $(IRA_INT_H). * ira-int.h (ira_max_nregs, ira_important_class_nums): Delete. (target_ira_int): New structure. (default_target_ira_int): Declare. (this_target_ira_int): Declare as a variable or define as a macro. (ira_reg_mode_hard_regset, ira_register_move_cost) (ira_may_move_in_cost, ira_may_move_out_cost, ira_class_subset_p) (ira_non_ordered_class_hard_regs, ira_class_hard_reg_index) (prohibited_class_mode_regs, ira_important_classes_num) (ira_important_classes, ira_reg_class_intersect) (ira_reg_classes_intersect_p, ira_reg_class_super_classes) (ira_reg_class_union): Redefine as macros. * ira.h (target_ira): New structure. (default_target_ira): Declare. (this_target_ira): Declare as a variable or define as a macro. (ira_available_class_regs, ira_hard_regno_cover_class) (ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate) (ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs) (ira_class_hard_regs_num): Redefine as macros. * ira.c (default_target_ira, default_target_ira_int): New variables. (this_target_ira, this_target_ira_int): New conditional variables. (ira_reg_mode_hard_regset, ira_memory_move_cost) (ira_register_move_cost, ira_may_move_in_cost, ira_may_move_out_cost) (ira_class_subset_p): Delete. (no_unit_alloc_regs): Redefine as a macro. (ira_class_hard_regs, ira_non_ordered_class_hard_regs) (ira_class_hard_regs_num, ira_class_hard_reg_index) (ira_available_class_regs): Delete. (alloc_reg_class_subclasses): Redefine as a macro. (ira_reg_class_cover_size, ira_reg_class_cover) (ira_important_classes_num, ira_important_classes) (ira_important_class_nums, ira_class_translate): Delete. (cover_class_order): Document the variable's lifetime. (reorder_important_classes): Don't set ira_important_class_nums. (ira_reg_class_intersect, ira_reg_classes_intersect_p) (ira_reg_class_super_classes, ira_reg_class_union) (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_max_nregs): Delete. (setup_reg_class_nregs): Don't set ira_max_regs. (prohibited_class_mode_regs): Delete. * target-globals.h (this_target_ira, this_target_ira_int): Declare. (target_globals): Add ira and ira_int fields. (restore_target_globals): Copy the ira field to this_target_ira and the ira_int field to this_target_ira_int. * target-globals.c: Include ira-int.h. (default_target_globals): Initialize the ira and ira_int fields. (save_target_globals): Likewise. From-SVN: r162102
2010-07-12 21:03:06 +02:00
/* For each reg class, table listing all the classes contained in it
(excluding the class itself. Non-allocatable registers are
dbxout.c (dbxout_symbol_location): Pass new argument to alter_subreg. 2012-10-23 Vladimir Makarov <vmakarov@redhat.com> * dbxout.c (dbxout_symbol_location): Pass new argument to alter_subreg. * dwarf2out.c: Include ira.h and lra.h. (based_loc_descr, compute_frame_pointer_to_fb_displacement): Use lra_eliminate_regs for LRA instead of eliminate_regs. * expr.c (emit_move_insn_1): Pass an additional argument to emit_move_via_integer. Use emit_move_via_integer for LRA only if the insn is recognized. * emit-rtl.c (gen_rtx_REG): Add lra_in_progress. (validate_subreg): Don't check offset for LRA and floating point modes. * final.c (final_scan_insn, cleanup_subreg_operands): Pass new argument to alter_subreg. (walk_alter_subreg, output_operand): Ditto. (alter_subreg): Add new argument. * gcse.c (calculate_bb_reg_pressure): Add parameter to ira_setup_eliminable_regset call. * ira.c: Include lra.h. (ira_init_once, ira_init, ira_finish_once): Call lra_start_once, lra_init, lra_finish_once in anyway. (ira_setup_eliminable_regset): Add parameter. Remove need_fp. Call lra_init_elimination and mark HARD_FRAME_POINTER_REGNUM as living forever if frame_pointer_needed. (setup_reg_class_relations): Set up ira_reg_class_subset. (ira_reg_equiv_invariant_p, ira_reg_equiv_const): Remove. (find_reg_equiv_invariant_const): Ditto. (setup_reg_renumber): Use ira_equiv_no_lvalue_p instead of ira_reg_equiv_invariant_p. Skip caps for LRA. (setup_reg_equiv_init, ira_update_equiv_info_by_shuffle_insn): New functions. (ira_reg_equiv_len, ira_reg_equiv): New externals. (ira_reg_equiv): New. (ira_expand_reg_equiv, init_reg_equiv, finish_reg_equiv): New functions. (no_equiv, update_equiv_regs): Use ira_reg_equiv instead of reg_equiv_init. (setup_reg_equiv): New function. (ira_use_lra_p): New global. (ira): Set up lra_simple_p and ira_conflicts_p. Set up and restore flag_caller_saves and flag_ira_region. Move initialization of ira_obstack and ira_bitmap_obstack upper. Call init_reg_equiv, setup_reg_equiv, and setup_reg_equiv_init instead of initialization of ira_reg_equiv_len, ira_reg_equiv_invariant_p, and ira_reg_equiv_const. Call ira_setup_eliminable_regset with a new argument. Don't flatten IRA IRA for LRA. Don't reassign conflict allocnos for LRA. Call finish_reg_equiv. (do_reload): Prepare code for LRA call. Call LRA. * ira.h (ira_use_lra_p): New external. (struct target_ira): Add members x_ira_class_subset_p x_ira_reg_class_subset, and x_ira_reg_classes_intersect_p. (ira_class_subset_p, ira_reg_class_subset): New macros. (ira_reg_classes_intersect_p): New macro. (struct ira_reg_equiv): New. (ira_setup_eliminable_regset): Add an argument. (ira_expand_reg_equiv, ira_update_equiv_info_by_shuffle_insn): New prototypes. * ira-color.c (color_pass, move_spill_restore, coalesce_allocnos): Use ira_equiv_no_lvalue_p. (coalesce_spill_slots, ira_sort_regnos_for_alter_reg): Ditto. * ira-emit.c (ira_create_new_reg): Call ira_expand_reg_equiv. (generate_edge_moves, change_loop) Use ira_equiv_no_lvalue_p. (emit_move_list): Simplify code. Call ira_update_equiv_info_by_shuffle_insn. Use ira_reg_equiv instead of ira_reg_equiv_invariant_p and ira_reg_equiv_const. Change assert. * ira-int.h (struct target_ira_int): Remove x_ira_class_subset_p and x_ira_reg_classes_intersect_p. (ira_class_subset_p, ira_reg_classes_intersect_p): Remove. (ira_reg_equiv_len, ira_reg_equiv_invariant_p): Ditto. (ira_reg_equiv_const): Ditto. (ira_equiv_no_lvalue_p): New function. * jump.c (true_regnum): Always use hard_regno for subreg_get_info when lra is in progress. * haifa-sched.c (sched_init): Pass new argument to ira_setup_eliminable_regset. * loop-invariant.c (calculate_loop_reg_pressure): Pass new argument to ira_setup_eliminable_regset. * lra.h: New. * lra-int.h: Ditto. * lra.c: Ditto. * lra-assigns.c: Ditto. * lra-constraints.c: Ditto. * lra-coalesce.c: Ditto. * lra-eliminations.c: Ditto. * lra-lives.c: Ditto. * lra-spills.c: Ditto. * Makefile.in (LRA_INT_H): New. (OBJS): Add lra.o, lra-assigns.o, lra-coalesce.o, lra-constraints.o, lra-eliminations.o, lra-lives.o, and lra-spills.o. (dwarf2out.o): Add dependence on ira.h and lra.h. (ira.o): Add dependence on lra.h. (lra.o, lra-assigns.o, lra-coalesce.o, lra-constraints.o): New entries. (lra-eliminations.o, lra-lives.o, lra-spills.o): Ditto. * output.h (alter_subreg): Add new argument. * rtlanal.c (simplify_subreg_regno): Permit mode changes for LRA. Permit ARG_POINTER_REGNUM and STACK_POINTER_REGNUM for LRA. * recog.c (general_operand, register_operand): Accept paradoxical FLOAT_MODE subregs for LRA. (scratch_operand): Accept pseudos for LRA. * rtl.h (lra_in_progress): New external. (debug_bb_n_slim, debug_bb_slim, print_value_slim): New prototypes. (debug_rtl_slim, debug_insn_slim): Ditto. * sdbout.c (sdbout_symbol): Pass new argument to alter_subreg. * sched-vis.c (print_value_slim): New. * target.def (lra_p): New hook. (register_priority): Ditto. (different_addr_displacement_p): Ditto. (spill_class): Ditto. * target-globals.h (this_target_lra_int): New external. (target_globals): New member lra_int. (restore_target_globals): Restore this_target_lra_int. * target-globals.c: Include lra-int.h. (default_target_globals): Add &default_target_lra_int. * targhooks.c (default_lra_p): New function. (default_register_priority): Ditto. (default_different_addr_displacement_p): Ditto. * targhooks.h (default_lra_p): Declare. (default_register_priority): Ditto. (default_different_addr_displacement_p): Ditto. * timevar.def (TV_LRA, TV_LRA_ELIMINATE, TV_LRA_INHERITANCE): New. (TV_LRA_CREATE_LIVE_RANGES, TV_LRA_ASSIGN, TV_LRA_COALESCE): New. * config/arm/arm.c (load_multiple_sequence): Pass new argument toOB alter_subreg. (store_multiple_sequence): Ditto. * config/i386/i386.h (enum ix86_tune_indices): Add X86_TUNE_GENERAL_REGS_SSE_SPILL. (TARGET_GENERAL_REGS_SSE_SPILL): New macro. * config/i386/i386.c (initial_ix86_tune_features): Set up X86_TUNE_GENERAL_REGS_SSE_SPILL for m_COREI7 and m_CORE2I7. (ix86_lra_p, ix86_register_priority): New functions. (ix86_secondary_reload): Add NON_Q_REGS, SIREG, DIREG. (inline_secondary_memory_needed): Change assert. (ix86_spill_class): New function. (TARGET_LRA_P, TARGET_REGISTER_BANK, TARGET_SPILL_CLASS): New macros. * config/m68k/m68k.c (emit_move_sequence): Pass new argument to alter_subreg. * config/m32r/m32r.c (gen_split_move_double): Ditto. * config/pa/pa.c (pa_emit_move_sequence): Ditto. * config/sh/sh.md: Ditto. * config/v850/v850.c (v850_reorg): Ditto. * config/xtensa/xtensa.c (fixup_subreg_mem): Ditto. * doc/md.texi: Add new interpretation of hint * for LRA. * doc/passes.texi: Describe LRA pass. * doc/tm.texi.in: Add TARGET_LRA_P, TARGET_REGISTER_PRIORITY, TARGET_DIFFERENT_ADDR_DISPLACEMENT_P, and TARGET_SPILL_CLASS. * doc/tm.texi: Update. From-SVN: r192719
2012-10-23 17:51:41 +02:00
excluded from the consideration). */
Makefile.in (target-globals.o): Depend on $(IRA_INT_H). gcc/ * Makefile.in (target-globals.o): Depend on $(IRA_INT_H). * ira-int.h (ira_max_nregs, ira_important_class_nums): Delete. (target_ira_int): New structure. (default_target_ira_int): Declare. (this_target_ira_int): Declare as a variable or define as a macro. (ira_reg_mode_hard_regset, ira_register_move_cost) (ira_may_move_in_cost, ira_may_move_out_cost, ira_class_subset_p) (ira_non_ordered_class_hard_regs, ira_class_hard_reg_index) (prohibited_class_mode_regs, ira_important_classes_num) (ira_important_classes, ira_reg_class_intersect) (ira_reg_classes_intersect_p, ira_reg_class_super_classes) (ira_reg_class_union): Redefine as macros. * ira.h (target_ira): New structure. (default_target_ira): Declare. (this_target_ira): Declare as a variable or define as a macro. (ira_available_class_regs, ira_hard_regno_cover_class) (ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate) (ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs) (ira_class_hard_regs_num): Redefine as macros. * ira.c (default_target_ira, default_target_ira_int): New variables. (this_target_ira, this_target_ira_int): New conditional variables. (ira_reg_mode_hard_regset, ira_memory_move_cost) (ira_register_move_cost, ira_may_move_in_cost, ira_may_move_out_cost) (ira_class_subset_p): Delete. (no_unit_alloc_regs): Redefine as a macro. (ira_class_hard_regs, ira_non_ordered_class_hard_regs) (ira_class_hard_regs_num, ira_class_hard_reg_index) (ira_available_class_regs): Delete. (alloc_reg_class_subclasses): Redefine as a macro. (ira_reg_class_cover_size, ira_reg_class_cover) (ira_important_classes_num, ira_important_classes) (ira_important_class_nums, ira_class_translate): Delete. (cover_class_order): Document the variable's lifetime. (reorder_important_classes): Don't set ira_important_class_nums. (ira_reg_class_intersect, ira_reg_classes_intersect_p) (ira_reg_class_super_classes, ira_reg_class_union) (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_max_nregs): Delete. (setup_reg_class_nregs): Don't set ira_max_regs. (prohibited_class_mode_regs): Delete. * target-globals.h (this_target_ira, this_target_ira_int): Declare. (target_globals): Add ira and ira_int fields. (restore_target_globals): Copy the ira field to this_target_ira and the ira_int field to this_target_ira_int. * target-globals.c: Include ira-int.h. (default_target_globals): Initialize the ira and ira_int fields. (save_target_globals): Likewise. From-SVN: r162102
2010-07-12 21:03:06 +02:00
enum reg_class x_alloc_reg_class_subclasses[N_REG_CLASSES][N_REG_CLASSES];
/* Array whose values are hard regset of hard registers for which
move of the hard register in given mode into itself is
prohibited. */
HARD_REG_SET x_ira_prohibited_mode_move_regs[NUM_MACHINE_MODES];
/* Flag of that the above array has been initialized. */
bool x_ira_prohibited_mode_move_regs_initialized_p;
Makefile.in (target-globals.o): Depend on $(IRA_INT_H). gcc/ * Makefile.in (target-globals.o): Depend on $(IRA_INT_H). * ira-int.h (ira_max_nregs, ira_important_class_nums): Delete. (target_ira_int): New structure. (default_target_ira_int): Declare. (this_target_ira_int): Declare as a variable or define as a macro. (ira_reg_mode_hard_regset, ira_register_move_cost) (ira_may_move_in_cost, ira_may_move_out_cost, ira_class_subset_p) (ira_non_ordered_class_hard_regs, ira_class_hard_reg_index) (prohibited_class_mode_regs, ira_important_classes_num) (ira_important_classes, ira_reg_class_intersect) (ira_reg_classes_intersect_p, ira_reg_class_super_classes) (ira_reg_class_union): Redefine as macros. * ira.h (target_ira): New structure. (default_target_ira): Declare. (this_target_ira): Declare as a variable or define as a macro. (ira_available_class_regs, ira_hard_regno_cover_class) (ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate) (ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs) (ira_class_hard_regs_num): Redefine as macros. * ira.c (default_target_ira, default_target_ira_int): New variables. (this_target_ira, this_target_ira_int): New conditional variables. (ira_reg_mode_hard_regset, ira_memory_move_cost) (ira_register_move_cost, ira_may_move_in_cost, ira_may_move_out_cost) (ira_class_subset_p): Delete. (no_unit_alloc_regs): Redefine as a macro. (ira_class_hard_regs, ira_non_ordered_class_hard_regs) (ira_class_hard_regs_num, ira_class_hard_reg_index) (ira_available_class_regs): Delete. (alloc_reg_class_subclasses): Redefine as a macro. (ira_reg_class_cover_size, ira_reg_class_cover) (ira_important_classes_num, ira_important_classes) (ira_important_class_nums, ira_class_translate): Delete. (cover_class_order): Document the variable's lifetime. (reorder_important_classes): Don't set ira_important_class_nums. (ira_reg_class_intersect, ira_reg_classes_intersect_p) (ira_reg_class_super_classes, ira_reg_class_union) (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_max_nregs): Delete. (setup_reg_class_nregs): Don't set ira_max_regs. (prohibited_class_mode_regs): Delete. * target-globals.h (this_target_ira, this_target_ira_int): Declare. (target_globals): Add ira and ira_int fields. (restore_target_globals): Copy the ira field to this_target_ira and the ira_int field to this_target_ira_int. * target-globals.c: Include ira-int.h. (default_target_globals): Initialize the ira and ira_int fields. (save_target_globals): Likewise. From-SVN: r162102
2010-07-12 21:03:06 +02:00
};
extern struct target_ira_int default_target_ira_int;
#if SWITCHABLE_TARGET
extern struct target_ira_int *this_target_ira_int;
#else
#define this_target_ira_int (&default_target_ira_int)
#endif
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
Makefile.in (target-globals.o): Depend on $(IRA_INT_H). gcc/ * Makefile.in (target-globals.o): Depend on $(IRA_INT_H). * ira-int.h (ira_max_nregs, ira_important_class_nums): Delete. (target_ira_int): New structure. (default_target_ira_int): Declare. (this_target_ira_int): Declare as a variable or define as a macro. (ira_reg_mode_hard_regset, ira_register_move_cost) (ira_may_move_in_cost, ira_may_move_out_cost, ira_class_subset_p) (ira_non_ordered_class_hard_regs, ira_class_hard_reg_index) (prohibited_class_mode_regs, ira_important_classes_num) (ira_important_classes, ira_reg_class_intersect) (ira_reg_classes_intersect_p, ira_reg_class_super_classes) (ira_reg_class_union): Redefine as macros. * ira.h (target_ira): New structure. (default_target_ira): Declare. (this_target_ira): Declare as a variable or define as a macro. (ira_available_class_regs, ira_hard_regno_cover_class) (ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate) (ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs) (ira_class_hard_regs_num): Redefine as macros. * ira.c (default_target_ira, default_target_ira_int): New variables. (this_target_ira, this_target_ira_int): New conditional variables. (ira_reg_mode_hard_regset, ira_memory_move_cost) (ira_register_move_cost, ira_may_move_in_cost, ira_may_move_out_cost) (ira_class_subset_p): Delete. (no_unit_alloc_regs): Redefine as a macro. (ira_class_hard_regs, ira_non_ordered_class_hard_regs) (ira_class_hard_regs_num, ira_class_hard_reg_index) (ira_available_class_regs): Delete. (alloc_reg_class_subclasses): Redefine as a macro. (ira_reg_class_cover_size, ira_reg_class_cover) (ira_important_classes_num, ira_important_classes) (ira_important_class_nums, ira_class_translate): Delete. (cover_class_order): Document the variable's lifetime. (reorder_important_classes): Don't set ira_important_class_nums. (ira_reg_class_intersect, ira_reg_classes_intersect_p) (ira_reg_class_super_classes, ira_reg_class_union) (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_max_nregs): Delete. (setup_reg_class_nregs): Don't set ira_max_regs. (prohibited_class_mode_regs): Delete. * target-globals.h (this_target_ira, this_target_ira_int): Declare. (target_globals): Add ira and ira_int fields. (restore_target_globals): Copy the ira field to this_target_ira and the ira_int field to this_target_ira_int. * target-globals.c: Include ira-int.h. (default_target_globals): Initialize the ira and ira_int fields. (save_target_globals): Likewise. From-SVN: r162102
2010-07-12 21:03:06 +02:00
#define ira_reg_mode_hard_regset \
(this_target_ira_int->x_ira_reg_mode_hard_regset)
#define ira_register_move_cost \
(this_target_ira_int->x_ira_register_move_cost)
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
#define ira_max_memory_move_cost \
(this_target_ira_int->x_ira_max_memory_move_cost)
Makefile.in (target-globals.o): Depend on $(IRA_INT_H). gcc/ * Makefile.in (target-globals.o): Depend on $(IRA_INT_H). * ira-int.h (ira_max_nregs, ira_important_class_nums): Delete. (target_ira_int): New structure. (default_target_ira_int): Declare. (this_target_ira_int): Declare as a variable or define as a macro. (ira_reg_mode_hard_regset, ira_register_move_cost) (ira_may_move_in_cost, ira_may_move_out_cost, ira_class_subset_p) (ira_non_ordered_class_hard_regs, ira_class_hard_reg_index) (prohibited_class_mode_regs, ira_important_classes_num) (ira_important_classes, ira_reg_class_intersect) (ira_reg_classes_intersect_p, ira_reg_class_super_classes) (ira_reg_class_union): Redefine as macros. * ira.h (target_ira): New structure. (default_target_ira): Declare. (this_target_ira): Declare as a variable or define as a macro. (ira_available_class_regs, ira_hard_regno_cover_class) (ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate) (ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs) (ira_class_hard_regs_num): Redefine as macros. * ira.c (default_target_ira, default_target_ira_int): New variables. (this_target_ira, this_target_ira_int): New conditional variables. (ira_reg_mode_hard_regset, ira_memory_move_cost) (ira_register_move_cost, ira_may_move_in_cost, ira_may_move_out_cost) (ira_class_subset_p): Delete. (no_unit_alloc_regs): Redefine as a macro. (ira_class_hard_regs, ira_non_ordered_class_hard_regs) (ira_class_hard_regs_num, ira_class_hard_reg_index) (ira_available_class_regs): Delete. (alloc_reg_class_subclasses): Redefine as a macro. (ira_reg_class_cover_size, ira_reg_class_cover) (ira_important_classes_num, ira_important_classes) (ira_important_class_nums, ira_class_translate): Delete. (cover_class_order): Document the variable's lifetime. (reorder_important_classes): Don't set ira_important_class_nums. (ira_reg_class_intersect, ira_reg_classes_intersect_p) (ira_reg_class_super_classes, ira_reg_class_union) (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_max_nregs): Delete. (setup_reg_class_nregs): Don't set ira_max_regs. (prohibited_class_mode_regs): Delete. * target-globals.h (this_target_ira, this_target_ira_int): Declare. (target_globals): Add ira and ira_int fields. (restore_target_globals): Copy the ira field to this_target_ira and the ira_int field to this_target_ira_int. * target-globals.c: Include ira-int.h. (default_target_globals): Initialize the ira and ira_int fields. (save_target_globals): Likewise. From-SVN: r162102
2010-07-12 21:03:06 +02:00
#define ira_may_move_in_cost \
(this_target_ira_int->x_ira_may_move_in_cost)
#define ira_may_move_out_cost \
(this_target_ira_int->x_ira_may_move_out_cost)
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
#define ira_reg_allocno_class_p \
(this_target_ira_int->x_ira_reg_allocno_class_p)
#define ira_reg_pressure_class_p \
(this_target_ira_int->x_ira_reg_pressure_class_p)
Makefile.in (target-globals.o): Depend on $(IRA_INT_H). gcc/ * Makefile.in (target-globals.o): Depend on $(IRA_INT_H). * ira-int.h (ira_max_nregs, ira_important_class_nums): Delete. (target_ira_int): New structure. (default_target_ira_int): Declare. (this_target_ira_int): Declare as a variable or define as a macro. (ira_reg_mode_hard_regset, ira_register_move_cost) (ira_may_move_in_cost, ira_may_move_out_cost, ira_class_subset_p) (ira_non_ordered_class_hard_regs, ira_class_hard_reg_index) (prohibited_class_mode_regs, ira_important_classes_num) (ira_important_classes, ira_reg_class_intersect) (ira_reg_classes_intersect_p, ira_reg_class_super_classes) (ira_reg_class_union): Redefine as macros. * ira.h (target_ira): New structure. (default_target_ira): Declare. (this_target_ira): Declare as a variable or define as a macro. (ira_available_class_regs, ira_hard_regno_cover_class) (ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate) (ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs) (ira_class_hard_regs_num): Redefine as macros. * ira.c (default_target_ira, default_target_ira_int): New variables. (this_target_ira, this_target_ira_int): New conditional variables. (ira_reg_mode_hard_regset, ira_memory_move_cost) (ira_register_move_cost, ira_may_move_in_cost, ira_may_move_out_cost) (ira_class_subset_p): Delete. (no_unit_alloc_regs): Redefine as a macro. (ira_class_hard_regs, ira_non_ordered_class_hard_regs) (ira_class_hard_regs_num, ira_class_hard_reg_index) (ira_available_class_regs): Delete. (alloc_reg_class_subclasses): Redefine as a macro. (ira_reg_class_cover_size, ira_reg_class_cover) (ira_important_classes_num, ira_important_classes) (ira_important_class_nums, ira_class_translate): Delete. (cover_class_order): Document the variable's lifetime. (reorder_important_classes): Don't set ira_important_class_nums. (ira_reg_class_intersect, ira_reg_classes_intersect_p) (ira_reg_class_super_classes, ira_reg_class_union) (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_max_nregs): Delete. (setup_reg_class_nregs): Don't set ira_max_regs. (prohibited_class_mode_regs): Delete. * target-globals.h (this_target_ira, this_target_ira_int): Declare. (target_globals): Add ira and ira_int fields. (restore_target_globals): Copy the ira field to this_target_ira and the ira_int field to this_target_ira_int. * target-globals.c: Include ira-int.h. (default_target_globals): Initialize the ira and ira_int fields. (save_target_globals): Likewise. From-SVN: r162102
2010-07-12 21:03:06 +02:00
#define ira_non_ordered_class_hard_regs \
(this_target_ira_int->x_ira_non_ordered_class_hard_regs)
#define ira_class_hard_reg_index \
(this_target_ira_int->x_ira_class_hard_reg_index)
#define ira_useful_class_mode_regs \
(this_target_ira_int->x_ira_useful_class_mode_regs)
Makefile.in (target-globals.o): Depend on $(IRA_INT_H). gcc/ * Makefile.in (target-globals.o): Depend on $(IRA_INT_H). * ira-int.h (ira_max_nregs, ira_important_class_nums): Delete. (target_ira_int): New structure. (default_target_ira_int): Declare. (this_target_ira_int): Declare as a variable or define as a macro. (ira_reg_mode_hard_regset, ira_register_move_cost) (ira_may_move_in_cost, ira_may_move_out_cost, ira_class_subset_p) (ira_non_ordered_class_hard_regs, ira_class_hard_reg_index) (prohibited_class_mode_regs, ira_important_classes_num) (ira_important_classes, ira_reg_class_intersect) (ira_reg_classes_intersect_p, ira_reg_class_super_classes) (ira_reg_class_union): Redefine as macros. * ira.h (target_ira): New structure. (default_target_ira): Declare. (this_target_ira): Declare as a variable or define as a macro. (ira_available_class_regs, ira_hard_regno_cover_class) (ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate) (ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs) (ira_class_hard_regs_num): Redefine as macros. * ira.c (default_target_ira, default_target_ira_int): New variables. (this_target_ira, this_target_ira_int): New conditional variables. (ira_reg_mode_hard_regset, ira_memory_move_cost) (ira_register_move_cost, ira_may_move_in_cost, ira_may_move_out_cost) (ira_class_subset_p): Delete. (no_unit_alloc_regs): Redefine as a macro. (ira_class_hard_regs, ira_non_ordered_class_hard_regs) (ira_class_hard_regs_num, ira_class_hard_reg_index) (ira_available_class_regs): Delete. (alloc_reg_class_subclasses): Redefine as a macro. (ira_reg_class_cover_size, ira_reg_class_cover) (ira_important_classes_num, ira_important_classes) (ira_important_class_nums, ira_class_translate): Delete. (cover_class_order): Document the variable's lifetime. (reorder_important_classes): Don't set ira_important_class_nums. (ira_reg_class_intersect, ira_reg_classes_intersect_p) (ira_reg_class_super_classes, ira_reg_class_union) (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_max_nregs): Delete. (setup_reg_class_nregs): Don't set ira_max_regs. (prohibited_class_mode_regs): Delete. * target-globals.h (this_target_ira, this_target_ira_int): Declare. (target_globals): Add ira and ira_int fields. (restore_target_globals): Copy the ira field to this_target_ira and the ira_int field to this_target_ira_int. * target-globals.c: Include ira-int.h. (default_target_globals): Initialize the ira and ira_int fields. (save_target_globals): Likewise. From-SVN: r162102
2010-07-12 21:03:06 +02:00
#define ira_important_classes_num \
(this_target_ira_int->x_ira_important_classes_num)
#define ira_important_classes \
(this_target_ira_int->x_ira_important_classes)
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
#define ira_important_class_nums \
(this_target_ira_int->x_ira_important_class_nums)
#define ira_uniform_class_p \
(this_target_ira_int->x_ira_uniform_class_p)
Makefile.in (target-globals.o): Depend on $(IRA_INT_H). gcc/ * Makefile.in (target-globals.o): Depend on $(IRA_INT_H). * ira-int.h (ira_max_nregs, ira_important_class_nums): Delete. (target_ira_int): New structure. (default_target_ira_int): Declare. (this_target_ira_int): Declare as a variable or define as a macro. (ira_reg_mode_hard_regset, ira_register_move_cost) (ira_may_move_in_cost, ira_may_move_out_cost, ira_class_subset_p) (ira_non_ordered_class_hard_regs, ira_class_hard_reg_index) (prohibited_class_mode_regs, ira_important_classes_num) (ira_important_classes, ira_reg_class_intersect) (ira_reg_classes_intersect_p, ira_reg_class_super_classes) (ira_reg_class_union): Redefine as macros. * ira.h (target_ira): New structure. (default_target_ira): Declare. (this_target_ira): Declare as a variable or define as a macro. (ira_available_class_regs, ira_hard_regno_cover_class) (ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate) (ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs) (ira_class_hard_regs_num): Redefine as macros. * ira.c (default_target_ira, default_target_ira_int): New variables. (this_target_ira, this_target_ira_int): New conditional variables. (ira_reg_mode_hard_regset, ira_memory_move_cost) (ira_register_move_cost, ira_may_move_in_cost, ira_may_move_out_cost) (ira_class_subset_p): Delete. (no_unit_alloc_regs): Redefine as a macro. (ira_class_hard_regs, ira_non_ordered_class_hard_regs) (ira_class_hard_regs_num, ira_class_hard_reg_index) (ira_available_class_regs): Delete. (alloc_reg_class_subclasses): Redefine as a macro. (ira_reg_class_cover_size, ira_reg_class_cover) (ira_important_classes_num, ira_important_classes) (ira_important_class_nums, ira_class_translate): Delete. (cover_class_order): Document the variable's lifetime. (reorder_important_classes): Don't set ira_important_class_nums. (ira_reg_class_intersect, ira_reg_classes_intersect_p) (ira_reg_class_super_classes, ira_reg_class_union) (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_max_nregs): Delete. (setup_reg_class_nregs): Don't set ira_max_regs. (prohibited_class_mode_regs): Delete. * target-globals.h (this_target_ira, this_target_ira_int): Declare. (target_globals): Add ira and ira_int fields. (restore_target_globals): Copy the ira field to this_target_ira and the ira_int field to this_target_ira_int. * target-globals.c: Include ira-int.h. (default_target_globals): Initialize the ira and ira_int fields. (save_target_globals): Likewise. From-SVN: r162102
2010-07-12 21:03:06 +02:00
#define ira_reg_class_intersect \
(this_target_ira_int->x_ira_reg_class_intersect)
#define ira_reg_class_super_classes \
(this_target_ira_int->x_ira_reg_class_super_classes)
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
#define ira_reg_class_subunion \
(this_target_ira_int->x_ira_reg_class_subunion)
#define ira_reg_class_superunion \
(this_target_ira_int->x_ira_reg_class_superunion)
#define ira_prohibited_mode_move_regs \
(this_target_ira_int->x_ira_prohibited_mode_move_regs)
Makefile.in (target-globals.o): Depend on $(IRA_INT_H). gcc/ * Makefile.in (target-globals.o): Depend on $(IRA_INT_H). * ira-int.h (ira_max_nregs, ira_important_class_nums): Delete. (target_ira_int): New structure. (default_target_ira_int): Declare. (this_target_ira_int): Declare as a variable or define as a macro. (ira_reg_mode_hard_regset, ira_register_move_cost) (ira_may_move_in_cost, ira_may_move_out_cost, ira_class_subset_p) (ira_non_ordered_class_hard_regs, ira_class_hard_reg_index) (prohibited_class_mode_regs, ira_important_classes_num) (ira_important_classes, ira_reg_class_intersect) (ira_reg_classes_intersect_p, ira_reg_class_super_classes) (ira_reg_class_union): Redefine as macros. * ira.h (target_ira): New structure. (default_target_ira): Declare. (this_target_ira): Declare as a variable or define as a macro. (ira_available_class_regs, ira_hard_regno_cover_class) (ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate) (ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs) (ira_class_hard_regs_num): Redefine as macros. * ira.c (default_target_ira, default_target_ira_int): New variables. (this_target_ira, this_target_ira_int): New conditional variables. (ira_reg_mode_hard_regset, ira_memory_move_cost) (ira_register_move_cost, ira_may_move_in_cost, ira_may_move_out_cost) (ira_class_subset_p): Delete. (no_unit_alloc_regs): Redefine as a macro. (ira_class_hard_regs, ira_non_ordered_class_hard_regs) (ira_class_hard_regs_num, ira_class_hard_reg_index) (ira_available_class_regs): Delete. (alloc_reg_class_subclasses): Redefine as a macro. (ira_reg_class_cover_size, ira_reg_class_cover) (ira_important_classes_num, ira_important_classes) (ira_important_class_nums, ira_class_translate): Delete. (cover_class_order): Document the variable's lifetime. (reorder_important_classes): Don't set ira_important_class_nums. (ira_reg_class_intersect, ira_reg_classes_intersect_p) (ira_reg_class_super_classes, ira_reg_class_union) (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_max_nregs): Delete. (setup_reg_class_nregs): Don't set ira_max_regs. (prohibited_class_mode_regs): Delete. * target-globals.h (this_target_ira, this_target_ira_int): Declare. (target_globals): Add ira and ira_int fields. (restore_target_globals): Copy the ira field to this_target_ira and the ira_int field to this_target_ira_int. * target-globals.c: Include ira-int.h. (default_target_globals): Initialize the ira and ira_int fields. (save_target_globals): Likewise. From-SVN: r162102
2010-07-12 21:03:06 +02:00
/* ira.c: */
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
extern void *ira_allocate (size_t);
extern void ira_free (void *addr);
extern bitmap ira_allocate_bitmap (void);
extern void ira_free_bitmap (bitmap);
extern void ira_print_disposition (FILE *);
extern void ira_debug_disposition (void);
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
extern void ira_debug_allocno_classes (void);
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
extern void ira_init_register_move_cost (machine_mode);
recog_memoized works on an rtx_insn * gcc/ChangeLog: 2014-09-09 David Malcolm <dmalcolm@redhat.com> * caller-save.c (rtx saveinsn): Strengthen this variable from rtx to rtx_insn *. (restinsn): Likewise. * config/aarch64/aarch64-protos.h (aarch64_simd_attr_length_move): Likewise for param. * config/aarch64/aarch64.c (aarch64_simd_attr_length_move): Likewise. * config/arc/arc-protos.h (arc_adjust_insn_length): Likewise for first param. (arc_hazard): Likewise for both params. * config/arc/arc.c (arc600_corereg_hazard): Likewise, adding checked casts to rtx_sequence * and uses of the insn method for type-safety. (arc_hazard): Strengthen both params from rtx to rtx_insn *. (arc_adjust_insn_length): Likewise for param "insn". (struct insn_length_parameters_s): Likewise for first param of "get_variants" callback field. (arc_get_insn_variants): Likewise for first param and local "inner". Replace a check of GET_CODE with a dyn_cast to rtx_sequence *, using methods for type-safety and clarity. * config/arc/arc.h (ADJUST_INSN_LENGTH): Use casts to rtx_sequence * and uses of the insn method for type-safety when invoking arc_adjust_insn_length. * config/arm/arm-protos.h (arm_attr_length_move_neon): Likewise for param. (arm_address_offset_is_imm): Likewise. (struct tune_params): Likewise for params 1 and 3 of the "sched_adjust_cost" callback field. * config/arm/arm.c (cortex_a9_sched_adjust_cost): Likewise for params 1 and 3 ("insn" and "dep"). (xscale_sched_adjust_cost): Likewise. (fa726te_sched_adjust_cost): Likewise. (cortexa7_older_only): Likewise for param "insn". (cortexa7_younger): Likewise. (arm_attr_length_move_neon): Likewise. (arm_address_offset_is_imm): Likewise. * config/avr/avr-protos.h (avr_notice_update_cc): Likewise. * config/avr/avr.c (avr_notice_update_cc): Likewise. * config/bfin/bfin.c (hwloop_pattern_reg): Likewise. (workaround_speculation): Likewise for local "last_condjump". * config/c6x/c6x.c (shadow_p): Likewise for param "insn". (shadow_or_blockage_p): Likewise. (get_unit_reqs): Likewise. (get_unit_operand_masks): Likewise. (c6x_registers_update): Likewise. (returning_call_p): Likewise. (can_use_callp): Likewise. (convert_to_callp): Likewise. (find_last_same_clock): Likwise for local "t". (reorg_split_calls): Likewise for local "shadow". (hwloop_pattern_reg): Likewise for param "insn". * config/frv/frv-protos.h (frv_final_prescan_insn): Likewise. * config/frv/frv.c (frv_final_prescan_insn): Likewise. (frv_extract_membar): Likewise. (frv_optimize_membar_local): Strengthen param "last_membar" from rtx * to rtx_insn **. (frv_optimize_membar_global): Strengthen param "membar" from rtx to rtx_insn *. (frv_optimize_membar): Strengthen local "last_membar" from rtx * to rtx_insn **. * config/ia64/ia64-protos.h (ia64_st_address_bypass_p): Strengthen both params from rtx to rtx_insn *. (ia64_ld_address_bypass_p): Likewise. * config/ia64/ia64.c (ia64_safe_itanium_class): Likewise for param "insn". (ia64_safe_type): Likewise. (group_barrier_needed): Likewise. (safe_group_barrier_needed): Likewise. (ia64_single_set): Likewise. (is_load_p): Likewise. (record_memory_reference): Likewise. (get_mode_no_for_insn): Likewise. (important_for_bundling_p): Likewise. (unknown_for_bundling_p): Likewise. (ia64_st_address_bypass_p): Likewise for both params. (ia64_ld_address_bypass_p): Likewise. (expand_vselect): Introduce new local rtx_insn * "insn", using it in place of rtx "x" after the emit_insn call. * config/i386/i386-protos.h (x86_extended_QIreg_mentioned_p): Strengthen param from rtx to rtx_insn *. (ix86_agi_dependent): Likewise for both params. (ix86_attr_length_immediate_default): Likewise for param 1. (ix86_attr_length_address_default): Likewise for param. (ix86_attr_length_vex_default): Likewise for param 1. * config/i386/i386.c (ix86_attr_length_immediate_default): Likewise for param "insn". (ix86_attr_length_address_default): Likewise. (ix86_attr_length_vex_default): Likewise. (ix86_agi_dependent): Likewise for both params. (x86_extended_QIreg_mentioned_p): Likewise for param "insn". (vselect_insn): Likewise for this variable. * config/m68k/m68k-protos.h (m68k_sched_attr_opx_type): Likewise for param 1. (m68k_sched_attr_opy_type): Likewise. * config/m68k/m68k.c (sched_get_operand): Likewise. (sched_attr_op_type): Likewise. (m68k_sched_attr_opx_type): Likewise. (m68k_sched_attr_opy_type): Likewise. (sched_get_reg_operand): Likewise. (sched_get_mem_operand): Likewise. (m68k_sched_address_bypass_p): Likewise for both params. (sched_get_indexed_address_scale): Likewise. (m68k_sched_indexed_address_bypass_p): Likewise. * config/m68k/m68k.h (m68k_sched_address_bypass_p): Likewise. (m68k_sched_indexed_address_bypass_p): Likewise. * config/mep/mep.c (mep_jmp_return_reorg): Strengthen locals "label", "ret" from rtx to rtx_insn *, adding a checked cast and removing another. * config/mips/mips-protos.h (mips_linked_madd_p): Strengthen both params from rtx to rtx_insn *. (mips_fmadd_bypass): Likewise. * config/mips/mips.c (mips_fmadd_bypass): Likewise. (mips_linked_madd_p): Likewise. (mips_macc_chains_last_hilo): Likewise for this variable. (mips_macc_chains_record): Likewise for param. (vr4130_last_insn): Likewise for this variable. (vr4130_swap_insns_p): Likewise for both params. (mips_ls2_variable_issue): Likewise for param. (mips_need_noat_wrapper_p): Likewise for param "insn". (mips_expand_vselect): Add a new local rtx_insn * "insn", using it in place of "x" after the emit_insn. * config/pa/pa-protos.h (pa_fpstore_bypass_p): Strengthen both params from rtx to rtx_insn *. * config/pa/pa.c (pa_fpstore_bypass_p): Likewise. (pa_combine_instructions): Introduce local "par" for result of gen_rtx_PARALLEL, moving decl and usage of new_rtx for after call to make_insn_raw. (pa_can_combine_p): Strengthen param "new_rtx" from rtx to rtx_insn *. * config/rl78/rl78.c (insn_ok_now): Likewise for param "insn". (rl78_alloc_physical_registers_op1): Likewise. (rl78_alloc_physical_registers_op2): Likewise. (rl78_alloc_physical_registers_ro1): Likewise. (rl78_alloc_physical_registers_cmp): Likewise. (rl78_alloc_physical_registers_umul): Likewise. (rl78_alloc_address_registers_macax): Likewise. (rl78_alloc_physical_registers): Likewise for locals "insn", "curr". * config/s390/predicates.md (execute_operation): Likewise for local "insn". * config/s390/s390-protos.h (s390_agen_dep_p): Likewise for both params. * config/s390/s390.c (s390_safe_attr_type): Likewise for param. (addr_generation_dependency_p): Likewise for param "insn". (s390_agen_dep_p): Likewise for both params. (s390_fpload_toreg): Likewise for param "insn". * config/sh/sh-protos.h (sh_loop_align): Likewise for param. * config/sh/sh.c (sh_loop_align): Likewise for param and local "next". * config/sh/sh.md (define_peephole2): Likewise for local "insn2". * config/sh/sh_treg_combine.cc (sh_treg_combine::make_inv_ccreg_insn): Likewise for return type and local "i". (sh_treg_combine::try_eliminate_cstores): Likewise for local "i". * config/stormy16/stormy16.c (combine_bnp): Likewise for locals "and_insn", "load", "shift". * config/tilegx/tilegx.c (match_pcrel_step2): Likewise for param "insn". * final.c (final_scan_insn): Introduce local rtx_insn * "other" for XEXP (note, 0) of the REG_CC_SETTER note. (cleanup_subreg_operands): Strengthen param "insn" from rtx to rtx_insn *, eliminating a checked cast made redundant by this. * gcse.c (process_insert_insn): Strengthen local "insn" from rtx to rtx_insn *. * genattr.c (main): When writing out the prototype to const_num_delay_slots, strengthen the param from rtx to rtx_insn *. * genattrtab.c (write_const_num_delay_slots): Likewise when writing out the implementation of const_num_delay_slots. * hw-doloop.h (struct hw_doloop_hooks): Strengthen the param "insn" of callback field "end_pattern_reg" from rtx to rtx_insn *. * ifcvt.c (noce_emit_store_flag): Eliminate local rtx "tmp" in favor of new rtx locals "src" and "set" and new local rtx_insn * "insn" and "seq". (noce_emit_move_insn): Strengthen locals "seq" and "insn" from rtx to rtx_insn *. (noce_emit_cmove): Eliminate local rtx "tmp" in favor of new rtx locals "cond", "if_then_else", "set" and new rtx_insn * locals "insn" and "seq". (noce_try_cmove_arith): Strengthen locals "insn_a" and "insn_b", "last" from rtx to rtx_insn *. Likewise for a local "tmp", renaming to "tmp_insn". Eliminate the other local rtx "tmp" from the top-level scope, replacing with new more tightly-scoped rtx locals "reg", "pat", "mem" and rtx_insn * "insn", "copy_of_a", "new_insn", "copy_of_insn_b", and make local rtx "set" more tightly-scoped. * ira-int.h (ira_setup_alts): Strengthen param "insn" from rtx to rtx_insn *. * ira.c (setup_prohibited_mode_move_regs): Likewise for local "move_insn". (ira_setup_alts): Likewise for param "insn". * lra-constraints.c (emit_inc): Likewise for local "add_insn". * lra.c (emit_add3_insn): Split local rtx "insn" in two, an rtx and an rtx_insn *. (lra_emit_add): Eliminate top-level local rtx "insn" in favor of new more-tightly scoped rtx locals "add3_insn", "insn", "add2_insn" and rtx_insn * "move_insn". * postreload-gcse.c (eliminate_partially_redundant_load): Add checked cast on result of gen_move_insn when invoking extract_insn. * recog.c (insn_invalid_p): Strengthen param "insn" from rtx to rtx_insn *. (verify_changes): Add a checked cast on "object" when invoking insn_invalid_p. (extract_insn_cached): Strengthen param "insn" from rtx to rtx_insn *. (extract_constrain_insn_cached): Likewise. (extract_insn): Likewise. * recog.h (insn_invalid_p): Likewise for param 1. (recog_memoized): Likewise for param. (extract_insn): Likewise. (extract_constrain_insn_cached): Likewise. (extract_insn_cached): Likewise. * reload.c (can_reload_into): Likewise for local "test_insn". * reload.h (cleanup_subreg_operands): Likewise for param. * reload1.c (emit_insn_if_valid_for_reload): Rename param from "insn" to "pat", reintroducing "insn" as an rtx_insn * on the result of emit_insn. Remove a checked cast made redundant by this change. * sel-sched-ir.c (sel_insn_rtx_cost): Strengthen param "insn" from rtx to rtx_insn *. * sel-sched.c (get_reg_class): Likewise. From-SVN: r215087
2014-09-09 18:34:56 +02:00
extern void ira_setup_alts (rtx_insn *insn, HARD_REG_SET &alts);
regmove.c: Remove. 2013-10-30 Vladimir Makarov <vmakarov@redhat.com> * regmove.c: Remove. * tree-pass.h (make_pass_regmove): Remove. * timevar.def (TV_REGMOVE): Remove. * passes.def (pass_regmove): Remove. * opts.c (default_options_table): Remove entry for regmove. * doc/passes.texi: Remove regmove pass description. * doc/invoke.texi (-foptimize-register-move, -fregmove): Remove options. (-fdump-rtl-regmove): Ditto. * common.opt (foptimize-register-move, fregmove): Ignore. * Makefile.in (OBJS): Remove regmove.o. * regmove.c: Remove. * ira-int.h (struct ira_allocno_pref, ira_pref_t): New structure and type. (struct ira_allocno) New member allocno_prefs. (ALLOCNO_PREFS): New macro. (ira_prefs, ira_prefs_num): New external vars. (ira_setup_alts, ira_get_dup_out_num, ira_debug_pref): New prototypes. (ira_debug_prefs, ira_debug_allocno_prefs, ira_create_pref): Ditto. (ira_add_allocno_pref, ira_remove_pref, ira_remove_allocno_prefs): Ditto. (ira_add_allocno_copy_to_list): Remove prototype. (ira_swap_allocno_copy_ends_if_necessary): Ditto. (ira_pref_iterator): New type. (ira_pref_iter_init, ira_pref_iter_cond): New functions. (FOR_EACH_PREF): New macro. * ira.c (commutative_constraint_p): Move from ira-conflicts.c. (ira_get_dup_out_num): Ditto. Rename from get_dup_num. Modify the code. (ira_setup_alts): New function. (decrease_live_ranges_number): New function. (ira): Call the above function. * ira-build.c (ira_prefs, ira_prefs_num): New global vars. (ira_create_allocno): Initialize allocno prefs. (pref_pool, pref_vec): New static vars. (initiate_prefs, find_allocno_pref, ira_create_pref): New functions. (add_allocno_pref_to_list, ira_add_allocno_pref, print_pref): Ditto. (ira_debug_pref, print_prefs, ira_debug_prefs): Ditto. (print_allocno_prefs, ira_debug_allocno_prefs, finish_pref): Ditto. (ira_remove_pref, ira_remove_allocno_prefs, finish_prefs): Ditto. (ira_add_allocno_copy_to_list): Make static. Rename to add_allocno_copy_to_list. (ira_swap_allocno_copy_ends_if_necessary): Make static. Rename to swap_allocno_copy_ends_if_necessary. (remove_unnecessary_allocnos, remove_low_level_allocnos): Call ira_remove_allocno_prefs. (ira_flattening): Ditto. (ira_build): Call initiate_prefs, print_prefs. (ira_destroy): Call finish_prefs. * ira-color.c (struct update_cost_record): New. (struct allocno_color_data): Add new member update_cost_records. (update_cost_record_pool): New static var. (init_update_cost_records, get_update_cost_record): New functions. (free_update_cost_record_list, finish_update_cost_records): Ditto. (struct update_cost_queue_elem): Add member from. (initiate_cost_update): Call init_update_cost_records. (finish_cost_update): Call finish_update_cost_records. (queue_update_cost, get_next_update_cost): Add new param from. (Update_allocno_cost, update_costs_from_allocno): New functions. (update_costs_from_prefs): Ditto. (update_copy_costs): Rename to update_costs_from_copies. (restore_costs_from_copies): New function. (update_conflict_hard_regno_costs): Don't go back. (assign_hard_reg): Call restore_costs_from_copies. Add printing more debug info. (pop_allocnos): Add priniting more debug info. (color_allocnos): Remove prefs for conflicting hard regs. Call update_costs_from_prefs. * ira-conflicts.c (commutative_constraint_p): Move to ira.c (get_dup_num): Rename, modify, and move to ira.c (process_regs_for_copy): Add prefs. (add_insn_allocno_copies): Put src as first arg of process_regs_for_copy. Remove dead code. Call ira_setup_alts. * ira-costs.c (record_reg_classes): Modify and move code into record_operands_costs. (find_costs_and_classes): Create prefs for the hard reg of small reg class. (process_bb_node_for_hard_reg_moves): Add prefs. 2013-10-30 Vladimir Makarov <vmakarov@redhat.com> * gcc.target/i386/fma_double_3.c: Use pattern for scan-assembler-times instead of just one insn name. * gcc.target/i386/fma_double_5.c: Ditto. * gcc.target/i386/fma_float_3.c: Ditto. * gcc.target/i386/fma_float_5.c: Ditto. * gcc.target/i386/l_fma_double_1.c: Ditto. * gcc.target/i386/l_fma_double_2.c: Ditto. * gcc.target/i386/l_fma_double_3.c: Ditto. * gcc.target/i386/l_fma_double_4.c: Ditto. * gcc.target/i386/l_fma_double_5.c: Ditto. * gcc.target/i386/l_fma_double_6.c: Ditto. * gcc.target/i386/l_fma_float_1.c: Ditto. * gcc.target/i386/l_fma_float_2.c: Ditto. * gcc.target/i386/l_fma_float_3.c: Ditto. * gcc.target/i386/l_fma_float_4.c: Ditto. * gcc.target/i386/l_fma_float_5.c: Ditto. * gcc.target/i386/l_fma_float_6.c: Ditto. From-SVN: r204212
2013-10-30 15:27:25 +01:00
extern int ira_get_dup_out_num (int op_num, HARD_REG_SET &alts);
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
/* ira-build.c */
/* The current loop tree node and its regno allocno map. */
extern ira_loop_tree_node_t ira_curr_loop_tree_node;
extern ira_allocno_t *ira_curr_regno_allocno_map;
regmove.c: Remove. 2013-10-30 Vladimir Makarov <vmakarov@redhat.com> * regmove.c: Remove. * tree-pass.h (make_pass_regmove): Remove. * timevar.def (TV_REGMOVE): Remove. * passes.def (pass_regmove): Remove. * opts.c (default_options_table): Remove entry for regmove. * doc/passes.texi: Remove regmove pass description. * doc/invoke.texi (-foptimize-register-move, -fregmove): Remove options. (-fdump-rtl-regmove): Ditto. * common.opt (foptimize-register-move, fregmove): Ignore. * Makefile.in (OBJS): Remove regmove.o. * regmove.c: Remove. * ira-int.h (struct ira_allocno_pref, ira_pref_t): New structure and type. (struct ira_allocno) New member allocno_prefs. (ALLOCNO_PREFS): New macro. (ira_prefs, ira_prefs_num): New external vars. (ira_setup_alts, ira_get_dup_out_num, ira_debug_pref): New prototypes. (ira_debug_prefs, ira_debug_allocno_prefs, ira_create_pref): Ditto. (ira_add_allocno_pref, ira_remove_pref, ira_remove_allocno_prefs): Ditto. (ira_add_allocno_copy_to_list): Remove prototype. (ira_swap_allocno_copy_ends_if_necessary): Ditto. (ira_pref_iterator): New type. (ira_pref_iter_init, ira_pref_iter_cond): New functions. (FOR_EACH_PREF): New macro. * ira.c (commutative_constraint_p): Move from ira-conflicts.c. (ira_get_dup_out_num): Ditto. Rename from get_dup_num. Modify the code. (ira_setup_alts): New function. (decrease_live_ranges_number): New function. (ira): Call the above function. * ira-build.c (ira_prefs, ira_prefs_num): New global vars. (ira_create_allocno): Initialize allocno prefs. (pref_pool, pref_vec): New static vars. (initiate_prefs, find_allocno_pref, ira_create_pref): New functions. (add_allocno_pref_to_list, ira_add_allocno_pref, print_pref): Ditto. (ira_debug_pref, print_prefs, ira_debug_prefs): Ditto. (print_allocno_prefs, ira_debug_allocno_prefs, finish_pref): Ditto. (ira_remove_pref, ira_remove_allocno_prefs, finish_prefs): Ditto. (ira_add_allocno_copy_to_list): Make static. Rename to add_allocno_copy_to_list. (ira_swap_allocno_copy_ends_if_necessary): Make static. Rename to swap_allocno_copy_ends_if_necessary. (remove_unnecessary_allocnos, remove_low_level_allocnos): Call ira_remove_allocno_prefs. (ira_flattening): Ditto. (ira_build): Call initiate_prefs, print_prefs. (ira_destroy): Call finish_prefs. * ira-color.c (struct update_cost_record): New. (struct allocno_color_data): Add new member update_cost_records. (update_cost_record_pool): New static var. (init_update_cost_records, get_update_cost_record): New functions. (free_update_cost_record_list, finish_update_cost_records): Ditto. (struct update_cost_queue_elem): Add member from. (initiate_cost_update): Call init_update_cost_records. (finish_cost_update): Call finish_update_cost_records. (queue_update_cost, get_next_update_cost): Add new param from. (Update_allocno_cost, update_costs_from_allocno): New functions. (update_costs_from_prefs): Ditto. (update_copy_costs): Rename to update_costs_from_copies. (restore_costs_from_copies): New function. (update_conflict_hard_regno_costs): Don't go back. (assign_hard_reg): Call restore_costs_from_copies. Add printing more debug info. (pop_allocnos): Add priniting more debug info. (color_allocnos): Remove prefs for conflicting hard regs. Call update_costs_from_prefs. * ira-conflicts.c (commutative_constraint_p): Move to ira.c (get_dup_num): Rename, modify, and move to ira.c (process_regs_for_copy): Add prefs. (add_insn_allocno_copies): Put src as first arg of process_regs_for_copy. Remove dead code. Call ira_setup_alts. * ira-costs.c (record_reg_classes): Modify and move code into record_operands_costs. (find_costs_and_classes): Create prefs for the hard reg of small reg class. (process_bb_node_for_hard_reg_moves): Add prefs. 2013-10-30 Vladimir Makarov <vmakarov@redhat.com> * gcc.target/i386/fma_double_3.c: Use pattern for scan-assembler-times instead of just one insn name. * gcc.target/i386/fma_double_5.c: Ditto. * gcc.target/i386/fma_float_3.c: Ditto. * gcc.target/i386/fma_float_5.c: Ditto. * gcc.target/i386/l_fma_double_1.c: Ditto. * gcc.target/i386/l_fma_double_2.c: Ditto. * gcc.target/i386/l_fma_double_3.c: Ditto. * gcc.target/i386/l_fma_double_4.c: Ditto. * gcc.target/i386/l_fma_double_5.c: Ditto. * gcc.target/i386/l_fma_double_6.c: Ditto. * gcc.target/i386/l_fma_float_1.c: Ditto. * gcc.target/i386/l_fma_float_2.c: Ditto. * gcc.target/i386/l_fma_float_3.c: Ditto. * gcc.target/i386/l_fma_float_4.c: Ditto. * gcc.target/i386/l_fma_float_5.c: Ditto. * gcc.target/i386/l_fma_float_6.c: Ditto. From-SVN: r204212
2013-10-30 15:27:25 +01:00
extern void ira_debug_pref (ira_pref_t);
extern void ira_debug_prefs (void);
extern void ira_debug_allocno_prefs (ira_allocno_t);
extern void ira_debug_copy (ira_copy_t);
Add uniform debug dump function names. Add some overloaded functions that provide uniform debug dump function names. These names are: debug: the general debug dumper debug_verbose: for more details debug_raw: for the gory details debug_head: for the heads of declarations, e.g. function heads debug_body: for the bodies of declarations, e.g. function bodies Not all types have the last four versions. The debug functions come in two flavors, those that take pointers to the type, and those that take references to the type. The first handles printing of '<nil>' for null pointers. The second assumes a valid reference, and prints the content. Example uses are as follows: cp_token t, *p; debug (t); debug (p); From the debugger, use call debug (t) The functions sets implemented are: debug (only) basic_block_def, const bitmap_head_def, cp_binding_level, cp_parser, cp_token, data_reference, die_struct, edge_def, gimple_statement_d, ira_allocno, ira_allocno_copy, live_range, lra_live_range, omega_pb_d, pt_solution, const rtx_def, sreal, tree_live_info_d, _var_map, vec<cp_token, va_gc>, vec<data_reference_p>, vec<ddr_p>, vec<rtx>, vec<tree, va_gc>, debug and debug_raw simple_bitmap_def debug and debug_verbose expr_def, struct loop, vinsn_def debug, debug_raw, debug_verbose, debug_head, debug_body const tree_node This patch is somewhat different from the original plan at gcc.gnu.org/wiki/cxx-conversion/debugging-dumps. The reason is that gdb has an incomplete implementation of C++ call syntax; requiring explicit specification of template arguments and explicit specification of function arguments even when they have default values. So, the original plan would have required typing call dump <cp_token> (t, 0, 0, stderr) which is undesireable. Instead instead of templates, we overload plain functions. This adds a small burden of manually adding the pointer version of dump for each type. Instead of default function arguments, we simply assume the default values. Most of the underlying dump functions did not use the options and indent parameters anyway. Several provide FILE* parameters, but we expect debugging to use stderr anyway. So, the explicit specification of arguments was not as valuable as we thought initially. Finally, a change of name from dump to debug reflect the implicit output to stderr. Index: gcc/ChangeLog 2013-03-28 Lawrence Crowl <crowl@google.com> * Makefile.in: Add several missing include dependences. (DUMPFILE_H): New. (test-dump.o): New. This object is not added to any executable, but is present for ad-hoc testing. * bitmap.c (debug (const bitmap_head_def &)): New. (debug (const bitmap_head_def *)): New. * bitmap.h (extern debug (const bitmap_head_def &)): New. (extern debug (const bitmap_head_def *)): New. * cfg.c (debug (edge_def &)): New. (debug (edge_def *)): New. * cfghooks.c (debug (basic_block_def &)): New. (debug (basic_block_def *)): New. * dumpfile.h (dump_node (const_tree, int, FILE *)): Correct source file. * dwarf2out.c (debug (die_struct &)): New. (debug (die_struct *)): New. * dwarf2out.h (extern debug (die_struct &)): New. (extern debug (die_struct *)): New. * gimple-pretty-print.c (debug (gimple_statement_d &)): New. (debug (gimple_statement_d *)): New. * gimple-pretty-print.h (extern debug (gimple_statement_d &)): New. (extern debug (gimple_statement_d *)): New. * ira-build.c (debug (ira_allocno_copy &)): New. (debug (ira_allocno_copy *)): New. (debug (ira_allocno &)): New. (debug (ira_allocno *)): New. * ira-int.h (extern debug (ira_allocno_copy &)): New. (extern debug (ira_allocno_copy *)): New. (extern debug (ira_allocno &)): New. (extern debug (ira_allocno *)): New. * ira-lives.c (debug (live_range &)): New. (debug (live_range *)): New. * lra-int.h (debug (lra_live_range &)): New. (debug (lra_live_range *)): New. * lra-lives.c (debug (lra_live_range &)): New. (debug (lra_live_range *)): New. * omega.c (debug (omega_pb_d &)): New. (debug (omega_pb_d *)): New. * omega.h (extern debug (omega_pb_d &)): New. (extern debug (omega_pb_d *)): New. * print-rtl.c (debug (const rtx_def &)): New. (debug (const rtx_def *)): New. * print-tree.c (debug_tree (tree): Move within file. (debug_raw (const tree_node &)): New. (debug_raw (const tree_node *)): New. (dump_tree_via_hooks (const tree_node *, int)): New. (debug (const tree_node &)): New. (debug (const tree_node *)): New. (debug_verbose (const tree_node &)): New. (debug_verbose (const tree_node *)): New. (debug_head (const tree_node &)): New. (debug_head (const tree_node *)): New. (debug_body (const tree_node &)): New. (debug_body (const tree_node *)): New. (debug_vec_tree (tree): Move and reimplement in terms of dump. (debug (vec<tree, va_gc> &)): New. (debug (vec<tree, va_gc> *)): New. * rtl.h (extern debug (const rtx_def &)): New. (extern debug (const rtx_def *)): New. * sbitmap.c (debug_raw (simple_bitmap_def &)): New. (debug_raw (simple_bitmap_def *)): New. (debug (simple_bitmap_def &)): New. (debug (simple_bitmap_def *)): New. * sbitmap.h (extern debug (simple_bitmap_def &)): New. (extern debug (simple_bitmap_def *)): New. (extern debug_raw (simple_bitmap_def &)): New. (extern debug_raw (simple_bitmap_def *)): New. * sel-sched-dump.c (debug (vinsn_def &)): New. (debug (vinsn_def *)): New. (debug_verbose (vinsn_def &)): New. (debug_verbose (vinsn_def *)): New. (debug (expr_def &)): New. (debug (expr_def *)): New. (debug_verbose (expr_def &)): New. (debug_verbose (expr_def *)): New. (debug (vec<rtx> &)): New. (debug (vec<rtx> *)): New. * sel-sched-dump.h (extern debug (vinsn_def &)): New. (extern debug (vinsn_def *)): New. (extern debug_verbose (vinsn_def &)): New. (extern debug_verbose (vinsn_def *)): New. (extern debug (expr_def &)): New. (extern debug (expr_def *)): New. (extern debug_verbose (expr_def &)): New. (extern debug_verbose (expr_def *)): New. (extern debug (vec<rtx> &)): New. (extern debug (vec<rtx> *)): New. * sel-sched-ir.h (_list_iter_cond_expr): Make inline instead of static. * sreal.c (debug (sreal &)): New. (debug (sreal *)): New. * sreal.h (extern debug (sreal &)): New. (extern debug (sreal *)): New. * tree.h (extern debug_raw (const tree_node &)): New. (extern debug_raw (const tree_node *)): New. (extern debug (const tree_node &)): New. (extern debug (const tree_node *)): New. (extern debug_verbose (const tree_node &)): New. (extern debug_verbose (const tree_node *)): New. (extern debug_head (const tree_node &)): New. (extern debug_head (const tree_node *)): New. (extern debug_body (const tree_node &)): New. (extern debug_body (const tree_node *)): New. (extern debug (vec<tree, va_gc> &)): New. (extern debug (vec<tree, va_gc> *)): New. * tree-cfg.c (debug (struct loop &)): New. (debug (struct loop *)): New. (debug_verbose (struct loop &)): New. (debug_verbose (struct loop *)): New. * tree-dump.c: Add header dependence. * tree-flow.h (extern debug (struct loop &)): New. (extern debug (struct loop *)): New. (extern debug_verbose (struct loop &)): New. (extern debug_verbose (struct loop *)): New. * tree-data-ref.c (debug (data_reference &)): New. (debug (data_reference *)): New. (debug (vec<data_reference_p> &)): New. (debug (vec<data_reference_p> *)): New. (debug (vec<ddr_p> &)): New. (debug (vec<ddr_p> *)): New. * tree-data-ref.h (extern debug (data_reference &)): New. (extern debug (data_reference *)): New. (extern debug (vec<data_reference_p> &)): New. (extern debug (vec<data_reference_p> *)): New. (extern debug (vec<ddr_p> &)): New. (extern debug (vec<ddr_p> *)): New. * tree-ssa-alias.c (debug (pt_solution &)): New. (debug (pt_solution *)): New. * tree-ssa-alias.h (extern debug (pt_solution &)): New. (extern debug (pt_solution *)): New. * tree-ssa-alias.c (debug (_var_map &)): New. (debug (_var_map *)): New. (debug (tree_live_info_d &)): New. (debug (tree_live_info_d *)): New. * tree-ssa-alias.h (extern debug (_var_map &)): New. (extern debug (_var_map *)): New. (extern debug (tree_live_info_d &)): New. (extern debug (tree_live_info_d *)): New. Index: gcc/cp/ChangeLog 2013-03-28 Lawrence Crowl <crowl@google.com> * Make-lang.in (CXX_PARSER_H): Add header dependence. * cp-tree.h (extern debug (cp_binding_level &)): New. (extern debug (cp_binding_level *)): New. * name-lookup.h (debug (cp_binding_level &)): New. (debug (cp_binding_level *)): New. * parser.c (debug (cp_parser &)): New. (debug (cp_parser *)): New. (debug (cp_token &)): New. (debug (cp_token *)): New. (debug (vec<cp_token, va_gc> &)): New. (debug (vec<cp_token, va_gc> *)): New. * parser.c: Add header dependence. (extern debug (cp_parser &)): New. (extern debug (cp_parser *)): New. (extern debug (cp_token &)): New. (extern debug (cp_token *)): New. (extern debug (vec<cp_token, va_gc> &)): New. (extern debug (vec<cp_token, va_gc> *)): New. From-SVN: r197224
2013-03-29 04:42:21 +01:00
extern void debug (ira_allocno_copy &ref);
extern void debug (ira_allocno_copy *ptr);
extern void ira_debug_copies (void);
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
extern void ira_debug_allocno_copies (ira_allocno_t);
Add uniform debug dump function names. Add some overloaded functions that provide uniform debug dump function names. These names are: debug: the general debug dumper debug_verbose: for more details debug_raw: for the gory details debug_head: for the heads of declarations, e.g. function heads debug_body: for the bodies of declarations, e.g. function bodies Not all types have the last four versions. The debug functions come in two flavors, those that take pointers to the type, and those that take references to the type. The first handles printing of '<nil>' for null pointers. The second assumes a valid reference, and prints the content. Example uses are as follows: cp_token t, *p; debug (t); debug (p); From the debugger, use call debug (t) The functions sets implemented are: debug (only) basic_block_def, const bitmap_head_def, cp_binding_level, cp_parser, cp_token, data_reference, die_struct, edge_def, gimple_statement_d, ira_allocno, ira_allocno_copy, live_range, lra_live_range, omega_pb_d, pt_solution, const rtx_def, sreal, tree_live_info_d, _var_map, vec<cp_token, va_gc>, vec<data_reference_p>, vec<ddr_p>, vec<rtx>, vec<tree, va_gc>, debug and debug_raw simple_bitmap_def debug and debug_verbose expr_def, struct loop, vinsn_def debug, debug_raw, debug_verbose, debug_head, debug_body const tree_node This patch is somewhat different from the original plan at gcc.gnu.org/wiki/cxx-conversion/debugging-dumps. The reason is that gdb has an incomplete implementation of C++ call syntax; requiring explicit specification of template arguments and explicit specification of function arguments even when they have default values. So, the original plan would have required typing call dump <cp_token> (t, 0, 0, stderr) which is undesireable. Instead instead of templates, we overload plain functions. This adds a small burden of manually adding the pointer version of dump for each type. Instead of default function arguments, we simply assume the default values. Most of the underlying dump functions did not use the options and indent parameters anyway. Several provide FILE* parameters, but we expect debugging to use stderr anyway. So, the explicit specification of arguments was not as valuable as we thought initially. Finally, a change of name from dump to debug reflect the implicit output to stderr. Index: gcc/ChangeLog 2013-03-28 Lawrence Crowl <crowl@google.com> * Makefile.in: Add several missing include dependences. (DUMPFILE_H): New. (test-dump.o): New. This object is not added to any executable, but is present for ad-hoc testing. * bitmap.c (debug (const bitmap_head_def &)): New. (debug (const bitmap_head_def *)): New. * bitmap.h (extern debug (const bitmap_head_def &)): New. (extern debug (const bitmap_head_def *)): New. * cfg.c (debug (edge_def &)): New. (debug (edge_def *)): New. * cfghooks.c (debug (basic_block_def &)): New. (debug (basic_block_def *)): New. * dumpfile.h (dump_node (const_tree, int, FILE *)): Correct source file. * dwarf2out.c (debug (die_struct &)): New. (debug (die_struct *)): New. * dwarf2out.h (extern debug (die_struct &)): New. (extern debug (die_struct *)): New. * gimple-pretty-print.c (debug (gimple_statement_d &)): New. (debug (gimple_statement_d *)): New. * gimple-pretty-print.h (extern debug (gimple_statement_d &)): New. (extern debug (gimple_statement_d *)): New. * ira-build.c (debug (ira_allocno_copy &)): New. (debug (ira_allocno_copy *)): New. (debug (ira_allocno &)): New. (debug (ira_allocno *)): New. * ira-int.h (extern debug (ira_allocno_copy &)): New. (extern debug (ira_allocno_copy *)): New. (extern debug (ira_allocno &)): New. (extern debug (ira_allocno *)): New. * ira-lives.c (debug (live_range &)): New. (debug (live_range *)): New. * lra-int.h (debug (lra_live_range &)): New. (debug (lra_live_range *)): New. * lra-lives.c (debug (lra_live_range &)): New. (debug (lra_live_range *)): New. * omega.c (debug (omega_pb_d &)): New. (debug (omega_pb_d *)): New. * omega.h (extern debug (omega_pb_d &)): New. (extern debug (omega_pb_d *)): New. * print-rtl.c (debug (const rtx_def &)): New. (debug (const rtx_def *)): New. * print-tree.c (debug_tree (tree): Move within file. (debug_raw (const tree_node &)): New. (debug_raw (const tree_node *)): New. (dump_tree_via_hooks (const tree_node *, int)): New. (debug (const tree_node &)): New. (debug (const tree_node *)): New. (debug_verbose (const tree_node &)): New. (debug_verbose (const tree_node *)): New. (debug_head (const tree_node &)): New. (debug_head (const tree_node *)): New. (debug_body (const tree_node &)): New. (debug_body (const tree_node *)): New. (debug_vec_tree (tree): Move and reimplement in terms of dump. (debug (vec<tree, va_gc> &)): New. (debug (vec<tree, va_gc> *)): New. * rtl.h (extern debug (const rtx_def &)): New. (extern debug (const rtx_def *)): New. * sbitmap.c (debug_raw (simple_bitmap_def &)): New. (debug_raw (simple_bitmap_def *)): New. (debug (simple_bitmap_def &)): New. (debug (simple_bitmap_def *)): New. * sbitmap.h (extern debug (simple_bitmap_def &)): New. (extern debug (simple_bitmap_def *)): New. (extern debug_raw (simple_bitmap_def &)): New. (extern debug_raw (simple_bitmap_def *)): New. * sel-sched-dump.c (debug (vinsn_def &)): New. (debug (vinsn_def *)): New. (debug_verbose (vinsn_def &)): New. (debug_verbose (vinsn_def *)): New. (debug (expr_def &)): New. (debug (expr_def *)): New. (debug_verbose (expr_def &)): New. (debug_verbose (expr_def *)): New. (debug (vec<rtx> &)): New. (debug (vec<rtx> *)): New. * sel-sched-dump.h (extern debug (vinsn_def &)): New. (extern debug (vinsn_def *)): New. (extern debug_verbose (vinsn_def &)): New. (extern debug_verbose (vinsn_def *)): New. (extern debug (expr_def &)): New. (extern debug (expr_def *)): New. (extern debug_verbose (expr_def &)): New. (extern debug_verbose (expr_def *)): New. (extern debug (vec<rtx> &)): New. (extern debug (vec<rtx> *)): New. * sel-sched-ir.h (_list_iter_cond_expr): Make inline instead of static. * sreal.c (debug (sreal &)): New. (debug (sreal *)): New. * sreal.h (extern debug (sreal &)): New. (extern debug (sreal *)): New. * tree.h (extern debug_raw (const tree_node &)): New. (extern debug_raw (const tree_node *)): New. (extern debug (const tree_node &)): New. (extern debug (const tree_node *)): New. (extern debug_verbose (const tree_node &)): New. (extern debug_verbose (const tree_node *)): New. (extern debug_head (const tree_node &)): New. (extern debug_head (const tree_node *)): New. (extern debug_body (const tree_node &)): New. (extern debug_body (const tree_node *)): New. (extern debug (vec<tree, va_gc> &)): New. (extern debug (vec<tree, va_gc> *)): New. * tree-cfg.c (debug (struct loop &)): New. (debug (struct loop *)): New. (debug_verbose (struct loop &)): New. (debug_verbose (struct loop *)): New. * tree-dump.c: Add header dependence. * tree-flow.h (extern debug (struct loop &)): New. (extern debug (struct loop *)): New. (extern debug_verbose (struct loop &)): New. (extern debug_verbose (struct loop *)): New. * tree-data-ref.c (debug (data_reference &)): New. (debug (data_reference *)): New. (debug (vec<data_reference_p> &)): New. (debug (vec<data_reference_p> *)): New. (debug (vec<ddr_p> &)): New. (debug (vec<ddr_p> *)): New. * tree-data-ref.h (extern debug (data_reference &)): New. (extern debug (data_reference *)): New. (extern debug (vec<data_reference_p> &)): New. (extern debug (vec<data_reference_p> *)): New. (extern debug (vec<ddr_p> &)): New. (extern debug (vec<ddr_p> *)): New. * tree-ssa-alias.c (debug (pt_solution &)): New. (debug (pt_solution *)): New. * tree-ssa-alias.h (extern debug (pt_solution &)): New. (extern debug (pt_solution *)): New. * tree-ssa-alias.c (debug (_var_map &)): New. (debug (_var_map *)): New. (debug (tree_live_info_d &)): New. (debug (tree_live_info_d *)): New. * tree-ssa-alias.h (extern debug (_var_map &)): New. (extern debug (_var_map *)): New. (extern debug (tree_live_info_d &)): New. (extern debug (tree_live_info_d *)): New. Index: gcc/cp/ChangeLog 2013-03-28 Lawrence Crowl <crowl@google.com> * Make-lang.in (CXX_PARSER_H): Add header dependence. * cp-tree.h (extern debug (cp_binding_level &)): New. (extern debug (cp_binding_level *)): New. * name-lookup.h (debug (cp_binding_level &)): New. (debug (cp_binding_level *)): New. * parser.c (debug (cp_parser &)): New. (debug (cp_parser *)): New. (debug (cp_token &)): New. (debug (cp_token *)): New. (debug (vec<cp_token, va_gc> &)): New. (debug (vec<cp_token, va_gc> *)): New. * parser.c: Add header dependence. (extern debug (cp_parser &)): New. (extern debug (cp_parser *)): New. (extern debug (cp_token &)): New. (extern debug (cp_token *)): New. (extern debug (vec<cp_token, va_gc> &)): New. (extern debug (vec<cp_token, va_gc> *)): New. From-SVN: r197224
2013-03-29 04:42:21 +01:00
extern void debug (ira_allocno &ref);
extern void debug (ira_allocno *ptr);
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
extern void ira_traverse_loop_tree (bool, ira_loop_tree_node_t,
void (*) (ira_loop_tree_node_t),
void (*) (ira_loop_tree_node_t));
extern ira_allocno_t ira_parent_allocno (ira_allocno_t);
extern ira_allocno_t ira_parent_or_cap_allocno (ira_allocno_t);
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
extern ira_allocno_t ira_create_allocno (int, bool, ira_loop_tree_node_t);
ira-build.c (ira_create_object): New arg SUBWORD; all callers changed. * ira-build.c (ira_create_object): New arg SUBWORD; all callers changed. Initialize OBJECT_SUBWORD. (ira_create_allocno): Clear ALLOCNO_NUM_OBJECTS. (ira_create_allocno_objects): Renamed from ira_create_allocno_object; all callers changed. (merge_hard_reg_conflicts): Iterate over allocno subobjects. (finish_allocno): Likewise. (move_allocno_live_ranges, copy_allocno_live_ranges): Likewise. (remove_low_level_allocnos): Likewise. (update_bad_spill_attribute): Likewise. (setup_min_max_allocno_live_range_point): Likewise. (sort_conflict_id_map): Likewise. (ira_flattening): Likewise. Use ior_hard_reg_conflicts. (ior_hard_reg_conflicts): New function. (ior_allocate_object_conflicts): Renamed first argument to OBJ. (compress_conflict_vecs): Iterate over objects, not allocnos. (ira_add_live_range_to_object): New function. (object_range_compare_func): Renamed from allocno_range_compare_func. All callers changed. (setup_min_max_conflict_allocno_ids): For allocnos with multiple subobjects, widen the min/max range of the lowest-order object to potentially include all other such low-order objects. * ira.c (ira_bad_reload_regno_1): Iterate over allocno subobjects. (check_allocation): Likewise. Use more fine-grained tests for register conflicts. * ira-color.c (allocnos_have_intersected_live_ranges_p): Iterate over allocno subobjects. (assign_hard_reg): Keep multiple sets of conflicts. Make finer-grained choices about which bits to set in each set. Don't use ira_hard_reg_not_in_set_p, perform a more elaborate test for conflicts using the multiple sets we computed. (push_allocno_to_stack): Iterate over allocno subobjects. (all_conflicting_hard_regs_coalesced): New static function. (setup_allocno_available_regs_num): Use it. (setup_allocno_left_conflicts_size): Likewise. Iterate over allocno subobjects. (coalesced_allocno_conflict): Test subobject 0 in each allocno. (setup_allocno_priorities): Divide ALLOCNO_EXCESS_PRESSURE_POINTS_NUM by ALLOCNO_NUM_OBJECTS. (calculate_spill_cost): Likewise. (color_pass): Express if statement in a more normal way. (ira_reassign_conflict_allocnos): Iterate over allocno subobjects. (slot_coalesced_allocno_live_ranges_intersect_p): Likewise. (setup_slot_coalesced_allocno_live_ranges): Likewise. (allocno_reload_assign): Likewise. (ira_reassign_pseudos): Likewise. (fast_allocation): Likewise. * ira-conflicts.c (build_conflict_bit_table): Likewise. (print_allocno_conflicts): Likewise. (ira_build_conflicts): Likewise. (allocnos_conflict_for_copy_p): Renamed from allocnos_conflict_p. All callers changed. Test subword 0 of each allocno for conflicts. (build_object_conflicts): Renamed from build_allocno_conflicts. All callers changed. Iterate over allocno subobjects. * ira-emit.c (modify_move_list): Iterate over allocno subobjects. * ira-int.h (struct ira_allocno): New member. num_objects. Rename object to objects and change it into an array. (ALLOCNO_OBJECT): Add new argument N. (ALLOCNO_NUM_OBJECTS, OBJECT_SUBWORD): New macros. (ira_create_allocno_objects): Renamed from ira_create_allocno_object. (ior_hard_reg_conflicts): Declare. (ira_add_live_range_to_object): Declare. (ira_allocno_object_iterator): New. (ira_allocno_object_iter_init, ira_allocno_object_iter_cond): New. (FOR_EACH_ALLOCNO_OBJECT): New macro. * ira-lives.c (objects_live): Renamed from allocnos_live; all uses changed. (allocnos_processed): New sparseset. (make_object_born): Renamed from make_allocno_born; take an ira_object_t argument. All callers changed. (make_object_dead): Renamed from make_allocno_dead; take an ira_object t argument. All callers changed. (update_allocno_pressure_excess_length): Take an ira_obejct_t argument. All callers changed. (mark_pseudo_regno_live): Iterate over allocno subobjects. (mark_pseudo_regno_dead): Likewise. (mark_pseudo_regno_subword_live, mark_pseudo_regno_subword_dead): New functions. (mark_ref_live): Detect subword accesses and call mark_pseudo_regno_subword_live as appropriate. (mark_ref_dead): Likewise for mark_pseudo_regno_subword_dead. (process_bb_nodes_live): Deal with object-related updates first; set and test bits in allocnos_processed to avoid computing allocno statistics more than once. (create_start_finish_chains): Iterate over objects, not allocnos. (print_object_live_ranges): New function. (print_allocno_live_ranges): Use it. (ira_create_allocno_live_ranges): Allocate and free allocnos_processed and objects_live. From-SVN: r162418
2010-07-22 17:48:30 +02:00
extern void ira_create_allocno_objects (ira_allocno_t);
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
extern void ira_set_allocno_class (ira_allocno_t, enum reg_class);
ira-int.h (struct ira_object): New. * ira-int.h (struct ira_object): New. (ira_object_t): New typedef. Add DEF_VEC_P and DEF_VEC_ALLOC_P for it. (struct ira_allocno): Remove members min, max, conflict_allocno_array, conflict_id, conflict_allocno_array_size, conflict_allocnos_num and conflict_vec_p. Add new member object. (OBJECT_CONFLICT_ARRAY, OBJECT_CONFLICT_VEC_P, OBJECT_NUM_CONFLICTS, OBJECT_CONFLICT_ARRAY_SIZE, OBJECT_CONFLICT_HARD_REGS, OBJECT_TOTAL_CONFLICT_HARD_REGS, OBJECT_MIN, OBJECT_MAX, OBJECT_CONFLICT_ID): Renamed from ALLOCNO_CONFLICT_ALLOCNO_ARRAY, ALLOCNO_CONFLICT_VEC_P, ALLOCNO_CONFLICT_ALLOCNOS_NUM, ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE, ALLOCNO_CONFLICT_HARD_REGS, ALLOCNO_TOTAL_CONFLICT_HARD_REGS) ALLOCNO_MIN, ALLOCNO_MAX, and ALLOCNO_CONFLICT_ID; now operate on an ira_object_t rather than ira_allocno_t. All uses changed. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_objects_num): Declare variable. (ira_create_allocno_object): Declare function. (ira_conflict_vector_profitable_p): Adjust prototype. (ira_allocate_conflict_vec): Renamed from ira_allocate_allocno_conflict_vec; first arg now ira_object_t. (ira_allocate_object_conflicts): Renamed from ira_allocate_allocno_conflicts; first arg now ira_object_t. (struct ira_object_iterator): New. (ira_object_iter_init, ira_object_iter_cond, FOR_EACH_OBJECT): New. (ira_allocno_conflict_iterator): Renamed member allocno_conflict_vec_p to conflict_vec_p. All uses changed. (ira_allocno_conflict_iter_init, ira_allocno_conflict_iter_cond): Changed to take into account that conflicts are now tracked for objects. * ira-conflicts.c (OBJECTS_CONFLICT_P): Renamed from CONFLICT_ALLOCNO_P. Args changed to accept ira_object_t. All uses changed. (allocnos_conflict_p): New static function. (collected_conflict_objects): Renamed from collected_allocno_objects; now a vector of ira_object_t. All uses changed. (build_conflict_bit_table): Changed to take into account that conflicts are now tracked for objects. (process_regs_for_copy, propagate_copies, build_allocno_conflicts) (print_allocno_conflicts, ira_build_conflicts): Likewise. * ira-color.c (assign_hard_reg, setup_allocno_available_regs_num) setup_allocno_left_conflicts_size, allocno_reload_assign, fast_allocation): Likewise. * ira-lives.c (make_hard_regno_born, make_allocno_born) process_single_reg_class_operands, process_bb_node_lives): Likewise. * ira-emit.c (modify_move_list, add_range_and_copies_from_move_list): Likewise. * ira-build.c (ira_objects_num): New variable. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_object_id_map_vec): Corresponding change. (object_pool): New static variable. (initiate_allocnos): Initialize it. (finish_allocnos): Free it. (ira_create_object, ira_create_allocno_object, create_allocno_objects): New functions. (ira_create_allocno): Don't set members that were removed. (ira_set_allocno_cover_class): Don't change conflict hard regs. (merge_hard_reg_conflicts): Changed to take into account that conflicts are now tracked for objects. (ira_conflict_vector_profitable_p, ira_allocate_conflict_vec, allocate_conflict_bit_vec, ira_allocate_object_conflicts, compress_conflict_vecs, remove_low_level_allocnos, ira_flattening, setup_min_max_allocno_live_range_point, allocno_range_compare_func, setup_min_max_conflict_allocno_ids, ): Likewise. ((add_to_conflicts): Renamed from add_to_allocno_conflicts, args changed to ira_object_t; all callers changed. (ira_add_conflict): Renamed from ira_add_allocno_conflict, args changed to ira_object_t, all callers changed. (clear_conflicts): Renamed from clear_allocno_conflicts, arg changed to ira_object_t, all callers changed. (conflict_check, curr_conflict_check_tick): Renamed from allocno_conflict_check and curr_allocno_conflict_check_tick; all uses changed. (compress_conflict_vec): Renamed from compress_allocno_conflict_vec, arg changed to ira_object_t, all callers changed. (create_cap_allocno): Call ira_create_allocno_object. (finish_allocno): Free the corresponding object. (sort_conflict_id_map): Renamed from sort_conflict_id_allocno_map; all callers changed. Adjusted for dealing with objects. (ira_build): Call create_allocno_objects after ira_costs. Adjusted for dealing with objects. * ira.c (ira_bad_reload_regno_1): Adjusted for dealing with objects. From-SVN: r162166
2010-07-14 03:53:35 +02:00
extern bool ira_conflict_vector_profitable_p (ira_object_t, int);
extern void ira_allocate_conflict_vec (ira_object_t, int);
extern void ira_allocate_object_conflicts (ira_object_t, int);
ira-build.c (ira_create_object): New arg SUBWORD; all callers changed. * ira-build.c (ira_create_object): New arg SUBWORD; all callers changed. Initialize OBJECT_SUBWORD. (ira_create_allocno): Clear ALLOCNO_NUM_OBJECTS. (ira_create_allocno_objects): Renamed from ira_create_allocno_object; all callers changed. (merge_hard_reg_conflicts): Iterate over allocno subobjects. (finish_allocno): Likewise. (move_allocno_live_ranges, copy_allocno_live_ranges): Likewise. (remove_low_level_allocnos): Likewise. (update_bad_spill_attribute): Likewise. (setup_min_max_allocno_live_range_point): Likewise. (sort_conflict_id_map): Likewise. (ira_flattening): Likewise. Use ior_hard_reg_conflicts. (ior_hard_reg_conflicts): New function. (ior_allocate_object_conflicts): Renamed first argument to OBJ. (compress_conflict_vecs): Iterate over objects, not allocnos. (ira_add_live_range_to_object): New function. (object_range_compare_func): Renamed from allocno_range_compare_func. All callers changed. (setup_min_max_conflict_allocno_ids): For allocnos with multiple subobjects, widen the min/max range of the lowest-order object to potentially include all other such low-order objects. * ira.c (ira_bad_reload_regno_1): Iterate over allocno subobjects. (check_allocation): Likewise. Use more fine-grained tests for register conflicts. * ira-color.c (allocnos_have_intersected_live_ranges_p): Iterate over allocno subobjects. (assign_hard_reg): Keep multiple sets of conflicts. Make finer-grained choices about which bits to set in each set. Don't use ira_hard_reg_not_in_set_p, perform a more elaborate test for conflicts using the multiple sets we computed. (push_allocno_to_stack): Iterate over allocno subobjects. (all_conflicting_hard_regs_coalesced): New static function. (setup_allocno_available_regs_num): Use it. (setup_allocno_left_conflicts_size): Likewise. Iterate over allocno subobjects. (coalesced_allocno_conflict): Test subobject 0 in each allocno. (setup_allocno_priorities): Divide ALLOCNO_EXCESS_PRESSURE_POINTS_NUM by ALLOCNO_NUM_OBJECTS. (calculate_spill_cost): Likewise. (color_pass): Express if statement in a more normal way. (ira_reassign_conflict_allocnos): Iterate over allocno subobjects. (slot_coalesced_allocno_live_ranges_intersect_p): Likewise. (setup_slot_coalesced_allocno_live_ranges): Likewise. (allocno_reload_assign): Likewise. (ira_reassign_pseudos): Likewise. (fast_allocation): Likewise. * ira-conflicts.c (build_conflict_bit_table): Likewise. (print_allocno_conflicts): Likewise. (ira_build_conflicts): Likewise. (allocnos_conflict_for_copy_p): Renamed from allocnos_conflict_p. All callers changed. Test subword 0 of each allocno for conflicts. (build_object_conflicts): Renamed from build_allocno_conflicts. All callers changed. Iterate over allocno subobjects. * ira-emit.c (modify_move_list): Iterate over allocno subobjects. * ira-int.h (struct ira_allocno): New member. num_objects. Rename object to objects and change it into an array. (ALLOCNO_OBJECT): Add new argument N. (ALLOCNO_NUM_OBJECTS, OBJECT_SUBWORD): New macros. (ira_create_allocno_objects): Renamed from ira_create_allocno_object. (ior_hard_reg_conflicts): Declare. (ira_add_live_range_to_object): Declare. (ira_allocno_object_iterator): New. (ira_allocno_object_iter_init, ira_allocno_object_iter_cond): New. (FOR_EACH_ALLOCNO_OBJECT): New macro. * ira-lives.c (objects_live): Renamed from allocnos_live; all uses changed. (allocnos_processed): New sparseset. (make_object_born): Renamed from make_allocno_born; take an ira_object_t argument. All callers changed. (make_object_dead): Renamed from make_allocno_dead; take an ira_object t argument. All callers changed. (update_allocno_pressure_excess_length): Take an ira_obejct_t argument. All callers changed. (mark_pseudo_regno_live): Iterate over allocno subobjects. (mark_pseudo_regno_dead): Likewise. (mark_pseudo_regno_subword_live, mark_pseudo_regno_subword_dead): New functions. (mark_ref_live): Detect subword accesses and call mark_pseudo_regno_subword_live as appropriate. (mark_ref_dead): Likewise for mark_pseudo_regno_subword_dead. (process_bb_nodes_live): Deal with object-related updates first; set and test bits in allocnos_processed to avoid computing allocno statistics more than once. (create_start_finish_chains): Iterate over objects, not allocnos. (print_object_live_ranges): New function. (print_allocno_live_ranges): Use it. (ira_create_allocno_live_ranges): Allocate and free allocnos_processed and objects_live. From-SVN: r162418
2010-07-22 17:48:30 +02:00
extern void ior_hard_reg_conflicts (ira_allocno_t, HARD_REG_SET *);
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
extern void ira_print_expanded_allocno (ira_allocno_t);
ira-build.c (ira_create_object): New arg SUBWORD; all callers changed. * ira-build.c (ira_create_object): New arg SUBWORD; all callers changed. Initialize OBJECT_SUBWORD. (ira_create_allocno): Clear ALLOCNO_NUM_OBJECTS. (ira_create_allocno_objects): Renamed from ira_create_allocno_object; all callers changed. (merge_hard_reg_conflicts): Iterate over allocno subobjects. (finish_allocno): Likewise. (move_allocno_live_ranges, copy_allocno_live_ranges): Likewise. (remove_low_level_allocnos): Likewise. (update_bad_spill_attribute): Likewise. (setup_min_max_allocno_live_range_point): Likewise. (sort_conflict_id_map): Likewise. (ira_flattening): Likewise. Use ior_hard_reg_conflicts. (ior_hard_reg_conflicts): New function. (ior_allocate_object_conflicts): Renamed first argument to OBJ. (compress_conflict_vecs): Iterate over objects, not allocnos. (ira_add_live_range_to_object): New function. (object_range_compare_func): Renamed from allocno_range_compare_func. All callers changed. (setup_min_max_conflict_allocno_ids): For allocnos with multiple subobjects, widen the min/max range of the lowest-order object to potentially include all other such low-order objects. * ira.c (ira_bad_reload_regno_1): Iterate over allocno subobjects. (check_allocation): Likewise. Use more fine-grained tests for register conflicts. * ira-color.c (allocnos_have_intersected_live_ranges_p): Iterate over allocno subobjects. (assign_hard_reg): Keep multiple sets of conflicts. Make finer-grained choices about which bits to set in each set. Don't use ira_hard_reg_not_in_set_p, perform a more elaborate test for conflicts using the multiple sets we computed. (push_allocno_to_stack): Iterate over allocno subobjects. (all_conflicting_hard_regs_coalesced): New static function. (setup_allocno_available_regs_num): Use it. (setup_allocno_left_conflicts_size): Likewise. Iterate over allocno subobjects. (coalesced_allocno_conflict): Test subobject 0 in each allocno. (setup_allocno_priorities): Divide ALLOCNO_EXCESS_PRESSURE_POINTS_NUM by ALLOCNO_NUM_OBJECTS. (calculate_spill_cost): Likewise. (color_pass): Express if statement in a more normal way. (ira_reassign_conflict_allocnos): Iterate over allocno subobjects. (slot_coalesced_allocno_live_ranges_intersect_p): Likewise. (setup_slot_coalesced_allocno_live_ranges): Likewise. (allocno_reload_assign): Likewise. (ira_reassign_pseudos): Likewise. (fast_allocation): Likewise. * ira-conflicts.c (build_conflict_bit_table): Likewise. (print_allocno_conflicts): Likewise. (ira_build_conflicts): Likewise. (allocnos_conflict_for_copy_p): Renamed from allocnos_conflict_p. All callers changed. Test subword 0 of each allocno for conflicts. (build_object_conflicts): Renamed from build_allocno_conflicts. All callers changed. Iterate over allocno subobjects. * ira-emit.c (modify_move_list): Iterate over allocno subobjects. * ira-int.h (struct ira_allocno): New member. num_objects. Rename object to objects and change it into an array. (ALLOCNO_OBJECT): Add new argument N. (ALLOCNO_NUM_OBJECTS, OBJECT_SUBWORD): New macros. (ira_create_allocno_objects): Renamed from ira_create_allocno_object. (ior_hard_reg_conflicts): Declare. (ira_add_live_range_to_object): Declare. (ira_allocno_object_iterator): New. (ira_allocno_object_iter_init, ira_allocno_object_iter_cond): New. (FOR_EACH_ALLOCNO_OBJECT): New macro. * ira-lives.c (objects_live): Renamed from allocnos_live; all uses changed. (allocnos_processed): New sparseset. (make_object_born): Renamed from make_allocno_born; take an ira_object_t argument. All callers changed. (make_object_dead): Renamed from make_allocno_dead; take an ira_object t argument. All callers changed. (update_allocno_pressure_excess_length): Take an ira_obejct_t argument. All callers changed. (mark_pseudo_regno_live): Iterate over allocno subobjects. (mark_pseudo_regno_dead): Likewise. (mark_pseudo_regno_subword_live, mark_pseudo_regno_subword_dead): New functions. (mark_ref_live): Detect subword accesses and call mark_pseudo_regno_subword_live as appropriate. (mark_ref_dead): Likewise for mark_pseudo_regno_subword_dead. (process_bb_nodes_live): Deal with object-related updates first; set and test bits in allocnos_processed to avoid computing allocno statistics more than once. (create_start_finish_chains): Iterate over objects, not allocnos. (print_object_live_ranges): New function. (print_allocno_live_ranges): Use it. (ira_create_allocno_live_ranges): Allocate and free allocnos_processed and objects_live. From-SVN: r162418
2010-07-22 17:48:30 +02:00
extern void ira_add_live_range_to_object (ira_object_t, int, int);
ira-int.h (struct live_range): Rename allocno member to object and change type to ira_object_t. * ira-int.h (struct live_range): Rename allocno member to object and change type to ira_object_t. (struct ira_object): New member live_ranges. (struct ira_allocno): Remove member live_ranges. (ALLOCNO_LIVE_RANGES): Remove. (OBJECT_LIVE_RANGES): New macro. (ira_create_live_range, ira_copy_live_range_list, ira_merge_live_range_list, ira_live_ranges_intersect_p, ira_finish_live_range, ira_finish_live_range_list): Adjust declarations. * ira-build.c (ira_create_object): Initialize live ranges here. (ira_create_allocno): Not here. (ira_create_live_range): Rename from ira_create_allocno_live_range, arg changed to ira_object_t, all callers changed. (copy_live_range): Rename from copy_allocno_live_range, all callers changed. (ira_copy_live_range_list): Rename from ira_copy_allocno_live_range_list, all callers changed. (ira_merge_live_ranges): Rename from ira_merge_allocno_live_range_list, all callers changed. (ira_live_ranges_intersect_p): Rename from ira_allocno_live_ranges_intersect_p, all callers changed. (ira_finish_live_range): Rename from ira_finish_allocno_live_range, all callers changed. (ira_finish_live_range_list): Rename from ira_finish_allocno_live_range_list, all callers changed. (change_object_in_range_list): Rename from change_allocno_in_range_list, last arg changed to ira_object_t, all callers changed. (finish_allocno): Changed to expect live ranges in the allocno's object. (move_allocno_live_ranges, copy_allocno_live_ranges, update_bad_spill_attribute, setup_min_max_allocno_live_range_point, ira_flattening, ira_build): Likewise. * ira-color.c (allocnos_have_intersected_live_ranges_p, slot_coalesced_allocno_live_ranges_intersect, setup_slot_coalesced_allocno_live_ranges, fast_allocation): Likewise. * ira-conflicts.c (build_conflict_bit_table): Likewise. * ira-emit.c (add_range_and_copies_from_move_list): Likewise. * ira-lives.c (make_allocno_born, update_allocno_pressure_excess_length, make_allocno_dead, create_start_finish_chains, remove_some_program_points_and_update_live_ranges, ira_debug_live_range_list): Likewise. From-SVN: r162167
2010-07-14 03:55:02 +02:00
extern live_range_t ira_create_live_range (ira_object_t, int, int,
live_range_t);
extern live_range_t ira_copy_live_range_list (live_range_t);
extern live_range_t ira_merge_live_ranges (live_range_t, live_range_t);
extern bool ira_live_ranges_intersect_p (live_range_t, live_range_t);
extern void ira_finish_live_range (live_range_t);
extern void ira_finish_live_range_list (live_range_t);
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
extern void ira_free_allocno_updated_costs (ira_allocno_t);
regmove.c: Remove. 2013-10-30 Vladimir Makarov <vmakarov@redhat.com> * regmove.c: Remove. * tree-pass.h (make_pass_regmove): Remove. * timevar.def (TV_REGMOVE): Remove. * passes.def (pass_regmove): Remove. * opts.c (default_options_table): Remove entry for regmove. * doc/passes.texi: Remove regmove pass description. * doc/invoke.texi (-foptimize-register-move, -fregmove): Remove options. (-fdump-rtl-regmove): Ditto. * common.opt (foptimize-register-move, fregmove): Ignore. * Makefile.in (OBJS): Remove regmove.o. * regmove.c: Remove. * ira-int.h (struct ira_allocno_pref, ira_pref_t): New structure and type. (struct ira_allocno) New member allocno_prefs. (ALLOCNO_PREFS): New macro. (ira_prefs, ira_prefs_num): New external vars. (ira_setup_alts, ira_get_dup_out_num, ira_debug_pref): New prototypes. (ira_debug_prefs, ira_debug_allocno_prefs, ira_create_pref): Ditto. (ira_add_allocno_pref, ira_remove_pref, ira_remove_allocno_prefs): Ditto. (ira_add_allocno_copy_to_list): Remove prototype. (ira_swap_allocno_copy_ends_if_necessary): Ditto. (ira_pref_iterator): New type. (ira_pref_iter_init, ira_pref_iter_cond): New functions. (FOR_EACH_PREF): New macro. * ira.c (commutative_constraint_p): Move from ira-conflicts.c. (ira_get_dup_out_num): Ditto. Rename from get_dup_num. Modify the code. (ira_setup_alts): New function. (decrease_live_ranges_number): New function. (ira): Call the above function. * ira-build.c (ira_prefs, ira_prefs_num): New global vars. (ira_create_allocno): Initialize allocno prefs. (pref_pool, pref_vec): New static vars. (initiate_prefs, find_allocno_pref, ira_create_pref): New functions. (add_allocno_pref_to_list, ira_add_allocno_pref, print_pref): Ditto. (ira_debug_pref, print_prefs, ira_debug_prefs): Ditto. (print_allocno_prefs, ira_debug_allocno_prefs, finish_pref): Ditto. (ira_remove_pref, ira_remove_allocno_prefs, finish_prefs): Ditto. (ira_add_allocno_copy_to_list): Make static. Rename to add_allocno_copy_to_list. (ira_swap_allocno_copy_ends_if_necessary): Make static. Rename to swap_allocno_copy_ends_if_necessary. (remove_unnecessary_allocnos, remove_low_level_allocnos): Call ira_remove_allocno_prefs. (ira_flattening): Ditto. (ira_build): Call initiate_prefs, print_prefs. (ira_destroy): Call finish_prefs. * ira-color.c (struct update_cost_record): New. (struct allocno_color_data): Add new member update_cost_records. (update_cost_record_pool): New static var. (init_update_cost_records, get_update_cost_record): New functions. (free_update_cost_record_list, finish_update_cost_records): Ditto. (struct update_cost_queue_elem): Add member from. (initiate_cost_update): Call init_update_cost_records. (finish_cost_update): Call finish_update_cost_records. (queue_update_cost, get_next_update_cost): Add new param from. (Update_allocno_cost, update_costs_from_allocno): New functions. (update_costs_from_prefs): Ditto. (update_copy_costs): Rename to update_costs_from_copies. (restore_costs_from_copies): New function. (update_conflict_hard_regno_costs): Don't go back. (assign_hard_reg): Call restore_costs_from_copies. Add printing more debug info. (pop_allocnos): Add priniting more debug info. (color_allocnos): Remove prefs for conflicting hard regs. Call update_costs_from_prefs. * ira-conflicts.c (commutative_constraint_p): Move to ira.c (get_dup_num): Rename, modify, and move to ira.c (process_regs_for_copy): Add prefs. (add_insn_allocno_copies): Put src as first arg of process_regs_for_copy. Remove dead code. Call ira_setup_alts. * ira-costs.c (record_reg_classes): Modify and move code into record_operands_costs. (find_costs_and_classes): Create prefs for the hard reg of small reg class. (process_bb_node_for_hard_reg_moves): Add prefs. 2013-10-30 Vladimir Makarov <vmakarov@redhat.com> * gcc.target/i386/fma_double_3.c: Use pattern for scan-assembler-times instead of just one insn name. * gcc.target/i386/fma_double_5.c: Ditto. * gcc.target/i386/fma_float_3.c: Ditto. * gcc.target/i386/fma_float_5.c: Ditto. * gcc.target/i386/l_fma_double_1.c: Ditto. * gcc.target/i386/l_fma_double_2.c: Ditto. * gcc.target/i386/l_fma_double_3.c: Ditto. * gcc.target/i386/l_fma_double_4.c: Ditto. * gcc.target/i386/l_fma_double_5.c: Ditto. * gcc.target/i386/l_fma_double_6.c: Ditto. * gcc.target/i386/l_fma_float_1.c: Ditto. * gcc.target/i386/l_fma_float_2.c: Ditto. * gcc.target/i386/l_fma_float_3.c: Ditto. * gcc.target/i386/l_fma_float_4.c: Ditto. * gcc.target/i386/l_fma_float_5.c: Ditto. * gcc.target/i386/l_fma_float_6.c: Ditto. From-SVN: r204212
2013-10-30 15:27:25 +01:00
extern ira_pref_t ira_create_pref (ira_allocno_t, int, int);
extern void ira_add_allocno_pref (ira_allocno_t, int, int);
extern void ira_remove_pref (ira_pref_t);
extern void ira_remove_allocno_prefs (ira_allocno_t);
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
extern ira_copy_t ira_create_copy (ira_allocno_t, ira_allocno_t,
ira: Use rtx_insn in various places gcc/ * ira-int.h (struct ira_allocno_copy): Strengthen field "insn" from rtx to rtx_insn *insn. (ira_create_copy): Strengthen param "insn" from rtx to rtx_insn *. (ira_add_allocno_copy): Likewise. * ira-build.c (find_allocno_copy): Strengthen param "insn" from rtx to rtx_insn *. (ira_create_copy): Likewise. (ira_add_allocno_copy): Likewise. (create_bb_allocnos): Likewise for local "insn". * ira-conflicts.c (process_regs_for_copy): Likewise for param "insn". (process_reg_shuffles): Update NULL_RTX to NULL in invocation of process_regs_for_copy for rtx_insn * param. (add_insn_allocno_copies): Strengthen param "insn" from rtx to rtx_insn *insn. Update NULL_RTX to NULL in invocation of process_regs_for_copy for rtx_insn * param. (add_copies): Strengthen local "insn" from rtx to rtx_insn *insn. * ira-costs.c (record_reg_classes): Likewise for param "insn". (record_operand_costs): Likewise. (scan_one_insn): Likewise for return type, and for param "insn". (process_bb_for_costs): Likewise for local "insn". (process_bb_node_for_hard_reg_moves): Likewise. * ira-emit.c (struct move): Likewise for field "insn". (create_move): Eliminate use of NULL_RTX when dealing with an rtx_insn *. (emit_move_list): Strengthen return type and locals "result", "insn" from rtx to rtx_insn *insn. (emit_moves): Likewise for locals "insns", "tmp". (ira_emit): Likewise for local "insn". * ira-lives.c (mark_hard_reg_early_clobbers): Likewise for param "insn". (find_call_crossed_cheap_reg): Likewise. (process_bb_node_lives): Likewise for local "insn". * ira.c (decrease_live_ranges_number): Likewise. (compute_regs_asm_clobbered): Likewise. (build_insn_chain): Likewise. (find_moveable_pseudos): Likewise, also locals "def_insn", "use_insn", "x". Also strengthen local "closest_uses" from rtx * to rtx_insn **. Add a checked cast when assigning from "closest_use" into closest_uses array in a region where we know it's a non-NULL insn. (interesting_dest_for_shprep): Strengthen param "insn" from rtx to rtx_insn *. (split_live_ranges_for_shrink_wrap): Likewise for locals "insn", "last_interesting_insn", "uin". (move_unallocated_pseudos): Likewise for locals "def_insn", "move_insn", "newinsn". From-SVN: r214339
2014-08-22 19:48:40 +02:00
int, bool, rtx_insn *,
ira_loop_tree_node_t);
re PR rtl-optimization/37948 (IRA generates slower code) 2008-11-07 Vladimir Makarov <vmakarov@redhat.com> PR rtl-optimizations/37948 * ira-int.h (struct ira_allocno_copy): New member constraint_p. (ira_create_copy, ira_add_allocno_copy): New parameter. * ira-conflicts.c (process_regs_for_copy): New parameter. Pass it to ira_add_allocno_copy. (process_reg_shuffles, add_insn_allocno_copies): Pass a new parameter to process_regs_for_copy. (propagate_copies): Pass a new parameter to ira_add_allocno_copy. Fix typo in passing second allocno to ira_add_allocno_copy. * ira-color.c (update_conflict_hard_regno_costs): Use head of coalesced allocnos list. (assign_hard_reg): Ditto. Check that assigned allocnos are not in the graph. (add_ira_allocno_to_bucket): Rename to add_allocno_to_bucket. (add_ira_allocno_to_ordered_bucket): Rename to add_allocno_to_ordered_bucket. (push_ira_allocno_to_stack): Rename to push_allocno_to_stack. Use head of coalesced allocnos list. (push_allocnos_to_stack): Remove calculation of ALLOCNO_TEMP. Check that it is aready calculated. (push_ira_allocno_to_spill): Rename to push_ira_allocno_to_spill. (setup_allocno_left_conflicts_num): Use head of coalesced allocnos list. (coalesce_allocnos): Do extended coalescing too. * ira-emit.c (add_range_and_copies_from_move_list): Pass a new parameter to ira_add_allocno_copy. * ira-build.c (ira_create_copy, ira_add_allocno_copy): Add a new parameter. (print_copy): Print copy origination too. * ira-costs.c (scan_one_insn): Use alloc_pref for load from equivalent memory. From-SVN: r141753
2008-11-11 00:21:45 +01:00
extern ira_copy_t ira_add_allocno_copy (ira_allocno_t, ira_allocno_t, int,
ira: Use rtx_insn in various places gcc/ * ira-int.h (struct ira_allocno_copy): Strengthen field "insn" from rtx to rtx_insn *insn. (ira_create_copy): Strengthen param "insn" from rtx to rtx_insn *. (ira_add_allocno_copy): Likewise. * ira-build.c (find_allocno_copy): Strengthen param "insn" from rtx to rtx_insn *. (ira_create_copy): Likewise. (ira_add_allocno_copy): Likewise. (create_bb_allocnos): Likewise for local "insn". * ira-conflicts.c (process_regs_for_copy): Likewise for param "insn". (process_reg_shuffles): Update NULL_RTX to NULL in invocation of process_regs_for_copy for rtx_insn * param. (add_insn_allocno_copies): Strengthen param "insn" from rtx to rtx_insn *insn. Update NULL_RTX to NULL in invocation of process_regs_for_copy for rtx_insn * param. (add_copies): Strengthen local "insn" from rtx to rtx_insn *insn. * ira-costs.c (record_reg_classes): Likewise for param "insn". (record_operand_costs): Likewise. (scan_one_insn): Likewise for return type, and for param "insn". (process_bb_for_costs): Likewise for local "insn". (process_bb_node_for_hard_reg_moves): Likewise. * ira-emit.c (struct move): Likewise for field "insn". (create_move): Eliminate use of NULL_RTX when dealing with an rtx_insn *. (emit_move_list): Strengthen return type and locals "result", "insn" from rtx to rtx_insn *insn. (emit_moves): Likewise for locals "insns", "tmp". (ira_emit): Likewise for local "insn". * ira-lives.c (mark_hard_reg_early_clobbers): Likewise for param "insn". (find_call_crossed_cheap_reg): Likewise. (process_bb_node_lives): Likewise for local "insn". * ira.c (decrease_live_ranges_number): Likewise. (compute_regs_asm_clobbered): Likewise. (build_insn_chain): Likewise. (find_moveable_pseudos): Likewise, also locals "def_insn", "use_insn", "x". Also strengthen local "closest_uses" from rtx * to rtx_insn **. Add a checked cast when assigning from "closest_use" into closest_uses array in a region where we know it's a non-NULL insn. (interesting_dest_for_shprep): Strengthen param "insn" from rtx to rtx_insn *. (split_live_ranges_for_shrink_wrap): Likewise for locals "insn", "last_interesting_insn", "uin". (move_unallocated_pseudos): Likewise for locals "def_insn", "move_insn", "newinsn". From-SVN: r214339
2014-08-22 19:48:40 +02:00
bool, rtx_insn *,
ira_loop_tree_node_t);
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
extern int *ira_allocate_cost_vector (reg_class_t);
extern void ira_free_cost_vector (int *, reg_class_t);
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
extern void ira_flattening (int, int);
re PR rtl-optimization/40761 (IRA memory hog for insanely nested loops) 2012-01-19 Vladimir Makarov <vmakarov@redhat.com> PR rtl-optimization/40761 * ira-int.h (struct ira_loop_tree_node): Add comment for member loop. Add new member loop_num. (IRA_LOOP_NODE_BY_INDEX): Modify the check. (ira_build): Remove the parameter. * ira.c (ira_print_disposition): Use loop_num instead of loop->num. (ira.c): Do not build CFG loops for one region allocation. Remove argument from ira_build call. * ira-build.c (init_loop_tree_node): New function. (create_loop_tree_nodes): Use it. Separate the case when CFG loops are not built. (more_one_region_p): Check current_loops. (finish_loop_tree_nodes): Separate the case when CFG loops are not built. (add_loop_to_tree): Process loop equal to NULL too. (form_loop_tree): Separate the case when CFG loops are not built. Use explicitly number for the root. (rebuild_regno_allocno_maps, create_loop_tree_node_allocnos): Add an assertion. (ira_print_expanded_allocno, loop_compare_func): Use loop_num instead of loop->num. (mark_loops_for_removal): Ditto. Use loop_num instead of loop->num. (mark_all_loops_for_removal): Ditto. (remove_unnecessary_regions): Separate the case when CFG loops are not built. (ira_build): Remove the parameter. Use explicit number of regions when CFG loops are not built. * ira-color.c (print_loop_title): Separate the case for the root node. Use loop_num instead of loop->num. (move_spill_restore): Use loop_num instead of loop->num. * ira-emit.c (setup_entered_from_non_parent_p): Add an assertion. (change_loop): Ditto. (change_loop): Use loop_num instead of loop->num. * ira-lives.c (process_bb_node_lives): Ditto. * ira-costs.c (print_allocno_costs, find_costs_and_classes): Ditto. * ira-conflicts.c (print_allocno_conflicts): Ditto. From-SVN: r183312
2012-01-19 21:46:31 +01:00
extern bool ira_build (void);
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
extern void ira_destroy (void);
/* ira-costs.c */
extern void ira_init_costs_once (void);
extern void ira_init_costs (void);
extern void ira_costs (void);
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
extern void ira_tune_allocno_costs (void);
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
/* ira-lives.c */
extern void ira_rebuild_start_finish_chains (void);
extern void ira_print_live_range_list (FILE *, live_range_t);
Add uniform debug dump function names. Add some overloaded functions that provide uniform debug dump function names. These names are: debug: the general debug dumper debug_verbose: for more details debug_raw: for the gory details debug_head: for the heads of declarations, e.g. function heads debug_body: for the bodies of declarations, e.g. function bodies Not all types have the last four versions. The debug functions come in two flavors, those that take pointers to the type, and those that take references to the type. The first handles printing of '<nil>' for null pointers. The second assumes a valid reference, and prints the content. Example uses are as follows: cp_token t, *p; debug (t); debug (p); From the debugger, use call debug (t) The functions sets implemented are: debug (only) basic_block_def, const bitmap_head_def, cp_binding_level, cp_parser, cp_token, data_reference, die_struct, edge_def, gimple_statement_d, ira_allocno, ira_allocno_copy, live_range, lra_live_range, omega_pb_d, pt_solution, const rtx_def, sreal, tree_live_info_d, _var_map, vec<cp_token, va_gc>, vec<data_reference_p>, vec<ddr_p>, vec<rtx>, vec<tree, va_gc>, debug and debug_raw simple_bitmap_def debug and debug_verbose expr_def, struct loop, vinsn_def debug, debug_raw, debug_verbose, debug_head, debug_body const tree_node This patch is somewhat different from the original plan at gcc.gnu.org/wiki/cxx-conversion/debugging-dumps. The reason is that gdb has an incomplete implementation of C++ call syntax; requiring explicit specification of template arguments and explicit specification of function arguments even when they have default values. So, the original plan would have required typing call dump <cp_token> (t, 0, 0, stderr) which is undesireable. Instead instead of templates, we overload plain functions. This adds a small burden of manually adding the pointer version of dump for each type. Instead of default function arguments, we simply assume the default values. Most of the underlying dump functions did not use the options and indent parameters anyway. Several provide FILE* parameters, but we expect debugging to use stderr anyway. So, the explicit specification of arguments was not as valuable as we thought initially. Finally, a change of name from dump to debug reflect the implicit output to stderr. Index: gcc/ChangeLog 2013-03-28 Lawrence Crowl <crowl@google.com> * Makefile.in: Add several missing include dependences. (DUMPFILE_H): New. (test-dump.o): New. This object is not added to any executable, but is present for ad-hoc testing. * bitmap.c (debug (const bitmap_head_def &)): New. (debug (const bitmap_head_def *)): New. * bitmap.h (extern debug (const bitmap_head_def &)): New. (extern debug (const bitmap_head_def *)): New. * cfg.c (debug (edge_def &)): New. (debug (edge_def *)): New. * cfghooks.c (debug (basic_block_def &)): New. (debug (basic_block_def *)): New. * dumpfile.h (dump_node (const_tree, int, FILE *)): Correct source file. * dwarf2out.c (debug (die_struct &)): New. (debug (die_struct *)): New. * dwarf2out.h (extern debug (die_struct &)): New. (extern debug (die_struct *)): New. * gimple-pretty-print.c (debug (gimple_statement_d &)): New. (debug (gimple_statement_d *)): New. * gimple-pretty-print.h (extern debug (gimple_statement_d &)): New. (extern debug (gimple_statement_d *)): New. * ira-build.c (debug (ira_allocno_copy &)): New. (debug (ira_allocno_copy *)): New. (debug (ira_allocno &)): New. (debug (ira_allocno *)): New. * ira-int.h (extern debug (ira_allocno_copy &)): New. (extern debug (ira_allocno_copy *)): New. (extern debug (ira_allocno &)): New. (extern debug (ira_allocno *)): New. * ira-lives.c (debug (live_range &)): New. (debug (live_range *)): New. * lra-int.h (debug (lra_live_range &)): New. (debug (lra_live_range *)): New. * lra-lives.c (debug (lra_live_range &)): New. (debug (lra_live_range *)): New. * omega.c (debug (omega_pb_d &)): New. (debug (omega_pb_d *)): New. * omega.h (extern debug (omega_pb_d &)): New. (extern debug (omega_pb_d *)): New. * print-rtl.c (debug (const rtx_def &)): New. (debug (const rtx_def *)): New. * print-tree.c (debug_tree (tree): Move within file. (debug_raw (const tree_node &)): New. (debug_raw (const tree_node *)): New. (dump_tree_via_hooks (const tree_node *, int)): New. (debug (const tree_node &)): New. (debug (const tree_node *)): New. (debug_verbose (const tree_node &)): New. (debug_verbose (const tree_node *)): New. (debug_head (const tree_node &)): New. (debug_head (const tree_node *)): New. (debug_body (const tree_node &)): New. (debug_body (const tree_node *)): New. (debug_vec_tree (tree): Move and reimplement in terms of dump. (debug (vec<tree, va_gc> &)): New. (debug (vec<tree, va_gc> *)): New. * rtl.h (extern debug (const rtx_def &)): New. (extern debug (const rtx_def *)): New. * sbitmap.c (debug_raw (simple_bitmap_def &)): New. (debug_raw (simple_bitmap_def *)): New. (debug (simple_bitmap_def &)): New. (debug (simple_bitmap_def *)): New. * sbitmap.h (extern debug (simple_bitmap_def &)): New. (extern debug (simple_bitmap_def *)): New. (extern debug_raw (simple_bitmap_def &)): New. (extern debug_raw (simple_bitmap_def *)): New. * sel-sched-dump.c (debug (vinsn_def &)): New. (debug (vinsn_def *)): New. (debug_verbose (vinsn_def &)): New. (debug_verbose (vinsn_def *)): New. (debug (expr_def &)): New. (debug (expr_def *)): New. (debug_verbose (expr_def &)): New. (debug_verbose (expr_def *)): New. (debug (vec<rtx> &)): New. (debug (vec<rtx> *)): New. * sel-sched-dump.h (extern debug (vinsn_def &)): New. (extern debug (vinsn_def *)): New. (extern debug_verbose (vinsn_def &)): New. (extern debug_verbose (vinsn_def *)): New. (extern debug (expr_def &)): New. (extern debug (expr_def *)): New. (extern debug_verbose (expr_def &)): New. (extern debug_verbose (expr_def *)): New. (extern debug (vec<rtx> &)): New. (extern debug (vec<rtx> *)): New. * sel-sched-ir.h (_list_iter_cond_expr): Make inline instead of static. * sreal.c (debug (sreal &)): New. (debug (sreal *)): New. * sreal.h (extern debug (sreal &)): New. (extern debug (sreal *)): New. * tree.h (extern debug_raw (const tree_node &)): New. (extern debug_raw (const tree_node *)): New. (extern debug (const tree_node &)): New. (extern debug (const tree_node *)): New. (extern debug_verbose (const tree_node &)): New. (extern debug_verbose (const tree_node *)): New. (extern debug_head (const tree_node &)): New. (extern debug_head (const tree_node *)): New. (extern debug_body (const tree_node &)): New. (extern debug_body (const tree_node *)): New. (extern debug (vec<tree, va_gc> &)): New. (extern debug (vec<tree, va_gc> *)): New. * tree-cfg.c (debug (struct loop &)): New. (debug (struct loop *)): New. (debug_verbose (struct loop &)): New. (debug_verbose (struct loop *)): New. * tree-dump.c: Add header dependence. * tree-flow.h (extern debug (struct loop &)): New. (extern debug (struct loop *)): New. (extern debug_verbose (struct loop &)): New. (extern debug_verbose (struct loop *)): New. * tree-data-ref.c (debug (data_reference &)): New. (debug (data_reference *)): New. (debug (vec<data_reference_p> &)): New. (debug (vec<data_reference_p> *)): New. (debug (vec<ddr_p> &)): New. (debug (vec<ddr_p> *)): New. * tree-data-ref.h (extern debug (data_reference &)): New. (extern debug (data_reference *)): New. (extern debug (vec<data_reference_p> &)): New. (extern debug (vec<data_reference_p> *)): New. (extern debug (vec<ddr_p> &)): New. (extern debug (vec<ddr_p> *)): New. * tree-ssa-alias.c (debug (pt_solution &)): New. (debug (pt_solution *)): New. * tree-ssa-alias.h (extern debug (pt_solution &)): New. (extern debug (pt_solution *)): New. * tree-ssa-alias.c (debug (_var_map &)): New. (debug (_var_map *)): New. (debug (tree_live_info_d &)): New. (debug (tree_live_info_d *)): New. * tree-ssa-alias.h (extern debug (_var_map &)): New. (extern debug (_var_map *)): New. (extern debug (tree_live_info_d &)): New. (extern debug (tree_live_info_d *)): New. Index: gcc/cp/ChangeLog 2013-03-28 Lawrence Crowl <crowl@google.com> * Make-lang.in (CXX_PARSER_H): Add header dependence. * cp-tree.h (extern debug (cp_binding_level &)): New. (extern debug (cp_binding_level *)): New. * name-lookup.h (debug (cp_binding_level &)): New. (debug (cp_binding_level *)): New. * parser.c (debug (cp_parser &)): New. (debug (cp_parser *)): New. (debug (cp_token &)): New. (debug (cp_token *)): New. (debug (vec<cp_token, va_gc> &)): New. (debug (vec<cp_token, va_gc> *)): New. * parser.c: Add header dependence. (extern debug (cp_parser &)): New. (extern debug (cp_parser *)): New. (extern debug (cp_token &)): New. (extern debug (cp_token *)): New. (extern debug (vec<cp_token, va_gc> &)): New. (extern debug (vec<cp_token, va_gc> *)): New. From-SVN: r197224
2013-03-29 04:42:21 +01:00
extern void debug (live_range &ref);
extern void debug (live_range *ptr);
extern void ira_debug_live_range_list (live_range_t);
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
extern void ira_debug_allocno_live_ranges (ira_allocno_t);
extern void ira_debug_live_ranges (void);
extern void ira_create_allocno_live_ranges (void);
extern void ira_compress_allocno_live_ranges (void);
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
extern void ira_finish_allocno_live_ranges (void);
extern void ira_implicitly_set_insn_hard_regs (HARD_REG_SET *,
alternative_mask);
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
/* ira-conflicts.c */
extern void ira_debug_conflicts (bool);
extern void ira_build_conflicts (void);
/* ira-color.c */
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
extern void ira_debug_hard_regs_forest (void);
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
extern int ira_loop_edge_freq (ira_loop_tree_node_t, int, bool);
extern void ira_reassign_conflict_allocnos (int);
extern void ira_initiate_assign (void);
extern void ira_finish_assign (void);
extern void ira_color (void);
/* ira-emit.c */
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
extern void ira_initiate_emit_data (void);
extern void ira_finish_emit_data (void);
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
extern void ira_emit (bool);
dbxout.c (dbxout_symbol_location): Pass new argument to alter_subreg. 2012-10-23 Vladimir Makarov <vmakarov@redhat.com> * dbxout.c (dbxout_symbol_location): Pass new argument to alter_subreg. * dwarf2out.c: Include ira.h and lra.h. (based_loc_descr, compute_frame_pointer_to_fb_displacement): Use lra_eliminate_regs for LRA instead of eliminate_regs. * expr.c (emit_move_insn_1): Pass an additional argument to emit_move_via_integer. Use emit_move_via_integer for LRA only if the insn is recognized. * emit-rtl.c (gen_rtx_REG): Add lra_in_progress. (validate_subreg): Don't check offset for LRA and floating point modes. * final.c (final_scan_insn, cleanup_subreg_operands): Pass new argument to alter_subreg. (walk_alter_subreg, output_operand): Ditto. (alter_subreg): Add new argument. * gcse.c (calculate_bb_reg_pressure): Add parameter to ira_setup_eliminable_regset call. * ira.c: Include lra.h. (ira_init_once, ira_init, ira_finish_once): Call lra_start_once, lra_init, lra_finish_once in anyway. (ira_setup_eliminable_regset): Add parameter. Remove need_fp. Call lra_init_elimination and mark HARD_FRAME_POINTER_REGNUM as living forever if frame_pointer_needed. (setup_reg_class_relations): Set up ira_reg_class_subset. (ira_reg_equiv_invariant_p, ira_reg_equiv_const): Remove. (find_reg_equiv_invariant_const): Ditto. (setup_reg_renumber): Use ira_equiv_no_lvalue_p instead of ira_reg_equiv_invariant_p. Skip caps for LRA. (setup_reg_equiv_init, ira_update_equiv_info_by_shuffle_insn): New functions. (ira_reg_equiv_len, ira_reg_equiv): New externals. (ira_reg_equiv): New. (ira_expand_reg_equiv, init_reg_equiv, finish_reg_equiv): New functions. (no_equiv, update_equiv_regs): Use ira_reg_equiv instead of reg_equiv_init. (setup_reg_equiv): New function. (ira_use_lra_p): New global. (ira): Set up lra_simple_p and ira_conflicts_p. Set up and restore flag_caller_saves and flag_ira_region. Move initialization of ira_obstack and ira_bitmap_obstack upper. Call init_reg_equiv, setup_reg_equiv, and setup_reg_equiv_init instead of initialization of ira_reg_equiv_len, ira_reg_equiv_invariant_p, and ira_reg_equiv_const. Call ira_setup_eliminable_regset with a new argument. Don't flatten IRA IRA for LRA. Don't reassign conflict allocnos for LRA. Call finish_reg_equiv. (do_reload): Prepare code for LRA call. Call LRA. * ira.h (ira_use_lra_p): New external. (struct target_ira): Add members x_ira_class_subset_p x_ira_reg_class_subset, and x_ira_reg_classes_intersect_p. (ira_class_subset_p, ira_reg_class_subset): New macros. (ira_reg_classes_intersect_p): New macro. (struct ira_reg_equiv): New. (ira_setup_eliminable_regset): Add an argument. (ira_expand_reg_equiv, ira_update_equiv_info_by_shuffle_insn): New prototypes. * ira-color.c (color_pass, move_spill_restore, coalesce_allocnos): Use ira_equiv_no_lvalue_p. (coalesce_spill_slots, ira_sort_regnos_for_alter_reg): Ditto. * ira-emit.c (ira_create_new_reg): Call ira_expand_reg_equiv. (generate_edge_moves, change_loop) Use ira_equiv_no_lvalue_p. (emit_move_list): Simplify code. Call ira_update_equiv_info_by_shuffle_insn. Use ira_reg_equiv instead of ira_reg_equiv_invariant_p and ira_reg_equiv_const. Change assert. * ira-int.h (struct target_ira_int): Remove x_ira_class_subset_p and x_ira_reg_classes_intersect_p. (ira_class_subset_p, ira_reg_classes_intersect_p): Remove. (ira_reg_equiv_len, ira_reg_equiv_invariant_p): Ditto. (ira_reg_equiv_const): Ditto. (ira_equiv_no_lvalue_p): New function. * jump.c (true_regnum): Always use hard_regno for subreg_get_info when lra is in progress. * haifa-sched.c (sched_init): Pass new argument to ira_setup_eliminable_regset. * loop-invariant.c (calculate_loop_reg_pressure): Pass new argument to ira_setup_eliminable_regset. * lra.h: New. * lra-int.h: Ditto. * lra.c: Ditto. * lra-assigns.c: Ditto. * lra-constraints.c: Ditto. * lra-coalesce.c: Ditto. * lra-eliminations.c: Ditto. * lra-lives.c: Ditto. * lra-spills.c: Ditto. * Makefile.in (LRA_INT_H): New. (OBJS): Add lra.o, lra-assigns.o, lra-coalesce.o, lra-constraints.o, lra-eliminations.o, lra-lives.o, and lra-spills.o. (dwarf2out.o): Add dependence on ira.h and lra.h. (ira.o): Add dependence on lra.h. (lra.o, lra-assigns.o, lra-coalesce.o, lra-constraints.o): New entries. (lra-eliminations.o, lra-lives.o, lra-spills.o): Ditto. * output.h (alter_subreg): Add new argument. * rtlanal.c (simplify_subreg_regno): Permit mode changes for LRA. Permit ARG_POINTER_REGNUM and STACK_POINTER_REGNUM for LRA. * recog.c (general_operand, register_operand): Accept paradoxical FLOAT_MODE subregs for LRA. (scratch_operand): Accept pseudos for LRA. * rtl.h (lra_in_progress): New external. (debug_bb_n_slim, debug_bb_slim, print_value_slim): New prototypes. (debug_rtl_slim, debug_insn_slim): Ditto. * sdbout.c (sdbout_symbol): Pass new argument to alter_subreg. * sched-vis.c (print_value_slim): New. * target.def (lra_p): New hook. (register_priority): Ditto. (different_addr_displacement_p): Ditto. (spill_class): Ditto. * target-globals.h (this_target_lra_int): New external. (target_globals): New member lra_int. (restore_target_globals): Restore this_target_lra_int. * target-globals.c: Include lra-int.h. (default_target_globals): Add &default_target_lra_int. * targhooks.c (default_lra_p): New function. (default_register_priority): Ditto. (default_different_addr_displacement_p): Ditto. * targhooks.h (default_lra_p): Declare. (default_register_priority): Ditto. (default_different_addr_displacement_p): Ditto. * timevar.def (TV_LRA, TV_LRA_ELIMINATE, TV_LRA_INHERITANCE): New. (TV_LRA_CREATE_LIVE_RANGES, TV_LRA_ASSIGN, TV_LRA_COALESCE): New. * config/arm/arm.c (load_multiple_sequence): Pass new argument toOB alter_subreg. (store_multiple_sequence): Ditto. * config/i386/i386.h (enum ix86_tune_indices): Add X86_TUNE_GENERAL_REGS_SSE_SPILL. (TARGET_GENERAL_REGS_SSE_SPILL): New macro. * config/i386/i386.c (initial_ix86_tune_features): Set up X86_TUNE_GENERAL_REGS_SSE_SPILL for m_COREI7 and m_CORE2I7. (ix86_lra_p, ix86_register_priority): New functions. (ix86_secondary_reload): Add NON_Q_REGS, SIREG, DIREG. (inline_secondary_memory_needed): Change assert. (ix86_spill_class): New function. (TARGET_LRA_P, TARGET_REGISTER_BANK, TARGET_SPILL_CLASS): New macros. * config/m68k/m68k.c (emit_move_sequence): Pass new argument to alter_subreg. * config/m32r/m32r.c (gen_split_move_double): Ditto. * config/pa/pa.c (pa_emit_move_sequence): Ditto. * config/sh/sh.md: Ditto. * config/v850/v850.c (v850_reorg): Ditto. * config/xtensa/xtensa.c (fixup_subreg_mem): Ditto. * doc/md.texi: Add new interpretation of hint * for LRA. * doc/passes.texi: Describe LRA pass. * doc/tm.texi.in: Add TARGET_LRA_P, TARGET_REGISTER_PRIORITY, TARGET_DIFFERENT_ADDR_DISPLACEMENT_P, and TARGET_SPILL_CLASS. * doc/tm.texi: Update. From-SVN: r192719
2012-10-23 17:51:41 +02:00
/* Return true if equivalence of pseudo REGNO is not a lvalue. */
static inline bool
ira_equiv_no_lvalue_p (int regno)
{
if (regno >= ira_reg_equiv_len)
return false;
return (ira_reg_equiv[regno].constant != NULL_RTX
|| ira_reg_equiv[regno].invariant != NULL_RTX
|| (ira_reg_equiv[regno].memory != NULL_RTX
&& MEM_READONLY_P (ira_reg_equiv[regno].memory)));
}
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
/* Initialize register costs for MODE if necessary. */
static inline void
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
ira_init_register_move_cost_if_necessary (machine_mode mode)
{
if (ira_register_move_cost[mode] == NULL)
ira_init_register_move_cost (mode);
}
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
/* The iterator for all allocnos. */
cgraph.h (cgraph_node_set_iterator, [...]): Remove typedef. * gcc/cgraph.h (cgraph_node_set_iterator, varpool_node_set_iterator): Remove typedef. (cgraph_inline_failed_enum, cgraph_inline_failed_t): Remove typedef and rename to cgraph_inline_failed_t. * gcc/tree-ssa-alias.h (ao_ref_s, ao_ref): Remove typedef and rename to ao_ref. * gcc/reload.h (reg_equivs_s, reg_equivs_t): Remove typedef and rename to reg_equivs_t. * gcc/conditions.h (CC_STATUS): Remove typedef. * gcc/bitmap.h (bitmap_obstack): Remove typedef. (bitmap_element_def, bitmap_element): Remove typedef and rename to bitmap_element. (bitmap_head_def, bitmap_head): Remove typedef and rename to bitmap_head. (bitmap_iterator): Remove typedef. * gcc/target.h (cumulative_args_t, print_switch_type, secondary_reload_info): Remove typedef. * gcc/dwarf2out.h (dw_cfi_oprnd_struct, dw_cfi_oprnd): Remove dw_cfi_oprnd_struct alias. (dw_cfi_struct, dw_cfi_node): Remove typedef and rename to dw_cfi_node. (dw_fde_struct, dw_fde_node): Remove typedef and rename to dw_fde_node. (cfa_loc, dw_cfa_location): Remove typedef and rename to dw_cfa_location. (dw_vec_struct, dw_vec_const): Remove typedef and rename to dw_vec_const. (dw_val_struct, dw_val_node): Remove typedef and rename to dw_val_node. (dw_loc_descr_struct, dw_loc_descr_node): Remove typedef and rename to dw_loc_descr_node. * gcc/params.h (param_info, compiler_param): Remove typedef. * gcc/opts.h (cl_deferred_param): Remove typedef. * gcc/sreal.h (sreal): Remove typedef. * gcc/ddg.h (dep_type, dep_data_type): Remove typedef. * gcc/graphite-clast-to-gimple.h (cloog_prog_clast, bb_pbb_def): Remove typedef. * gcc/lto-streamer.h (lto_decl_stream_e_t, lto_encoder_entry, lto_symtab_encoder_iterator, res_pair): Remove typedef. * gcc/tree-affine.h (affine_tree_combination, aff_tree): Remove typedef and rename to aff_tree. * gcc/sched-int.h (region): Remove typedef. * gcc/diagnostic.h (diagnostic_info, diagnostic_classification_change_t): Remove typedef. * gcc/tree-ssa-loop.h (affine_iv_d): Remove typedef and rename to affine_iv. * gcc/sbitmap.h (sbitmap_iterator): Remove typedef. * gcc/ssa-iterators.h (immediate_use_iterator_d, imm_use_iterator): Remove typedef and rename to imm_use_iterator. (ssa_operand_iterator_d, ssa_op_iter): Remove typedef and rename to ssa_op_iter. * gcc/ggc-internal.h (ggc_statistics): Remove typedef. * gcc/cselib.h (cselib_val_struct, cselib_val): Remove typedef and rename to cselib_val. * gcc/tree-core.h (alias_pair): Remove typedef. (constructor_elt_d, constructor_elt): Remove typedef and rename to constructor_elt. (ssa_use_operand_d, ssa_use_operand_t): Remove typedef and rename to ssa_use_operand_t. * gcc/graphite-sese-to-poly.h (base_alias_pair): Remove typedef. * gcc/tree-data-ref.h (conflict_function): Remove typedef. * gcc/tree-inline.h (copy_body_data): Remove typedef. * gcc/ipa-inline.h (condition, size_time_entry, inline_param_summary_t, edge_growth_cache_entry): Remove typedef. * gcc/regrename.h (operand_rr_info, insn_rr_info): Remove typedef. * gcc/gimple-iterator.h (gimple_stmt_iterator_d, gimple_stmt_iterator): Remove typedef and rename to gimple_stmt_iterator. * gcc/basic-block.h (ce_if_block, ce_if_block_t): Remove typedef and rename to ce_if_block. (edge_iterator): Remove typedef. * gcc/ipa-prop.h (ipa_agg_jf_item, ipa_agg_jf_item_t): Remove typedef and rename to ipa_agg_jf_item. (ipa_agg_jump_function_t, ipa_param_descriptor_t, ipa_node_params_t, ipa_parm_adjustment_t): Remove typedef. (ipa_jump_func, ipa_jump_func_t): Remove typedef and rename to ipa_jump_func. (ipa_edge_args, ipa_edge_args_t): Remove typedef and rename to ipa_edge_args. * gcc/gcov-io.h (gcov_bucket_type): Remove typedef. (gcov_working_set_info, gcov_working_set_t): Remove typedef and rename to gcov_working_set_t. * gcc/ira-int.h (minmax_set_iterator, ira_allocno_iterator, ira_object_iterator, ira_allocno_object_iterator, ira_pref_iterator, ira_copy_iterator, ira_object_conflict_iterator): Remove typedef. * gcc/tree-iterator.h (tree_stmt_iterator): Remove typedef. * gcc/rtl.h (addr_diff_vec_flags, mem_attrs, reg_attrs, replace_label_data): Remove typedef. (rtunion_def, rtunion): Remove typedef and rename to rtunion. * gcc/hard-reg-set.h (hard_reg_set_iterator): Remove typedef. * gcc/sel-sched-ir.h (_list_iterator, sel_global_bb_info_def, sel_region_bb_info_def, succ_iterator): Remove typedef. (deps_where_def, deps_where_t): Remove typedef and rename to deps_where_t. * gcc/coretypes.h: Adapt forward declarations. * gcc/tree-scalar-evolution.h: Likewise. * gcc/tree-ssa-address.h: Likewise. * gcc/tree-ssa-operands.h: Likewise. * gcc/function.h: Likewise. * gcc/config/frv/frv-protos.h: Likewise. * gcc/targhooks.h: Likewise. * gcc/basic_block.h: Likewise. * gcc/rtl.def: Adapt documentation. * gcc/doc/tm.texi: Likewise. * gcc/ipa-cp.c: Adapt uses. * gcc/bitmap.c: Likewise. * gcc/dwarf2out.c: Likewise. * gcc/target.def: Likewise. * gcc/ipa-inline-analysis.c: Likewise. * gcc/dwarf2cfi.c: Likewise. * gcc/tree-ssa-loop-ivopts.c: Likewise. * gcc/lto-cgraph.c: Likewise. * gcc/config/frv/frv.c: Likewise. * gcc/ifcvt.c: Likewise. * gcc/ipa-prop.c: Likewise. From-SVN: r205863
2013-12-10 17:48:44 +01:00
struct ira_allocno_iterator {
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
/* The number of the current element in IRA_ALLOCNOS. */
int n;
cgraph.h (cgraph_node_set_iterator, [...]): Remove typedef. * gcc/cgraph.h (cgraph_node_set_iterator, varpool_node_set_iterator): Remove typedef. (cgraph_inline_failed_enum, cgraph_inline_failed_t): Remove typedef and rename to cgraph_inline_failed_t. * gcc/tree-ssa-alias.h (ao_ref_s, ao_ref): Remove typedef and rename to ao_ref. * gcc/reload.h (reg_equivs_s, reg_equivs_t): Remove typedef and rename to reg_equivs_t. * gcc/conditions.h (CC_STATUS): Remove typedef. * gcc/bitmap.h (bitmap_obstack): Remove typedef. (bitmap_element_def, bitmap_element): Remove typedef and rename to bitmap_element. (bitmap_head_def, bitmap_head): Remove typedef and rename to bitmap_head. (bitmap_iterator): Remove typedef. * gcc/target.h (cumulative_args_t, print_switch_type, secondary_reload_info): Remove typedef. * gcc/dwarf2out.h (dw_cfi_oprnd_struct, dw_cfi_oprnd): Remove dw_cfi_oprnd_struct alias. (dw_cfi_struct, dw_cfi_node): Remove typedef and rename to dw_cfi_node. (dw_fde_struct, dw_fde_node): Remove typedef and rename to dw_fde_node. (cfa_loc, dw_cfa_location): Remove typedef and rename to dw_cfa_location. (dw_vec_struct, dw_vec_const): Remove typedef and rename to dw_vec_const. (dw_val_struct, dw_val_node): Remove typedef and rename to dw_val_node. (dw_loc_descr_struct, dw_loc_descr_node): Remove typedef and rename to dw_loc_descr_node. * gcc/params.h (param_info, compiler_param): Remove typedef. * gcc/opts.h (cl_deferred_param): Remove typedef. * gcc/sreal.h (sreal): Remove typedef. * gcc/ddg.h (dep_type, dep_data_type): Remove typedef. * gcc/graphite-clast-to-gimple.h (cloog_prog_clast, bb_pbb_def): Remove typedef. * gcc/lto-streamer.h (lto_decl_stream_e_t, lto_encoder_entry, lto_symtab_encoder_iterator, res_pair): Remove typedef. * gcc/tree-affine.h (affine_tree_combination, aff_tree): Remove typedef and rename to aff_tree. * gcc/sched-int.h (region): Remove typedef. * gcc/diagnostic.h (diagnostic_info, diagnostic_classification_change_t): Remove typedef. * gcc/tree-ssa-loop.h (affine_iv_d): Remove typedef and rename to affine_iv. * gcc/sbitmap.h (sbitmap_iterator): Remove typedef. * gcc/ssa-iterators.h (immediate_use_iterator_d, imm_use_iterator): Remove typedef and rename to imm_use_iterator. (ssa_operand_iterator_d, ssa_op_iter): Remove typedef and rename to ssa_op_iter. * gcc/ggc-internal.h (ggc_statistics): Remove typedef. * gcc/cselib.h (cselib_val_struct, cselib_val): Remove typedef and rename to cselib_val. * gcc/tree-core.h (alias_pair): Remove typedef. (constructor_elt_d, constructor_elt): Remove typedef and rename to constructor_elt. (ssa_use_operand_d, ssa_use_operand_t): Remove typedef and rename to ssa_use_operand_t. * gcc/graphite-sese-to-poly.h (base_alias_pair): Remove typedef. * gcc/tree-data-ref.h (conflict_function): Remove typedef. * gcc/tree-inline.h (copy_body_data): Remove typedef. * gcc/ipa-inline.h (condition, size_time_entry, inline_param_summary_t, edge_growth_cache_entry): Remove typedef. * gcc/regrename.h (operand_rr_info, insn_rr_info): Remove typedef. * gcc/gimple-iterator.h (gimple_stmt_iterator_d, gimple_stmt_iterator): Remove typedef and rename to gimple_stmt_iterator. * gcc/basic-block.h (ce_if_block, ce_if_block_t): Remove typedef and rename to ce_if_block. (edge_iterator): Remove typedef. * gcc/ipa-prop.h (ipa_agg_jf_item, ipa_agg_jf_item_t): Remove typedef and rename to ipa_agg_jf_item. (ipa_agg_jump_function_t, ipa_param_descriptor_t, ipa_node_params_t, ipa_parm_adjustment_t): Remove typedef. (ipa_jump_func, ipa_jump_func_t): Remove typedef and rename to ipa_jump_func. (ipa_edge_args, ipa_edge_args_t): Remove typedef and rename to ipa_edge_args. * gcc/gcov-io.h (gcov_bucket_type): Remove typedef. (gcov_working_set_info, gcov_working_set_t): Remove typedef and rename to gcov_working_set_t. * gcc/ira-int.h (minmax_set_iterator, ira_allocno_iterator, ira_object_iterator, ira_allocno_object_iterator, ira_pref_iterator, ira_copy_iterator, ira_object_conflict_iterator): Remove typedef. * gcc/tree-iterator.h (tree_stmt_iterator): Remove typedef. * gcc/rtl.h (addr_diff_vec_flags, mem_attrs, reg_attrs, replace_label_data): Remove typedef. (rtunion_def, rtunion): Remove typedef and rename to rtunion. * gcc/hard-reg-set.h (hard_reg_set_iterator): Remove typedef. * gcc/sel-sched-ir.h (_list_iterator, sel_global_bb_info_def, sel_region_bb_info_def, succ_iterator): Remove typedef. (deps_where_def, deps_where_t): Remove typedef and rename to deps_where_t. * gcc/coretypes.h: Adapt forward declarations. * gcc/tree-scalar-evolution.h: Likewise. * gcc/tree-ssa-address.h: Likewise. * gcc/tree-ssa-operands.h: Likewise. * gcc/function.h: Likewise. * gcc/config/frv/frv-protos.h: Likewise. * gcc/targhooks.h: Likewise. * gcc/basic_block.h: Likewise. * gcc/rtl.def: Adapt documentation. * gcc/doc/tm.texi: Likewise. * gcc/ipa-cp.c: Adapt uses. * gcc/bitmap.c: Likewise. * gcc/dwarf2out.c: Likewise. * gcc/target.def: Likewise. * gcc/ipa-inline-analysis.c: Likewise. * gcc/dwarf2cfi.c: Likewise. * gcc/tree-ssa-loop-ivopts.c: Likewise. * gcc/lto-cgraph.c: Likewise. * gcc/config/frv/frv.c: Likewise. * gcc/ifcvt.c: Likewise. * gcc/ipa-prop.c: Likewise. From-SVN: r205863
2013-12-10 17:48:44 +01:00
};
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
/* Initialize the iterator I. */
static inline void
ira_allocno_iter_init (ira_allocno_iterator *i)
{
i->n = 0;
}
/* Return TRUE if we have more allocnos to visit, in which case *A is
set to the allocno to be visited. Otherwise, return FALSE. */
static inline bool
ira_allocno_iter_cond (ira_allocno_iterator *i, ira_allocno_t *a)
{
int n;
for (n = i->n; n < ira_allocnos_num; n++)
if (ira_allocnos[n] != NULL)
{
*a = ira_allocnos[n];
i->n = n + 1;
return true;
}
return false;
}
/* Loop over all allocnos. In each iteration, A is set to the next
allocno. ITER is an instance of ira_allocno_iterator used to iterate
the allocnos. */
#define FOR_EACH_ALLOCNO(A, ITER) \
for (ira_allocno_iter_init (&(ITER)); \
ira_allocno_iter_cond (&(ITER), &(A));)
ira-int.h (struct ira_object): New. * ira-int.h (struct ira_object): New. (ira_object_t): New typedef. Add DEF_VEC_P and DEF_VEC_ALLOC_P for it. (struct ira_allocno): Remove members min, max, conflict_allocno_array, conflict_id, conflict_allocno_array_size, conflict_allocnos_num and conflict_vec_p. Add new member object. (OBJECT_CONFLICT_ARRAY, OBJECT_CONFLICT_VEC_P, OBJECT_NUM_CONFLICTS, OBJECT_CONFLICT_ARRAY_SIZE, OBJECT_CONFLICT_HARD_REGS, OBJECT_TOTAL_CONFLICT_HARD_REGS, OBJECT_MIN, OBJECT_MAX, OBJECT_CONFLICT_ID): Renamed from ALLOCNO_CONFLICT_ALLOCNO_ARRAY, ALLOCNO_CONFLICT_VEC_P, ALLOCNO_CONFLICT_ALLOCNOS_NUM, ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE, ALLOCNO_CONFLICT_HARD_REGS, ALLOCNO_TOTAL_CONFLICT_HARD_REGS) ALLOCNO_MIN, ALLOCNO_MAX, and ALLOCNO_CONFLICT_ID; now operate on an ira_object_t rather than ira_allocno_t. All uses changed. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_objects_num): Declare variable. (ira_create_allocno_object): Declare function. (ira_conflict_vector_profitable_p): Adjust prototype. (ira_allocate_conflict_vec): Renamed from ira_allocate_allocno_conflict_vec; first arg now ira_object_t. (ira_allocate_object_conflicts): Renamed from ira_allocate_allocno_conflicts; first arg now ira_object_t. (struct ira_object_iterator): New. (ira_object_iter_init, ira_object_iter_cond, FOR_EACH_OBJECT): New. (ira_allocno_conflict_iterator): Renamed member allocno_conflict_vec_p to conflict_vec_p. All uses changed. (ira_allocno_conflict_iter_init, ira_allocno_conflict_iter_cond): Changed to take into account that conflicts are now tracked for objects. * ira-conflicts.c (OBJECTS_CONFLICT_P): Renamed from CONFLICT_ALLOCNO_P. Args changed to accept ira_object_t. All uses changed. (allocnos_conflict_p): New static function. (collected_conflict_objects): Renamed from collected_allocno_objects; now a vector of ira_object_t. All uses changed. (build_conflict_bit_table): Changed to take into account that conflicts are now tracked for objects. (process_regs_for_copy, propagate_copies, build_allocno_conflicts) (print_allocno_conflicts, ira_build_conflicts): Likewise. * ira-color.c (assign_hard_reg, setup_allocno_available_regs_num) setup_allocno_left_conflicts_size, allocno_reload_assign, fast_allocation): Likewise. * ira-lives.c (make_hard_regno_born, make_allocno_born) process_single_reg_class_operands, process_bb_node_lives): Likewise. * ira-emit.c (modify_move_list, add_range_and_copies_from_move_list): Likewise. * ira-build.c (ira_objects_num): New variable. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_object_id_map_vec): Corresponding change. (object_pool): New static variable. (initiate_allocnos): Initialize it. (finish_allocnos): Free it. (ira_create_object, ira_create_allocno_object, create_allocno_objects): New functions. (ira_create_allocno): Don't set members that were removed. (ira_set_allocno_cover_class): Don't change conflict hard regs. (merge_hard_reg_conflicts): Changed to take into account that conflicts are now tracked for objects. (ira_conflict_vector_profitable_p, ira_allocate_conflict_vec, allocate_conflict_bit_vec, ira_allocate_object_conflicts, compress_conflict_vecs, remove_low_level_allocnos, ira_flattening, setup_min_max_allocno_live_range_point, allocno_range_compare_func, setup_min_max_conflict_allocno_ids, ): Likewise. ((add_to_conflicts): Renamed from add_to_allocno_conflicts, args changed to ira_object_t; all callers changed. (ira_add_conflict): Renamed from ira_add_allocno_conflict, args changed to ira_object_t, all callers changed. (clear_conflicts): Renamed from clear_allocno_conflicts, arg changed to ira_object_t, all callers changed. (conflict_check, curr_conflict_check_tick): Renamed from allocno_conflict_check and curr_allocno_conflict_check_tick; all uses changed. (compress_conflict_vec): Renamed from compress_allocno_conflict_vec, arg changed to ira_object_t, all callers changed. (create_cap_allocno): Call ira_create_allocno_object. (finish_allocno): Free the corresponding object. (sort_conflict_id_map): Renamed from sort_conflict_id_allocno_map; all callers changed. Adjusted for dealing with objects. (ira_build): Call create_allocno_objects after ira_costs. Adjusted for dealing with objects. * ira.c (ira_bad_reload_regno_1): Adjusted for dealing with objects. From-SVN: r162166
2010-07-14 03:53:35 +02:00
/* The iterator for all objects. */
cgraph.h (cgraph_node_set_iterator, [...]): Remove typedef. * gcc/cgraph.h (cgraph_node_set_iterator, varpool_node_set_iterator): Remove typedef. (cgraph_inline_failed_enum, cgraph_inline_failed_t): Remove typedef and rename to cgraph_inline_failed_t. * gcc/tree-ssa-alias.h (ao_ref_s, ao_ref): Remove typedef and rename to ao_ref. * gcc/reload.h (reg_equivs_s, reg_equivs_t): Remove typedef and rename to reg_equivs_t. * gcc/conditions.h (CC_STATUS): Remove typedef. * gcc/bitmap.h (bitmap_obstack): Remove typedef. (bitmap_element_def, bitmap_element): Remove typedef and rename to bitmap_element. (bitmap_head_def, bitmap_head): Remove typedef and rename to bitmap_head. (bitmap_iterator): Remove typedef. * gcc/target.h (cumulative_args_t, print_switch_type, secondary_reload_info): Remove typedef. * gcc/dwarf2out.h (dw_cfi_oprnd_struct, dw_cfi_oprnd): Remove dw_cfi_oprnd_struct alias. (dw_cfi_struct, dw_cfi_node): Remove typedef and rename to dw_cfi_node. (dw_fde_struct, dw_fde_node): Remove typedef and rename to dw_fde_node. (cfa_loc, dw_cfa_location): Remove typedef and rename to dw_cfa_location. (dw_vec_struct, dw_vec_const): Remove typedef and rename to dw_vec_const. (dw_val_struct, dw_val_node): Remove typedef and rename to dw_val_node. (dw_loc_descr_struct, dw_loc_descr_node): Remove typedef and rename to dw_loc_descr_node. * gcc/params.h (param_info, compiler_param): Remove typedef. * gcc/opts.h (cl_deferred_param): Remove typedef. * gcc/sreal.h (sreal): Remove typedef. * gcc/ddg.h (dep_type, dep_data_type): Remove typedef. * gcc/graphite-clast-to-gimple.h (cloog_prog_clast, bb_pbb_def): Remove typedef. * gcc/lto-streamer.h (lto_decl_stream_e_t, lto_encoder_entry, lto_symtab_encoder_iterator, res_pair): Remove typedef. * gcc/tree-affine.h (affine_tree_combination, aff_tree): Remove typedef and rename to aff_tree. * gcc/sched-int.h (region): Remove typedef. * gcc/diagnostic.h (diagnostic_info, diagnostic_classification_change_t): Remove typedef. * gcc/tree-ssa-loop.h (affine_iv_d): Remove typedef and rename to affine_iv. * gcc/sbitmap.h (sbitmap_iterator): Remove typedef. * gcc/ssa-iterators.h (immediate_use_iterator_d, imm_use_iterator): Remove typedef and rename to imm_use_iterator. (ssa_operand_iterator_d, ssa_op_iter): Remove typedef and rename to ssa_op_iter. * gcc/ggc-internal.h (ggc_statistics): Remove typedef. * gcc/cselib.h (cselib_val_struct, cselib_val): Remove typedef and rename to cselib_val. * gcc/tree-core.h (alias_pair): Remove typedef. (constructor_elt_d, constructor_elt): Remove typedef and rename to constructor_elt. (ssa_use_operand_d, ssa_use_operand_t): Remove typedef and rename to ssa_use_operand_t. * gcc/graphite-sese-to-poly.h (base_alias_pair): Remove typedef. * gcc/tree-data-ref.h (conflict_function): Remove typedef. * gcc/tree-inline.h (copy_body_data): Remove typedef. * gcc/ipa-inline.h (condition, size_time_entry, inline_param_summary_t, edge_growth_cache_entry): Remove typedef. * gcc/regrename.h (operand_rr_info, insn_rr_info): Remove typedef. * gcc/gimple-iterator.h (gimple_stmt_iterator_d, gimple_stmt_iterator): Remove typedef and rename to gimple_stmt_iterator. * gcc/basic-block.h (ce_if_block, ce_if_block_t): Remove typedef and rename to ce_if_block. (edge_iterator): Remove typedef. * gcc/ipa-prop.h (ipa_agg_jf_item, ipa_agg_jf_item_t): Remove typedef and rename to ipa_agg_jf_item. (ipa_agg_jump_function_t, ipa_param_descriptor_t, ipa_node_params_t, ipa_parm_adjustment_t): Remove typedef. (ipa_jump_func, ipa_jump_func_t): Remove typedef and rename to ipa_jump_func. (ipa_edge_args, ipa_edge_args_t): Remove typedef and rename to ipa_edge_args. * gcc/gcov-io.h (gcov_bucket_type): Remove typedef. (gcov_working_set_info, gcov_working_set_t): Remove typedef and rename to gcov_working_set_t. * gcc/ira-int.h (minmax_set_iterator, ira_allocno_iterator, ira_object_iterator, ira_allocno_object_iterator, ira_pref_iterator, ira_copy_iterator, ira_object_conflict_iterator): Remove typedef. * gcc/tree-iterator.h (tree_stmt_iterator): Remove typedef. * gcc/rtl.h (addr_diff_vec_flags, mem_attrs, reg_attrs, replace_label_data): Remove typedef. (rtunion_def, rtunion): Remove typedef and rename to rtunion. * gcc/hard-reg-set.h (hard_reg_set_iterator): Remove typedef. * gcc/sel-sched-ir.h (_list_iterator, sel_global_bb_info_def, sel_region_bb_info_def, succ_iterator): Remove typedef. (deps_where_def, deps_where_t): Remove typedef and rename to deps_where_t. * gcc/coretypes.h: Adapt forward declarations. * gcc/tree-scalar-evolution.h: Likewise. * gcc/tree-ssa-address.h: Likewise. * gcc/tree-ssa-operands.h: Likewise. * gcc/function.h: Likewise. * gcc/config/frv/frv-protos.h: Likewise. * gcc/targhooks.h: Likewise. * gcc/basic_block.h: Likewise. * gcc/rtl.def: Adapt documentation. * gcc/doc/tm.texi: Likewise. * gcc/ipa-cp.c: Adapt uses. * gcc/bitmap.c: Likewise. * gcc/dwarf2out.c: Likewise. * gcc/target.def: Likewise. * gcc/ipa-inline-analysis.c: Likewise. * gcc/dwarf2cfi.c: Likewise. * gcc/tree-ssa-loop-ivopts.c: Likewise. * gcc/lto-cgraph.c: Likewise. * gcc/config/frv/frv.c: Likewise. * gcc/ifcvt.c: Likewise. * gcc/ipa-prop.c: Likewise. From-SVN: r205863
2013-12-10 17:48:44 +01:00
struct ira_object_iterator {
ira-build.c (ira_create_object): New arg SUBWORD; all callers changed. * ira-build.c (ira_create_object): New arg SUBWORD; all callers changed. Initialize OBJECT_SUBWORD. (ira_create_allocno): Clear ALLOCNO_NUM_OBJECTS. (ira_create_allocno_objects): Renamed from ira_create_allocno_object; all callers changed. (merge_hard_reg_conflicts): Iterate over allocno subobjects. (finish_allocno): Likewise. (move_allocno_live_ranges, copy_allocno_live_ranges): Likewise. (remove_low_level_allocnos): Likewise. (update_bad_spill_attribute): Likewise. (setup_min_max_allocno_live_range_point): Likewise. (sort_conflict_id_map): Likewise. (ira_flattening): Likewise. Use ior_hard_reg_conflicts. (ior_hard_reg_conflicts): New function. (ior_allocate_object_conflicts): Renamed first argument to OBJ. (compress_conflict_vecs): Iterate over objects, not allocnos. (ira_add_live_range_to_object): New function. (object_range_compare_func): Renamed from allocno_range_compare_func. All callers changed. (setup_min_max_conflict_allocno_ids): For allocnos with multiple subobjects, widen the min/max range of the lowest-order object to potentially include all other such low-order objects. * ira.c (ira_bad_reload_regno_1): Iterate over allocno subobjects. (check_allocation): Likewise. Use more fine-grained tests for register conflicts. * ira-color.c (allocnos_have_intersected_live_ranges_p): Iterate over allocno subobjects. (assign_hard_reg): Keep multiple sets of conflicts. Make finer-grained choices about which bits to set in each set. Don't use ira_hard_reg_not_in_set_p, perform a more elaborate test for conflicts using the multiple sets we computed. (push_allocno_to_stack): Iterate over allocno subobjects. (all_conflicting_hard_regs_coalesced): New static function. (setup_allocno_available_regs_num): Use it. (setup_allocno_left_conflicts_size): Likewise. Iterate over allocno subobjects. (coalesced_allocno_conflict): Test subobject 0 in each allocno. (setup_allocno_priorities): Divide ALLOCNO_EXCESS_PRESSURE_POINTS_NUM by ALLOCNO_NUM_OBJECTS. (calculate_spill_cost): Likewise. (color_pass): Express if statement in a more normal way. (ira_reassign_conflict_allocnos): Iterate over allocno subobjects. (slot_coalesced_allocno_live_ranges_intersect_p): Likewise. (setup_slot_coalesced_allocno_live_ranges): Likewise. (allocno_reload_assign): Likewise. (ira_reassign_pseudos): Likewise. (fast_allocation): Likewise. * ira-conflicts.c (build_conflict_bit_table): Likewise. (print_allocno_conflicts): Likewise. (ira_build_conflicts): Likewise. (allocnos_conflict_for_copy_p): Renamed from allocnos_conflict_p. All callers changed. Test subword 0 of each allocno for conflicts. (build_object_conflicts): Renamed from build_allocno_conflicts. All callers changed. Iterate over allocno subobjects. * ira-emit.c (modify_move_list): Iterate over allocno subobjects. * ira-int.h (struct ira_allocno): New member. num_objects. Rename object to objects and change it into an array. (ALLOCNO_OBJECT): Add new argument N. (ALLOCNO_NUM_OBJECTS, OBJECT_SUBWORD): New macros. (ira_create_allocno_objects): Renamed from ira_create_allocno_object. (ior_hard_reg_conflicts): Declare. (ira_add_live_range_to_object): Declare. (ira_allocno_object_iterator): New. (ira_allocno_object_iter_init, ira_allocno_object_iter_cond): New. (FOR_EACH_ALLOCNO_OBJECT): New macro. * ira-lives.c (objects_live): Renamed from allocnos_live; all uses changed. (allocnos_processed): New sparseset. (make_object_born): Renamed from make_allocno_born; take an ira_object_t argument. All callers changed. (make_object_dead): Renamed from make_allocno_dead; take an ira_object t argument. All callers changed. (update_allocno_pressure_excess_length): Take an ira_obejct_t argument. All callers changed. (mark_pseudo_regno_live): Iterate over allocno subobjects. (mark_pseudo_regno_dead): Likewise. (mark_pseudo_regno_subword_live, mark_pseudo_regno_subword_dead): New functions. (mark_ref_live): Detect subword accesses and call mark_pseudo_regno_subword_live as appropriate. (mark_ref_dead): Likewise for mark_pseudo_regno_subword_dead. (process_bb_nodes_live): Deal with object-related updates first; set and test bits in allocnos_processed to avoid computing allocno statistics more than once. (create_start_finish_chains): Iterate over objects, not allocnos. (print_object_live_ranges): New function. (print_allocno_live_ranges): Use it. (ira_create_allocno_live_ranges): Allocate and free allocnos_processed and objects_live. From-SVN: r162418
2010-07-22 17:48:30 +02:00
/* The number of the current element in ira_object_id_map. */
ira-int.h (struct ira_object): New. * ira-int.h (struct ira_object): New. (ira_object_t): New typedef. Add DEF_VEC_P and DEF_VEC_ALLOC_P for it. (struct ira_allocno): Remove members min, max, conflict_allocno_array, conflict_id, conflict_allocno_array_size, conflict_allocnos_num and conflict_vec_p. Add new member object. (OBJECT_CONFLICT_ARRAY, OBJECT_CONFLICT_VEC_P, OBJECT_NUM_CONFLICTS, OBJECT_CONFLICT_ARRAY_SIZE, OBJECT_CONFLICT_HARD_REGS, OBJECT_TOTAL_CONFLICT_HARD_REGS, OBJECT_MIN, OBJECT_MAX, OBJECT_CONFLICT_ID): Renamed from ALLOCNO_CONFLICT_ALLOCNO_ARRAY, ALLOCNO_CONFLICT_VEC_P, ALLOCNO_CONFLICT_ALLOCNOS_NUM, ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE, ALLOCNO_CONFLICT_HARD_REGS, ALLOCNO_TOTAL_CONFLICT_HARD_REGS) ALLOCNO_MIN, ALLOCNO_MAX, and ALLOCNO_CONFLICT_ID; now operate on an ira_object_t rather than ira_allocno_t. All uses changed. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_objects_num): Declare variable. (ira_create_allocno_object): Declare function. (ira_conflict_vector_profitable_p): Adjust prototype. (ira_allocate_conflict_vec): Renamed from ira_allocate_allocno_conflict_vec; first arg now ira_object_t. (ira_allocate_object_conflicts): Renamed from ira_allocate_allocno_conflicts; first arg now ira_object_t. (struct ira_object_iterator): New. (ira_object_iter_init, ira_object_iter_cond, FOR_EACH_OBJECT): New. (ira_allocno_conflict_iterator): Renamed member allocno_conflict_vec_p to conflict_vec_p. All uses changed. (ira_allocno_conflict_iter_init, ira_allocno_conflict_iter_cond): Changed to take into account that conflicts are now tracked for objects. * ira-conflicts.c (OBJECTS_CONFLICT_P): Renamed from CONFLICT_ALLOCNO_P. Args changed to accept ira_object_t. All uses changed. (allocnos_conflict_p): New static function. (collected_conflict_objects): Renamed from collected_allocno_objects; now a vector of ira_object_t. All uses changed. (build_conflict_bit_table): Changed to take into account that conflicts are now tracked for objects. (process_regs_for_copy, propagate_copies, build_allocno_conflicts) (print_allocno_conflicts, ira_build_conflicts): Likewise. * ira-color.c (assign_hard_reg, setup_allocno_available_regs_num) setup_allocno_left_conflicts_size, allocno_reload_assign, fast_allocation): Likewise. * ira-lives.c (make_hard_regno_born, make_allocno_born) process_single_reg_class_operands, process_bb_node_lives): Likewise. * ira-emit.c (modify_move_list, add_range_and_copies_from_move_list): Likewise. * ira-build.c (ira_objects_num): New variable. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_object_id_map_vec): Corresponding change. (object_pool): New static variable. (initiate_allocnos): Initialize it. (finish_allocnos): Free it. (ira_create_object, ira_create_allocno_object, create_allocno_objects): New functions. (ira_create_allocno): Don't set members that were removed. (ira_set_allocno_cover_class): Don't change conflict hard regs. (merge_hard_reg_conflicts): Changed to take into account that conflicts are now tracked for objects. (ira_conflict_vector_profitable_p, ira_allocate_conflict_vec, allocate_conflict_bit_vec, ira_allocate_object_conflicts, compress_conflict_vecs, remove_low_level_allocnos, ira_flattening, setup_min_max_allocno_live_range_point, allocno_range_compare_func, setup_min_max_conflict_allocno_ids, ): Likewise. ((add_to_conflicts): Renamed from add_to_allocno_conflicts, args changed to ira_object_t; all callers changed. (ira_add_conflict): Renamed from ira_add_allocno_conflict, args changed to ira_object_t, all callers changed. (clear_conflicts): Renamed from clear_allocno_conflicts, arg changed to ira_object_t, all callers changed. (conflict_check, curr_conflict_check_tick): Renamed from allocno_conflict_check and curr_allocno_conflict_check_tick; all uses changed. (compress_conflict_vec): Renamed from compress_allocno_conflict_vec, arg changed to ira_object_t, all callers changed. (create_cap_allocno): Call ira_create_allocno_object. (finish_allocno): Free the corresponding object. (sort_conflict_id_map): Renamed from sort_conflict_id_allocno_map; all callers changed. Adjusted for dealing with objects. (ira_build): Call create_allocno_objects after ira_costs. Adjusted for dealing with objects. * ira.c (ira_bad_reload_regno_1): Adjusted for dealing with objects. From-SVN: r162166
2010-07-14 03:53:35 +02:00
int n;
cgraph.h (cgraph_node_set_iterator, [...]): Remove typedef. * gcc/cgraph.h (cgraph_node_set_iterator, varpool_node_set_iterator): Remove typedef. (cgraph_inline_failed_enum, cgraph_inline_failed_t): Remove typedef and rename to cgraph_inline_failed_t. * gcc/tree-ssa-alias.h (ao_ref_s, ao_ref): Remove typedef and rename to ao_ref. * gcc/reload.h (reg_equivs_s, reg_equivs_t): Remove typedef and rename to reg_equivs_t. * gcc/conditions.h (CC_STATUS): Remove typedef. * gcc/bitmap.h (bitmap_obstack): Remove typedef. (bitmap_element_def, bitmap_element): Remove typedef and rename to bitmap_element. (bitmap_head_def, bitmap_head): Remove typedef and rename to bitmap_head. (bitmap_iterator): Remove typedef. * gcc/target.h (cumulative_args_t, print_switch_type, secondary_reload_info): Remove typedef. * gcc/dwarf2out.h (dw_cfi_oprnd_struct, dw_cfi_oprnd): Remove dw_cfi_oprnd_struct alias. (dw_cfi_struct, dw_cfi_node): Remove typedef and rename to dw_cfi_node. (dw_fde_struct, dw_fde_node): Remove typedef and rename to dw_fde_node. (cfa_loc, dw_cfa_location): Remove typedef and rename to dw_cfa_location. (dw_vec_struct, dw_vec_const): Remove typedef and rename to dw_vec_const. (dw_val_struct, dw_val_node): Remove typedef and rename to dw_val_node. (dw_loc_descr_struct, dw_loc_descr_node): Remove typedef and rename to dw_loc_descr_node. * gcc/params.h (param_info, compiler_param): Remove typedef. * gcc/opts.h (cl_deferred_param): Remove typedef. * gcc/sreal.h (sreal): Remove typedef. * gcc/ddg.h (dep_type, dep_data_type): Remove typedef. * gcc/graphite-clast-to-gimple.h (cloog_prog_clast, bb_pbb_def): Remove typedef. * gcc/lto-streamer.h (lto_decl_stream_e_t, lto_encoder_entry, lto_symtab_encoder_iterator, res_pair): Remove typedef. * gcc/tree-affine.h (affine_tree_combination, aff_tree): Remove typedef and rename to aff_tree. * gcc/sched-int.h (region): Remove typedef. * gcc/diagnostic.h (diagnostic_info, diagnostic_classification_change_t): Remove typedef. * gcc/tree-ssa-loop.h (affine_iv_d): Remove typedef and rename to affine_iv. * gcc/sbitmap.h (sbitmap_iterator): Remove typedef. * gcc/ssa-iterators.h (immediate_use_iterator_d, imm_use_iterator): Remove typedef and rename to imm_use_iterator. (ssa_operand_iterator_d, ssa_op_iter): Remove typedef and rename to ssa_op_iter. * gcc/ggc-internal.h (ggc_statistics): Remove typedef. * gcc/cselib.h (cselib_val_struct, cselib_val): Remove typedef and rename to cselib_val. * gcc/tree-core.h (alias_pair): Remove typedef. (constructor_elt_d, constructor_elt): Remove typedef and rename to constructor_elt. (ssa_use_operand_d, ssa_use_operand_t): Remove typedef and rename to ssa_use_operand_t. * gcc/graphite-sese-to-poly.h (base_alias_pair): Remove typedef. * gcc/tree-data-ref.h (conflict_function): Remove typedef. * gcc/tree-inline.h (copy_body_data): Remove typedef. * gcc/ipa-inline.h (condition, size_time_entry, inline_param_summary_t, edge_growth_cache_entry): Remove typedef. * gcc/regrename.h (operand_rr_info, insn_rr_info): Remove typedef. * gcc/gimple-iterator.h (gimple_stmt_iterator_d, gimple_stmt_iterator): Remove typedef and rename to gimple_stmt_iterator. * gcc/basic-block.h (ce_if_block, ce_if_block_t): Remove typedef and rename to ce_if_block. (edge_iterator): Remove typedef. * gcc/ipa-prop.h (ipa_agg_jf_item, ipa_agg_jf_item_t): Remove typedef and rename to ipa_agg_jf_item. (ipa_agg_jump_function_t, ipa_param_descriptor_t, ipa_node_params_t, ipa_parm_adjustment_t): Remove typedef. (ipa_jump_func, ipa_jump_func_t): Remove typedef and rename to ipa_jump_func. (ipa_edge_args, ipa_edge_args_t): Remove typedef and rename to ipa_edge_args. * gcc/gcov-io.h (gcov_bucket_type): Remove typedef. (gcov_working_set_info, gcov_working_set_t): Remove typedef and rename to gcov_working_set_t. * gcc/ira-int.h (minmax_set_iterator, ira_allocno_iterator, ira_object_iterator, ira_allocno_object_iterator, ira_pref_iterator, ira_copy_iterator, ira_object_conflict_iterator): Remove typedef. * gcc/tree-iterator.h (tree_stmt_iterator): Remove typedef. * gcc/rtl.h (addr_diff_vec_flags, mem_attrs, reg_attrs, replace_label_data): Remove typedef. (rtunion_def, rtunion): Remove typedef and rename to rtunion. * gcc/hard-reg-set.h (hard_reg_set_iterator): Remove typedef. * gcc/sel-sched-ir.h (_list_iterator, sel_global_bb_info_def, sel_region_bb_info_def, succ_iterator): Remove typedef. (deps_where_def, deps_where_t): Remove typedef and rename to deps_where_t. * gcc/coretypes.h: Adapt forward declarations. * gcc/tree-scalar-evolution.h: Likewise. * gcc/tree-ssa-address.h: Likewise. * gcc/tree-ssa-operands.h: Likewise. * gcc/function.h: Likewise. * gcc/config/frv/frv-protos.h: Likewise. * gcc/targhooks.h: Likewise. * gcc/basic_block.h: Likewise. * gcc/rtl.def: Adapt documentation. * gcc/doc/tm.texi: Likewise. * gcc/ipa-cp.c: Adapt uses. * gcc/bitmap.c: Likewise. * gcc/dwarf2out.c: Likewise. * gcc/target.def: Likewise. * gcc/ipa-inline-analysis.c: Likewise. * gcc/dwarf2cfi.c: Likewise. * gcc/tree-ssa-loop-ivopts.c: Likewise. * gcc/lto-cgraph.c: Likewise. * gcc/config/frv/frv.c: Likewise. * gcc/ifcvt.c: Likewise. * gcc/ipa-prop.c: Likewise. From-SVN: r205863
2013-12-10 17:48:44 +01:00
};
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
ira-int.h (struct ira_object): New. * ira-int.h (struct ira_object): New. (ira_object_t): New typedef. Add DEF_VEC_P and DEF_VEC_ALLOC_P for it. (struct ira_allocno): Remove members min, max, conflict_allocno_array, conflict_id, conflict_allocno_array_size, conflict_allocnos_num and conflict_vec_p. Add new member object. (OBJECT_CONFLICT_ARRAY, OBJECT_CONFLICT_VEC_P, OBJECT_NUM_CONFLICTS, OBJECT_CONFLICT_ARRAY_SIZE, OBJECT_CONFLICT_HARD_REGS, OBJECT_TOTAL_CONFLICT_HARD_REGS, OBJECT_MIN, OBJECT_MAX, OBJECT_CONFLICT_ID): Renamed from ALLOCNO_CONFLICT_ALLOCNO_ARRAY, ALLOCNO_CONFLICT_VEC_P, ALLOCNO_CONFLICT_ALLOCNOS_NUM, ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE, ALLOCNO_CONFLICT_HARD_REGS, ALLOCNO_TOTAL_CONFLICT_HARD_REGS) ALLOCNO_MIN, ALLOCNO_MAX, and ALLOCNO_CONFLICT_ID; now operate on an ira_object_t rather than ira_allocno_t. All uses changed. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_objects_num): Declare variable. (ira_create_allocno_object): Declare function. (ira_conflict_vector_profitable_p): Adjust prototype. (ira_allocate_conflict_vec): Renamed from ira_allocate_allocno_conflict_vec; first arg now ira_object_t. (ira_allocate_object_conflicts): Renamed from ira_allocate_allocno_conflicts; first arg now ira_object_t. (struct ira_object_iterator): New. (ira_object_iter_init, ira_object_iter_cond, FOR_EACH_OBJECT): New. (ira_allocno_conflict_iterator): Renamed member allocno_conflict_vec_p to conflict_vec_p. All uses changed. (ira_allocno_conflict_iter_init, ira_allocno_conflict_iter_cond): Changed to take into account that conflicts are now tracked for objects. * ira-conflicts.c (OBJECTS_CONFLICT_P): Renamed from CONFLICT_ALLOCNO_P. Args changed to accept ira_object_t. All uses changed. (allocnos_conflict_p): New static function. (collected_conflict_objects): Renamed from collected_allocno_objects; now a vector of ira_object_t. All uses changed. (build_conflict_bit_table): Changed to take into account that conflicts are now tracked for objects. (process_regs_for_copy, propagate_copies, build_allocno_conflicts) (print_allocno_conflicts, ira_build_conflicts): Likewise. * ira-color.c (assign_hard_reg, setup_allocno_available_regs_num) setup_allocno_left_conflicts_size, allocno_reload_assign, fast_allocation): Likewise. * ira-lives.c (make_hard_regno_born, make_allocno_born) process_single_reg_class_operands, process_bb_node_lives): Likewise. * ira-emit.c (modify_move_list, add_range_and_copies_from_move_list): Likewise. * ira-build.c (ira_objects_num): New variable. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_object_id_map_vec): Corresponding change. (object_pool): New static variable. (initiate_allocnos): Initialize it. (finish_allocnos): Free it. (ira_create_object, ira_create_allocno_object, create_allocno_objects): New functions. (ira_create_allocno): Don't set members that were removed. (ira_set_allocno_cover_class): Don't change conflict hard regs. (merge_hard_reg_conflicts): Changed to take into account that conflicts are now tracked for objects. (ira_conflict_vector_profitable_p, ira_allocate_conflict_vec, allocate_conflict_bit_vec, ira_allocate_object_conflicts, compress_conflict_vecs, remove_low_level_allocnos, ira_flattening, setup_min_max_allocno_live_range_point, allocno_range_compare_func, setup_min_max_conflict_allocno_ids, ): Likewise. ((add_to_conflicts): Renamed from add_to_allocno_conflicts, args changed to ira_object_t; all callers changed. (ira_add_conflict): Renamed from ira_add_allocno_conflict, args changed to ira_object_t, all callers changed. (clear_conflicts): Renamed from clear_allocno_conflicts, arg changed to ira_object_t, all callers changed. (conflict_check, curr_conflict_check_tick): Renamed from allocno_conflict_check and curr_allocno_conflict_check_tick; all uses changed. (compress_conflict_vec): Renamed from compress_allocno_conflict_vec, arg changed to ira_object_t, all callers changed. (create_cap_allocno): Call ira_create_allocno_object. (finish_allocno): Free the corresponding object. (sort_conflict_id_map): Renamed from sort_conflict_id_allocno_map; all callers changed. Adjusted for dealing with objects. (ira_build): Call create_allocno_objects after ira_costs. Adjusted for dealing with objects. * ira.c (ira_bad_reload_regno_1): Adjusted for dealing with objects. From-SVN: r162166
2010-07-14 03:53:35 +02:00
/* Initialize the iterator I. */
static inline void
ira_object_iter_init (ira_object_iterator *i)
{
i->n = 0;
}
/* Return TRUE if we have more objects to visit, in which case *OBJ is
set to the object to be visited. Otherwise, return FALSE. */
static inline bool
ira_object_iter_cond (ira_object_iterator *i, ira_object_t *obj)
{
int n;
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
ira-int.h (struct ira_object): New. * ira-int.h (struct ira_object): New. (ira_object_t): New typedef. Add DEF_VEC_P and DEF_VEC_ALLOC_P for it. (struct ira_allocno): Remove members min, max, conflict_allocno_array, conflict_id, conflict_allocno_array_size, conflict_allocnos_num and conflict_vec_p. Add new member object. (OBJECT_CONFLICT_ARRAY, OBJECT_CONFLICT_VEC_P, OBJECT_NUM_CONFLICTS, OBJECT_CONFLICT_ARRAY_SIZE, OBJECT_CONFLICT_HARD_REGS, OBJECT_TOTAL_CONFLICT_HARD_REGS, OBJECT_MIN, OBJECT_MAX, OBJECT_CONFLICT_ID): Renamed from ALLOCNO_CONFLICT_ALLOCNO_ARRAY, ALLOCNO_CONFLICT_VEC_P, ALLOCNO_CONFLICT_ALLOCNOS_NUM, ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE, ALLOCNO_CONFLICT_HARD_REGS, ALLOCNO_TOTAL_CONFLICT_HARD_REGS) ALLOCNO_MIN, ALLOCNO_MAX, and ALLOCNO_CONFLICT_ID; now operate on an ira_object_t rather than ira_allocno_t. All uses changed. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_objects_num): Declare variable. (ira_create_allocno_object): Declare function. (ira_conflict_vector_profitable_p): Adjust prototype. (ira_allocate_conflict_vec): Renamed from ira_allocate_allocno_conflict_vec; first arg now ira_object_t. (ira_allocate_object_conflicts): Renamed from ira_allocate_allocno_conflicts; first arg now ira_object_t. (struct ira_object_iterator): New. (ira_object_iter_init, ira_object_iter_cond, FOR_EACH_OBJECT): New. (ira_allocno_conflict_iterator): Renamed member allocno_conflict_vec_p to conflict_vec_p. All uses changed. (ira_allocno_conflict_iter_init, ira_allocno_conflict_iter_cond): Changed to take into account that conflicts are now tracked for objects. * ira-conflicts.c (OBJECTS_CONFLICT_P): Renamed from CONFLICT_ALLOCNO_P. Args changed to accept ira_object_t. All uses changed. (allocnos_conflict_p): New static function. (collected_conflict_objects): Renamed from collected_allocno_objects; now a vector of ira_object_t. All uses changed. (build_conflict_bit_table): Changed to take into account that conflicts are now tracked for objects. (process_regs_for_copy, propagate_copies, build_allocno_conflicts) (print_allocno_conflicts, ira_build_conflicts): Likewise. * ira-color.c (assign_hard_reg, setup_allocno_available_regs_num) setup_allocno_left_conflicts_size, allocno_reload_assign, fast_allocation): Likewise. * ira-lives.c (make_hard_regno_born, make_allocno_born) process_single_reg_class_operands, process_bb_node_lives): Likewise. * ira-emit.c (modify_move_list, add_range_and_copies_from_move_list): Likewise. * ira-build.c (ira_objects_num): New variable. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_object_id_map_vec): Corresponding change. (object_pool): New static variable. (initiate_allocnos): Initialize it. (finish_allocnos): Free it. (ira_create_object, ira_create_allocno_object, create_allocno_objects): New functions. (ira_create_allocno): Don't set members that were removed. (ira_set_allocno_cover_class): Don't change conflict hard regs. (merge_hard_reg_conflicts): Changed to take into account that conflicts are now tracked for objects. (ira_conflict_vector_profitable_p, ira_allocate_conflict_vec, allocate_conflict_bit_vec, ira_allocate_object_conflicts, compress_conflict_vecs, remove_low_level_allocnos, ira_flattening, setup_min_max_allocno_live_range_point, allocno_range_compare_func, setup_min_max_conflict_allocno_ids, ): Likewise. ((add_to_conflicts): Renamed from add_to_allocno_conflicts, args changed to ira_object_t; all callers changed. (ira_add_conflict): Renamed from ira_add_allocno_conflict, args changed to ira_object_t, all callers changed. (clear_conflicts): Renamed from clear_allocno_conflicts, arg changed to ira_object_t, all callers changed. (conflict_check, curr_conflict_check_tick): Renamed from allocno_conflict_check and curr_allocno_conflict_check_tick; all uses changed. (compress_conflict_vec): Renamed from compress_allocno_conflict_vec, arg changed to ira_object_t, all callers changed. (create_cap_allocno): Call ira_create_allocno_object. (finish_allocno): Free the corresponding object. (sort_conflict_id_map): Renamed from sort_conflict_id_allocno_map; all callers changed. Adjusted for dealing with objects. (ira_build): Call create_allocno_objects after ira_costs. Adjusted for dealing with objects. * ira.c (ira_bad_reload_regno_1): Adjusted for dealing with objects. From-SVN: r162166
2010-07-14 03:53:35 +02:00
for (n = i->n; n < ira_objects_num; n++)
if (ira_object_id_map[n] != NULL)
{
*obj = ira_object_id_map[n];
i->n = n + 1;
return true;
}
return false;
}
ira-build.c (ira_create_object): New arg SUBWORD; all callers changed. * ira-build.c (ira_create_object): New arg SUBWORD; all callers changed. Initialize OBJECT_SUBWORD. (ira_create_allocno): Clear ALLOCNO_NUM_OBJECTS. (ira_create_allocno_objects): Renamed from ira_create_allocno_object; all callers changed. (merge_hard_reg_conflicts): Iterate over allocno subobjects. (finish_allocno): Likewise. (move_allocno_live_ranges, copy_allocno_live_ranges): Likewise. (remove_low_level_allocnos): Likewise. (update_bad_spill_attribute): Likewise. (setup_min_max_allocno_live_range_point): Likewise. (sort_conflict_id_map): Likewise. (ira_flattening): Likewise. Use ior_hard_reg_conflicts. (ior_hard_reg_conflicts): New function. (ior_allocate_object_conflicts): Renamed first argument to OBJ. (compress_conflict_vecs): Iterate over objects, not allocnos. (ira_add_live_range_to_object): New function. (object_range_compare_func): Renamed from allocno_range_compare_func. All callers changed. (setup_min_max_conflict_allocno_ids): For allocnos with multiple subobjects, widen the min/max range of the lowest-order object to potentially include all other such low-order objects. * ira.c (ira_bad_reload_regno_1): Iterate over allocno subobjects. (check_allocation): Likewise. Use more fine-grained tests for register conflicts. * ira-color.c (allocnos_have_intersected_live_ranges_p): Iterate over allocno subobjects. (assign_hard_reg): Keep multiple sets of conflicts. Make finer-grained choices about which bits to set in each set. Don't use ira_hard_reg_not_in_set_p, perform a more elaborate test for conflicts using the multiple sets we computed. (push_allocno_to_stack): Iterate over allocno subobjects. (all_conflicting_hard_regs_coalesced): New static function. (setup_allocno_available_regs_num): Use it. (setup_allocno_left_conflicts_size): Likewise. Iterate over allocno subobjects. (coalesced_allocno_conflict): Test subobject 0 in each allocno. (setup_allocno_priorities): Divide ALLOCNO_EXCESS_PRESSURE_POINTS_NUM by ALLOCNO_NUM_OBJECTS. (calculate_spill_cost): Likewise. (color_pass): Express if statement in a more normal way. (ira_reassign_conflict_allocnos): Iterate over allocno subobjects. (slot_coalesced_allocno_live_ranges_intersect_p): Likewise. (setup_slot_coalesced_allocno_live_ranges): Likewise. (allocno_reload_assign): Likewise. (ira_reassign_pseudos): Likewise. (fast_allocation): Likewise. * ira-conflicts.c (build_conflict_bit_table): Likewise. (print_allocno_conflicts): Likewise. (ira_build_conflicts): Likewise. (allocnos_conflict_for_copy_p): Renamed from allocnos_conflict_p. All callers changed. Test subword 0 of each allocno for conflicts. (build_object_conflicts): Renamed from build_allocno_conflicts. All callers changed. Iterate over allocno subobjects. * ira-emit.c (modify_move_list): Iterate over allocno subobjects. * ira-int.h (struct ira_allocno): New member. num_objects. Rename object to objects and change it into an array. (ALLOCNO_OBJECT): Add new argument N. (ALLOCNO_NUM_OBJECTS, OBJECT_SUBWORD): New macros. (ira_create_allocno_objects): Renamed from ira_create_allocno_object. (ior_hard_reg_conflicts): Declare. (ira_add_live_range_to_object): Declare. (ira_allocno_object_iterator): New. (ira_allocno_object_iter_init, ira_allocno_object_iter_cond): New. (FOR_EACH_ALLOCNO_OBJECT): New macro. * ira-lives.c (objects_live): Renamed from allocnos_live; all uses changed. (allocnos_processed): New sparseset. (make_object_born): Renamed from make_allocno_born; take an ira_object_t argument. All callers changed. (make_object_dead): Renamed from make_allocno_dead; take an ira_object t argument. All callers changed. (update_allocno_pressure_excess_length): Take an ira_obejct_t argument. All callers changed. (mark_pseudo_regno_live): Iterate over allocno subobjects. (mark_pseudo_regno_dead): Likewise. (mark_pseudo_regno_subword_live, mark_pseudo_regno_subword_dead): New functions. (mark_ref_live): Detect subword accesses and call mark_pseudo_regno_subword_live as appropriate. (mark_ref_dead): Likewise for mark_pseudo_regno_subword_dead. (process_bb_nodes_live): Deal with object-related updates first; set and test bits in allocnos_processed to avoid computing allocno statistics more than once. (create_start_finish_chains): Iterate over objects, not allocnos. (print_object_live_ranges): New function. (print_allocno_live_ranges): Use it. (ira_create_allocno_live_ranges): Allocate and free allocnos_processed and objects_live. From-SVN: r162418
2010-07-22 17:48:30 +02:00
/* Loop over all objects. In each iteration, OBJ is set to the next
object. ITER is an instance of ira_object_iterator used to iterate
ira-int.h (struct ira_object): New. * ira-int.h (struct ira_object): New. (ira_object_t): New typedef. Add DEF_VEC_P and DEF_VEC_ALLOC_P for it. (struct ira_allocno): Remove members min, max, conflict_allocno_array, conflict_id, conflict_allocno_array_size, conflict_allocnos_num and conflict_vec_p. Add new member object. (OBJECT_CONFLICT_ARRAY, OBJECT_CONFLICT_VEC_P, OBJECT_NUM_CONFLICTS, OBJECT_CONFLICT_ARRAY_SIZE, OBJECT_CONFLICT_HARD_REGS, OBJECT_TOTAL_CONFLICT_HARD_REGS, OBJECT_MIN, OBJECT_MAX, OBJECT_CONFLICT_ID): Renamed from ALLOCNO_CONFLICT_ALLOCNO_ARRAY, ALLOCNO_CONFLICT_VEC_P, ALLOCNO_CONFLICT_ALLOCNOS_NUM, ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE, ALLOCNO_CONFLICT_HARD_REGS, ALLOCNO_TOTAL_CONFLICT_HARD_REGS) ALLOCNO_MIN, ALLOCNO_MAX, and ALLOCNO_CONFLICT_ID; now operate on an ira_object_t rather than ira_allocno_t. All uses changed. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_objects_num): Declare variable. (ira_create_allocno_object): Declare function. (ira_conflict_vector_profitable_p): Adjust prototype. (ira_allocate_conflict_vec): Renamed from ira_allocate_allocno_conflict_vec; first arg now ira_object_t. (ira_allocate_object_conflicts): Renamed from ira_allocate_allocno_conflicts; first arg now ira_object_t. (struct ira_object_iterator): New. (ira_object_iter_init, ira_object_iter_cond, FOR_EACH_OBJECT): New. (ira_allocno_conflict_iterator): Renamed member allocno_conflict_vec_p to conflict_vec_p. All uses changed. (ira_allocno_conflict_iter_init, ira_allocno_conflict_iter_cond): Changed to take into account that conflicts are now tracked for objects. * ira-conflicts.c (OBJECTS_CONFLICT_P): Renamed from CONFLICT_ALLOCNO_P. Args changed to accept ira_object_t. All uses changed. (allocnos_conflict_p): New static function. (collected_conflict_objects): Renamed from collected_allocno_objects; now a vector of ira_object_t. All uses changed. (build_conflict_bit_table): Changed to take into account that conflicts are now tracked for objects. (process_regs_for_copy, propagate_copies, build_allocno_conflicts) (print_allocno_conflicts, ira_build_conflicts): Likewise. * ira-color.c (assign_hard_reg, setup_allocno_available_regs_num) setup_allocno_left_conflicts_size, allocno_reload_assign, fast_allocation): Likewise. * ira-lives.c (make_hard_regno_born, make_allocno_born) process_single_reg_class_operands, process_bb_node_lives): Likewise. * ira-emit.c (modify_move_list, add_range_and_copies_from_move_list): Likewise. * ira-build.c (ira_objects_num): New variable. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_object_id_map_vec): Corresponding change. (object_pool): New static variable. (initiate_allocnos): Initialize it. (finish_allocnos): Free it. (ira_create_object, ira_create_allocno_object, create_allocno_objects): New functions. (ira_create_allocno): Don't set members that were removed. (ira_set_allocno_cover_class): Don't change conflict hard regs. (merge_hard_reg_conflicts): Changed to take into account that conflicts are now tracked for objects. (ira_conflict_vector_profitable_p, ira_allocate_conflict_vec, allocate_conflict_bit_vec, ira_allocate_object_conflicts, compress_conflict_vecs, remove_low_level_allocnos, ira_flattening, setup_min_max_allocno_live_range_point, allocno_range_compare_func, setup_min_max_conflict_allocno_ids, ): Likewise. ((add_to_conflicts): Renamed from add_to_allocno_conflicts, args changed to ira_object_t; all callers changed. (ira_add_conflict): Renamed from ira_add_allocno_conflict, args changed to ira_object_t, all callers changed. (clear_conflicts): Renamed from clear_allocno_conflicts, arg changed to ira_object_t, all callers changed. (conflict_check, curr_conflict_check_tick): Renamed from allocno_conflict_check and curr_allocno_conflict_check_tick; all uses changed. (compress_conflict_vec): Renamed from compress_allocno_conflict_vec, arg changed to ira_object_t, all callers changed. (create_cap_allocno): Call ira_create_allocno_object. (finish_allocno): Free the corresponding object. (sort_conflict_id_map): Renamed from sort_conflict_id_allocno_map; all callers changed. Adjusted for dealing with objects. (ira_build): Call create_allocno_objects after ira_costs. Adjusted for dealing with objects. * ira.c (ira_bad_reload_regno_1): Adjusted for dealing with objects. From-SVN: r162166
2010-07-14 03:53:35 +02:00
the objects. */
#define FOR_EACH_OBJECT(OBJ, ITER) \
for (ira_object_iter_init (&(ITER)); \
ira_object_iter_cond (&(ITER), &(OBJ));)
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
ira-build.c (ira_create_object): New arg SUBWORD; all callers changed. * ira-build.c (ira_create_object): New arg SUBWORD; all callers changed. Initialize OBJECT_SUBWORD. (ira_create_allocno): Clear ALLOCNO_NUM_OBJECTS. (ira_create_allocno_objects): Renamed from ira_create_allocno_object; all callers changed. (merge_hard_reg_conflicts): Iterate over allocno subobjects. (finish_allocno): Likewise. (move_allocno_live_ranges, copy_allocno_live_ranges): Likewise. (remove_low_level_allocnos): Likewise. (update_bad_spill_attribute): Likewise. (setup_min_max_allocno_live_range_point): Likewise. (sort_conflict_id_map): Likewise. (ira_flattening): Likewise. Use ior_hard_reg_conflicts. (ior_hard_reg_conflicts): New function. (ior_allocate_object_conflicts): Renamed first argument to OBJ. (compress_conflict_vecs): Iterate over objects, not allocnos. (ira_add_live_range_to_object): New function. (object_range_compare_func): Renamed from allocno_range_compare_func. All callers changed. (setup_min_max_conflict_allocno_ids): For allocnos with multiple subobjects, widen the min/max range of the lowest-order object to potentially include all other such low-order objects. * ira.c (ira_bad_reload_regno_1): Iterate over allocno subobjects. (check_allocation): Likewise. Use more fine-grained tests for register conflicts. * ira-color.c (allocnos_have_intersected_live_ranges_p): Iterate over allocno subobjects. (assign_hard_reg): Keep multiple sets of conflicts. Make finer-grained choices about which bits to set in each set. Don't use ira_hard_reg_not_in_set_p, perform a more elaborate test for conflicts using the multiple sets we computed. (push_allocno_to_stack): Iterate over allocno subobjects. (all_conflicting_hard_regs_coalesced): New static function. (setup_allocno_available_regs_num): Use it. (setup_allocno_left_conflicts_size): Likewise. Iterate over allocno subobjects. (coalesced_allocno_conflict): Test subobject 0 in each allocno. (setup_allocno_priorities): Divide ALLOCNO_EXCESS_PRESSURE_POINTS_NUM by ALLOCNO_NUM_OBJECTS. (calculate_spill_cost): Likewise. (color_pass): Express if statement in a more normal way. (ira_reassign_conflict_allocnos): Iterate over allocno subobjects. (slot_coalesced_allocno_live_ranges_intersect_p): Likewise. (setup_slot_coalesced_allocno_live_ranges): Likewise. (allocno_reload_assign): Likewise. (ira_reassign_pseudos): Likewise. (fast_allocation): Likewise. * ira-conflicts.c (build_conflict_bit_table): Likewise. (print_allocno_conflicts): Likewise. (ira_build_conflicts): Likewise. (allocnos_conflict_for_copy_p): Renamed from allocnos_conflict_p. All callers changed. Test subword 0 of each allocno for conflicts. (build_object_conflicts): Renamed from build_allocno_conflicts. All callers changed. Iterate over allocno subobjects. * ira-emit.c (modify_move_list): Iterate over allocno subobjects. * ira-int.h (struct ira_allocno): New member. num_objects. Rename object to objects and change it into an array. (ALLOCNO_OBJECT): Add new argument N. (ALLOCNO_NUM_OBJECTS, OBJECT_SUBWORD): New macros. (ira_create_allocno_objects): Renamed from ira_create_allocno_object. (ior_hard_reg_conflicts): Declare. (ira_add_live_range_to_object): Declare. (ira_allocno_object_iterator): New. (ira_allocno_object_iter_init, ira_allocno_object_iter_cond): New. (FOR_EACH_ALLOCNO_OBJECT): New macro. * ira-lives.c (objects_live): Renamed from allocnos_live; all uses changed. (allocnos_processed): New sparseset. (make_object_born): Renamed from make_allocno_born; take an ira_object_t argument. All callers changed. (make_object_dead): Renamed from make_allocno_dead; take an ira_object t argument. All callers changed. (update_allocno_pressure_excess_length): Take an ira_obejct_t argument. All callers changed. (mark_pseudo_regno_live): Iterate over allocno subobjects. (mark_pseudo_regno_dead): Likewise. (mark_pseudo_regno_subword_live, mark_pseudo_regno_subword_dead): New functions. (mark_ref_live): Detect subword accesses and call mark_pseudo_regno_subword_live as appropriate. (mark_ref_dead): Likewise for mark_pseudo_regno_subword_dead. (process_bb_nodes_live): Deal with object-related updates first; set and test bits in allocnos_processed to avoid computing allocno statistics more than once. (create_start_finish_chains): Iterate over objects, not allocnos. (print_object_live_ranges): New function. (print_allocno_live_ranges): Use it. (ira_create_allocno_live_ranges): Allocate and free allocnos_processed and objects_live. From-SVN: r162418
2010-07-22 17:48:30 +02:00
/* The iterator for objects associated with an allocno. */
cgraph.h (cgraph_node_set_iterator, [...]): Remove typedef. * gcc/cgraph.h (cgraph_node_set_iterator, varpool_node_set_iterator): Remove typedef. (cgraph_inline_failed_enum, cgraph_inline_failed_t): Remove typedef and rename to cgraph_inline_failed_t. * gcc/tree-ssa-alias.h (ao_ref_s, ao_ref): Remove typedef and rename to ao_ref. * gcc/reload.h (reg_equivs_s, reg_equivs_t): Remove typedef and rename to reg_equivs_t. * gcc/conditions.h (CC_STATUS): Remove typedef. * gcc/bitmap.h (bitmap_obstack): Remove typedef. (bitmap_element_def, bitmap_element): Remove typedef and rename to bitmap_element. (bitmap_head_def, bitmap_head): Remove typedef and rename to bitmap_head. (bitmap_iterator): Remove typedef. * gcc/target.h (cumulative_args_t, print_switch_type, secondary_reload_info): Remove typedef. * gcc/dwarf2out.h (dw_cfi_oprnd_struct, dw_cfi_oprnd): Remove dw_cfi_oprnd_struct alias. (dw_cfi_struct, dw_cfi_node): Remove typedef and rename to dw_cfi_node. (dw_fde_struct, dw_fde_node): Remove typedef and rename to dw_fde_node. (cfa_loc, dw_cfa_location): Remove typedef and rename to dw_cfa_location. (dw_vec_struct, dw_vec_const): Remove typedef and rename to dw_vec_const. (dw_val_struct, dw_val_node): Remove typedef and rename to dw_val_node. (dw_loc_descr_struct, dw_loc_descr_node): Remove typedef and rename to dw_loc_descr_node. * gcc/params.h (param_info, compiler_param): Remove typedef. * gcc/opts.h (cl_deferred_param): Remove typedef. * gcc/sreal.h (sreal): Remove typedef. * gcc/ddg.h (dep_type, dep_data_type): Remove typedef. * gcc/graphite-clast-to-gimple.h (cloog_prog_clast, bb_pbb_def): Remove typedef. * gcc/lto-streamer.h (lto_decl_stream_e_t, lto_encoder_entry, lto_symtab_encoder_iterator, res_pair): Remove typedef. * gcc/tree-affine.h (affine_tree_combination, aff_tree): Remove typedef and rename to aff_tree. * gcc/sched-int.h (region): Remove typedef. * gcc/diagnostic.h (diagnostic_info, diagnostic_classification_change_t): Remove typedef. * gcc/tree-ssa-loop.h (affine_iv_d): Remove typedef and rename to affine_iv. * gcc/sbitmap.h (sbitmap_iterator): Remove typedef. * gcc/ssa-iterators.h (immediate_use_iterator_d, imm_use_iterator): Remove typedef and rename to imm_use_iterator. (ssa_operand_iterator_d, ssa_op_iter): Remove typedef and rename to ssa_op_iter. * gcc/ggc-internal.h (ggc_statistics): Remove typedef. * gcc/cselib.h (cselib_val_struct, cselib_val): Remove typedef and rename to cselib_val. * gcc/tree-core.h (alias_pair): Remove typedef. (constructor_elt_d, constructor_elt): Remove typedef and rename to constructor_elt. (ssa_use_operand_d, ssa_use_operand_t): Remove typedef and rename to ssa_use_operand_t. * gcc/graphite-sese-to-poly.h (base_alias_pair): Remove typedef. * gcc/tree-data-ref.h (conflict_function): Remove typedef. * gcc/tree-inline.h (copy_body_data): Remove typedef. * gcc/ipa-inline.h (condition, size_time_entry, inline_param_summary_t, edge_growth_cache_entry): Remove typedef. * gcc/regrename.h (operand_rr_info, insn_rr_info): Remove typedef. * gcc/gimple-iterator.h (gimple_stmt_iterator_d, gimple_stmt_iterator): Remove typedef and rename to gimple_stmt_iterator. * gcc/basic-block.h (ce_if_block, ce_if_block_t): Remove typedef and rename to ce_if_block. (edge_iterator): Remove typedef. * gcc/ipa-prop.h (ipa_agg_jf_item, ipa_agg_jf_item_t): Remove typedef and rename to ipa_agg_jf_item. (ipa_agg_jump_function_t, ipa_param_descriptor_t, ipa_node_params_t, ipa_parm_adjustment_t): Remove typedef. (ipa_jump_func, ipa_jump_func_t): Remove typedef and rename to ipa_jump_func. (ipa_edge_args, ipa_edge_args_t): Remove typedef and rename to ipa_edge_args. * gcc/gcov-io.h (gcov_bucket_type): Remove typedef. (gcov_working_set_info, gcov_working_set_t): Remove typedef and rename to gcov_working_set_t. * gcc/ira-int.h (minmax_set_iterator, ira_allocno_iterator, ira_object_iterator, ira_allocno_object_iterator, ira_pref_iterator, ira_copy_iterator, ira_object_conflict_iterator): Remove typedef. * gcc/tree-iterator.h (tree_stmt_iterator): Remove typedef. * gcc/rtl.h (addr_diff_vec_flags, mem_attrs, reg_attrs, replace_label_data): Remove typedef. (rtunion_def, rtunion): Remove typedef and rename to rtunion. * gcc/hard-reg-set.h (hard_reg_set_iterator): Remove typedef. * gcc/sel-sched-ir.h (_list_iterator, sel_global_bb_info_def, sel_region_bb_info_def, succ_iterator): Remove typedef. (deps_where_def, deps_where_t): Remove typedef and rename to deps_where_t. * gcc/coretypes.h: Adapt forward declarations. * gcc/tree-scalar-evolution.h: Likewise. * gcc/tree-ssa-address.h: Likewise. * gcc/tree-ssa-operands.h: Likewise. * gcc/function.h: Likewise. * gcc/config/frv/frv-protos.h: Likewise. * gcc/targhooks.h: Likewise. * gcc/basic_block.h: Likewise. * gcc/rtl.def: Adapt documentation. * gcc/doc/tm.texi: Likewise. * gcc/ipa-cp.c: Adapt uses. * gcc/bitmap.c: Likewise. * gcc/dwarf2out.c: Likewise. * gcc/target.def: Likewise. * gcc/ipa-inline-analysis.c: Likewise. * gcc/dwarf2cfi.c: Likewise. * gcc/tree-ssa-loop-ivopts.c: Likewise. * gcc/lto-cgraph.c: Likewise. * gcc/config/frv/frv.c: Likewise. * gcc/ifcvt.c: Likewise. * gcc/ipa-prop.c: Likewise. From-SVN: r205863
2013-12-10 17:48:44 +01:00
struct ira_allocno_object_iterator {
ira-build.c (ira_create_object): New arg SUBWORD; all callers changed. * ira-build.c (ira_create_object): New arg SUBWORD; all callers changed. Initialize OBJECT_SUBWORD. (ira_create_allocno): Clear ALLOCNO_NUM_OBJECTS. (ira_create_allocno_objects): Renamed from ira_create_allocno_object; all callers changed. (merge_hard_reg_conflicts): Iterate over allocno subobjects. (finish_allocno): Likewise. (move_allocno_live_ranges, copy_allocno_live_ranges): Likewise. (remove_low_level_allocnos): Likewise. (update_bad_spill_attribute): Likewise. (setup_min_max_allocno_live_range_point): Likewise. (sort_conflict_id_map): Likewise. (ira_flattening): Likewise. Use ior_hard_reg_conflicts. (ior_hard_reg_conflicts): New function. (ior_allocate_object_conflicts): Renamed first argument to OBJ. (compress_conflict_vecs): Iterate over objects, not allocnos. (ira_add_live_range_to_object): New function. (object_range_compare_func): Renamed from allocno_range_compare_func. All callers changed. (setup_min_max_conflict_allocno_ids): For allocnos with multiple subobjects, widen the min/max range of the lowest-order object to potentially include all other such low-order objects. * ira.c (ira_bad_reload_regno_1): Iterate over allocno subobjects. (check_allocation): Likewise. Use more fine-grained tests for register conflicts. * ira-color.c (allocnos_have_intersected_live_ranges_p): Iterate over allocno subobjects. (assign_hard_reg): Keep multiple sets of conflicts. Make finer-grained choices about which bits to set in each set. Don't use ira_hard_reg_not_in_set_p, perform a more elaborate test for conflicts using the multiple sets we computed. (push_allocno_to_stack): Iterate over allocno subobjects. (all_conflicting_hard_regs_coalesced): New static function. (setup_allocno_available_regs_num): Use it. (setup_allocno_left_conflicts_size): Likewise. Iterate over allocno subobjects. (coalesced_allocno_conflict): Test subobject 0 in each allocno. (setup_allocno_priorities): Divide ALLOCNO_EXCESS_PRESSURE_POINTS_NUM by ALLOCNO_NUM_OBJECTS. (calculate_spill_cost): Likewise. (color_pass): Express if statement in a more normal way. (ira_reassign_conflict_allocnos): Iterate over allocno subobjects. (slot_coalesced_allocno_live_ranges_intersect_p): Likewise. (setup_slot_coalesced_allocno_live_ranges): Likewise. (allocno_reload_assign): Likewise. (ira_reassign_pseudos): Likewise. (fast_allocation): Likewise. * ira-conflicts.c (build_conflict_bit_table): Likewise. (print_allocno_conflicts): Likewise. (ira_build_conflicts): Likewise. (allocnos_conflict_for_copy_p): Renamed from allocnos_conflict_p. All callers changed. Test subword 0 of each allocno for conflicts. (build_object_conflicts): Renamed from build_allocno_conflicts. All callers changed. Iterate over allocno subobjects. * ira-emit.c (modify_move_list): Iterate over allocno subobjects. * ira-int.h (struct ira_allocno): New member. num_objects. Rename object to objects and change it into an array. (ALLOCNO_OBJECT): Add new argument N. (ALLOCNO_NUM_OBJECTS, OBJECT_SUBWORD): New macros. (ira_create_allocno_objects): Renamed from ira_create_allocno_object. (ior_hard_reg_conflicts): Declare. (ira_add_live_range_to_object): Declare. (ira_allocno_object_iterator): New. (ira_allocno_object_iter_init, ira_allocno_object_iter_cond): New. (FOR_EACH_ALLOCNO_OBJECT): New macro. * ira-lives.c (objects_live): Renamed from allocnos_live; all uses changed. (allocnos_processed): New sparseset. (make_object_born): Renamed from make_allocno_born; take an ira_object_t argument. All callers changed. (make_object_dead): Renamed from make_allocno_dead; take an ira_object t argument. All callers changed. (update_allocno_pressure_excess_length): Take an ira_obejct_t argument. All callers changed. (mark_pseudo_regno_live): Iterate over allocno subobjects. (mark_pseudo_regno_dead): Likewise. (mark_pseudo_regno_subword_live, mark_pseudo_regno_subword_dead): New functions. (mark_ref_live): Detect subword accesses and call mark_pseudo_regno_subword_live as appropriate. (mark_ref_dead): Likewise for mark_pseudo_regno_subword_dead. (process_bb_nodes_live): Deal with object-related updates first; set and test bits in allocnos_processed to avoid computing allocno statistics more than once. (create_start_finish_chains): Iterate over objects, not allocnos. (print_object_live_ranges): New function. (print_allocno_live_ranges): Use it. (ira_create_allocno_live_ranges): Allocate and free allocnos_processed and objects_live. From-SVN: r162418
2010-07-22 17:48:30 +02:00
/* The number of the element the allocno's object array. */
int n;
cgraph.h (cgraph_node_set_iterator, [...]): Remove typedef. * gcc/cgraph.h (cgraph_node_set_iterator, varpool_node_set_iterator): Remove typedef. (cgraph_inline_failed_enum, cgraph_inline_failed_t): Remove typedef and rename to cgraph_inline_failed_t. * gcc/tree-ssa-alias.h (ao_ref_s, ao_ref): Remove typedef and rename to ao_ref. * gcc/reload.h (reg_equivs_s, reg_equivs_t): Remove typedef and rename to reg_equivs_t. * gcc/conditions.h (CC_STATUS): Remove typedef. * gcc/bitmap.h (bitmap_obstack): Remove typedef. (bitmap_element_def, bitmap_element): Remove typedef and rename to bitmap_element. (bitmap_head_def, bitmap_head): Remove typedef and rename to bitmap_head. (bitmap_iterator): Remove typedef. * gcc/target.h (cumulative_args_t, print_switch_type, secondary_reload_info): Remove typedef. * gcc/dwarf2out.h (dw_cfi_oprnd_struct, dw_cfi_oprnd): Remove dw_cfi_oprnd_struct alias. (dw_cfi_struct, dw_cfi_node): Remove typedef and rename to dw_cfi_node. (dw_fde_struct, dw_fde_node): Remove typedef and rename to dw_fde_node. (cfa_loc, dw_cfa_location): Remove typedef and rename to dw_cfa_location. (dw_vec_struct, dw_vec_const): Remove typedef and rename to dw_vec_const. (dw_val_struct, dw_val_node): Remove typedef and rename to dw_val_node. (dw_loc_descr_struct, dw_loc_descr_node): Remove typedef and rename to dw_loc_descr_node. * gcc/params.h (param_info, compiler_param): Remove typedef. * gcc/opts.h (cl_deferred_param): Remove typedef. * gcc/sreal.h (sreal): Remove typedef. * gcc/ddg.h (dep_type, dep_data_type): Remove typedef. * gcc/graphite-clast-to-gimple.h (cloog_prog_clast, bb_pbb_def): Remove typedef. * gcc/lto-streamer.h (lto_decl_stream_e_t, lto_encoder_entry, lto_symtab_encoder_iterator, res_pair): Remove typedef. * gcc/tree-affine.h (affine_tree_combination, aff_tree): Remove typedef and rename to aff_tree. * gcc/sched-int.h (region): Remove typedef. * gcc/diagnostic.h (diagnostic_info, diagnostic_classification_change_t): Remove typedef. * gcc/tree-ssa-loop.h (affine_iv_d): Remove typedef and rename to affine_iv. * gcc/sbitmap.h (sbitmap_iterator): Remove typedef. * gcc/ssa-iterators.h (immediate_use_iterator_d, imm_use_iterator): Remove typedef and rename to imm_use_iterator. (ssa_operand_iterator_d, ssa_op_iter): Remove typedef and rename to ssa_op_iter. * gcc/ggc-internal.h (ggc_statistics): Remove typedef. * gcc/cselib.h (cselib_val_struct, cselib_val): Remove typedef and rename to cselib_val. * gcc/tree-core.h (alias_pair): Remove typedef. (constructor_elt_d, constructor_elt): Remove typedef and rename to constructor_elt. (ssa_use_operand_d, ssa_use_operand_t): Remove typedef and rename to ssa_use_operand_t. * gcc/graphite-sese-to-poly.h (base_alias_pair): Remove typedef. * gcc/tree-data-ref.h (conflict_function): Remove typedef. * gcc/tree-inline.h (copy_body_data): Remove typedef. * gcc/ipa-inline.h (condition, size_time_entry, inline_param_summary_t, edge_growth_cache_entry): Remove typedef. * gcc/regrename.h (operand_rr_info, insn_rr_info): Remove typedef. * gcc/gimple-iterator.h (gimple_stmt_iterator_d, gimple_stmt_iterator): Remove typedef and rename to gimple_stmt_iterator. * gcc/basic-block.h (ce_if_block, ce_if_block_t): Remove typedef and rename to ce_if_block. (edge_iterator): Remove typedef. * gcc/ipa-prop.h (ipa_agg_jf_item, ipa_agg_jf_item_t): Remove typedef and rename to ipa_agg_jf_item. (ipa_agg_jump_function_t, ipa_param_descriptor_t, ipa_node_params_t, ipa_parm_adjustment_t): Remove typedef. (ipa_jump_func, ipa_jump_func_t): Remove typedef and rename to ipa_jump_func. (ipa_edge_args, ipa_edge_args_t): Remove typedef and rename to ipa_edge_args. * gcc/gcov-io.h (gcov_bucket_type): Remove typedef. (gcov_working_set_info, gcov_working_set_t): Remove typedef and rename to gcov_working_set_t. * gcc/ira-int.h (minmax_set_iterator, ira_allocno_iterator, ira_object_iterator, ira_allocno_object_iterator, ira_pref_iterator, ira_copy_iterator, ira_object_conflict_iterator): Remove typedef. * gcc/tree-iterator.h (tree_stmt_iterator): Remove typedef. * gcc/rtl.h (addr_diff_vec_flags, mem_attrs, reg_attrs, replace_label_data): Remove typedef. (rtunion_def, rtunion): Remove typedef and rename to rtunion. * gcc/hard-reg-set.h (hard_reg_set_iterator): Remove typedef. * gcc/sel-sched-ir.h (_list_iterator, sel_global_bb_info_def, sel_region_bb_info_def, succ_iterator): Remove typedef. (deps_where_def, deps_where_t): Remove typedef and rename to deps_where_t. * gcc/coretypes.h: Adapt forward declarations. * gcc/tree-scalar-evolution.h: Likewise. * gcc/tree-ssa-address.h: Likewise. * gcc/tree-ssa-operands.h: Likewise. * gcc/function.h: Likewise. * gcc/config/frv/frv-protos.h: Likewise. * gcc/targhooks.h: Likewise. * gcc/basic_block.h: Likewise. * gcc/rtl.def: Adapt documentation. * gcc/doc/tm.texi: Likewise. * gcc/ipa-cp.c: Adapt uses. * gcc/bitmap.c: Likewise. * gcc/dwarf2out.c: Likewise. * gcc/target.def: Likewise. * gcc/ipa-inline-analysis.c: Likewise. * gcc/dwarf2cfi.c: Likewise. * gcc/tree-ssa-loop-ivopts.c: Likewise. * gcc/lto-cgraph.c: Likewise. * gcc/config/frv/frv.c: Likewise. * gcc/ifcvt.c: Likewise. * gcc/ipa-prop.c: Likewise. From-SVN: r205863
2013-12-10 17:48:44 +01:00
};
ira-build.c (ira_create_object): New arg SUBWORD; all callers changed. * ira-build.c (ira_create_object): New arg SUBWORD; all callers changed. Initialize OBJECT_SUBWORD. (ira_create_allocno): Clear ALLOCNO_NUM_OBJECTS. (ira_create_allocno_objects): Renamed from ira_create_allocno_object; all callers changed. (merge_hard_reg_conflicts): Iterate over allocno subobjects. (finish_allocno): Likewise. (move_allocno_live_ranges, copy_allocno_live_ranges): Likewise. (remove_low_level_allocnos): Likewise. (update_bad_spill_attribute): Likewise. (setup_min_max_allocno_live_range_point): Likewise. (sort_conflict_id_map): Likewise. (ira_flattening): Likewise. Use ior_hard_reg_conflicts. (ior_hard_reg_conflicts): New function. (ior_allocate_object_conflicts): Renamed first argument to OBJ. (compress_conflict_vecs): Iterate over objects, not allocnos. (ira_add_live_range_to_object): New function. (object_range_compare_func): Renamed from allocno_range_compare_func. All callers changed. (setup_min_max_conflict_allocno_ids): For allocnos with multiple subobjects, widen the min/max range of the lowest-order object to potentially include all other such low-order objects. * ira.c (ira_bad_reload_regno_1): Iterate over allocno subobjects. (check_allocation): Likewise. Use more fine-grained tests for register conflicts. * ira-color.c (allocnos_have_intersected_live_ranges_p): Iterate over allocno subobjects. (assign_hard_reg): Keep multiple sets of conflicts. Make finer-grained choices about which bits to set in each set. Don't use ira_hard_reg_not_in_set_p, perform a more elaborate test for conflicts using the multiple sets we computed. (push_allocno_to_stack): Iterate over allocno subobjects. (all_conflicting_hard_regs_coalesced): New static function. (setup_allocno_available_regs_num): Use it. (setup_allocno_left_conflicts_size): Likewise. Iterate over allocno subobjects. (coalesced_allocno_conflict): Test subobject 0 in each allocno. (setup_allocno_priorities): Divide ALLOCNO_EXCESS_PRESSURE_POINTS_NUM by ALLOCNO_NUM_OBJECTS. (calculate_spill_cost): Likewise. (color_pass): Express if statement in a more normal way. (ira_reassign_conflict_allocnos): Iterate over allocno subobjects. (slot_coalesced_allocno_live_ranges_intersect_p): Likewise. (setup_slot_coalesced_allocno_live_ranges): Likewise. (allocno_reload_assign): Likewise. (ira_reassign_pseudos): Likewise. (fast_allocation): Likewise. * ira-conflicts.c (build_conflict_bit_table): Likewise. (print_allocno_conflicts): Likewise. (ira_build_conflicts): Likewise. (allocnos_conflict_for_copy_p): Renamed from allocnos_conflict_p. All callers changed. Test subword 0 of each allocno for conflicts. (build_object_conflicts): Renamed from build_allocno_conflicts. All callers changed. Iterate over allocno subobjects. * ira-emit.c (modify_move_list): Iterate over allocno subobjects. * ira-int.h (struct ira_allocno): New member. num_objects. Rename object to objects and change it into an array. (ALLOCNO_OBJECT): Add new argument N. (ALLOCNO_NUM_OBJECTS, OBJECT_SUBWORD): New macros. (ira_create_allocno_objects): Renamed from ira_create_allocno_object. (ior_hard_reg_conflicts): Declare. (ira_add_live_range_to_object): Declare. (ira_allocno_object_iterator): New. (ira_allocno_object_iter_init, ira_allocno_object_iter_cond): New. (FOR_EACH_ALLOCNO_OBJECT): New macro. * ira-lives.c (objects_live): Renamed from allocnos_live; all uses changed. (allocnos_processed): New sparseset. (make_object_born): Renamed from make_allocno_born; take an ira_object_t argument. All callers changed. (make_object_dead): Renamed from make_allocno_dead; take an ira_object t argument. All callers changed. (update_allocno_pressure_excess_length): Take an ira_obejct_t argument. All callers changed. (mark_pseudo_regno_live): Iterate over allocno subobjects. (mark_pseudo_regno_dead): Likewise. (mark_pseudo_regno_subword_live, mark_pseudo_regno_subword_dead): New functions. (mark_ref_live): Detect subword accesses and call mark_pseudo_regno_subword_live as appropriate. (mark_ref_dead): Likewise for mark_pseudo_regno_subword_dead. (process_bb_nodes_live): Deal with object-related updates first; set and test bits in allocnos_processed to avoid computing allocno statistics more than once. (create_start_finish_chains): Iterate over objects, not allocnos. (print_object_live_ranges): New function. (print_allocno_live_ranges): Use it. (ira_create_allocno_live_ranges): Allocate and free allocnos_processed and objects_live. From-SVN: r162418
2010-07-22 17:48:30 +02:00
/* Initialize the iterator I. */
static inline void
ira_allocno_object_iter_init (ira_allocno_object_iterator *i)
{
i->n = 0;
}
/* Return TRUE if we have more objects to visit in allocno A, in which
case *O is set to the object to be visited. Otherwise, return
FALSE. */
static inline bool
ira_allocno_object_iter_cond (ira_allocno_object_iterator *i, ira_allocno_t a,
ira_object_t *o)
{
int n = i->n++;
if (n < ALLOCNO_NUM_OBJECTS (a))
{
*o = ALLOCNO_OBJECT (a, n);
return true;
}
return false;
ira-build.c (ira_create_object): New arg SUBWORD; all callers changed. * ira-build.c (ira_create_object): New arg SUBWORD; all callers changed. Initialize OBJECT_SUBWORD. (ira_create_allocno): Clear ALLOCNO_NUM_OBJECTS. (ira_create_allocno_objects): Renamed from ira_create_allocno_object; all callers changed. (merge_hard_reg_conflicts): Iterate over allocno subobjects. (finish_allocno): Likewise. (move_allocno_live_ranges, copy_allocno_live_ranges): Likewise. (remove_low_level_allocnos): Likewise. (update_bad_spill_attribute): Likewise. (setup_min_max_allocno_live_range_point): Likewise. (sort_conflict_id_map): Likewise. (ira_flattening): Likewise. Use ior_hard_reg_conflicts. (ior_hard_reg_conflicts): New function. (ior_allocate_object_conflicts): Renamed first argument to OBJ. (compress_conflict_vecs): Iterate over objects, not allocnos. (ira_add_live_range_to_object): New function. (object_range_compare_func): Renamed from allocno_range_compare_func. All callers changed. (setup_min_max_conflict_allocno_ids): For allocnos with multiple subobjects, widen the min/max range of the lowest-order object to potentially include all other such low-order objects. * ira.c (ira_bad_reload_regno_1): Iterate over allocno subobjects. (check_allocation): Likewise. Use more fine-grained tests for register conflicts. * ira-color.c (allocnos_have_intersected_live_ranges_p): Iterate over allocno subobjects. (assign_hard_reg): Keep multiple sets of conflicts. Make finer-grained choices about which bits to set in each set. Don't use ira_hard_reg_not_in_set_p, perform a more elaborate test for conflicts using the multiple sets we computed. (push_allocno_to_stack): Iterate over allocno subobjects. (all_conflicting_hard_regs_coalesced): New static function. (setup_allocno_available_regs_num): Use it. (setup_allocno_left_conflicts_size): Likewise. Iterate over allocno subobjects. (coalesced_allocno_conflict): Test subobject 0 in each allocno. (setup_allocno_priorities): Divide ALLOCNO_EXCESS_PRESSURE_POINTS_NUM by ALLOCNO_NUM_OBJECTS. (calculate_spill_cost): Likewise. (color_pass): Express if statement in a more normal way. (ira_reassign_conflict_allocnos): Iterate over allocno subobjects. (slot_coalesced_allocno_live_ranges_intersect_p): Likewise. (setup_slot_coalesced_allocno_live_ranges): Likewise. (allocno_reload_assign): Likewise. (ira_reassign_pseudos): Likewise. (fast_allocation): Likewise. * ira-conflicts.c (build_conflict_bit_table): Likewise. (print_allocno_conflicts): Likewise. (ira_build_conflicts): Likewise. (allocnos_conflict_for_copy_p): Renamed from allocnos_conflict_p. All callers changed. Test subword 0 of each allocno for conflicts. (build_object_conflicts): Renamed from build_allocno_conflicts. All callers changed. Iterate over allocno subobjects. * ira-emit.c (modify_move_list): Iterate over allocno subobjects. * ira-int.h (struct ira_allocno): New member. num_objects. Rename object to objects and change it into an array. (ALLOCNO_OBJECT): Add new argument N. (ALLOCNO_NUM_OBJECTS, OBJECT_SUBWORD): New macros. (ira_create_allocno_objects): Renamed from ira_create_allocno_object. (ior_hard_reg_conflicts): Declare. (ira_add_live_range_to_object): Declare. (ira_allocno_object_iterator): New. (ira_allocno_object_iter_init, ira_allocno_object_iter_cond): New. (FOR_EACH_ALLOCNO_OBJECT): New macro. * ira-lives.c (objects_live): Renamed from allocnos_live; all uses changed. (allocnos_processed): New sparseset. (make_object_born): Renamed from make_allocno_born; take an ira_object_t argument. All callers changed. (make_object_dead): Renamed from make_allocno_dead; take an ira_object t argument. All callers changed. (update_allocno_pressure_excess_length): Take an ira_obejct_t argument. All callers changed. (mark_pseudo_regno_live): Iterate over allocno subobjects. (mark_pseudo_regno_dead): Likewise. (mark_pseudo_regno_subword_live, mark_pseudo_regno_subword_dead): New functions. (mark_ref_live): Detect subword accesses and call mark_pseudo_regno_subword_live as appropriate. (mark_ref_dead): Likewise for mark_pseudo_regno_subword_dead. (process_bb_nodes_live): Deal with object-related updates first; set and test bits in allocnos_processed to avoid computing allocno statistics more than once. (create_start_finish_chains): Iterate over objects, not allocnos. (print_object_live_ranges): New function. (print_allocno_live_ranges): Use it. (ira_create_allocno_live_ranges): Allocate and free allocnos_processed and objects_live. From-SVN: r162418
2010-07-22 17:48:30 +02:00
}
/* Loop over all objects associated with allocno A. In each
iteration, O is set to the next object. ITER is an instance of
ira_allocno_object_iterator used to iterate the conflicts. */
#define FOR_EACH_ALLOCNO_OBJECT(A, O, ITER) \
for (ira_allocno_object_iter_init (&(ITER)); \
ira_allocno_object_iter_cond (&(ITER), (A), &(O));)
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
regmove.c: Remove. 2013-10-30 Vladimir Makarov <vmakarov@redhat.com> * regmove.c: Remove. * tree-pass.h (make_pass_regmove): Remove. * timevar.def (TV_REGMOVE): Remove. * passes.def (pass_regmove): Remove. * opts.c (default_options_table): Remove entry for regmove. * doc/passes.texi: Remove regmove pass description. * doc/invoke.texi (-foptimize-register-move, -fregmove): Remove options. (-fdump-rtl-regmove): Ditto. * common.opt (foptimize-register-move, fregmove): Ignore. * Makefile.in (OBJS): Remove regmove.o. * regmove.c: Remove. * ira-int.h (struct ira_allocno_pref, ira_pref_t): New structure and type. (struct ira_allocno) New member allocno_prefs. (ALLOCNO_PREFS): New macro. (ira_prefs, ira_prefs_num): New external vars. (ira_setup_alts, ira_get_dup_out_num, ira_debug_pref): New prototypes. (ira_debug_prefs, ira_debug_allocno_prefs, ira_create_pref): Ditto. (ira_add_allocno_pref, ira_remove_pref, ira_remove_allocno_prefs): Ditto. (ira_add_allocno_copy_to_list): Remove prototype. (ira_swap_allocno_copy_ends_if_necessary): Ditto. (ira_pref_iterator): New type. (ira_pref_iter_init, ira_pref_iter_cond): New functions. (FOR_EACH_PREF): New macro. * ira.c (commutative_constraint_p): Move from ira-conflicts.c. (ira_get_dup_out_num): Ditto. Rename from get_dup_num. Modify the code. (ira_setup_alts): New function. (decrease_live_ranges_number): New function. (ira): Call the above function. * ira-build.c (ira_prefs, ira_prefs_num): New global vars. (ira_create_allocno): Initialize allocno prefs. (pref_pool, pref_vec): New static vars. (initiate_prefs, find_allocno_pref, ira_create_pref): New functions. (add_allocno_pref_to_list, ira_add_allocno_pref, print_pref): Ditto. (ira_debug_pref, print_prefs, ira_debug_prefs): Ditto. (print_allocno_prefs, ira_debug_allocno_prefs, finish_pref): Ditto. (ira_remove_pref, ira_remove_allocno_prefs, finish_prefs): Ditto. (ira_add_allocno_copy_to_list): Make static. Rename to add_allocno_copy_to_list. (ira_swap_allocno_copy_ends_if_necessary): Make static. Rename to swap_allocno_copy_ends_if_necessary. (remove_unnecessary_allocnos, remove_low_level_allocnos): Call ira_remove_allocno_prefs. (ira_flattening): Ditto. (ira_build): Call initiate_prefs, print_prefs. (ira_destroy): Call finish_prefs. * ira-color.c (struct update_cost_record): New. (struct allocno_color_data): Add new member update_cost_records. (update_cost_record_pool): New static var. (init_update_cost_records, get_update_cost_record): New functions. (free_update_cost_record_list, finish_update_cost_records): Ditto. (struct update_cost_queue_elem): Add member from. (initiate_cost_update): Call init_update_cost_records. (finish_cost_update): Call finish_update_cost_records. (queue_update_cost, get_next_update_cost): Add new param from. (Update_allocno_cost, update_costs_from_allocno): New functions. (update_costs_from_prefs): Ditto. (update_copy_costs): Rename to update_costs_from_copies. (restore_costs_from_copies): New function. (update_conflict_hard_regno_costs): Don't go back. (assign_hard_reg): Call restore_costs_from_copies. Add printing more debug info. (pop_allocnos): Add priniting more debug info. (color_allocnos): Remove prefs for conflicting hard regs. Call update_costs_from_prefs. * ira-conflicts.c (commutative_constraint_p): Move to ira.c (get_dup_num): Rename, modify, and move to ira.c (process_regs_for_copy): Add prefs. (add_insn_allocno_copies): Put src as first arg of process_regs_for_copy. Remove dead code. Call ira_setup_alts. * ira-costs.c (record_reg_classes): Modify and move code into record_operands_costs. (find_costs_and_classes): Create prefs for the hard reg of small reg class. (process_bb_node_for_hard_reg_moves): Add prefs. 2013-10-30 Vladimir Makarov <vmakarov@redhat.com> * gcc.target/i386/fma_double_3.c: Use pattern for scan-assembler-times instead of just one insn name. * gcc.target/i386/fma_double_5.c: Ditto. * gcc.target/i386/fma_float_3.c: Ditto. * gcc.target/i386/fma_float_5.c: Ditto. * gcc.target/i386/l_fma_double_1.c: Ditto. * gcc.target/i386/l_fma_double_2.c: Ditto. * gcc.target/i386/l_fma_double_3.c: Ditto. * gcc.target/i386/l_fma_double_4.c: Ditto. * gcc.target/i386/l_fma_double_5.c: Ditto. * gcc.target/i386/l_fma_double_6.c: Ditto. * gcc.target/i386/l_fma_float_1.c: Ditto. * gcc.target/i386/l_fma_float_2.c: Ditto. * gcc.target/i386/l_fma_float_3.c: Ditto. * gcc.target/i386/l_fma_float_4.c: Ditto. * gcc.target/i386/l_fma_float_5.c: Ditto. * gcc.target/i386/l_fma_float_6.c: Ditto. From-SVN: r204212
2013-10-30 15:27:25 +01:00
/* The iterator for prefs. */
cgraph.h (cgraph_node_set_iterator, [...]): Remove typedef. * gcc/cgraph.h (cgraph_node_set_iterator, varpool_node_set_iterator): Remove typedef. (cgraph_inline_failed_enum, cgraph_inline_failed_t): Remove typedef and rename to cgraph_inline_failed_t. * gcc/tree-ssa-alias.h (ao_ref_s, ao_ref): Remove typedef and rename to ao_ref. * gcc/reload.h (reg_equivs_s, reg_equivs_t): Remove typedef and rename to reg_equivs_t. * gcc/conditions.h (CC_STATUS): Remove typedef. * gcc/bitmap.h (bitmap_obstack): Remove typedef. (bitmap_element_def, bitmap_element): Remove typedef and rename to bitmap_element. (bitmap_head_def, bitmap_head): Remove typedef and rename to bitmap_head. (bitmap_iterator): Remove typedef. * gcc/target.h (cumulative_args_t, print_switch_type, secondary_reload_info): Remove typedef. * gcc/dwarf2out.h (dw_cfi_oprnd_struct, dw_cfi_oprnd): Remove dw_cfi_oprnd_struct alias. (dw_cfi_struct, dw_cfi_node): Remove typedef and rename to dw_cfi_node. (dw_fde_struct, dw_fde_node): Remove typedef and rename to dw_fde_node. (cfa_loc, dw_cfa_location): Remove typedef and rename to dw_cfa_location. (dw_vec_struct, dw_vec_const): Remove typedef and rename to dw_vec_const. (dw_val_struct, dw_val_node): Remove typedef and rename to dw_val_node. (dw_loc_descr_struct, dw_loc_descr_node): Remove typedef and rename to dw_loc_descr_node. * gcc/params.h (param_info, compiler_param): Remove typedef. * gcc/opts.h (cl_deferred_param): Remove typedef. * gcc/sreal.h (sreal): Remove typedef. * gcc/ddg.h (dep_type, dep_data_type): Remove typedef. * gcc/graphite-clast-to-gimple.h (cloog_prog_clast, bb_pbb_def): Remove typedef. * gcc/lto-streamer.h (lto_decl_stream_e_t, lto_encoder_entry, lto_symtab_encoder_iterator, res_pair): Remove typedef. * gcc/tree-affine.h (affine_tree_combination, aff_tree): Remove typedef and rename to aff_tree. * gcc/sched-int.h (region): Remove typedef. * gcc/diagnostic.h (diagnostic_info, diagnostic_classification_change_t): Remove typedef. * gcc/tree-ssa-loop.h (affine_iv_d): Remove typedef and rename to affine_iv. * gcc/sbitmap.h (sbitmap_iterator): Remove typedef. * gcc/ssa-iterators.h (immediate_use_iterator_d, imm_use_iterator): Remove typedef and rename to imm_use_iterator. (ssa_operand_iterator_d, ssa_op_iter): Remove typedef and rename to ssa_op_iter. * gcc/ggc-internal.h (ggc_statistics): Remove typedef. * gcc/cselib.h (cselib_val_struct, cselib_val): Remove typedef and rename to cselib_val. * gcc/tree-core.h (alias_pair): Remove typedef. (constructor_elt_d, constructor_elt): Remove typedef and rename to constructor_elt. (ssa_use_operand_d, ssa_use_operand_t): Remove typedef and rename to ssa_use_operand_t. * gcc/graphite-sese-to-poly.h (base_alias_pair): Remove typedef. * gcc/tree-data-ref.h (conflict_function): Remove typedef. * gcc/tree-inline.h (copy_body_data): Remove typedef. * gcc/ipa-inline.h (condition, size_time_entry, inline_param_summary_t, edge_growth_cache_entry): Remove typedef. * gcc/regrename.h (operand_rr_info, insn_rr_info): Remove typedef. * gcc/gimple-iterator.h (gimple_stmt_iterator_d, gimple_stmt_iterator): Remove typedef and rename to gimple_stmt_iterator. * gcc/basic-block.h (ce_if_block, ce_if_block_t): Remove typedef and rename to ce_if_block. (edge_iterator): Remove typedef. * gcc/ipa-prop.h (ipa_agg_jf_item, ipa_agg_jf_item_t): Remove typedef and rename to ipa_agg_jf_item. (ipa_agg_jump_function_t, ipa_param_descriptor_t, ipa_node_params_t, ipa_parm_adjustment_t): Remove typedef. (ipa_jump_func, ipa_jump_func_t): Remove typedef and rename to ipa_jump_func. (ipa_edge_args, ipa_edge_args_t): Remove typedef and rename to ipa_edge_args. * gcc/gcov-io.h (gcov_bucket_type): Remove typedef. (gcov_working_set_info, gcov_working_set_t): Remove typedef and rename to gcov_working_set_t. * gcc/ira-int.h (minmax_set_iterator, ira_allocno_iterator, ira_object_iterator, ira_allocno_object_iterator, ira_pref_iterator, ira_copy_iterator, ira_object_conflict_iterator): Remove typedef. * gcc/tree-iterator.h (tree_stmt_iterator): Remove typedef. * gcc/rtl.h (addr_diff_vec_flags, mem_attrs, reg_attrs, replace_label_data): Remove typedef. (rtunion_def, rtunion): Remove typedef and rename to rtunion. * gcc/hard-reg-set.h (hard_reg_set_iterator): Remove typedef. * gcc/sel-sched-ir.h (_list_iterator, sel_global_bb_info_def, sel_region_bb_info_def, succ_iterator): Remove typedef. (deps_where_def, deps_where_t): Remove typedef and rename to deps_where_t. * gcc/coretypes.h: Adapt forward declarations. * gcc/tree-scalar-evolution.h: Likewise. * gcc/tree-ssa-address.h: Likewise. * gcc/tree-ssa-operands.h: Likewise. * gcc/function.h: Likewise. * gcc/config/frv/frv-protos.h: Likewise. * gcc/targhooks.h: Likewise. * gcc/basic_block.h: Likewise. * gcc/rtl.def: Adapt documentation. * gcc/doc/tm.texi: Likewise. * gcc/ipa-cp.c: Adapt uses. * gcc/bitmap.c: Likewise. * gcc/dwarf2out.c: Likewise. * gcc/target.def: Likewise. * gcc/ipa-inline-analysis.c: Likewise. * gcc/dwarf2cfi.c: Likewise. * gcc/tree-ssa-loop-ivopts.c: Likewise. * gcc/lto-cgraph.c: Likewise. * gcc/config/frv/frv.c: Likewise. * gcc/ifcvt.c: Likewise. * gcc/ipa-prop.c: Likewise. From-SVN: r205863
2013-12-10 17:48:44 +01:00
struct ira_pref_iterator {
regmove.c: Remove. 2013-10-30 Vladimir Makarov <vmakarov@redhat.com> * regmove.c: Remove. * tree-pass.h (make_pass_regmove): Remove. * timevar.def (TV_REGMOVE): Remove. * passes.def (pass_regmove): Remove. * opts.c (default_options_table): Remove entry for regmove. * doc/passes.texi: Remove regmove pass description. * doc/invoke.texi (-foptimize-register-move, -fregmove): Remove options. (-fdump-rtl-regmove): Ditto. * common.opt (foptimize-register-move, fregmove): Ignore. * Makefile.in (OBJS): Remove regmove.o. * regmove.c: Remove. * ira-int.h (struct ira_allocno_pref, ira_pref_t): New structure and type. (struct ira_allocno) New member allocno_prefs. (ALLOCNO_PREFS): New macro. (ira_prefs, ira_prefs_num): New external vars. (ira_setup_alts, ira_get_dup_out_num, ira_debug_pref): New prototypes. (ira_debug_prefs, ira_debug_allocno_prefs, ira_create_pref): Ditto. (ira_add_allocno_pref, ira_remove_pref, ira_remove_allocno_prefs): Ditto. (ira_add_allocno_copy_to_list): Remove prototype. (ira_swap_allocno_copy_ends_if_necessary): Ditto. (ira_pref_iterator): New type. (ira_pref_iter_init, ira_pref_iter_cond): New functions. (FOR_EACH_PREF): New macro. * ira.c (commutative_constraint_p): Move from ira-conflicts.c. (ira_get_dup_out_num): Ditto. Rename from get_dup_num. Modify the code. (ira_setup_alts): New function. (decrease_live_ranges_number): New function. (ira): Call the above function. * ira-build.c (ira_prefs, ira_prefs_num): New global vars. (ira_create_allocno): Initialize allocno prefs. (pref_pool, pref_vec): New static vars. (initiate_prefs, find_allocno_pref, ira_create_pref): New functions. (add_allocno_pref_to_list, ira_add_allocno_pref, print_pref): Ditto. (ira_debug_pref, print_prefs, ira_debug_prefs): Ditto. (print_allocno_prefs, ira_debug_allocno_prefs, finish_pref): Ditto. (ira_remove_pref, ira_remove_allocno_prefs, finish_prefs): Ditto. (ira_add_allocno_copy_to_list): Make static. Rename to add_allocno_copy_to_list. (ira_swap_allocno_copy_ends_if_necessary): Make static. Rename to swap_allocno_copy_ends_if_necessary. (remove_unnecessary_allocnos, remove_low_level_allocnos): Call ira_remove_allocno_prefs. (ira_flattening): Ditto. (ira_build): Call initiate_prefs, print_prefs. (ira_destroy): Call finish_prefs. * ira-color.c (struct update_cost_record): New. (struct allocno_color_data): Add new member update_cost_records. (update_cost_record_pool): New static var. (init_update_cost_records, get_update_cost_record): New functions. (free_update_cost_record_list, finish_update_cost_records): Ditto. (struct update_cost_queue_elem): Add member from. (initiate_cost_update): Call init_update_cost_records. (finish_cost_update): Call finish_update_cost_records. (queue_update_cost, get_next_update_cost): Add new param from. (Update_allocno_cost, update_costs_from_allocno): New functions. (update_costs_from_prefs): Ditto. (update_copy_costs): Rename to update_costs_from_copies. (restore_costs_from_copies): New function. (update_conflict_hard_regno_costs): Don't go back. (assign_hard_reg): Call restore_costs_from_copies. Add printing more debug info. (pop_allocnos): Add priniting more debug info. (color_allocnos): Remove prefs for conflicting hard regs. Call update_costs_from_prefs. * ira-conflicts.c (commutative_constraint_p): Move to ira.c (get_dup_num): Rename, modify, and move to ira.c (process_regs_for_copy): Add prefs. (add_insn_allocno_copies): Put src as first arg of process_regs_for_copy. Remove dead code. Call ira_setup_alts. * ira-costs.c (record_reg_classes): Modify and move code into record_operands_costs. (find_costs_and_classes): Create prefs for the hard reg of small reg class. (process_bb_node_for_hard_reg_moves): Add prefs. 2013-10-30 Vladimir Makarov <vmakarov@redhat.com> * gcc.target/i386/fma_double_3.c: Use pattern for scan-assembler-times instead of just one insn name. * gcc.target/i386/fma_double_5.c: Ditto. * gcc.target/i386/fma_float_3.c: Ditto. * gcc.target/i386/fma_float_5.c: Ditto. * gcc.target/i386/l_fma_double_1.c: Ditto. * gcc.target/i386/l_fma_double_2.c: Ditto. * gcc.target/i386/l_fma_double_3.c: Ditto. * gcc.target/i386/l_fma_double_4.c: Ditto. * gcc.target/i386/l_fma_double_5.c: Ditto. * gcc.target/i386/l_fma_double_6.c: Ditto. * gcc.target/i386/l_fma_float_1.c: Ditto. * gcc.target/i386/l_fma_float_2.c: Ditto. * gcc.target/i386/l_fma_float_3.c: Ditto. * gcc.target/i386/l_fma_float_4.c: Ditto. * gcc.target/i386/l_fma_float_5.c: Ditto. * gcc.target/i386/l_fma_float_6.c: Ditto. From-SVN: r204212
2013-10-30 15:27:25 +01:00
/* The number of the current element in IRA_PREFS. */
int n;
cgraph.h (cgraph_node_set_iterator, [...]): Remove typedef. * gcc/cgraph.h (cgraph_node_set_iterator, varpool_node_set_iterator): Remove typedef. (cgraph_inline_failed_enum, cgraph_inline_failed_t): Remove typedef and rename to cgraph_inline_failed_t. * gcc/tree-ssa-alias.h (ao_ref_s, ao_ref): Remove typedef and rename to ao_ref. * gcc/reload.h (reg_equivs_s, reg_equivs_t): Remove typedef and rename to reg_equivs_t. * gcc/conditions.h (CC_STATUS): Remove typedef. * gcc/bitmap.h (bitmap_obstack): Remove typedef. (bitmap_element_def, bitmap_element): Remove typedef and rename to bitmap_element. (bitmap_head_def, bitmap_head): Remove typedef and rename to bitmap_head. (bitmap_iterator): Remove typedef. * gcc/target.h (cumulative_args_t, print_switch_type, secondary_reload_info): Remove typedef. * gcc/dwarf2out.h (dw_cfi_oprnd_struct, dw_cfi_oprnd): Remove dw_cfi_oprnd_struct alias. (dw_cfi_struct, dw_cfi_node): Remove typedef and rename to dw_cfi_node. (dw_fde_struct, dw_fde_node): Remove typedef and rename to dw_fde_node. (cfa_loc, dw_cfa_location): Remove typedef and rename to dw_cfa_location. (dw_vec_struct, dw_vec_const): Remove typedef and rename to dw_vec_const. (dw_val_struct, dw_val_node): Remove typedef and rename to dw_val_node. (dw_loc_descr_struct, dw_loc_descr_node): Remove typedef and rename to dw_loc_descr_node. * gcc/params.h (param_info, compiler_param): Remove typedef. * gcc/opts.h (cl_deferred_param): Remove typedef. * gcc/sreal.h (sreal): Remove typedef. * gcc/ddg.h (dep_type, dep_data_type): Remove typedef. * gcc/graphite-clast-to-gimple.h (cloog_prog_clast, bb_pbb_def): Remove typedef. * gcc/lto-streamer.h (lto_decl_stream_e_t, lto_encoder_entry, lto_symtab_encoder_iterator, res_pair): Remove typedef. * gcc/tree-affine.h (affine_tree_combination, aff_tree): Remove typedef and rename to aff_tree. * gcc/sched-int.h (region): Remove typedef. * gcc/diagnostic.h (diagnostic_info, diagnostic_classification_change_t): Remove typedef. * gcc/tree-ssa-loop.h (affine_iv_d): Remove typedef and rename to affine_iv. * gcc/sbitmap.h (sbitmap_iterator): Remove typedef. * gcc/ssa-iterators.h (immediate_use_iterator_d, imm_use_iterator): Remove typedef and rename to imm_use_iterator. (ssa_operand_iterator_d, ssa_op_iter): Remove typedef and rename to ssa_op_iter. * gcc/ggc-internal.h (ggc_statistics): Remove typedef. * gcc/cselib.h (cselib_val_struct, cselib_val): Remove typedef and rename to cselib_val. * gcc/tree-core.h (alias_pair): Remove typedef. (constructor_elt_d, constructor_elt): Remove typedef and rename to constructor_elt. (ssa_use_operand_d, ssa_use_operand_t): Remove typedef and rename to ssa_use_operand_t. * gcc/graphite-sese-to-poly.h (base_alias_pair): Remove typedef. * gcc/tree-data-ref.h (conflict_function): Remove typedef. * gcc/tree-inline.h (copy_body_data): Remove typedef. * gcc/ipa-inline.h (condition, size_time_entry, inline_param_summary_t, edge_growth_cache_entry): Remove typedef. * gcc/regrename.h (operand_rr_info, insn_rr_info): Remove typedef. * gcc/gimple-iterator.h (gimple_stmt_iterator_d, gimple_stmt_iterator): Remove typedef and rename to gimple_stmt_iterator. * gcc/basic-block.h (ce_if_block, ce_if_block_t): Remove typedef and rename to ce_if_block. (edge_iterator): Remove typedef. * gcc/ipa-prop.h (ipa_agg_jf_item, ipa_agg_jf_item_t): Remove typedef and rename to ipa_agg_jf_item. (ipa_agg_jump_function_t, ipa_param_descriptor_t, ipa_node_params_t, ipa_parm_adjustment_t): Remove typedef. (ipa_jump_func, ipa_jump_func_t): Remove typedef and rename to ipa_jump_func. (ipa_edge_args, ipa_edge_args_t): Remove typedef and rename to ipa_edge_args. * gcc/gcov-io.h (gcov_bucket_type): Remove typedef. (gcov_working_set_info, gcov_working_set_t): Remove typedef and rename to gcov_working_set_t. * gcc/ira-int.h (minmax_set_iterator, ira_allocno_iterator, ira_object_iterator, ira_allocno_object_iterator, ira_pref_iterator, ira_copy_iterator, ira_object_conflict_iterator): Remove typedef. * gcc/tree-iterator.h (tree_stmt_iterator): Remove typedef. * gcc/rtl.h (addr_diff_vec_flags, mem_attrs, reg_attrs, replace_label_data): Remove typedef. (rtunion_def, rtunion): Remove typedef and rename to rtunion. * gcc/hard-reg-set.h (hard_reg_set_iterator): Remove typedef. * gcc/sel-sched-ir.h (_list_iterator, sel_global_bb_info_def, sel_region_bb_info_def, succ_iterator): Remove typedef. (deps_where_def, deps_where_t): Remove typedef and rename to deps_where_t. * gcc/coretypes.h: Adapt forward declarations. * gcc/tree-scalar-evolution.h: Likewise. * gcc/tree-ssa-address.h: Likewise. * gcc/tree-ssa-operands.h: Likewise. * gcc/function.h: Likewise. * gcc/config/frv/frv-protos.h: Likewise. * gcc/targhooks.h: Likewise. * gcc/basic_block.h: Likewise. * gcc/rtl.def: Adapt documentation. * gcc/doc/tm.texi: Likewise. * gcc/ipa-cp.c: Adapt uses. * gcc/bitmap.c: Likewise. * gcc/dwarf2out.c: Likewise. * gcc/target.def: Likewise. * gcc/ipa-inline-analysis.c: Likewise. * gcc/dwarf2cfi.c: Likewise. * gcc/tree-ssa-loop-ivopts.c: Likewise. * gcc/lto-cgraph.c: Likewise. * gcc/config/frv/frv.c: Likewise. * gcc/ifcvt.c: Likewise. * gcc/ipa-prop.c: Likewise. From-SVN: r205863
2013-12-10 17:48:44 +01:00
};
regmove.c: Remove. 2013-10-30 Vladimir Makarov <vmakarov@redhat.com> * regmove.c: Remove. * tree-pass.h (make_pass_regmove): Remove. * timevar.def (TV_REGMOVE): Remove. * passes.def (pass_regmove): Remove. * opts.c (default_options_table): Remove entry for regmove. * doc/passes.texi: Remove regmove pass description. * doc/invoke.texi (-foptimize-register-move, -fregmove): Remove options. (-fdump-rtl-regmove): Ditto. * common.opt (foptimize-register-move, fregmove): Ignore. * Makefile.in (OBJS): Remove regmove.o. * regmove.c: Remove. * ira-int.h (struct ira_allocno_pref, ira_pref_t): New structure and type. (struct ira_allocno) New member allocno_prefs. (ALLOCNO_PREFS): New macro. (ira_prefs, ira_prefs_num): New external vars. (ira_setup_alts, ira_get_dup_out_num, ira_debug_pref): New prototypes. (ira_debug_prefs, ira_debug_allocno_prefs, ira_create_pref): Ditto. (ira_add_allocno_pref, ira_remove_pref, ira_remove_allocno_prefs): Ditto. (ira_add_allocno_copy_to_list): Remove prototype. (ira_swap_allocno_copy_ends_if_necessary): Ditto. (ira_pref_iterator): New type. (ira_pref_iter_init, ira_pref_iter_cond): New functions. (FOR_EACH_PREF): New macro. * ira.c (commutative_constraint_p): Move from ira-conflicts.c. (ira_get_dup_out_num): Ditto. Rename from get_dup_num. Modify the code. (ira_setup_alts): New function. (decrease_live_ranges_number): New function. (ira): Call the above function. * ira-build.c (ira_prefs, ira_prefs_num): New global vars. (ira_create_allocno): Initialize allocno prefs. (pref_pool, pref_vec): New static vars. (initiate_prefs, find_allocno_pref, ira_create_pref): New functions. (add_allocno_pref_to_list, ira_add_allocno_pref, print_pref): Ditto. (ira_debug_pref, print_prefs, ira_debug_prefs): Ditto. (print_allocno_prefs, ira_debug_allocno_prefs, finish_pref): Ditto. (ira_remove_pref, ira_remove_allocno_prefs, finish_prefs): Ditto. (ira_add_allocno_copy_to_list): Make static. Rename to add_allocno_copy_to_list. (ira_swap_allocno_copy_ends_if_necessary): Make static. Rename to swap_allocno_copy_ends_if_necessary. (remove_unnecessary_allocnos, remove_low_level_allocnos): Call ira_remove_allocno_prefs. (ira_flattening): Ditto. (ira_build): Call initiate_prefs, print_prefs. (ira_destroy): Call finish_prefs. * ira-color.c (struct update_cost_record): New. (struct allocno_color_data): Add new member update_cost_records. (update_cost_record_pool): New static var. (init_update_cost_records, get_update_cost_record): New functions. (free_update_cost_record_list, finish_update_cost_records): Ditto. (struct update_cost_queue_elem): Add member from. (initiate_cost_update): Call init_update_cost_records. (finish_cost_update): Call finish_update_cost_records. (queue_update_cost, get_next_update_cost): Add new param from. (Update_allocno_cost, update_costs_from_allocno): New functions. (update_costs_from_prefs): Ditto. (update_copy_costs): Rename to update_costs_from_copies. (restore_costs_from_copies): New function. (update_conflict_hard_regno_costs): Don't go back. (assign_hard_reg): Call restore_costs_from_copies. Add printing more debug info. (pop_allocnos): Add priniting more debug info. (color_allocnos): Remove prefs for conflicting hard regs. Call update_costs_from_prefs. * ira-conflicts.c (commutative_constraint_p): Move to ira.c (get_dup_num): Rename, modify, and move to ira.c (process_regs_for_copy): Add prefs. (add_insn_allocno_copies): Put src as first arg of process_regs_for_copy. Remove dead code. Call ira_setup_alts. * ira-costs.c (record_reg_classes): Modify and move code into record_operands_costs. (find_costs_and_classes): Create prefs for the hard reg of small reg class. (process_bb_node_for_hard_reg_moves): Add prefs. 2013-10-30 Vladimir Makarov <vmakarov@redhat.com> * gcc.target/i386/fma_double_3.c: Use pattern for scan-assembler-times instead of just one insn name. * gcc.target/i386/fma_double_5.c: Ditto. * gcc.target/i386/fma_float_3.c: Ditto. * gcc.target/i386/fma_float_5.c: Ditto. * gcc.target/i386/l_fma_double_1.c: Ditto. * gcc.target/i386/l_fma_double_2.c: Ditto. * gcc.target/i386/l_fma_double_3.c: Ditto. * gcc.target/i386/l_fma_double_4.c: Ditto. * gcc.target/i386/l_fma_double_5.c: Ditto. * gcc.target/i386/l_fma_double_6.c: Ditto. * gcc.target/i386/l_fma_float_1.c: Ditto. * gcc.target/i386/l_fma_float_2.c: Ditto. * gcc.target/i386/l_fma_float_3.c: Ditto. * gcc.target/i386/l_fma_float_4.c: Ditto. * gcc.target/i386/l_fma_float_5.c: Ditto. * gcc.target/i386/l_fma_float_6.c: Ditto. From-SVN: r204212
2013-10-30 15:27:25 +01:00
/* Initialize the iterator I. */
static inline void
ira_pref_iter_init (ira_pref_iterator *i)
{
i->n = 0;
}
/* Return TRUE if we have more prefs to visit, in which case *PREF is
set to the pref to be visited. Otherwise, return FALSE. */
static inline bool
ira_pref_iter_cond (ira_pref_iterator *i, ira_pref_t *pref)
{
int n;
for (n = i->n; n < ira_prefs_num; n++)
if (ira_prefs[n] != NULL)
{
*pref = ira_prefs[n];
i->n = n + 1;
return true;
}
return false;
}
/* Loop over all prefs. In each iteration, P is set to the next
pref. ITER is an instance of ira_pref_iterator used to iterate
the prefs. */
#define FOR_EACH_PREF(P, ITER) \
for (ira_pref_iter_init (&(ITER)); \
ira_pref_iter_cond (&(ITER), &(P));)
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
/* The iterator for copies. */
cgraph.h (cgraph_node_set_iterator, [...]): Remove typedef. * gcc/cgraph.h (cgraph_node_set_iterator, varpool_node_set_iterator): Remove typedef. (cgraph_inline_failed_enum, cgraph_inline_failed_t): Remove typedef and rename to cgraph_inline_failed_t. * gcc/tree-ssa-alias.h (ao_ref_s, ao_ref): Remove typedef and rename to ao_ref. * gcc/reload.h (reg_equivs_s, reg_equivs_t): Remove typedef and rename to reg_equivs_t. * gcc/conditions.h (CC_STATUS): Remove typedef. * gcc/bitmap.h (bitmap_obstack): Remove typedef. (bitmap_element_def, bitmap_element): Remove typedef and rename to bitmap_element. (bitmap_head_def, bitmap_head): Remove typedef and rename to bitmap_head. (bitmap_iterator): Remove typedef. * gcc/target.h (cumulative_args_t, print_switch_type, secondary_reload_info): Remove typedef. * gcc/dwarf2out.h (dw_cfi_oprnd_struct, dw_cfi_oprnd): Remove dw_cfi_oprnd_struct alias. (dw_cfi_struct, dw_cfi_node): Remove typedef and rename to dw_cfi_node. (dw_fde_struct, dw_fde_node): Remove typedef and rename to dw_fde_node. (cfa_loc, dw_cfa_location): Remove typedef and rename to dw_cfa_location. (dw_vec_struct, dw_vec_const): Remove typedef and rename to dw_vec_const. (dw_val_struct, dw_val_node): Remove typedef and rename to dw_val_node. (dw_loc_descr_struct, dw_loc_descr_node): Remove typedef and rename to dw_loc_descr_node. * gcc/params.h (param_info, compiler_param): Remove typedef. * gcc/opts.h (cl_deferred_param): Remove typedef. * gcc/sreal.h (sreal): Remove typedef. * gcc/ddg.h (dep_type, dep_data_type): Remove typedef. * gcc/graphite-clast-to-gimple.h (cloog_prog_clast, bb_pbb_def): Remove typedef. * gcc/lto-streamer.h (lto_decl_stream_e_t, lto_encoder_entry, lto_symtab_encoder_iterator, res_pair): Remove typedef. * gcc/tree-affine.h (affine_tree_combination, aff_tree): Remove typedef and rename to aff_tree. * gcc/sched-int.h (region): Remove typedef. * gcc/diagnostic.h (diagnostic_info, diagnostic_classification_change_t): Remove typedef. * gcc/tree-ssa-loop.h (affine_iv_d): Remove typedef and rename to affine_iv. * gcc/sbitmap.h (sbitmap_iterator): Remove typedef. * gcc/ssa-iterators.h (immediate_use_iterator_d, imm_use_iterator): Remove typedef and rename to imm_use_iterator. (ssa_operand_iterator_d, ssa_op_iter): Remove typedef and rename to ssa_op_iter. * gcc/ggc-internal.h (ggc_statistics): Remove typedef. * gcc/cselib.h (cselib_val_struct, cselib_val): Remove typedef and rename to cselib_val. * gcc/tree-core.h (alias_pair): Remove typedef. (constructor_elt_d, constructor_elt): Remove typedef and rename to constructor_elt. (ssa_use_operand_d, ssa_use_operand_t): Remove typedef and rename to ssa_use_operand_t. * gcc/graphite-sese-to-poly.h (base_alias_pair): Remove typedef. * gcc/tree-data-ref.h (conflict_function): Remove typedef. * gcc/tree-inline.h (copy_body_data): Remove typedef. * gcc/ipa-inline.h (condition, size_time_entry, inline_param_summary_t, edge_growth_cache_entry): Remove typedef. * gcc/regrename.h (operand_rr_info, insn_rr_info): Remove typedef. * gcc/gimple-iterator.h (gimple_stmt_iterator_d, gimple_stmt_iterator): Remove typedef and rename to gimple_stmt_iterator. * gcc/basic-block.h (ce_if_block, ce_if_block_t): Remove typedef and rename to ce_if_block. (edge_iterator): Remove typedef. * gcc/ipa-prop.h (ipa_agg_jf_item, ipa_agg_jf_item_t): Remove typedef and rename to ipa_agg_jf_item. (ipa_agg_jump_function_t, ipa_param_descriptor_t, ipa_node_params_t, ipa_parm_adjustment_t): Remove typedef. (ipa_jump_func, ipa_jump_func_t): Remove typedef and rename to ipa_jump_func. (ipa_edge_args, ipa_edge_args_t): Remove typedef and rename to ipa_edge_args. * gcc/gcov-io.h (gcov_bucket_type): Remove typedef. (gcov_working_set_info, gcov_working_set_t): Remove typedef and rename to gcov_working_set_t. * gcc/ira-int.h (minmax_set_iterator, ira_allocno_iterator, ira_object_iterator, ira_allocno_object_iterator, ira_pref_iterator, ira_copy_iterator, ira_object_conflict_iterator): Remove typedef. * gcc/tree-iterator.h (tree_stmt_iterator): Remove typedef. * gcc/rtl.h (addr_diff_vec_flags, mem_attrs, reg_attrs, replace_label_data): Remove typedef. (rtunion_def, rtunion): Remove typedef and rename to rtunion. * gcc/hard-reg-set.h (hard_reg_set_iterator): Remove typedef. * gcc/sel-sched-ir.h (_list_iterator, sel_global_bb_info_def, sel_region_bb_info_def, succ_iterator): Remove typedef. (deps_where_def, deps_where_t): Remove typedef and rename to deps_where_t. * gcc/coretypes.h: Adapt forward declarations. * gcc/tree-scalar-evolution.h: Likewise. * gcc/tree-ssa-address.h: Likewise. * gcc/tree-ssa-operands.h: Likewise. * gcc/function.h: Likewise. * gcc/config/frv/frv-protos.h: Likewise. * gcc/targhooks.h: Likewise. * gcc/basic_block.h: Likewise. * gcc/rtl.def: Adapt documentation. * gcc/doc/tm.texi: Likewise. * gcc/ipa-cp.c: Adapt uses. * gcc/bitmap.c: Likewise. * gcc/dwarf2out.c: Likewise. * gcc/target.def: Likewise. * gcc/ipa-inline-analysis.c: Likewise. * gcc/dwarf2cfi.c: Likewise. * gcc/tree-ssa-loop-ivopts.c: Likewise. * gcc/lto-cgraph.c: Likewise. * gcc/config/frv/frv.c: Likewise. * gcc/ifcvt.c: Likewise. * gcc/ipa-prop.c: Likewise. From-SVN: r205863
2013-12-10 17:48:44 +01:00
struct ira_copy_iterator {
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
/* The number of the current element in IRA_COPIES. */
int n;
cgraph.h (cgraph_node_set_iterator, [...]): Remove typedef. * gcc/cgraph.h (cgraph_node_set_iterator, varpool_node_set_iterator): Remove typedef. (cgraph_inline_failed_enum, cgraph_inline_failed_t): Remove typedef and rename to cgraph_inline_failed_t. * gcc/tree-ssa-alias.h (ao_ref_s, ao_ref): Remove typedef and rename to ao_ref. * gcc/reload.h (reg_equivs_s, reg_equivs_t): Remove typedef and rename to reg_equivs_t. * gcc/conditions.h (CC_STATUS): Remove typedef. * gcc/bitmap.h (bitmap_obstack): Remove typedef. (bitmap_element_def, bitmap_element): Remove typedef and rename to bitmap_element. (bitmap_head_def, bitmap_head): Remove typedef and rename to bitmap_head. (bitmap_iterator): Remove typedef. * gcc/target.h (cumulative_args_t, print_switch_type, secondary_reload_info): Remove typedef. * gcc/dwarf2out.h (dw_cfi_oprnd_struct, dw_cfi_oprnd): Remove dw_cfi_oprnd_struct alias. (dw_cfi_struct, dw_cfi_node): Remove typedef and rename to dw_cfi_node. (dw_fde_struct, dw_fde_node): Remove typedef and rename to dw_fde_node. (cfa_loc, dw_cfa_location): Remove typedef and rename to dw_cfa_location. (dw_vec_struct, dw_vec_const): Remove typedef and rename to dw_vec_const. (dw_val_struct, dw_val_node): Remove typedef and rename to dw_val_node. (dw_loc_descr_struct, dw_loc_descr_node): Remove typedef and rename to dw_loc_descr_node. * gcc/params.h (param_info, compiler_param): Remove typedef. * gcc/opts.h (cl_deferred_param): Remove typedef. * gcc/sreal.h (sreal): Remove typedef. * gcc/ddg.h (dep_type, dep_data_type): Remove typedef. * gcc/graphite-clast-to-gimple.h (cloog_prog_clast, bb_pbb_def): Remove typedef. * gcc/lto-streamer.h (lto_decl_stream_e_t, lto_encoder_entry, lto_symtab_encoder_iterator, res_pair): Remove typedef. * gcc/tree-affine.h (affine_tree_combination, aff_tree): Remove typedef and rename to aff_tree. * gcc/sched-int.h (region): Remove typedef. * gcc/diagnostic.h (diagnostic_info, diagnostic_classification_change_t): Remove typedef. * gcc/tree-ssa-loop.h (affine_iv_d): Remove typedef and rename to affine_iv. * gcc/sbitmap.h (sbitmap_iterator): Remove typedef. * gcc/ssa-iterators.h (immediate_use_iterator_d, imm_use_iterator): Remove typedef and rename to imm_use_iterator. (ssa_operand_iterator_d, ssa_op_iter): Remove typedef and rename to ssa_op_iter. * gcc/ggc-internal.h (ggc_statistics): Remove typedef. * gcc/cselib.h (cselib_val_struct, cselib_val): Remove typedef and rename to cselib_val. * gcc/tree-core.h (alias_pair): Remove typedef. (constructor_elt_d, constructor_elt): Remove typedef and rename to constructor_elt. (ssa_use_operand_d, ssa_use_operand_t): Remove typedef and rename to ssa_use_operand_t. * gcc/graphite-sese-to-poly.h (base_alias_pair): Remove typedef. * gcc/tree-data-ref.h (conflict_function): Remove typedef. * gcc/tree-inline.h (copy_body_data): Remove typedef. * gcc/ipa-inline.h (condition, size_time_entry, inline_param_summary_t, edge_growth_cache_entry): Remove typedef. * gcc/regrename.h (operand_rr_info, insn_rr_info): Remove typedef. * gcc/gimple-iterator.h (gimple_stmt_iterator_d, gimple_stmt_iterator): Remove typedef and rename to gimple_stmt_iterator. * gcc/basic-block.h (ce_if_block, ce_if_block_t): Remove typedef and rename to ce_if_block. (edge_iterator): Remove typedef. * gcc/ipa-prop.h (ipa_agg_jf_item, ipa_agg_jf_item_t): Remove typedef and rename to ipa_agg_jf_item. (ipa_agg_jump_function_t, ipa_param_descriptor_t, ipa_node_params_t, ipa_parm_adjustment_t): Remove typedef. (ipa_jump_func, ipa_jump_func_t): Remove typedef and rename to ipa_jump_func. (ipa_edge_args, ipa_edge_args_t): Remove typedef and rename to ipa_edge_args. * gcc/gcov-io.h (gcov_bucket_type): Remove typedef. (gcov_working_set_info, gcov_working_set_t): Remove typedef and rename to gcov_working_set_t. * gcc/ira-int.h (minmax_set_iterator, ira_allocno_iterator, ira_object_iterator, ira_allocno_object_iterator, ira_pref_iterator, ira_copy_iterator, ira_object_conflict_iterator): Remove typedef. * gcc/tree-iterator.h (tree_stmt_iterator): Remove typedef. * gcc/rtl.h (addr_diff_vec_flags, mem_attrs, reg_attrs, replace_label_data): Remove typedef. (rtunion_def, rtunion): Remove typedef and rename to rtunion. * gcc/hard-reg-set.h (hard_reg_set_iterator): Remove typedef. * gcc/sel-sched-ir.h (_list_iterator, sel_global_bb_info_def, sel_region_bb_info_def, succ_iterator): Remove typedef. (deps_where_def, deps_where_t): Remove typedef and rename to deps_where_t. * gcc/coretypes.h: Adapt forward declarations. * gcc/tree-scalar-evolution.h: Likewise. * gcc/tree-ssa-address.h: Likewise. * gcc/tree-ssa-operands.h: Likewise. * gcc/function.h: Likewise. * gcc/config/frv/frv-protos.h: Likewise. * gcc/targhooks.h: Likewise. * gcc/basic_block.h: Likewise. * gcc/rtl.def: Adapt documentation. * gcc/doc/tm.texi: Likewise. * gcc/ipa-cp.c: Adapt uses. * gcc/bitmap.c: Likewise. * gcc/dwarf2out.c: Likewise. * gcc/target.def: Likewise. * gcc/ipa-inline-analysis.c: Likewise. * gcc/dwarf2cfi.c: Likewise. * gcc/tree-ssa-loop-ivopts.c: Likewise. * gcc/lto-cgraph.c: Likewise. * gcc/config/frv/frv.c: Likewise. * gcc/ifcvt.c: Likewise. * gcc/ipa-prop.c: Likewise. From-SVN: r205863
2013-12-10 17:48:44 +01:00
};
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
/* Initialize the iterator I. */
static inline void
ira_copy_iter_init (ira_copy_iterator *i)
{
i->n = 0;
}
/* Return TRUE if we have more copies to visit, in which case *CP is
set to the copy to be visited. Otherwise, return FALSE. */
static inline bool
ira_copy_iter_cond (ira_copy_iterator *i, ira_copy_t *cp)
{
int n;
for (n = i->n; n < ira_copies_num; n++)
if (ira_copies[n] != NULL)
{
*cp = ira_copies[n];
i->n = n + 1;
return true;
}
return false;
}
/* Loop over all copies. In each iteration, C is set to the next
copy. ITER is an instance of ira_copy_iterator used to iterate
the copies. */
#define FOR_EACH_COPY(C, ITER) \
for (ira_copy_iter_init (&(ITER)); \
ira_copy_iter_cond (&(ITER), &(C));)
ira-build.c (ira_create_object): New arg SUBWORD; all callers changed. * ira-build.c (ira_create_object): New arg SUBWORD; all callers changed. Initialize OBJECT_SUBWORD. (ira_create_allocno): Clear ALLOCNO_NUM_OBJECTS. (ira_create_allocno_objects): Renamed from ira_create_allocno_object; all callers changed. (merge_hard_reg_conflicts): Iterate over allocno subobjects. (finish_allocno): Likewise. (move_allocno_live_ranges, copy_allocno_live_ranges): Likewise. (remove_low_level_allocnos): Likewise. (update_bad_spill_attribute): Likewise. (setup_min_max_allocno_live_range_point): Likewise. (sort_conflict_id_map): Likewise. (ira_flattening): Likewise. Use ior_hard_reg_conflicts. (ior_hard_reg_conflicts): New function. (ior_allocate_object_conflicts): Renamed first argument to OBJ. (compress_conflict_vecs): Iterate over objects, not allocnos. (ira_add_live_range_to_object): New function. (object_range_compare_func): Renamed from allocno_range_compare_func. All callers changed. (setup_min_max_conflict_allocno_ids): For allocnos with multiple subobjects, widen the min/max range of the lowest-order object to potentially include all other such low-order objects. * ira.c (ira_bad_reload_regno_1): Iterate over allocno subobjects. (check_allocation): Likewise. Use more fine-grained tests for register conflicts. * ira-color.c (allocnos_have_intersected_live_ranges_p): Iterate over allocno subobjects. (assign_hard_reg): Keep multiple sets of conflicts. Make finer-grained choices about which bits to set in each set. Don't use ira_hard_reg_not_in_set_p, perform a more elaborate test for conflicts using the multiple sets we computed. (push_allocno_to_stack): Iterate over allocno subobjects. (all_conflicting_hard_regs_coalesced): New static function. (setup_allocno_available_regs_num): Use it. (setup_allocno_left_conflicts_size): Likewise. Iterate over allocno subobjects. (coalesced_allocno_conflict): Test subobject 0 in each allocno. (setup_allocno_priorities): Divide ALLOCNO_EXCESS_PRESSURE_POINTS_NUM by ALLOCNO_NUM_OBJECTS. (calculate_spill_cost): Likewise. (color_pass): Express if statement in a more normal way. (ira_reassign_conflict_allocnos): Iterate over allocno subobjects. (slot_coalesced_allocno_live_ranges_intersect_p): Likewise. (setup_slot_coalesced_allocno_live_ranges): Likewise. (allocno_reload_assign): Likewise. (ira_reassign_pseudos): Likewise. (fast_allocation): Likewise. * ira-conflicts.c (build_conflict_bit_table): Likewise. (print_allocno_conflicts): Likewise. (ira_build_conflicts): Likewise. (allocnos_conflict_for_copy_p): Renamed from allocnos_conflict_p. All callers changed. Test subword 0 of each allocno for conflicts. (build_object_conflicts): Renamed from build_allocno_conflicts. All callers changed. Iterate over allocno subobjects. * ira-emit.c (modify_move_list): Iterate over allocno subobjects. * ira-int.h (struct ira_allocno): New member. num_objects. Rename object to objects and change it into an array. (ALLOCNO_OBJECT): Add new argument N. (ALLOCNO_NUM_OBJECTS, OBJECT_SUBWORD): New macros. (ira_create_allocno_objects): Renamed from ira_create_allocno_object. (ior_hard_reg_conflicts): Declare. (ira_add_live_range_to_object): Declare. (ira_allocno_object_iterator): New. (ira_allocno_object_iter_init, ira_allocno_object_iter_cond): New. (FOR_EACH_ALLOCNO_OBJECT): New macro. * ira-lives.c (objects_live): Renamed from allocnos_live; all uses changed. (allocnos_processed): New sparseset. (make_object_born): Renamed from make_allocno_born; take an ira_object_t argument. All callers changed. (make_object_dead): Renamed from make_allocno_dead; take an ira_object t argument. All callers changed. (update_allocno_pressure_excess_length): Take an ira_obejct_t argument. All callers changed. (mark_pseudo_regno_live): Iterate over allocno subobjects. (mark_pseudo_regno_dead): Likewise. (mark_pseudo_regno_subword_live, mark_pseudo_regno_subword_dead): New functions. (mark_ref_live): Detect subword accesses and call mark_pseudo_regno_subword_live as appropriate. (mark_ref_dead): Likewise for mark_pseudo_regno_subword_dead. (process_bb_nodes_live): Deal with object-related updates first; set and test bits in allocnos_processed to avoid computing allocno statistics more than once. (create_start_finish_chains): Iterate over objects, not allocnos. (print_object_live_ranges): New function. (print_allocno_live_ranges): Use it. (ira_create_allocno_live_ranges): Allocate and free allocnos_processed and objects_live. From-SVN: r162418
2010-07-22 17:48:30 +02:00
/* The iterator for object conflicts. */
cgraph.h (cgraph_node_set_iterator, [...]): Remove typedef. * gcc/cgraph.h (cgraph_node_set_iterator, varpool_node_set_iterator): Remove typedef. (cgraph_inline_failed_enum, cgraph_inline_failed_t): Remove typedef and rename to cgraph_inline_failed_t. * gcc/tree-ssa-alias.h (ao_ref_s, ao_ref): Remove typedef and rename to ao_ref. * gcc/reload.h (reg_equivs_s, reg_equivs_t): Remove typedef and rename to reg_equivs_t. * gcc/conditions.h (CC_STATUS): Remove typedef. * gcc/bitmap.h (bitmap_obstack): Remove typedef. (bitmap_element_def, bitmap_element): Remove typedef and rename to bitmap_element. (bitmap_head_def, bitmap_head): Remove typedef and rename to bitmap_head. (bitmap_iterator): Remove typedef. * gcc/target.h (cumulative_args_t, print_switch_type, secondary_reload_info): Remove typedef. * gcc/dwarf2out.h (dw_cfi_oprnd_struct, dw_cfi_oprnd): Remove dw_cfi_oprnd_struct alias. (dw_cfi_struct, dw_cfi_node): Remove typedef and rename to dw_cfi_node. (dw_fde_struct, dw_fde_node): Remove typedef and rename to dw_fde_node. (cfa_loc, dw_cfa_location): Remove typedef and rename to dw_cfa_location. (dw_vec_struct, dw_vec_const): Remove typedef and rename to dw_vec_const. (dw_val_struct, dw_val_node): Remove typedef and rename to dw_val_node. (dw_loc_descr_struct, dw_loc_descr_node): Remove typedef and rename to dw_loc_descr_node. * gcc/params.h (param_info, compiler_param): Remove typedef. * gcc/opts.h (cl_deferred_param): Remove typedef. * gcc/sreal.h (sreal): Remove typedef. * gcc/ddg.h (dep_type, dep_data_type): Remove typedef. * gcc/graphite-clast-to-gimple.h (cloog_prog_clast, bb_pbb_def): Remove typedef. * gcc/lto-streamer.h (lto_decl_stream_e_t, lto_encoder_entry, lto_symtab_encoder_iterator, res_pair): Remove typedef. * gcc/tree-affine.h (affine_tree_combination, aff_tree): Remove typedef and rename to aff_tree. * gcc/sched-int.h (region): Remove typedef. * gcc/diagnostic.h (diagnostic_info, diagnostic_classification_change_t): Remove typedef. * gcc/tree-ssa-loop.h (affine_iv_d): Remove typedef and rename to affine_iv. * gcc/sbitmap.h (sbitmap_iterator): Remove typedef. * gcc/ssa-iterators.h (immediate_use_iterator_d, imm_use_iterator): Remove typedef and rename to imm_use_iterator. (ssa_operand_iterator_d, ssa_op_iter): Remove typedef and rename to ssa_op_iter. * gcc/ggc-internal.h (ggc_statistics): Remove typedef. * gcc/cselib.h (cselib_val_struct, cselib_val): Remove typedef and rename to cselib_val. * gcc/tree-core.h (alias_pair): Remove typedef. (constructor_elt_d, constructor_elt): Remove typedef and rename to constructor_elt. (ssa_use_operand_d, ssa_use_operand_t): Remove typedef and rename to ssa_use_operand_t. * gcc/graphite-sese-to-poly.h (base_alias_pair): Remove typedef. * gcc/tree-data-ref.h (conflict_function): Remove typedef. * gcc/tree-inline.h (copy_body_data): Remove typedef. * gcc/ipa-inline.h (condition, size_time_entry, inline_param_summary_t, edge_growth_cache_entry): Remove typedef. * gcc/regrename.h (operand_rr_info, insn_rr_info): Remove typedef. * gcc/gimple-iterator.h (gimple_stmt_iterator_d, gimple_stmt_iterator): Remove typedef and rename to gimple_stmt_iterator. * gcc/basic-block.h (ce_if_block, ce_if_block_t): Remove typedef and rename to ce_if_block. (edge_iterator): Remove typedef. * gcc/ipa-prop.h (ipa_agg_jf_item, ipa_agg_jf_item_t): Remove typedef and rename to ipa_agg_jf_item. (ipa_agg_jump_function_t, ipa_param_descriptor_t, ipa_node_params_t, ipa_parm_adjustment_t): Remove typedef. (ipa_jump_func, ipa_jump_func_t): Remove typedef and rename to ipa_jump_func. (ipa_edge_args, ipa_edge_args_t): Remove typedef and rename to ipa_edge_args. * gcc/gcov-io.h (gcov_bucket_type): Remove typedef. (gcov_working_set_info, gcov_working_set_t): Remove typedef and rename to gcov_working_set_t. * gcc/ira-int.h (minmax_set_iterator, ira_allocno_iterator, ira_object_iterator, ira_allocno_object_iterator, ira_pref_iterator, ira_copy_iterator, ira_object_conflict_iterator): Remove typedef. * gcc/tree-iterator.h (tree_stmt_iterator): Remove typedef. * gcc/rtl.h (addr_diff_vec_flags, mem_attrs, reg_attrs, replace_label_data): Remove typedef. (rtunion_def, rtunion): Remove typedef and rename to rtunion. * gcc/hard-reg-set.h (hard_reg_set_iterator): Remove typedef. * gcc/sel-sched-ir.h (_list_iterator, sel_global_bb_info_def, sel_region_bb_info_def, succ_iterator): Remove typedef. (deps_where_def, deps_where_t): Remove typedef and rename to deps_where_t. * gcc/coretypes.h: Adapt forward declarations. * gcc/tree-scalar-evolution.h: Likewise. * gcc/tree-ssa-address.h: Likewise. * gcc/tree-ssa-operands.h: Likewise. * gcc/function.h: Likewise. * gcc/config/frv/frv-protos.h: Likewise. * gcc/targhooks.h: Likewise. * gcc/basic_block.h: Likewise. * gcc/rtl.def: Adapt documentation. * gcc/doc/tm.texi: Likewise. * gcc/ipa-cp.c: Adapt uses. * gcc/bitmap.c: Likewise. * gcc/dwarf2out.c: Likewise. * gcc/target.def: Likewise. * gcc/ipa-inline-analysis.c: Likewise. * gcc/dwarf2cfi.c: Likewise. * gcc/tree-ssa-loop-ivopts.c: Likewise. * gcc/lto-cgraph.c: Likewise. * gcc/config/frv/frv.c: Likewise. * gcc/ifcvt.c: Likewise. * gcc/ipa-prop.c: Likewise. From-SVN: r205863
2013-12-10 17:48:44 +01:00
struct ira_object_conflict_iterator {
ira-build.c (ira_create_object): New arg SUBWORD; all callers changed. * ira-build.c (ira_create_object): New arg SUBWORD; all callers changed. Initialize OBJECT_SUBWORD. (ira_create_allocno): Clear ALLOCNO_NUM_OBJECTS. (ira_create_allocno_objects): Renamed from ira_create_allocno_object; all callers changed. (merge_hard_reg_conflicts): Iterate over allocno subobjects. (finish_allocno): Likewise. (move_allocno_live_ranges, copy_allocno_live_ranges): Likewise. (remove_low_level_allocnos): Likewise. (update_bad_spill_attribute): Likewise. (setup_min_max_allocno_live_range_point): Likewise. (sort_conflict_id_map): Likewise. (ira_flattening): Likewise. Use ior_hard_reg_conflicts. (ior_hard_reg_conflicts): New function. (ior_allocate_object_conflicts): Renamed first argument to OBJ. (compress_conflict_vecs): Iterate over objects, not allocnos. (ira_add_live_range_to_object): New function. (object_range_compare_func): Renamed from allocno_range_compare_func. All callers changed. (setup_min_max_conflict_allocno_ids): For allocnos with multiple subobjects, widen the min/max range of the lowest-order object to potentially include all other such low-order objects. * ira.c (ira_bad_reload_regno_1): Iterate over allocno subobjects. (check_allocation): Likewise. Use more fine-grained tests for register conflicts. * ira-color.c (allocnos_have_intersected_live_ranges_p): Iterate over allocno subobjects. (assign_hard_reg): Keep multiple sets of conflicts. Make finer-grained choices about which bits to set in each set. Don't use ira_hard_reg_not_in_set_p, perform a more elaborate test for conflicts using the multiple sets we computed. (push_allocno_to_stack): Iterate over allocno subobjects. (all_conflicting_hard_regs_coalesced): New static function. (setup_allocno_available_regs_num): Use it. (setup_allocno_left_conflicts_size): Likewise. Iterate over allocno subobjects. (coalesced_allocno_conflict): Test subobject 0 in each allocno. (setup_allocno_priorities): Divide ALLOCNO_EXCESS_PRESSURE_POINTS_NUM by ALLOCNO_NUM_OBJECTS. (calculate_spill_cost): Likewise. (color_pass): Express if statement in a more normal way. (ira_reassign_conflict_allocnos): Iterate over allocno subobjects. (slot_coalesced_allocno_live_ranges_intersect_p): Likewise. (setup_slot_coalesced_allocno_live_ranges): Likewise. (allocno_reload_assign): Likewise. (ira_reassign_pseudos): Likewise. (fast_allocation): Likewise. * ira-conflicts.c (build_conflict_bit_table): Likewise. (print_allocno_conflicts): Likewise. (ira_build_conflicts): Likewise. (allocnos_conflict_for_copy_p): Renamed from allocnos_conflict_p. All callers changed. Test subword 0 of each allocno for conflicts. (build_object_conflicts): Renamed from build_allocno_conflicts. All callers changed. Iterate over allocno subobjects. * ira-emit.c (modify_move_list): Iterate over allocno subobjects. * ira-int.h (struct ira_allocno): New member. num_objects. Rename object to objects and change it into an array. (ALLOCNO_OBJECT): Add new argument N. (ALLOCNO_NUM_OBJECTS, OBJECT_SUBWORD): New macros. (ira_create_allocno_objects): Renamed from ira_create_allocno_object. (ior_hard_reg_conflicts): Declare. (ira_add_live_range_to_object): Declare. (ira_allocno_object_iterator): New. (ira_allocno_object_iter_init, ira_allocno_object_iter_cond): New. (FOR_EACH_ALLOCNO_OBJECT): New macro. * ira-lives.c (objects_live): Renamed from allocnos_live; all uses changed. (allocnos_processed): New sparseset. (make_object_born): Renamed from make_allocno_born; take an ira_object_t argument. All callers changed. (make_object_dead): Renamed from make_allocno_dead; take an ira_object t argument. All callers changed. (update_allocno_pressure_excess_length): Take an ira_obejct_t argument. All callers changed. (mark_pseudo_regno_live): Iterate over allocno subobjects. (mark_pseudo_regno_dead): Likewise. (mark_pseudo_regno_subword_live, mark_pseudo_regno_subword_dead): New functions. (mark_ref_live): Detect subword accesses and call mark_pseudo_regno_subword_live as appropriate. (mark_ref_dead): Likewise for mark_pseudo_regno_subword_dead. (process_bb_nodes_live): Deal with object-related updates first; set and test bits in allocnos_processed to avoid computing allocno statistics more than once. (create_start_finish_chains): Iterate over objects, not allocnos. (print_object_live_ranges): New function. (print_allocno_live_ranges): Use it. (ira_create_allocno_live_ranges): Allocate and free allocnos_processed and objects_live. From-SVN: r162418
2010-07-22 17:48:30 +02:00
/* TRUE if the conflicts are represented by vector of allocnos. */
ira-int.h (struct ira_object): New. * ira-int.h (struct ira_object): New. (ira_object_t): New typedef. Add DEF_VEC_P and DEF_VEC_ALLOC_P for it. (struct ira_allocno): Remove members min, max, conflict_allocno_array, conflict_id, conflict_allocno_array_size, conflict_allocnos_num and conflict_vec_p. Add new member object. (OBJECT_CONFLICT_ARRAY, OBJECT_CONFLICT_VEC_P, OBJECT_NUM_CONFLICTS, OBJECT_CONFLICT_ARRAY_SIZE, OBJECT_CONFLICT_HARD_REGS, OBJECT_TOTAL_CONFLICT_HARD_REGS, OBJECT_MIN, OBJECT_MAX, OBJECT_CONFLICT_ID): Renamed from ALLOCNO_CONFLICT_ALLOCNO_ARRAY, ALLOCNO_CONFLICT_VEC_P, ALLOCNO_CONFLICT_ALLOCNOS_NUM, ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE, ALLOCNO_CONFLICT_HARD_REGS, ALLOCNO_TOTAL_CONFLICT_HARD_REGS) ALLOCNO_MIN, ALLOCNO_MAX, and ALLOCNO_CONFLICT_ID; now operate on an ira_object_t rather than ira_allocno_t. All uses changed. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_objects_num): Declare variable. (ira_create_allocno_object): Declare function. (ira_conflict_vector_profitable_p): Adjust prototype. (ira_allocate_conflict_vec): Renamed from ira_allocate_allocno_conflict_vec; first arg now ira_object_t. (ira_allocate_object_conflicts): Renamed from ira_allocate_allocno_conflicts; first arg now ira_object_t. (struct ira_object_iterator): New. (ira_object_iter_init, ira_object_iter_cond, FOR_EACH_OBJECT): New. (ira_allocno_conflict_iterator): Renamed member allocno_conflict_vec_p to conflict_vec_p. All uses changed. (ira_allocno_conflict_iter_init, ira_allocno_conflict_iter_cond): Changed to take into account that conflicts are now tracked for objects. * ira-conflicts.c (OBJECTS_CONFLICT_P): Renamed from CONFLICT_ALLOCNO_P. Args changed to accept ira_object_t. All uses changed. (allocnos_conflict_p): New static function. (collected_conflict_objects): Renamed from collected_allocno_objects; now a vector of ira_object_t. All uses changed. (build_conflict_bit_table): Changed to take into account that conflicts are now tracked for objects. (process_regs_for_copy, propagate_copies, build_allocno_conflicts) (print_allocno_conflicts, ira_build_conflicts): Likewise. * ira-color.c (assign_hard_reg, setup_allocno_available_regs_num) setup_allocno_left_conflicts_size, allocno_reload_assign, fast_allocation): Likewise. * ira-lives.c (make_hard_regno_born, make_allocno_born) process_single_reg_class_operands, process_bb_node_lives): Likewise. * ira-emit.c (modify_move_list, add_range_and_copies_from_move_list): Likewise. * ira-build.c (ira_objects_num): New variable. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_object_id_map_vec): Corresponding change. (object_pool): New static variable. (initiate_allocnos): Initialize it. (finish_allocnos): Free it. (ira_create_object, ira_create_allocno_object, create_allocno_objects): New functions. (ira_create_allocno): Don't set members that were removed. (ira_set_allocno_cover_class): Don't change conflict hard regs. (merge_hard_reg_conflicts): Changed to take into account that conflicts are now tracked for objects. (ira_conflict_vector_profitable_p, ira_allocate_conflict_vec, allocate_conflict_bit_vec, ira_allocate_object_conflicts, compress_conflict_vecs, remove_low_level_allocnos, ira_flattening, setup_min_max_allocno_live_range_point, allocno_range_compare_func, setup_min_max_conflict_allocno_ids, ): Likewise. ((add_to_conflicts): Renamed from add_to_allocno_conflicts, args changed to ira_object_t; all callers changed. (ira_add_conflict): Renamed from ira_add_allocno_conflict, args changed to ira_object_t, all callers changed. (clear_conflicts): Renamed from clear_allocno_conflicts, arg changed to ira_object_t, all callers changed. (conflict_check, curr_conflict_check_tick): Renamed from allocno_conflict_check and curr_allocno_conflict_check_tick; all uses changed. (compress_conflict_vec): Renamed from compress_allocno_conflict_vec, arg changed to ira_object_t, all callers changed. (create_cap_allocno): Call ira_create_allocno_object. (finish_allocno): Free the corresponding object. (sort_conflict_id_map): Renamed from sort_conflict_id_allocno_map; all callers changed. Adjusted for dealing with objects. (ira_build): Call create_allocno_objects after ira_costs. Adjusted for dealing with objects. * ira.c (ira_bad_reload_regno_1): Adjusted for dealing with objects. From-SVN: r162166
2010-07-14 03:53:35 +02:00
bool conflict_vec_p;
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
/* The conflict vector or conflict bit vector. */
void *vec;
/* The number of the current element in the vector (of type
ira-int.h (struct ira_object): New. * ira-int.h (struct ira_object): New. (ira_object_t): New typedef. Add DEF_VEC_P and DEF_VEC_ALLOC_P for it. (struct ira_allocno): Remove members min, max, conflict_allocno_array, conflict_id, conflict_allocno_array_size, conflict_allocnos_num and conflict_vec_p. Add new member object. (OBJECT_CONFLICT_ARRAY, OBJECT_CONFLICT_VEC_P, OBJECT_NUM_CONFLICTS, OBJECT_CONFLICT_ARRAY_SIZE, OBJECT_CONFLICT_HARD_REGS, OBJECT_TOTAL_CONFLICT_HARD_REGS, OBJECT_MIN, OBJECT_MAX, OBJECT_CONFLICT_ID): Renamed from ALLOCNO_CONFLICT_ALLOCNO_ARRAY, ALLOCNO_CONFLICT_VEC_P, ALLOCNO_CONFLICT_ALLOCNOS_NUM, ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE, ALLOCNO_CONFLICT_HARD_REGS, ALLOCNO_TOTAL_CONFLICT_HARD_REGS) ALLOCNO_MIN, ALLOCNO_MAX, and ALLOCNO_CONFLICT_ID; now operate on an ira_object_t rather than ira_allocno_t. All uses changed. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_objects_num): Declare variable. (ira_create_allocno_object): Declare function. (ira_conflict_vector_profitable_p): Adjust prototype. (ira_allocate_conflict_vec): Renamed from ira_allocate_allocno_conflict_vec; first arg now ira_object_t. (ira_allocate_object_conflicts): Renamed from ira_allocate_allocno_conflicts; first arg now ira_object_t. (struct ira_object_iterator): New. (ira_object_iter_init, ira_object_iter_cond, FOR_EACH_OBJECT): New. (ira_allocno_conflict_iterator): Renamed member allocno_conflict_vec_p to conflict_vec_p. All uses changed. (ira_allocno_conflict_iter_init, ira_allocno_conflict_iter_cond): Changed to take into account that conflicts are now tracked for objects. * ira-conflicts.c (OBJECTS_CONFLICT_P): Renamed from CONFLICT_ALLOCNO_P. Args changed to accept ira_object_t. All uses changed. (allocnos_conflict_p): New static function. (collected_conflict_objects): Renamed from collected_allocno_objects; now a vector of ira_object_t. All uses changed. (build_conflict_bit_table): Changed to take into account that conflicts are now tracked for objects. (process_regs_for_copy, propagate_copies, build_allocno_conflicts) (print_allocno_conflicts, ira_build_conflicts): Likewise. * ira-color.c (assign_hard_reg, setup_allocno_available_regs_num) setup_allocno_left_conflicts_size, allocno_reload_assign, fast_allocation): Likewise. * ira-lives.c (make_hard_regno_born, make_allocno_born) process_single_reg_class_operands, process_bb_node_lives): Likewise. * ira-emit.c (modify_move_list, add_range_and_copies_from_move_list): Likewise. * ira-build.c (ira_objects_num): New variable. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_object_id_map_vec): Corresponding change. (object_pool): New static variable. (initiate_allocnos): Initialize it. (finish_allocnos): Free it. (ira_create_object, ira_create_allocno_object, create_allocno_objects): New functions. (ira_create_allocno): Don't set members that were removed. (ira_set_allocno_cover_class): Don't change conflict hard regs. (merge_hard_reg_conflicts): Changed to take into account that conflicts are now tracked for objects. (ira_conflict_vector_profitable_p, ira_allocate_conflict_vec, allocate_conflict_bit_vec, ira_allocate_object_conflicts, compress_conflict_vecs, remove_low_level_allocnos, ira_flattening, setup_min_max_allocno_live_range_point, allocno_range_compare_func, setup_min_max_conflict_allocno_ids, ): Likewise. ((add_to_conflicts): Renamed from add_to_allocno_conflicts, args changed to ira_object_t; all callers changed. (ira_add_conflict): Renamed from ira_add_allocno_conflict, args changed to ira_object_t, all callers changed. (clear_conflicts): Renamed from clear_allocno_conflicts, arg changed to ira_object_t, all callers changed. (conflict_check, curr_conflict_check_tick): Renamed from allocno_conflict_check and curr_allocno_conflict_check_tick; all uses changed. (compress_conflict_vec): Renamed from compress_allocno_conflict_vec, arg changed to ira_object_t, all callers changed. (create_cap_allocno): Call ira_create_allocno_object. (finish_allocno): Free the corresponding object. (sort_conflict_id_map): Renamed from sort_conflict_id_allocno_map; all callers changed. Adjusted for dealing with objects. (ira_build): Call create_allocno_objects after ira_costs. Adjusted for dealing with objects. * ira.c (ira_bad_reload_regno_1): Adjusted for dealing with objects. From-SVN: r162166
2010-07-14 03:53:35 +02:00
ira_object_t or IRA_INT_TYPE). */
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
unsigned int word_num;
/* The bit vector size. It is defined only if
ira-int.h (struct ira_object): New. * ira-int.h (struct ira_object): New. (ira_object_t): New typedef. Add DEF_VEC_P and DEF_VEC_ALLOC_P for it. (struct ira_allocno): Remove members min, max, conflict_allocno_array, conflict_id, conflict_allocno_array_size, conflict_allocnos_num and conflict_vec_p. Add new member object. (OBJECT_CONFLICT_ARRAY, OBJECT_CONFLICT_VEC_P, OBJECT_NUM_CONFLICTS, OBJECT_CONFLICT_ARRAY_SIZE, OBJECT_CONFLICT_HARD_REGS, OBJECT_TOTAL_CONFLICT_HARD_REGS, OBJECT_MIN, OBJECT_MAX, OBJECT_CONFLICT_ID): Renamed from ALLOCNO_CONFLICT_ALLOCNO_ARRAY, ALLOCNO_CONFLICT_VEC_P, ALLOCNO_CONFLICT_ALLOCNOS_NUM, ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE, ALLOCNO_CONFLICT_HARD_REGS, ALLOCNO_TOTAL_CONFLICT_HARD_REGS) ALLOCNO_MIN, ALLOCNO_MAX, and ALLOCNO_CONFLICT_ID; now operate on an ira_object_t rather than ira_allocno_t. All uses changed. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_objects_num): Declare variable. (ira_create_allocno_object): Declare function. (ira_conflict_vector_profitable_p): Adjust prototype. (ira_allocate_conflict_vec): Renamed from ira_allocate_allocno_conflict_vec; first arg now ira_object_t. (ira_allocate_object_conflicts): Renamed from ira_allocate_allocno_conflicts; first arg now ira_object_t. (struct ira_object_iterator): New. (ira_object_iter_init, ira_object_iter_cond, FOR_EACH_OBJECT): New. (ira_allocno_conflict_iterator): Renamed member allocno_conflict_vec_p to conflict_vec_p. All uses changed. (ira_allocno_conflict_iter_init, ira_allocno_conflict_iter_cond): Changed to take into account that conflicts are now tracked for objects. * ira-conflicts.c (OBJECTS_CONFLICT_P): Renamed from CONFLICT_ALLOCNO_P. Args changed to accept ira_object_t. All uses changed. (allocnos_conflict_p): New static function. (collected_conflict_objects): Renamed from collected_allocno_objects; now a vector of ira_object_t. All uses changed. (build_conflict_bit_table): Changed to take into account that conflicts are now tracked for objects. (process_regs_for_copy, propagate_copies, build_allocno_conflicts) (print_allocno_conflicts, ira_build_conflicts): Likewise. * ira-color.c (assign_hard_reg, setup_allocno_available_regs_num) setup_allocno_left_conflicts_size, allocno_reload_assign, fast_allocation): Likewise. * ira-lives.c (make_hard_regno_born, make_allocno_born) process_single_reg_class_operands, process_bb_node_lives): Likewise. * ira-emit.c (modify_move_list, add_range_and_copies_from_move_list): Likewise. * ira-build.c (ira_objects_num): New variable. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_object_id_map_vec): Corresponding change. (object_pool): New static variable. (initiate_allocnos): Initialize it. (finish_allocnos): Free it. (ira_create_object, ira_create_allocno_object, create_allocno_objects): New functions. (ira_create_allocno): Don't set members that were removed. (ira_set_allocno_cover_class): Don't change conflict hard regs. (merge_hard_reg_conflicts): Changed to take into account that conflicts are now tracked for objects. (ira_conflict_vector_profitable_p, ira_allocate_conflict_vec, allocate_conflict_bit_vec, ira_allocate_object_conflicts, compress_conflict_vecs, remove_low_level_allocnos, ira_flattening, setup_min_max_allocno_live_range_point, allocno_range_compare_func, setup_min_max_conflict_allocno_ids, ): Likewise. ((add_to_conflicts): Renamed from add_to_allocno_conflicts, args changed to ira_object_t; all callers changed. (ira_add_conflict): Renamed from ira_add_allocno_conflict, args changed to ira_object_t, all callers changed. (clear_conflicts): Renamed from clear_allocno_conflicts, arg changed to ira_object_t, all callers changed. (conflict_check, curr_conflict_check_tick): Renamed from allocno_conflict_check and curr_allocno_conflict_check_tick; all uses changed. (compress_conflict_vec): Renamed from compress_allocno_conflict_vec, arg changed to ira_object_t, all callers changed. (create_cap_allocno): Call ira_create_allocno_object. (finish_allocno): Free the corresponding object. (sort_conflict_id_map): Renamed from sort_conflict_id_allocno_map; all callers changed. Adjusted for dealing with objects. (ira_build): Call create_allocno_objects after ira_costs. Adjusted for dealing with objects. * ira.c (ira_bad_reload_regno_1): Adjusted for dealing with objects. From-SVN: r162166
2010-07-14 03:53:35 +02:00
OBJECT_CONFLICT_VEC_P is FALSE. */
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
unsigned int size;
/* The current bit index of bit vector. It is defined only if
ira-int.h (struct ira_object): New. * ira-int.h (struct ira_object): New. (ira_object_t): New typedef. Add DEF_VEC_P and DEF_VEC_ALLOC_P for it. (struct ira_allocno): Remove members min, max, conflict_allocno_array, conflict_id, conflict_allocno_array_size, conflict_allocnos_num and conflict_vec_p. Add new member object. (OBJECT_CONFLICT_ARRAY, OBJECT_CONFLICT_VEC_P, OBJECT_NUM_CONFLICTS, OBJECT_CONFLICT_ARRAY_SIZE, OBJECT_CONFLICT_HARD_REGS, OBJECT_TOTAL_CONFLICT_HARD_REGS, OBJECT_MIN, OBJECT_MAX, OBJECT_CONFLICT_ID): Renamed from ALLOCNO_CONFLICT_ALLOCNO_ARRAY, ALLOCNO_CONFLICT_VEC_P, ALLOCNO_CONFLICT_ALLOCNOS_NUM, ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE, ALLOCNO_CONFLICT_HARD_REGS, ALLOCNO_TOTAL_CONFLICT_HARD_REGS) ALLOCNO_MIN, ALLOCNO_MAX, and ALLOCNO_CONFLICT_ID; now operate on an ira_object_t rather than ira_allocno_t. All uses changed. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_objects_num): Declare variable. (ira_create_allocno_object): Declare function. (ira_conflict_vector_profitable_p): Adjust prototype. (ira_allocate_conflict_vec): Renamed from ira_allocate_allocno_conflict_vec; first arg now ira_object_t. (ira_allocate_object_conflicts): Renamed from ira_allocate_allocno_conflicts; first arg now ira_object_t. (struct ira_object_iterator): New. (ira_object_iter_init, ira_object_iter_cond, FOR_EACH_OBJECT): New. (ira_allocno_conflict_iterator): Renamed member allocno_conflict_vec_p to conflict_vec_p. All uses changed. (ira_allocno_conflict_iter_init, ira_allocno_conflict_iter_cond): Changed to take into account that conflicts are now tracked for objects. * ira-conflicts.c (OBJECTS_CONFLICT_P): Renamed from CONFLICT_ALLOCNO_P. Args changed to accept ira_object_t. All uses changed. (allocnos_conflict_p): New static function. (collected_conflict_objects): Renamed from collected_allocno_objects; now a vector of ira_object_t. All uses changed. (build_conflict_bit_table): Changed to take into account that conflicts are now tracked for objects. (process_regs_for_copy, propagate_copies, build_allocno_conflicts) (print_allocno_conflicts, ira_build_conflicts): Likewise. * ira-color.c (assign_hard_reg, setup_allocno_available_regs_num) setup_allocno_left_conflicts_size, allocno_reload_assign, fast_allocation): Likewise. * ira-lives.c (make_hard_regno_born, make_allocno_born) process_single_reg_class_operands, process_bb_node_lives): Likewise. * ira-emit.c (modify_move_list, add_range_and_copies_from_move_list): Likewise. * ira-build.c (ira_objects_num): New variable. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_object_id_map_vec): Corresponding change. (object_pool): New static variable. (initiate_allocnos): Initialize it. (finish_allocnos): Free it. (ira_create_object, ira_create_allocno_object, create_allocno_objects): New functions. (ira_create_allocno): Don't set members that were removed. (ira_set_allocno_cover_class): Don't change conflict hard regs. (merge_hard_reg_conflicts): Changed to take into account that conflicts are now tracked for objects. (ira_conflict_vector_profitable_p, ira_allocate_conflict_vec, allocate_conflict_bit_vec, ira_allocate_object_conflicts, compress_conflict_vecs, remove_low_level_allocnos, ira_flattening, setup_min_max_allocno_live_range_point, allocno_range_compare_func, setup_min_max_conflict_allocno_ids, ): Likewise. ((add_to_conflicts): Renamed from add_to_allocno_conflicts, args changed to ira_object_t; all callers changed. (ira_add_conflict): Renamed from ira_add_allocno_conflict, args changed to ira_object_t, all callers changed. (clear_conflicts): Renamed from clear_allocno_conflicts, arg changed to ira_object_t, all callers changed. (conflict_check, curr_conflict_check_tick): Renamed from allocno_conflict_check and curr_allocno_conflict_check_tick; all uses changed. (compress_conflict_vec): Renamed from compress_allocno_conflict_vec, arg changed to ira_object_t, all callers changed. (create_cap_allocno): Call ira_create_allocno_object. (finish_allocno): Free the corresponding object. (sort_conflict_id_map): Renamed from sort_conflict_id_allocno_map; all callers changed. Adjusted for dealing with objects. (ira_build): Call create_allocno_objects after ira_costs. Adjusted for dealing with objects. * ira.c (ira_bad_reload_regno_1): Adjusted for dealing with objects. From-SVN: r162166
2010-07-14 03:53:35 +02:00
OBJECT_CONFLICT_VEC_P is FALSE. */
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
unsigned int bit_num;
ira-int.h (struct ira_object): New. * ira-int.h (struct ira_object): New. (ira_object_t): New typedef. Add DEF_VEC_P and DEF_VEC_ALLOC_P for it. (struct ira_allocno): Remove members min, max, conflict_allocno_array, conflict_id, conflict_allocno_array_size, conflict_allocnos_num and conflict_vec_p. Add new member object. (OBJECT_CONFLICT_ARRAY, OBJECT_CONFLICT_VEC_P, OBJECT_NUM_CONFLICTS, OBJECT_CONFLICT_ARRAY_SIZE, OBJECT_CONFLICT_HARD_REGS, OBJECT_TOTAL_CONFLICT_HARD_REGS, OBJECT_MIN, OBJECT_MAX, OBJECT_CONFLICT_ID): Renamed from ALLOCNO_CONFLICT_ALLOCNO_ARRAY, ALLOCNO_CONFLICT_VEC_P, ALLOCNO_CONFLICT_ALLOCNOS_NUM, ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE, ALLOCNO_CONFLICT_HARD_REGS, ALLOCNO_TOTAL_CONFLICT_HARD_REGS) ALLOCNO_MIN, ALLOCNO_MAX, and ALLOCNO_CONFLICT_ID; now operate on an ira_object_t rather than ira_allocno_t. All uses changed. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_objects_num): Declare variable. (ira_create_allocno_object): Declare function. (ira_conflict_vector_profitable_p): Adjust prototype. (ira_allocate_conflict_vec): Renamed from ira_allocate_allocno_conflict_vec; first arg now ira_object_t. (ira_allocate_object_conflicts): Renamed from ira_allocate_allocno_conflicts; first arg now ira_object_t. (struct ira_object_iterator): New. (ira_object_iter_init, ira_object_iter_cond, FOR_EACH_OBJECT): New. (ira_allocno_conflict_iterator): Renamed member allocno_conflict_vec_p to conflict_vec_p. All uses changed. (ira_allocno_conflict_iter_init, ira_allocno_conflict_iter_cond): Changed to take into account that conflicts are now tracked for objects. * ira-conflicts.c (OBJECTS_CONFLICT_P): Renamed from CONFLICT_ALLOCNO_P. Args changed to accept ira_object_t. All uses changed. (allocnos_conflict_p): New static function. (collected_conflict_objects): Renamed from collected_allocno_objects; now a vector of ira_object_t. All uses changed. (build_conflict_bit_table): Changed to take into account that conflicts are now tracked for objects. (process_regs_for_copy, propagate_copies, build_allocno_conflicts) (print_allocno_conflicts, ira_build_conflicts): Likewise. * ira-color.c (assign_hard_reg, setup_allocno_available_regs_num) setup_allocno_left_conflicts_size, allocno_reload_assign, fast_allocation): Likewise. * ira-lives.c (make_hard_regno_born, make_allocno_born) process_single_reg_class_operands, process_bb_node_lives): Likewise. * ira-emit.c (modify_move_list, add_range_and_copies_from_move_list): Likewise. * ira-build.c (ira_objects_num): New variable. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_object_id_map_vec): Corresponding change. (object_pool): New static variable. (initiate_allocnos): Initialize it. (finish_allocnos): Free it. (ira_create_object, ira_create_allocno_object, create_allocno_objects): New functions. (ira_create_allocno): Don't set members that were removed. (ira_set_allocno_cover_class): Don't change conflict hard regs. (merge_hard_reg_conflicts): Changed to take into account that conflicts are now tracked for objects. (ira_conflict_vector_profitable_p, ira_allocate_conflict_vec, allocate_conflict_bit_vec, ira_allocate_object_conflicts, compress_conflict_vecs, remove_low_level_allocnos, ira_flattening, setup_min_max_allocno_live_range_point, allocno_range_compare_func, setup_min_max_conflict_allocno_ids, ): Likewise. ((add_to_conflicts): Renamed from add_to_allocno_conflicts, args changed to ira_object_t; all callers changed. (ira_add_conflict): Renamed from ira_add_allocno_conflict, args changed to ira_object_t, all callers changed. (clear_conflicts): Renamed from clear_allocno_conflicts, arg changed to ira_object_t, all callers changed. (conflict_check, curr_conflict_check_tick): Renamed from allocno_conflict_check and curr_allocno_conflict_check_tick; all uses changed. (compress_conflict_vec): Renamed from compress_allocno_conflict_vec, arg changed to ira_object_t, all callers changed. (create_cap_allocno): Call ira_create_allocno_object. (finish_allocno): Free the corresponding object. (sort_conflict_id_map): Renamed from sort_conflict_id_allocno_map; all callers changed. Adjusted for dealing with objects. (ira_build): Call create_allocno_objects after ira_costs. Adjusted for dealing with objects. * ira.c (ira_bad_reload_regno_1): Adjusted for dealing with objects. From-SVN: r162166
2010-07-14 03:53:35 +02:00
/* The object id corresponding to the 1st bit of the bit vector. It
is defined only if OBJECT_CONFLICT_VEC_P is FALSE. */
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
int base_conflict_id;
/* The word of bit vector currently visited. It is defined only if
ira-int.h (struct ira_object): New. * ira-int.h (struct ira_object): New. (ira_object_t): New typedef. Add DEF_VEC_P and DEF_VEC_ALLOC_P for it. (struct ira_allocno): Remove members min, max, conflict_allocno_array, conflict_id, conflict_allocno_array_size, conflict_allocnos_num and conflict_vec_p. Add new member object. (OBJECT_CONFLICT_ARRAY, OBJECT_CONFLICT_VEC_P, OBJECT_NUM_CONFLICTS, OBJECT_CONFLICT_ARRAY_SIZE, OBJECT_CONFLICT_HARD_REGS, OBJECT_TOTAL_CONFLICT_HARD_REGS, OBJECT_MIN, OBJECT_MAX, OBJECT_CONFLICT_ID): Renamed from ALLOCNO_CONFLICT_ALLOCNO_ARRAY, ALLOCNO_CONFLICT_VEC_P, ALLOCNO_CONFLICT_ALLOCNOS_NUM, ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE, ALLOCNO_CONFLICT_HARD_REGS, ALLOCNO_TOTAL_CONFLICT_HARD_REGS) ALLOCNO_MIN, ALLOCNO_MAX, and ALLOCNO_CONFLICT_ID; now operate on an ira_object_t rather than ira_allocno_t. All uses changed. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_objects_num): Declare variable. (ira_create_allocno_object): Declare function. (ira_conflict_vector_profitable_p): Adjust prototype. (ira_allocate_conflict_vec): Renamed from ira_allocate_allocno_conflict_vec; first arg now ira_object_t. (ira_allocate_object_conflicts): Renamed from ira_allocate_allocno_conflicts; first arg now ira_object_t. (struct ira_object_iterator): New. (ira_object_iter_init, ira_object_iter_cond, FOR_EACH_OBJECT): New. (ira_allocno_conflict_iterator): Renamed member allocno_conflict_vec_p to conflict_vec_p. All uses changed. (ira_allocno_conflict_iter_init, ira_allocno_conflict_iter_cond): Changed to take into account that conflicts are now tracked for objects. * ira-conflicts.c (OBJECTS_CONFLICT_P): Renamed from CONFLICT_ALLOCNO_P. Args changed to accept ira_object_t. All uses changed. (allocnos_conflict_p): New static function. (collected_conflict_objects): Renamed from collected_allocno_objects; now a vector of ira_object_t. All uses changed. (build_conflict_bit_table): Changed to take into account that conflicts are now tracked for objects. (process_regs_for_copy, propagate_copies, build_allocno_conflicts) (print_allocno_conflicts, ira_build_conflicts): Likewise. * ira-color.c (assign_hard_reg, setup_allocno_available_regs_num) setup_allocno_left_conflicts_size, allocno_reload_assign, fast_allocation): Likewise. * ira-lives.c (make_hard_regno_born, make_allocno_born) process_single_reg_class_operands, process_bb_node_lives): Likewise. * ira-emit.c (modify_move_list, add_range_and_copies_from_move_list): Likewise. * ira-build.c (ira_objects_num): New variable. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_object_id_map_vec): Corresponding change. (object_pool): New static variable. (initiate_allocnos): Initialize it. (finish_allocnos): Free it. (ira_create_object, ira_create_allocno_object, create_allocno_objects): New functions. (ira_create_allocno): Don't set members that were removed. (ira_set_allocno_cover_class): Don't change conflict hard regs. (merge_hard_reg_conflicts): Changed to take into account that conflicts are now tracked for objects. (ira_conflict_vector_profitable_p, ira_allocate_conflict_vec, allocate_conflict_bit_vec, ira_allocate_object_conflicts, compress_conflict_vecs, remove_low_level_allocnos, ira_flattening, setup_min_max_allocno_live_range_point, allocno_range_compare_func, setup_min_max_conflict_allocno_ids, ): Likewise. ((add_to_conflicts): Renamed from add_to_allocno_conflicts, args changed to ira_object_t; all callers changed. (ira_add_conflict): Renamed from ira_add_allocno_conflict, args changed to ira_object_t, all callers changed. (clear_conflicts): Renamed from clear_allocno_conflicts, arg changed to ira_object_t, all callers changed. (conflict_check, curr_conflict_check_tick): Renamed from allocno_conflict_check and curr_allocno_conflict_check_tick; all uses changed. (compress_conflict_vec): Renamed from compress_allocno_conflict_vec, arg changed to ira_object_t, all callers changed. (create_cap_allocno): Call ira_create_allocno_object. (finish_allocno): Free the corresponding object. (sort_conflict_id_map): Renamed from sort_conflict_id_allocno_map; all callers changed. Adjusted for dealing with objects. (ira_build): Call create_allocno_objects after ira_costs. Adjusted for dealing with objects. * ira.c (ira_bad_reload_regno_1): Adjusted for dealing with objects. From-SVN: r162166
2010-07-14 03:53:35 +02:00
OBJECT_CONFLICT_VEC_P is FALSE. */
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
unsigned IRA_INT_TYPE word;
cgraph.h (cgraph_node_set_iterator, [...]): Remove typedef. * gcc/cgraph.h (cgraph_node_set_iterator, varpool_node_set_iterator): Remove typedef. (cgraph_inline_failed_enum, cgraph_inline_failed_t): Remove typedef and rename to cgraph_inline_failed_t. * gcc/tree-ssa-alias.h (ao_ref_s, ao_ref): Remove typedef and rename to ao_ref. * gcc/reload.h (reg_equivs_s, reg_equivs_t): Remove typedef and rename to reg_equivs_t. * gcc/conditions.h (CC_STATUS): Remove typedef. * gcc/bitmap.h (bitmap_obstack): Remove typedef. (bitmap_element_def, bitmap_element): Remove typedef and rename to bitmap_element. (bitmap_head_def, bitmap_head): Remove typedef and rename to bitmap_head. (bitmap_iterator): Remove typedef. * gcc/target.h (cumulative_args_t, print_switch_type, secondary_reload_info): Remove typedef. * gcc/dwarf2out.h (dw_cfi_oprnd_struct, dw_cfi_oprnd): Remove dw_cfi_oprnd_struct alias. (dw_cfi_struct, dw_cfi_node): Remove typedef and rename to dw_cfi_node. (dw_fde_struct, dw_fde_node): Remove typedef and rename to dw_fde_node. (cfa_loc, dw_cfa_location): Remove typedef and rename to dw_cfa_location. (dw_vec_struct, dw_vec_const): Remove typedef and rename to dw_vec_const. (dw_val_struct, dw_val_node): Remove typedef and rename to dw_val_node. (dw_loc_descr_struct, dw_loc_descr_node): Remove typedef and rename to dw_loc_descr_node. * gcc/params.h (param_info, compiler_param): Remove typedef. * gcc/opts.h (cl_deferred_param): Remove typedef. * gcc/sreal.h (sreal): Remove typedef. * gcc/ddg.h (dep_type, dep_data_type): Remove typedef. * gcc/graphite-clast-to-gimple.h (cloog_prog_clast, bb_pbb_def): Remove typedef. * gcc/lto-streamer.h (lto_decl_stream_e_t, lto_encoder_entry, lto_symtab_encoder_iterator, res_pair): Remove typedef. * gcc/tree-affine.h (affine_tree_combination, aff_tree): Remove typedef and rename to aff_tree. * gcc/sched-int.h (region): Remove typedef. * gcc/diagnostic.h (diagnostic_info, diagnostic_classification_change_t): Remove typedef. * gcc/tree-ssa-loop.h (affine_iv_d): Remove typedef and rename to affine_iv. * gcc/sbitmap.h (sbitmap_iterator): Remove typedef. * gcc/ssa-iterators.h (immediate_use_iterator_d, imm_use_iterator): Remove typedef and rename to imm_use_iterator. (ssa_operand_iterator_d, ssa_op_iter): Remove typedef and rename to ssa_op_iter. * gcc/ggc-internal.h (ggc_statistics): Remove typedef. * gcc/cselib.h (cselib_val_struct, cselib_val): Remove typedef and rename to cselib_val. * gcc/tree-core.h (alias_pair): Remove typedef. (constructor_elt_d, constructor_elt): Remove typedef and rename to constructor_elt. (ssa_use_operand_d, ssa_use_operand_t): Remove typedef and rename to ssa_use_operand_t. * gcc/graphite-sese-to-poly.h (base_alias_pair): Remove typedef. * gcc/tree-data-ref.h (conflict_function): Remove typedef. * gcc/tree-inline.h (copy_body_data): Remove typedef. * gcc/ipa-inline.h (condition, size_time_entry, inline_param_summary_t, edge_growth_cache_entry): Remove typedef. * gcc/regrename.h (operand_rr_info, insn_rr_info): Remove typedef. * gcc/gimple-iterator.h (gimple_stmt_iterator_d, gimple_stmt_iterator): Remove typedef and rename to gimple_stmt_iterator. * gcc/basic-block.h (ce_if_block, ce_if_block_t): Remove typedef and rename to ce_if_block. (edge_iterator): Remove typedef. * gcc/ipa-prop.h (ipa_agg_jf_item, ipa_agg_jf_item_t): Remove typedef and rename to ipa_agg_jf_item. (ipa_agg_jump_function_t, ipa_param_descriptor_t, ipa_node_params_t, ipa_parm_adjustment_t): Remove typedef. (ipa_jump_func, ipa_jump_func_t): Remove typedef and rename to ipa_jump_func. (ipa_edge_args, ipa_edge_args_t): Remove typedef and rename to ipa_edge_args. * gcc/gcov-io.h (gcov_bucket_type): Remove typedef. (gcov_working_set_info, gcov_working_set_t): Remove typedef and rename to gcov_working_set_t. * gcc/ira-int.h (minmax_set_iterator, ira_allocno_iterator, ira_object_iterator, ira_allocno_object_iterator, ira_pref_iterator, ira_copy_iterator, ira_object_conflict_iterator): Remove typedef. * gcc/tree-iterator.h (tree_stmt_iterator): Remove typedef. * gcc/rtl.h (addr_diff_vec_flags, mem_attrs, reg_attrs, replace_label_data): Remove typedef. (rtunion_def, rtunion): Remove typedef and rename to rtunion. * gcc/hard-reg-set.h (hard_reg_set_iterator): Remove typedef. * gcc/sel-sched-ir.h (_list_iterator, sel_global_bb_info_def, sel_region_bb_info_def, succ_iterator): Remove typedef. (deps_where_def, deps_where_t): Remove typedef and rename to deps_where_t. * gcc/coretypes.h: Adapt forward declarations. * gcc/tree-scalar-evolution.h: Likewise. * gcc/tree-ssa-address.h: Likewise. * gcc/tree-ssa-operands.h: Likewise. * gcc/function.h: Likewise. * gcc/config/frv/frv-protos.h: Likewise. * gcc/targhooks.h: Likewise. * gcc/basic_block.h: Likewise. * gcc/rtl.def: Adapt documentation. * gcc/doc/tm.texi: Likewise. * gcc/ipa-cp.c: Adapt uses. * gcc/bitmap.c: Likewise. * gcc/dwarf2out.c: Likewise. * gcc/target.def: Likewise. * gcc/ipa-inline-analysis.c: Likewise. * gcc/dwarf2cfi.c: Likewise. * gcc/tree-ssa-loop-ivopts.c: Likewise. * gcc/lto-cgraph.c: Likewise. * gcc/config/frv/frv.c: Likewise. * gcc/ifcvt.c: Likewise. * gcc/ipa-prop.c: Likewise. From-SVN: r205863
2013-12-10 17:48:44 +01:00
};
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
/* Initialize the iterator I with ALLOCNO conflicts. */
static inline void
ira_object_conflict_iter_init (ira_object_conflict_iterator *i,
ira_object_t obj)
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
{
ira-int.h (struct ira_object): New. * ira-int.h (struct ira_object): New. (ira_object_t): New typedef. Add DEF_VEC_P and DEF_VEC_ALLOC_P for it. (struct ira_allocno): Remove members min, max, conflict_allocno_array, conflict_id, conflict_allocno_array_size, conflict_allocnos_num and conflict_vec_p. Add new member object. (OBJECT_CONFLICT_ARRAY, OBJECT_CONFLICT_VEC_P, OBJECT_NUM_CONFLICTS, OBJECT_CONFLICT_ARRAY_SIZE, OBJECT_CONFLICT_HARD_REGS, OBJECT_TOTAL_CONFLICT_HARD_REGS, OBJECT_MIN, OBJECT_MAX, OBJECT_CONFLICT_ID): Renamed from ALLOCNO_CONFLICT_ALLOCNO_ARRAY, ALLOCNO_CONFLICT_VEC_P, ALLOCNO_CONFLICT_ALLOCNOS_NUM, ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE, ALLOCNO_CONFLICT_HARD_REGS, ALLOCNO_TOTAL_CONFLICT_HARD_REGS) ALLOCNO_MIN, ALLOCNO_MAX, and ALLOCNO_CONFLICT_ID; now operate on an ira_object_t rather than ira_allocno_t. All uses changed. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_objects_num): Declare variable. (ira_create_allocno_object): Declare function. (ira_conflict_vector_profitable_p): Adjust prototype. (ira_allocate_conflict_vec): Renamed from ira_allocate_allocno_conflict_vec; first arg now ira_object_t. (ira_allocate_object_conflicts): Renamed from ira_allocate_allocno_conflicts; first arg now ira_object_t. (struct ira_object_iterator): New. (ira_object_iter_init, ira_object_iter_cond, FOR_EACH_OBJECT): New. (ira_allocno_conflict_iterator): Renamed member allocno_conflict_vec_p to conflict_vec_p. All uses changed. (ira_allocno_conflict_iter_init, ira_allocno_conflict_iter_cond): Changed to take into account that conflicts are now tracked for objects. * ira-conflicts.c (OBJECTS_CONFLICT_P): Renamed from CONFLICT_ALLOCNO_P. Args changed to accept ira_object_t. All uses changed. (allocnos_conflict_p): New static function. (collected_conflict_objects): Renamed from collected_allocno_objects; now a vector of ira_object_t. All uses changed. (build_conflict_bit_table): Changed to take into account that conflicts are now tracked for objects. (process_regs_for_copy, propagate_copies, build_allocno_conflicts) (print_allocno_conflicts, ira_build_conflicts): Likewise. * ira-color.c (assign_hard_reg, setup_allocno_available_regs_num) setup_allocno_left_conflicts_size, allocno_reload_assign, fast_allocation): Likewise. * ira-lives.c (make_hard_regno_born, make_allocno_born) process_single_reg_class_operands, process_bb_node_lives): Likewise. * ira-emit.c (modify_move_list, add_range_and_copies_from_move_list): Likewise. * ira-build.c (ira_objects_num): New variable. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_object_id_map_vec): Corresponding change. (object_pool): New static variable. (initiate_allocnos): Initialize it. (finish_allocnos): Free it. (ira_create_object, ira_create_allocno_object, create_allocno_objects): New functions. (ira_create_allocno): Don't set members that were removed. (ira_set_allocno_cover_class): Don't change conflict hard regs. (merge_hard_reg_conflicts): Changed to take into account that conflicts are now tracked for objects. (ira_conflict_vector_profitable_p, ira_allocate_conflict_vec, allocate_conflict_bit_vec, ira_allocate_object_conflicts, compress_conflict_vecs, remove_low_level_allocnos, ira_flattening, setup_min_max_allocno_live_range_point, allocno_range_compare_func, setup_min_max_conflict_allocno_ids, ): Likewise. ((add_to_conflicts): Renamed from add_to_allocno_conflicts, args changed to ira_object_t; all callers changed. (ira_add_conflict): Renamed from ira_add_allocno_conflict, args changed to ira_object_t, all callers changed. (clear_conflicts): Renamed from clear_allocno_conflicts, arg changed to ira_object_t, all callers changed. (conflict_check, curr_conflict_check_tick): Renamed from allocno_conflict_check and curr_allocno_conflict_check_tick; all uses changed. (compress_conflict_vec): Renamed from compress_allocno_conflict_vec, arg changed to ira_object_t, all callers changed. (create_cap_allocno): Call ira_create_allocno_object. (finish_allocno): Free the corresponding object. (sort_conflict_id_map): Renamed from sort_conflict_id_allocno_map; all callers changed. Adjusted for dealing with objects. (ira_build): Call create_allocno_objects after ira_costs. Adjusted for dealing with objects. * ira.c (ira_bad_reload_regno_1): Adjusted for dealing with objects. From-SVN: r162166
2010-07-14 03:53:35 +02:00
i->conflict_vec_p = OBJECT_CONFLICT_VEC_P (obj);
i->vec = OBJECT_CONFLICT_ARRAY (obj);
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
i->word_num = 0;
ira-int.h (struct ira_object): New. * ira-int.h (struct ira_object): New. (ira_object_t): New typedef. Add DEF_VEC_P and DEF_VEC_ALLOC_P for it. (struct ira_allocno): Remove members min, max, conflict_allocno_array, conflict_id, conflict_allocno_array_size, conflict_allocnos_num and conflict_vec_p. Add new member object. (OBJECT_CONFLICT_ARRAY, OBJECT_CONFLICT_VEC_P, OBJECT_NUM_CONFLICTS, OBJECT_CONFLICT_ARRAY_SIZE, OBJECT_CONFLICT_HARD_REGS, OBJECT_TOTAL_CONFLICT_HARD_REGS, OBJECT_MIN, OBJECT_MAX, OBJECT_CONFLICT_ID): Renamed from ALLOCNO_CONFLICT_ALLOCNO_ARRAY, ALLOCNO_CONFLICT_VEC_P, ALLOCNO_CONFLICT_ALLOCNOS_NUM, ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE, ALLOCNO_CONFLICT_HARD_REGS, ALLOCNO_TOTAL_CONFLICT_HARD_REGS) ALLOCNO_MIN, ALLOCNO_MAX, and ALLOCNO_CONFLICT_ID; now operate on an ira_object_t rather than ira_allocno_t. All uses changed. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_objects_num): Declare variable. (ira_create_allocno_object): Declare function. (ira_conflict_vector_profitable_p): Adjust prototype. (ira_allocate_conflict_vec): Renamed from ira_allocate_allocno_conflict_vec; first arg now ira_object_t. (ira_allocate_object_conflicts): Renamed from ira_allocate_allocno_conflicts; first arg now ira_object_t. (struct ira_object_iterator): New. (ira_object_iter_init, ira_object_iter_cond, FOR_EACH_OBJECT): New. (ira_allocno_conflict_iterator): Renamed member allocno_conflict_vec_p to conflict_vec_p. All uses changed. (ira_allocno_conflict_iter_init, ira_allocno_conflict_iter_cond): Changed to take into account that conflicts are now tracked for objects. * ira-conflicts.c (OBJECTS_CONFLICT_P): Renamed from CONFLICT_ALLOCNO_P. Args changed to accept ira_object_t. All uses changed. (allocnos_conflict_p): New static function. (collected_conflict_objects): Renamed from collected_allocno_objects; now a vector of ira_object_t. All uses changed. (build_conflict_bit_table): Changed to take into account that conflicts are now tracked for objects. (process_regs_for_copy, propagate_copies, build_allocno_conflicts) (print_allocno_conflicts, ira_build_conflicts): Likewise. * ira-color.c (assign_hard_reg, setup_allocno_available_regs_num) setup_allocno_left_conflicts_size, allocno_reload_assign, fast_allocation): Likewise. * ira-lives.c (make_hard_regno_born, make_allocno_born) process_single_reg_class_operands, process_bb_node_lives): Likewise. * ira-emit.c (modify_move_list, add_range_and_copies_from_move_list): Likewise. * ira-build.c (ira_objects_num): New variable. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_object_id_map_vec): Corresponding change. (object_pool): New static variable. (initiate_allocnos): Initialize it. (finish_allocnos): Free it. (ira_create_object, ira_create_allocno_object, create_allocno_objects): New functions. (ira_create_allocno): Don't set members that were removed. (ira_set_allocno_cover_class): Don't change conflict hard regs. (merge_hard_reg_conflicts): Changed to take into account that conflicts are now tracked for objects. (ira_conflict_vector_profitable_p, ira_allocate_conflict_vec, allocate_conflict_bit_vec, ira_allocate_object_conflicts, compress_conflict_vecs, remove_low_level_allocnos, ira_flattening, setup_min_max_allocno_live_range_point, allocno_range_compare_func, setup_min_max_conflict_allocno_ids, ): Likewise. ((add_to_conflicts): Renamed from add_to_allocno_conflicts, args changed to ira_object_t; all callers changed. (ira_add_conflict): Renamed from ira_add_allocno_conflict, args changed to ira_object_t, all callers changed. (clear_conflicts): Renamed from clear_allocno_conflicts, arg changed to ira_object_t, all callers changed. (conflict_check, curr_conflict_check_tick): Renamed from allocno_conflict_check and curr_allocno_conflict_check_tick; all uses changed. (compress_conflict_vec): Renamed from compress_allocno_conflict_vec, arg changed to ira_object_t, all callers changed. (create_cap_allocno): Call ira_create_allocno_object. (finish_allocno): Free the corresponding object. (sort_conflict_id_map): Renamed from sort_conflict_id_allocno_map; all callers changed. Adjusted for dealing with objects. (ira_build): Call create_allocno_objects after ira_costs. Adjusted for dealing with objects. * ira.c (ira_bad_reload_regno_1): Adjusted for dealing with objects. From-SVN: r162166
2010-07-14 03:53:35 +02:00
if (i->conflict_vec_p)
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
i->size = i->bit_num = i->base_conflict_id = i->word = 0;
else
{
ira-int.h (struct ira_object): New. * ira-int.h (struct ira_object): New. (ira_object_t): New typedef. Add DEF_VEC_P and DEF_VEC_ALLOC_P for it. (struct ira_allocno): Remove members min, max, conflict_allocno_array, conflict_id, conflict_allocno_array_size, conflict_allocnos_num and conflict_vec_p. Add new member object. (OBJECT_CONFLICT_ARRAY, OBJECT_CONFLICT_VEC_P, OBJECT_NUM_CONFLICTS, OBJECT_CONFLICT_ARRAY_SIZE, OBJECT_CONFLICT_HARD_REGS, OBJECT_TOTAL_CONFLICT_HARD_REGS, OBJECT_MIN, OBJECT_MAX, OBJECT_CONFLICT_ID): Renamed from ALLOCNO_CONFLICT_ALLOCNO_ARRAY, ALLOCNO_CONFLICT_VEC_P, ALLOCNO_CONFLICT_ALLOCNOS_NUM, ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE, ALLOCNO_CONFLICT_HARD_REGS, ALLOCNO_TOTAL_CONFLICT_HARD_REGS) ALLOCNO_MIN, ALLOCNO_MAX, and ALLOCNO_CONFLICT_ID; now operate on an ira_object_t rather than ira_allocno_t. All uses changed. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_objects_num): Declare variable. (ira_create_allocno_object): Declare function. (ira_conflict_vector_profitable_p): Adjust prototype. (ira_allocate_conflict_vec): Renamed from ira_allocate_allocno_conflict_vec; first arg now ira_object_t. (ira_allocate_object_conflicts): Renamed from ira_allocate_allocno_conflicts; first arg now ira_object_t. (struct ira_object_iterator): New. (ira_object_iter_init, ira_object_iter_cond, FOR_EACH_OBJECT): New. (ira_allocno_conflict_iterator): Renamed member allocno_conflict_vec_p to conflict_vec_p. All uses changed. (ira_allocno_conflict_iter_init, ira_allocno_conflict_iter_cond): Changed to take into account that conflicts are now tracked for objects. * ira-conflicts.c (OBJECTS_CONFLICT_P): Renamed from CONFLICT_ALLOCNO_P. Args changed to accept ira_object_t. All uses changed. (allocnos_conflict_p): New static function. (collected_conflict_objects): Renamed from collected_allocno_objects; now a vector of ira_object_t. All uses changed. (build_conflict_bit_table): Changed to take into account that conflicts are now tracked for objects. (process_regs_for_copy, propagate_copies, build_allocno_conflicts) (print_allocno_conflicts, ira_build_conflicts): Likewise. * ira-color.c (assign_hard_reg, setup_allocno_available_regs_num) setup_allocno_left_conflicts_size, allocno_reload_assign, fast_allocation): Likewise. * ira-lives.c (make_hard_regno_born, make_allocno_born) process_single_reg_class_operands, process_bb_node_lives): Likewise. * ira-emit.c (modify_move_list, add_range_and_copies_from_move_list): Likewise. * ira-build.c (ira_objects_num): New variable. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_object_id_map_vec): Corresponding change. (object_pool): New static variable. (initiate_allocnos): Initialize it. (finish_allocnos): Free it. (ira_create_object, ira_create_allocno_object, create_allocno_objects): New functions. (ira_create_allocno): Don't set members that were removed. (ira_set_allocno_cover_class): Don't change conflict hard regs. (merge_hard_reg_conflicts): Changed to take into account that conflicts are now tracked for objects. (ira_conflict_vector_profitable_p, ira_allocate_conflict_vec, allocate_conflict_bit_vec, ira_allocate_object_conflicts, compress_conflict_vecs, remove_low_level_allocnos, ira_flattening, setup_min_max_allocno_live_range_point, allocno_range_compare_func, setup_min_max_conflict_allocno_ids, ): Likewise. ((add_to_conflicts): Renamed from add_to_allocno_conflicts, args changed to ira_object_t; all callers changed. (ira_add_conflict): Renamed from ira_add_allocno_conflict, args changed to ira_object_t, all callers changed. (clear_conflicts): Renamed from clear_allocno_conflicts, arg changed to ira_object_t, all callers changed. (conflict_check, curr_conflict_check_tick): Renamed from allocno_conflict_check and curr_allocno_conflict_check_tick; all uses changed. (compress_conflict_vec): Renamed from compress_allocno_conflict_vec, arg changed to ira_object_t, all callers changed. (create_cap_allocno): Call ira_create_allocno_object. (finish_allocno): Free the corresponding object. (sort_conflict_id_map): Renamed from sort_conflict_id_allocno_map; all callers changed. Adjusted for dealing with objects. (ira_build): Call create_allocno_objects after ira_costs. Adjusted for dealing with objects. * ira.c (ira_bad_reload_regno_1): Adjusted for dealing with objects. From-SVN: r162166
2010-07-14 03:53:35 +02:00
if (OBJECT_MIN (obj) > OBJECT_MAX (obj))
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
i->size = 0;
else
ira-int.h (struct ira_object): New. * ira-int.h (struct ira_object): New. (ira_object_t): New typedef. Add DEF_VEC_P and DEF_VEC_ALLOC_P for it. (struct ira_allocno): Remove members min, max, conflict_allocno_array, conflict_id, conflict_allocno_array_size, conflict_allocnos_num and conflict_vec_p. Add new member object. (OBJECT_CONFLICT_ARRAY, OBJECT_CONFLICT_VEC_P, OBJECT_NUM_CONFLICTS, OBJECT_CONFLICT_ARRAY_SIZE, OBJECT_CONFLICT_HARD_REGS, OBJECT_TOTAL_CONFLICT_HARD_REGS, OBJECT_MIN, OBJECT_MAX, OBJECT_CONFLICT_ID): Renamed from ALLOCNO_CONFLICT_ALLOCNO_ARRAY, ALLOCNO_CONFLICT_VEC_P, ALLOCNO_CONFLICT_ALLOCNOS_NUM, ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE, ALLOCNO_CONFLICT_HARD_REGS, ALLOCNO_TOTAL_CONFLICT_HARD_REGS) ALLOCNO_MIN, ALLOCNO_MAX, and ALLOCNO_CONFLICT_ID; now operate on an ira_object_t rather than ira_allocno_t. All uses changed. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_objects_num): Declare variable. (ira_create_allocno_object): Declare function. (ira_conflict_vector_profitable_p): Adjust prototype. (ira_allocate_conflict_vec): Renamed from ira_allocate_allocno_conflict_vec; first arg now ira_object_t. (ira_allocate_object_conflicts): Renamed from ira_allocate_allocno_conflicts; first arg now ira_object_t. (struct ira_object_iterator): New. (ira_object_iter_init, ira_object_iter_cond, FOR_EACH_OBJECT): New. (ira_allocno_conflict_iterator): Renamed member allocno_conflict_vec_p to conflict_vec_p. All uses changed. (ira_allocno_conflict_iter_init, ira_allocno_conflict_iter_cond): Changed to take into account that conflicts are now tracked for objects. * ira-conflicts.c (OBJECTS_CONFLICT_P): Renamed from CONFLICT_ALLOCNO_P. Args changed to accept ira_object_t. All uses changed. (allocnos_conflict_p): New static function. (collected_conflict_objects): Renamed from collected_allocno_objects; now a vector of ira_object_t. All uses changed. (build_conflict_bit_table): Changed to take into account that conflicts are now tracked for objects. (process_regs_for_copy, propagate_copies, build_allocno_conflicts) (print_allocno_conflicts, ira_build_conflicts): Likewise. * ira-color.c (assign_hard_reg, setup_allocno_available_regs_num) setup_allocno_left_conflicts_size, allocno_reload_assign, fast_allocation): Likewise. * ira-lives.c (make_hard_regno_born, make_allocno_born) process_single_reg_class_operands, process_bb_node_lives): Likewise. * ira-emit.c (modify_move_list, add_range_and_copies_from_move_list): Likewise. * ira-build.c (ira_objects_num): New variable. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_object_id_map_vec): Corresponding change. (object_pool): New static variable. (initiate_allocnos): Initialize it. (finish_allocnos): Free it. (ira_create_object, ira_create_allocno_object, create_allocno_objects): New functions. (ira_create_allocno): Don't set members that were removed. (ira_set_allocno_cover_class): Don't change conflict hard regs. (merge_hard_reg_conflicts): Changed to take into account that conflicts are now tracked for objects. (ira_conflict_vector_profitable_p, ira_allocate_conflict_vec, allocate_conflict_bit_vec, ira_allocate_object_conflicts, compress_conflict_vecs, remove_low_level_allocnos, ira_flattening, setup_min_max_allocno_live_range_point, allocno_range_compare_func, setup_min_max_conflict_allocno_ids, ): Likewise. ((add_to_conflicts): Renamed from add_to_allocno_conflicts, args changed to ira_object_t; all callers changed. (ira_add_conflict): Renamed from ira_add_allocno_conflict, args changed to ira_object_t, all callers changed. (clear_conflicts): Renamed from clear_allocno_conflicts, arg changed to ira_object_t, all callers changed. (conflict_check, curr_conflict_check_tick): Renamed from allocno_conflict_check and curr_allocno_conflict_check_tick; all uses changed. (compress_conflict_vec): Renamed from compress_allocno_conflict_vec, arg changed to ira_object_t, all callers changed. (create_cap_allocno): Call ira_create_allocno_object. (finish_allocno): Free the corresponding object. (sort_conflict_id_map): Renamed from sort_conflict_id_allocno_map; all callers changed. Adjusted for dealing with objects. (ira_build): Call create_allocno_objects after ira_costs. Adjusted for dealing with objects. * ira.c (ira_bad_reload_regno_1): Adjusted for dealing with objects. From-SVN: r162166
2010-07-14 03:53:35 +02:00
i->size = ((OBJECT_MAX (obj) - OBJECT_MIN (obj)
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
+ IRA_INT_BITS)
/ IRA_INT_BITS) * sizeof (IRA_INT_TYPE);
i->bit_num = 0;
ira-int.h (struct ira_object): New. * ira-int.h (struct ira_object): New. (ira_object_t): New typedef. Add DEF_VEC_P and DEF_VEC_ALLOC_P for it. (struct ira_allocno): Remove members min, max, conflict_allocno_array, conflict_id, conflict_allocno_array_size, conflict_allocnos_num and conflict_vec_p. Add new member object. (OBJECT_CONFLICT_ARRAY, OBJECT_CONFLICT_VEC_P, OBJECT_NUM_CONFLICTS, OBJECT_CONFLICT_ARRAY_SIZE, OBJECT_CONFLICT_HARD_REGS, OBJECT_TOTAL_CONFLICT_HARD_REGS, OBJECT_MIN, OBJECT_MAX, OBJECT_CONFLICT_ID): Renamed from ALLOCNO_CONFLICT_ALLOCNO_ARRAY, ALLOCNO_CONFLICT_VEC_P, ALLOCNO_CONFLICT_ALLOCNOS_NUM, ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE, ALLOCNO_CONFLICT_HARD_REGS, ALLOCNO_TOTAL_CONFLICT_HARD_REGS) ALLOCNO_MIN, ALLOCNO_MAX, and ALLOCNO_CONFLICT_ID; now operate on an ira_object_t rather than ira_allocno_t. All uses changed. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_objects_num): Declare variable. (ira_create_allocno_object): Declare function. (ira_conflict_vector_profitable_p): Adjust prototype. (ira_allocate_conflict_vec): Renamed from ira_allocate_allocno_conflict_vec; first arg now ira_object_t. (ira_allocate_object_conflicts): Renamed from ira_allocate_allocno_conflicts; first arg now ira_object_t. (struct ira_object_iterator): New. (ira_object_iter_init, ira_object_iter_cond, FOR_EACH_OBJECT): New. (ira_allocno_conflict_iterator): Renamed member allocno_conflict_vec_p to conflict_vec_p. All uses changed. (ira_allocno_conflict_iter_init, ira_allocno_conflict_iter_cond): Changed to take into account that conflicts are now tracked for objects. * ira-conflicts.c (OBJECTS_CONFLICT_P): Renamed from CONFLICT_ALLOCNO_P. Args changed to accept ira_object_t. All uses changed. (allocnos_conflict_p): New static function. (collected_conflict_objects): Renamed from collected_allocno_objects; now a vector of ira_object_t. All uses changed. (build_conflict_bit_table): Changed to take into account that conflicts are now tracked for objects. (process_regs_for_copy, propagate_copies, build_allocno_conflicts) (print_allocno_conflicts, ira_build_conflicts): Likewise. * ira-color.c (assign_hard_reg, setup_allocno_available_regs_num) setup_allocno_left_conflicts_size, allocno_reload_assign, fast_allocation): Likewise. * ira-lives.c (make_hard_regno_born, make_allocno_born) process_single_reg_class_operands, process_bb_node_lives): Likewise. * ira-emit.c (modify_move_list, add_range_and_copies_from_move_list): Likewise. * ira-build.c (ira_objects_num): New variable. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_object_id_map_vec): Corresponding change. (object_pool): New static variable. (initiate_allocnos): Initialize it. (finish_allocnos): Free it. (ira_create_object, ira_create_allocno_object, create_allocno_objects): New functions. (ira_create_allocno): Don't set members that were removed. (ira_set_allocno_cover_class): Don't change conflict hard regs. (merge_hard_reg_conflicts): Changed to take into account that conflicts are now tracked for objects. (ira_conflict_vector_profitable_p, ira_allocate_conflict_vec, allocate_conflict_bit_vec, ira_allocate_object_conflicts, compress_conflict_vecs, remove_low_level_allocnos, ira_flattening, setup_min_max_allocno_live_range_point, allocno_range_compare_func, setup_min_max_conflict_allocno_ids, ): Likewise. ((add_to_conflicts): Renamed from add_to_allocno_conflicts, args changed to ira_object_t; all callers changed. (ira_add_conflict): Renamed from ira_add_allocno_conflict, args changed to ira_object_t, all callers changed. (clear_conflicts): Renamed from clear_allocno_conflicts, arg changed to ira_object_t, all callers changed. (conflict_check, curr_conflict_check_tick): Renamed from allocno_conflict_check and curr_allocno_conflict_check_tick; all uses changed. (compress_conflict_vec): Renamed from compress_allocno_conflict_vec, arg changed to ira_object_t, all callers changed. (create_cap_allocno): Call ira_create_allocno_object. (finish_allocno): Free the corresponding object. (sort_conflict_id_map): Renamed from sort_conflict_id_allocno_map; all callers changed. Adjusted for dealing with objects. (ira_build): Call create_allocno_objects after ira_costs. Adjusted for dealing with objects. * ira.c (ira_bad_reload_regno_1): Adjusted for dealing with objects. From-SVN: r162166
2010-07-14 03:53:35 +02:00
i->base_conflict_id = OBJECT_MIN (obj);
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
i->word = (i->size == 0 ? 0 : ((IRA_INT_TYPE *) i->vec)[0]);
}
}
/* Return TRUE if we have more conflicting allocnos to visit, in which
case *A is set to the allocno to be visited. Otherwise, return
FALSE. */
static inline bool
ira_object_conflict_iter_cond (ira_object_conflict_iterator *i,
ira_object_t *pobj)
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
{
ira-int.h (struct ira_object): New. * ira-int.h (struct ira_object): New. (ira_object_t): New typedef. Add DEF_VEC_P and DEF_VEC_ALLOC_P for it. (struct ira_allocno): Remove members min, max, conflict_allocno_array, conflict_id, conflict_allocno_array_size, conflict_allocnos_num and conflict_vec_p. Add new member object. (OBJECT_CONFLICT_ARRAY, OBJECT_CONFLICT_VEC_P, OBJECT_NUM_CONFLICTS, OBJECT_CONFLICT_ARRAY_SIZE, OBJECT_CONFLICT_HARD_REGS, OBJECT_TOTAL_CONFLICT_HARD_REGS, OBJECT_MIN, OBJECT_MAX, OBJECT_CONFLICT_ID): Renamed from ALLOCNO_CONFLICT_ALLOCNO_ARRAY, ALLOCNO_CONFLICT_VEC_P, ALLOCNO_CONFLICT_ALLOCNOS_NUM, ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE, ALLOCNO_CONFLICT_HARD_REGS, ALLOCNO_TOTAL_CONFLICT_HARD_REGS) ALLOCNO_MIN, ALLOCNO_MAX, and ALLOCNO_CONFLICT_ID; now operate on an ira_object_t rather than ira_allocno_t. All uses changed. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_objects_num): Declare variable. (ira_create_allocno_object): Declare function. (ira_conflict_vector_profitable_p): Adjust prototype. (ira_allocate_conflict_vec): Renamed from ira_allocate_allocno_conflict_vec; first arg now ira_object_t. (ira_allocate_object_conflicts): Renamed from ira_allocate_allocno_conflicts; first arg now ira_object_t. (struct ira_object_iterator): New. (ira_object_iter_init, ira_object_iter_cond, FOR_EACH_OBJECT): New. (ira_allocno_conflict_iterator): Renamed member allocno_conflict_vec_p to conflict_vec_p. All uses changed. (ira_allocno_conflict_iter_init, ira_allocno_conflict_iter_cond): Changed to take into account that conflicts are now tracked for objects. * ira-conflicts.c (OBJECTS_CONFLICT_P): Renamed from CONFLICT_ALLOCNO_P. Args changed to accept ira_object_t. All uses changed. (allocnos_conflict_p): New static function. (collected_conflict_objects): Renamed from collected_allocno_objects; now a vector of ira_object_t. All uses changed. (build_conflict_bit_table): Changed to take into account that conflicts are now tracked for objects. (process_regs_for_copy, propagate_copies, build_allocno_conflicts) (print_allocno_conflicts, ira_build_conflicts): Likewise. * ira-color.c (assign_hard_reg, setup_allocno_available_regs_num) setup_allocno_left_conflicts_size, allocno_reload_assign, fast_allocation): Likewise. * ira-lives.c (make_hard_regno_born, make_allocno_born) process_single_reg_class_operands, process_bb_node_lives): Likewise. * ira-emit.c (modify_move_list, add_range_and_copies_from_move_list): Likewise. * ira-build.c (ira_objects_num): New variable. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_object_id_map_vec): Corresponding change. (object_pool): New static variable. (initiate_allocnos): Initialize it. (finish_allocnos): Free it. (ira_create_object, ira_create_allocno_object, create_allocno_objects): New functions. (ira_create_allocno): Don't set members that were removed. (ira_set_allocno_cover_class): Don't change conflict hard regs. (merge_hard_reg_conflicts): Changed to take into account that conflicts are now tracked for objects. (ira_conflict_vector_profitable_p, ira_allocate_conflict_vec, allocate_conflict_bit_vec, ira_allocate_object_conflicts, compress_conflict_vecs, remove_low_level_allocnos, ira_flattening, setup_min_max_allocno_live_range_point, allocno_range_compare_func, setup_min_max_conflict_allocno_ids, ): Likewise. ((add_to_conflicts): Renamed from add_to_allocno_conflicts, args changed to ira_object_t; all callers changed. (ira_add_conflict): Renamed from ira_add_allocno_conflict, args changed to ira_object_t, all callers changed. (clear_conflicts): Renamed from clear_allocno_conflicts, arg changed to ira_object_t, all callers changed. (conflict_check, curr_conflict_check_tick): Renamed from allocno_conflict_check and curr_allocno_conflict_check_tick; all uses changed. (compress_conflict_vec): Renamed from compress_allocno_conflict_vec, arg changed to ira_object_t, all callers changed. (create_cap_allocno): Call ira_create_allocno_object. (finish_allocno): Free the corresponding object. (sort_conflict_id_map): Renamed from sort_conflict_id_allocno_map; all callers changed. Adjusted for dealing with objects. (ira_build): Call create_allocno_objects after ira_costs. Adjusted for dealing with objects. * ira.c (ira_bad_reload_regno_1): Adjusted for dealing with objects. From-SVN: r162166
2010-07-14 03:53:35 +02:00
ira_object_t obj;
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
ira-int.h (struct ira_object): New. * ira-int.h (struct ira_object): New. (ira_object_t): New typedef. Add DEF_VEC_P and DEF_VEC_ALLOC_P for it. (struct ira_allocno): Remove members min, max, conflict_allocno_array, conflict_id, conflict_allocno_array_size, conflict_allocnos_num and conflict_vec_p. Add new member object. (OBJECT_CONFLICT_ARRAY, OBJECT_CONFLICT_VEC_P, OBJECT_NUM_CONFLICTS, OBJECT_CONFLICT_ARRAY_SIZE, OBJECT_CONFLICT_HARD_REGS, OBJECT_TOTAL_CONFLICT_HARD_REGS, OBJECT_MIN, OBJECT_MAX, OBJECT_CONFLICT_ID): Renamed from ALLOCNO_CONFLICT_ALLOCNO_ARRAY, ALLOCNO_CONFLICT_VEC_P, ALLOCNO_CONFLICT_ALLOCNOS_NUM, ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE, ALLOCNO_CONFLICT_HARD_REGS, ALLOCNO_TOTAL_CONFLICT_HARD_REGS) ALLOCNO_MIN, ALLOCNO_MAX, and ALLOCNO_CONFLICT_ID; now operate on an ira_object_t rather than ira_allocno_t. All uses changed. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_objects_num): Declare variable. (ira_create_allocno_object): Declare function. (ira_conflict_vector_profitable_p): Adjust prototype. (ira_allocate_conflict_vec): Renamed from ira_allocate_allocno_conflict_vec; first arg now ira_object_t. (ira_allocate_object_conflicts): Renamed from ira_allocate_allocno_conflicts; first arg now ira_object_t. (struct ira_object_iterator): New. (ira_object_iter_init, ira_object_iter_cond, FOR_EACH_OBJECT): New. (ira_allocno_conflict_iterator): Renamed member allocno_conflict_vec_p to conflict_vec_p. All uses changed. (ira_allocno_conflict_iter_init, ira_allocno_conflict_iter_cond): Changed to take into account that conflicts are now tracked for objects. * ira-conflicts.c (OBJECTS_CONFLICT_P): Renamed from CONFLICT_ALLOCNO_P. Args changed to accept ira_object_t. All uses changed. (allocnos_conflict_p): New static function. (collected_conflict_objects): Renamed from collected_allocno_objects; now a vector of ira_object_t. All uses changed. (build_conflict_bit_table): Changed to take into account that conflicts are now tracked for objects. (process_regs_for_copy, propagate_copies, build_allocno_conflicts) (print_allocno_conflicts, ira_build_conflicts): Likewise. * ira-color.c (assign_hard_reg, setup_allocno_available_regs_num) setup_allocno_left_conflicts_size, allocno_reload_assign, fast_allocation): Likewise. * ira-lives.c (make_hard_regno_born, make_allocno_born) process_single_reg_class_operands, process_bb_node_lives): Likewise. * ira-emit.c (modify_move_list, add_range_and_copies_from_move_list): Likewise. * ira-build.c (ira_objects_num): New variable. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_object_id_map_vec): Corresponding change. (object_pool): New static variable. (initiate_allocnos): Initialize it. (finish_allocnos): Free it. (ira_create_object, ira_create_allocno_object, create_allocno_objects): New functions. (ira_create_allocno): Don't set members that were removed. (ira_set_allocno_cover_class): Don't change conflict hard regs. (merge_hard_reg_conflicts): Changed to take into account that conflicts are now tracked for objects. (ira_conflict_vector_profitable_p, ira_allocate_conflict_vec, allocate_conflict_bit_vec, ira_allocate_object_conflicts, compress_conflict_vecs, remove_low_level_allocnos, ira_flattening, setup_min_max_allocno_live_range_point, allocno_range_compare_func, setup_min_max_conflict_allocno_ids, ): Likewise. ((add_to_conflicts): Renamed from add_to_allocno_conflicts, args changed to ira_object_t; all callers changed. (ira_add_conflict): Renamed from ira_add_allocno_conflict, args changed to ira_object_t, all callers changed. (clear_conflicts): Renamed from clear_allocno_conflicts, arg changed to ira_object_t, all callers changed. (conflict_check, curr_conflict_check_tick): Renamed from allocno_conflict_check and curr_allocno_conflict_check_tick; all uses changed. (compress_conflict_vec): Renamed from compress_allocno_conflict_vec, arg changed to ira_object_t, all callers changed. (create_cap_allocno): Call ira_create_allocno_object. (finish_allocno): Free the corresponding object. (sort_conflict_id_map): Renamed from sort_conflict_id_allocno_map; all callers changed. Adjusted for dealing with objects. (ira_build): Call create_allocno_objects after ira_costs. Adjusted for dealing with objects. * ira.c (ira_bad_reload_regno_1): Adjusted for dealing with objects. From-SVN: r162166
2010-07-14 03:53:35 +02:00
if (i->conflict_vec_p)
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
{
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
obj = ((ira_object_t *) i->vec)[i->word_num++];
ira-int.h (struct ira_object): New. * ira-int.h (struct ira_object): New. (ira_object_t): New typedef. Add DEF_VEC_P and DEF_VEC_ALLOC_P for it. (struct ira_allocno): Remove members min, max, conflict_allocno_array, conflict_id, conflict_allocno_array_size, conflict_allocnos_num and conflict_vec_p. Add new member object. (OBJECT_CONFLICT_ARRAY, OBJECT_CONFLICT_VEC_P, OBJECT_NUM_CONFLICTS, OBJECT_CONFLICT_ARRAY_SIZE, OBJECT_CONFLICT_HARD_REGS, OBJECT_TOTAL_CONFLICT_HARD_REGS, OBJECT_MIN, OBJECT_MAX, OBJECT_CONFLICT_ID): Renamed from ALLOCNO_CONFLICT_ALLOCNO_ARRAY, ALLOCNO_CONFLICT_VEC_P, ALLOCNO_CONFLICT_ALLOCNOS_NUM, ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE, ALLOCNO_CONFLICT_HARD_REGS, ALLOCNO_TOTAL_CONFLICT_HARD_REGS) ALLOCNO_MIN, ALLOCNO_MAX, and ALLOCNO_CONFLICT_ID; now operate on an ira_object_t rather than ira_allocno_t. All uses changed. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_objects_num): Declare variable. (ira_create_allocno_object): Declare function. (ira_conflict_vector_profitable_p): Adjust prototype. (ira_allocate_conflict_vec): Renamed from ira_allocate_allocno_conflict_vec; first arg now ira_object_t. (ira_allocate_object_conflicts): Renamed from ira_allocate_allocno_conflicts; first arg now ira_object_t. (struct ira_object_iterator): New. (ira_object_iter_init, ira_object_iter_cond, FOR_EACH_OBJECT): New. (ira_allocno_conflict_iterator): Renamed member allocno_conflict_vec_p to conflict_vec_p. All uses changed. (ira_allocno_conflict_iter_init, ira_allocno_conflict_iter_cond): Changed to take into account that conflicts are now tracked for objects. * ira-conflicts.c (OBJECTS_CONFLICT_P): Renamed from CONFLICT_ALLOCNO_P. Args changed to accept ira_object_t. All uses changed. (allocnos_conflict_p): New static function. (collected_conflict_objects): Renamed from collected_allocno_objects; now a vector of ira_object_t. All uses changed. (build_conflict_bit_table): Changed to take into account that conflicts are now tracked for objects. (process_regs_for_copy, propagate_copies, build_allocno_conflicts) (print_allocno_conflicts, ira_build_conflicts): Likewise. * ira-color.c (assign_hard_reg, setup_allocno_available_regs_num) setup_allocno_left_conflicts_size, allocno_reload_assign, fast_allocation): Likewise. * ira-lives.c (make_hard_regno_born, make_allocno_born) process_single_reg_class_operands, process_bb_node_lives): Likewise. * ira-emit.c (modify_move_list, add_range_and_copies_from_move_list): Likewise. * ira-build.c (ira_objects_num): New variable. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_object_id_map_vec): Corresponding change. (object_pool): New static variable. (initiate_allocnos): Initialize it. (finish_allocnos): Free it. (ira_create_object, ira_create_allocno_object, create_allocno_objects): New functions. (ira_create_allocno): Don't set members that were removed. (ira_set_allocno_cover_class): Don't change conflict hard regs. (merge_hard_reg_conflicts): Changed to take into account that conflicts are now tracked for objects. (ira_conflict_vector_profitable_p, ira_allocate_conflict_vec, allocate_conflict_bit_vec, ira_allocate_object_conflicts, compress_conflict_vecs, remove_low_level_allocnos, ira_flattening, setup_min_max_allocno_live_range_point, allocno_range_compare_func, setup_min_max_conflict_allocno_ids, ): Likewise. ((add_to_conflicts): Renamed from add_to_allocno_conflicts, args changed to ira_object_t; all callers changed. (ira_add_conflict): Renamed from ira_add_allocno_conflict, args changed to ira_object_t, all callers changed. (clear_conflicts): Renamed from clear_allocno_conflicts, arg changed to ira_object_t, all callers changed. (conflict_check, curr_conflict_check_tick): Renamed from allocno_conflict_check and curr_allocno_conflict_check_tick; all uses changed. (compress_conflict_vec): Renamed from compress_allocno_conflict_vec, arg changed to ira_object_t, all callers changed. (create_cap_allocno): Call ira_create_allocno_object. (finish_allocno): Free the corresponding object. (sort_conflict_id_map): Renamed from sort_conflict_id_allocno_map; all callers changed. Adjusted for dealing with objects. (ira_build): Call create_allocno_objects after ira_costs. Adjusted for dealing with objects. * ira.c (ira_bad_reload_regno_1): Adjusted for dealing with objects. From-SVN: r162166
2010-07-14 03:53:35 +02:00
if (obj == NULL)
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
return false;
}
else
{
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
unsigned IRA_INT_TYPE word = i->word;
unsigned int bit_num = i->bit_num;
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
/* Skip words that are zeros. */
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
for (; word == 0; word = ((IRA_INT_TYPE *) i->vec)[i->word_num])
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
{
i->word_num++;
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
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
/* If we have reached the end, break. */
if (i->word_num * sizeof (IRA_INT_TYPE) >= i->size)
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
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
bit_num = i->word_num * IRA_INT_BITS;
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02: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
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
/* Skip bits that are zero. */
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
for (; (word & 1) == 0; word >>= 1)
bit_num++;
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
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
obj = ira_object_id_map[bit_num + i->base_conflict_id];
i->bit_num = bit_num + 1;
i->word = word >> 1;
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
}
ira-int.h (struct ira_object): New. * ira-int.h (struct ira_object): New. (ira_object_t): New typedef. Add DEF_VEC_P and DEF_VEC_ALLOC_P for it. (struct ira_allocno): Remove members min, max, conflict_allocno_array, conflict_id, conflict_allocno_array_size, conflict_allocnos_num and conflict_vec_p. Add new member object. (OBJECT_CONFLICT_ARRAY, OBJECT_CONFLICT_VEC_P, OBJECT_NUM_CONFLICTS, OBJECT_CONFLICT_ARRAY_SIZE, OBJECT_CONFLICT_HARD_REGS, OBJECT_TOTAL_CONFLICT_HARD_REGS, OBJECT_MIN, OBJECT_MAX, OBJECT_CONFLICT_ID): Renamed from ALLOCNO_CONFLICT_ALLOCNO_ARRAY, ALLOCNO_CONFLICT_VEC_P, ALLOCNO_CONFLICT_ALLOCNOS_NUM, ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE, ALLOCNO_CONFLICT_HARD_REGS, ALLOCNO_TOTAL_CONFLICT_HARD_REGS) ALLOCNO_MIN, ALLOCNO_MAX, and ALLOCNO_CONFLICT_ID; now operate on an ira_object_t rather than ira_allocno_t. All uses changed. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_objects_num): Declare variable. (ira_create_allocno_object): Declare function. (ira_conflict_vector_profitable_p): Adjust prototype. (ira_allocate_conflict_vec): Renamed from ira_allocate_allocno_conflict_vec; first arg now ira_object_t. (ira_allocate_object_conflicts): Renamed from ira_allocate_allocno_conflicts; first arg now ira_object_t. (struct ira_object_iterator): New. (ira_object_iter_init, ira_object_iter_cond, FOR_EACH_OBJECT): New. (ira_allocno_conflict_iterator): Renamed member allocno_conflict_vec_p to conflict_vec_p. All uses changed. (ira_allocno_conflict_iter_init, ira_allocno_conflict_iter_cond): Changed to take into account that conflicts are now tracked for objects. * ira-conflicts.c (OBJECTS_CONFLICT_P): Renamed from CONFLICT_ALLOCNO_P. Args changed to accept ira_object_t. All uses changed. (allocnos_conflict_p): New static function. (collected_conflict_objects): Renamed from collected_allocno_objects; now a vector of ira_object_t. All uses changed. (build_conflict_bit_table): Changed to take into account that conflicts are now tracked for objects. (process_regs_for_copy, propagate_copies, build_allocno_conflicts) (print_allocno_conflicts, ira_build_conflicts): Likewise. * ira-color.c (assign_hard_reg, setup_allocno_available_regs_num) setup_allocno_left_conflicts_size, allocno_reload_assign, fast_allocation): Likewise. * ira-lives.c (make_hard_regno_born, make_allocno_born) process_single_reg_class_operands, process_bb_node_lives): Likewise. * ira-emit.c (modify_move_list, add_range_and_copies_from_move_list): Likewise. * ira-build.c (ira_objects_num): New variable. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_object_id_map_vec): Corresponding change. (object_pool): New static variable. (initiate_allocnos): Initialize it. (finish_allocnos): Free it. (ira_create_object, ira_create_allocno_object, create_allocno_objects): New functions. (ira_create_allocno): Don't set members that were removed. (ira_set_allocno_cover_class): Don't change conflict hard regs. (merge_hard_reg_conflicts): Changed to take into account that conflicts are now tracked for objects. (ira_conflict_vector_profitable_p, ira_allocate_conflict_vec, allocate_conflict_bit_vec, ira_allocate_object_conflicts, compress_conflict_vecs, remove_low_level_allocnos, ira_flattening, setup_min_max_allocno_live_range_point, allocno_range_compare_func, setup_min_max_conflict_allocno_ids, ): Likewise. ((add_to_conflicts): Renamed from add_to_allocno_conflicts, args changed to ira_object_t; all callers changed. (ira_add_conflict): Renamed from ira_add_allocno_conflict, args changed to ira_object_t, all callers changed. (clear_conflicts): Renamed from clear_allocno_conflicts, arg changed to ira_object_t, all callers changed. (conflict_check, curr_conflict_check_tick): Renamed from allocno_conflict_check and curr_allocno_conflict_check_tick; all uses changed. (compress_conflict_vec): Renamed from compress_allocno_conflict_vec, arg changed to ira_object_t, all callers changed. (create_cap_allocno): Call ira_create_allocno_object. (finish_allocno): Free the corresponding object. (sort_conflict_id_map): Renamed from sort_conflict_id_allocno_map; all callers changed. Adjusted for dealing with objects. (ira_build): Call create_allocno_objects after ira_costs. Adjusted for dealing with objects. * ira.c (ira_bad_reload_regno_1): Adjusted for dealing with objects. From-SVN: r162166
2010-07-14 03:53:35 +02:00
*pobj = obj;
ira-int.h (struct ira_object): New. * ira-int.h (struct ira_object): New. (ira_object_t): New typedef. Add DEF_VEC_P and DEF_VEC_ALLOC_P for it. (struct ira_allocno): Remove members min, max, conflict_allocno_array, conflict_id, conflict_allocno_array_size, conflict_allocnos_num and conflict_vec_p. Add new member object. (OBJECT_CONFLICT_ARRAY, OBJECT_CONFLICT_VEC_P, OBJECT_NUM_CONFLICTS, OBJECT_CONFLICT_ARRAY_SIZE, OBJECT_CONFLICT_HARD_REGS, OBJECT_TOTAL_CONFLICT_HARD_REGS, OBJECT_MIN, OBJECT_MAX, OBJECT_CONFLICT_ID): Renamed from ALLOCNO_CONFLICT_ALLOCNO_ARRAY, ALLOCNO_CONFLICT_VEC_P, ALLOCNO_CONFLICT_ALLOCNOS_NUM, ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE, ALLOCNO_CONFLICT_HARD_REGS, ALLOCNO_TOTAL_CONFLICT_HARD_REGS) ALLOCNO_MIN, ALLOCNO_MAX, and ALLOCNO_CONFLICT_ID; now operate on an ira_object_t rather than ira_allocno_t. All uses changed. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_objects_num): Declare variable. (ira_create_allocno_object): Declare function. (ira_conflict_vector_profitable_p): Adjust prototype. (ira_allocate_conflict_vec): Renamed from ira_allocate_allocno_conflict_vec; first arg now ira_object_t. (ira_allocate_object_conflicts): Renamed from ira_allocate_allocno_conflicts; first arg now ira_object_t. (struct ira_object_iterator): New. (ira_object_iter_init, ira_object_iter_cond, FOR_EACH_OBJECT): New. (ira_allocno_conflict_iterator): Renamed member allocno_conflict_vec_p to conflict_vec_p. All uses changed. (ira_allocno_conflict_iter_init, ira_allocno_conflict_iter_cond): Changed to take into account that conflicts are now tracked for objects. * ira-conflicts.c (OBJECTS_CONFLICT_P): Renamed from CONFLICT_ALLOCNO_P. Args changed to accept ira_object_t. All uses changed. (allocnos_conflict_p): New static function. (collected_conflict_objects): Renamed from collected_allocno_objects; now a vector of ira_object_t. All uses changed. (build_conflict_bit_table): Changed to take into account that conflicts are now tracked for objects. (process_regs_for_copy, propagate_copies, build_allocno_conflicts) (print_allocno_conflicts, ira_build_conflicts): Likewise. * ira-color.c (assign_hard_reg, setup_allocno_available_regs_num) setup_allocno_left_conflicts_size, allocno_reload_assign, fast_allocation): Likewise. * ira-lives.c (make_hard_regno_born, make_allocno_born) process_single_reg_class_operands, process_bb_node_lives): Likewise. * ira-emit.c (modify_move_list, add_range_and_copies_from_move_list): Likewise. * ira-build.c (ira_objects_num): New variable. (ira_object_id_map): Renamed from ira_conflict_id_allocno_map; now contains a vector of ira_object_t; all uses changed. (ira_object_id_map_vec): Corresponding change. (object_pool): New static variable. (initiate_allocnos): Initialize it. (finish_allocnos): Free it. (ira_create_object, ira_create_allocno_object, create_allocno_objects): New functions. (ira_create_allocno): Don't set members that were removed. (ira_set_allocno_cover_class): Don't change conflict hard regs. (merge_hard_reg_conflicts): Changed to take into account that conflicts are now tracked for objects. (ira_conflict_vector_profitable_p, ira_allocate_conflict_vec, allocate_conflict_bit_vec, ira_allocate_object_conflicts, compress_conflict_vecs, remove_low_level_allocnos, ira_flattening, setup_min_max_allocno_live_range_point, allocno_range_compare_func, setup_min_max_conflict_allocno_ids, ): Likewise. ((add_to_conflicts): Renamed from add_to_allocno_conflicts, args changed to ira_object_t; all callers changed. (ira_add_conflict): Renamed from ira_add_allocno_conflict, args changed to ira_object_t, all callers changed. (clear_conflicts): Renamed from clear_allocno_conflicts, arg changed to ira_object_t, all callers changed. (conflict_check, curr_conflict_check_tick): Renamed from allocno_conflict_check and curr_allocno_conflict_check_tick; all uses changed. (compress_conflict_vec): Renamed from compress_allocno_conflict_vec, arg changed to ira_object_t, all callers changed. (create_cap_allocno): Call ira_create_allocno_object. (finish_allocno): Free the corresponding object. (sort_conflict_id_map): Renamed from sort_conflict_id_allocno_map; all callers changed. Adjusted for dealing with objects. (ira_build): Call create_allocno_objects after ira_costs. Adjusted for dealing with objects. * ira.c (ira_bad_reload_regno_1): Adjusted for dealing with objects. From-SVN: r162166
2010-07-14 03:53:35 +02:00
return true;
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
}
/* Loop over all objects conflicting with OBJ. In each iteration,
CONF is set to the next conflicting object. ITER is an instance
of ira_object_conflict_iterator used to iterate the conflicts. */
#define FOR_EACH_OBJECT_CONFLICT(OBJ, CONF, ITER) \
for (ira_object_conflict_iter_init (&(ITER), (OBJ)); \
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
ira_object_conflict_iter_cond (&(ITER), &(CONF));)
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
/* The function returns TRUE if at least one hard register from ones
starting with HARD_REGNO and containing value of MODE are in set
HARD_REGSET. */
static inline bool
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
ira_hard_reg_set_intersection_p (int hard_regno, machine_mode mode,
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
HARD_REG_SET hard_regset)
{
int i;
gcc_assert (hard_regno >= 0);
for (i = hard_regno_nregs[hard_regno][mode] - 1; i >= 0; i--)
if (TEST_HARD_REG_BIT (hard_regset, hard_regno + i))
return true;
return false;
}
/* Return number of hard registers in hard register SET. */
static inline int
hard_reg_set_size (HARD_REG_SET set)
{
int i, size;
for (size = i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (TEST_HARD_REG_BIT (set, i))
size++;
return size;
}
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
/* The function returns TRUE if hard registers starting with
HARD_REGNO and containing value of MODE are fully in set
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
HARD_REGSET. */
static inline bool
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
ira_hard_reg_in_set_p (int hard_regno, machine_mode mode,
HARD_REG_SET hard_regset)
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
{
int i;
ira_assert (hard_regno >= 0);
for (i = hard_regno_nregs[hard_regno][mode] - 1; i >= 0; i--)
if (!TEST_HARD_REG_BIT (hard_regset, hard_regno + i))
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
return false;
return true;
}
/* To save memory we use a lazy approach for allocation and
initialization of the cost vectors. We do this only when it is
really necessary. */
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
/* Allocate cost vector *VEC for hard registers of ACLASS and
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
initialize the elements by VAL if it is necessary */
static inline void
ira_allocate_and_set_costs (int **vec, reg_class_t aclass, int val)
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
{
int i, *reg_costs;
int len;
if (*vec != NULL)
return;
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
*vec = reg_costs = ira_allocate_cost_vector (aclass);
len = ira_class_hard_regs_num[(int) aclass];
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
for (i = 0; i < len; i++)
reg_costs[i] = val;
}
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
/* Allocate cost vector *VEC for hard registers of ACLASS and copy
values of vector SRC into the vector if it is necessary */
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
static inline void
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
ira_allocate_and_copy_costs (int **vec, enum reg_class aclass, int *src)
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
{
int len;
if (*vec != NULL || src == NULL)
return;
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
*vec = ira_allocate_cost_vector (aclass);
len = ira_class_hard_regs_num[aclass];
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
memcpy (*vec, src, sizeof (int) * len);
}
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
/* Allocate cost vector *VEC for hard registers of ACLASS and add
values of vector SRC into the vector if it is necessary */
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
static inline void
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
ira_allocate_and_accumulate_costs (int **vec, enum reg_class aclass, int *src)
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
{
int i, len;
if (src == NULL)
return;
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
len = ira_class_hard_regs_num[aclass];
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
if (*vec == NULL)
{
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
*vec = ira_allocate_cost_vector (aclass);
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
memset (*vec, 0, sizeof (int) * len);
}
for (i = 0; i < len; i++)
(*vec)[i] += src[i];
}
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
/* Allocate cost vector *VEC for hard registers of ACLASS and copy
values of vector SRC into the vector or initialize it by VAL (if
SRC is null). */
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
static inline void
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
ira_allocate_and_set_or_copy_costs (int **vec, enum reg_class aclass,
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
int val, int *src)
{
int i, *reg_costs;
int len;
if (*vec != NULL)
return;
[multiple changes] 2011-03-28 Vladimir Makarov <vmakarov@redhat.com> * ira-color.c (update_left_conflict_sizes_p): Don't assume that conflict object hard regset nodes have intersecting hard reg sets. * regmove.c (regmove_optimize): Move ira_set_pseudo_classes call after regstat_init_n_sets_and_refs. * ira.c: Add more comments at the top. (setup_stack_reg_pressure_class, setup_pressure_classes): Add comments how we compute the register pressure classes. (setup_allocno_and_important_classes): Add more comments. (setup_class_translate_array, reorder_important_classes) (setup_reg_class_relations): Add comments. * ira-emit.c: Add 2011 to the Copyright line. Add comments at the start of the file. * ira-color.c: Add 2011 to the Copyright line. (assign_hard_reg): Add more comments. (improve_allocation): Ditto. * ira-costs.c: Add 2011 to the Copyright line. (setup_cost_classes, setup_regno_cost_classes_by_aclass): Add more comments. (setup_regno_cost_classes_by_mode): Ditto. Initial patches from ira-improv branch: 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c: (ira_create_object): Remove initialization of OBJECT_PROFITABLE_HARD_REGS. Initialize OBJECT_ADD_DATA. (ira_create_allocno): Remove initialization of ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, ALLOCNO_SOMEWHERE_RENAMED_P, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO, ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO. Initialize ALLOCNO_ADD_DATA. (copy_info_to_removed_store_destinations): Use ALLOCNO_EMIT_DATA and allocno_emit_reg instead of ALLOCNO_MEM_OPTIMIZED_DEST_P and ALLOCNO_REG. (ira_flattening): Ditto. Use ALLOCNO_EMIT_DATA instead of ALLOCNO_MEM_OPTIMIZED_DEST and ALLOCNO_SOMEWHERE_RENAMED_P. * ira.c (ira_reallocate): Remove. (setup_pressure_classes): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (setup_allocno_assignment_flags): Use ALLOCNO_EMIT_DATA. (ira): Call ira_initiate_emit_data and ira_finish_emit_data. * ira-color.c: Use ALLOCNO_COLOR_DATA instead of ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P, ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM, ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO. ALLOCNO_TEMP. Use OBJECT_COLOR_DATA instead of OBJECT_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START, OBJECT_HARD_REGS_SUBNODES_NUM. Fix formatting. (object_hard_regs_t, object_hard_regs_node_t): Move from ira-int.h. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct allocno_color_data): New. (allocno_color_data_t): New typedef. (allocno_color_data): New definition. (ALLOCNO_COLOR_DATA): New macro. (struct object_color_data): New. (object_color_data_t): New typedef. (object_color_data): New definition. (OBJECT_COLOR_DATA): New macro. (update_copy_costs, calculate_allocno_spill_cost): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (move_spill_restore, update_curr_costs): Ditto. (allocno_spill_priority): Make it inline. (color_pass): Allocate and free allocno_color_dat and object_color_data. (struct coalesce_data, coalesce_data_t): New. (allocno_coalesce_data): New definition. (ALLOCNO_COALESCE_DATA): New macro. (merge_allocnos, coalesced_allocno_conflict_p): Use ALLOCNO_COALESCED_DATA instead of ALLOCNO_FIRST_COALESCED_ALLOCNO, ALLOCNO_NEXT_COALESCED_ALLOCNO, ALLOCNO_TEMP. (coalesce_allocnos): Ditto. (setup_coalesced_allocno_costs_and_nums): Ditto. (collect_spilled_coalesced_allocnos): Ditto. (slot_coalesced_allocno_live_ranges_intersect_p): Ditto. (setup_slot_coalesced_allocno_live_ranges): Ditto. (coalesce_spill_slots): Ditto. (ira_sort_regnos_for_alter_reg): Ditto. Allocate, initialize and free allocno_coalesce_data. * ira-conflicts.c: Fix formatting. (process_regs_for_copy): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. (build_object_conflicts): Optimize. * ira-costs.c (record_reg_classes): Optimize. Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost, ira_may_move_in_cost, and ira_may_move_out_cost instead of ira_get_register_move_cost and ira_get_may_move_cost. (record_address_regs): Ditto. (scan_one_insn): Optimize. (find_costs_and_classes): Optimize. (process_bb_node_for_hard_reg_moves): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-emit.c: Use allocno_emit_reg, ALLOCNO_EMIT_DATA instead of ALLOCNO_REG, ALLOCNO_CHILD_RENAMED_P, ALLOCNO_MEM_OPTIMIZED_DEST, ALLOCNO_MEM_OPTIMIZED_DEST_P, and ALLOCNO_SOMEWHERE_RENAMED_P. (ira_allocno_emit_data, void_p, new_allocno_emit_data_vec): New definitions. (ira_initiate_emit_data, ira_finish_emit_data) (create_new_allocno): New functions. (modify_move_list): Call create_new_alloc instead of ira_create_allocno. (emit_move_list): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. * ira-int.h: Fix some comments. (object_hard_regs_t, object_hard_regs_node_t): Move to ira-color.c. (struct object_hard_regs, struct object_hard_regs_node): Ditto. (struct ira_object): Remove profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. Add new member add_data. (struct ira_allocno): Make mode and aclass a bitfield. Move other bitfield after mode. Make hard_regno a short int. Make hard_regno short. Remove first_coalesced_allocno and next_coalesced_allocno. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, and mem_optimized_dest into struct ira_emit_data. Remove in_graph_p, may_be_spilled_p, available_regs_num, next_bucket_allocno, prev_bucket_allocno, temp, colorable_p. Add new member add_data. (ALLOCNO_IN_GRAPH_P, ALLOCNO_MAY_BE_SPILLED_P): Remove. (ALLOCNO_COLORABLE_P, ALLOCNO_AVAILABLE_REGS_NUM): Remove. (ALLOCNO_NEXT_BUCKET_ALLOCNO, ALLOCNO_PREV_BUCKET_ALLOCNO): Remove. (ALLOCNO_TEMP, ALLOCNO_FIRST_COALESCED_ALLOCNO): Remove. (ALLOCNO_NEXT_COALESCED_ALLOCNO): Remove. (ALLOCNO_ADD_DATA): New macro. (ira_emit_data_t): New typedef. (struct ira_emit_data): New. Move mem_optimized_dest_p, somewhere_renamed_p, child_renamed_p, reg, mem_optimized_dest from struct ira_allocno. (ALLOCNO_EMIT_DATA): New macro. (ira_allocno_emit_data, allocno_emit_reg): New. (ALLOCNO_PROFITABLE_HARD_REGS, OBJECT_HARD_REGS_NODE): Remove. (OBJECT_HARD_REGS_SUBNODES_STAR, OBJECT_HARD_REGS_SUBNODES_NUM): Remove. (OBJECT_ADD_DATA): New macro. (ira_reallocate): Remove. (ira_initiate_emit_data, ira_finish_emit_data): New. (ira_get_register_move_cost, ira_get_may_move_cost): Remove. (ira_init_register_move_cost_if_necessary): New. (ira_object_conflict_iter_next): Merge into ira_object_conflict_iter_cond. (FOR_EACH_OBJECT_CONFLICT): Don't use ira_object_conflict_iter_next. * ira-live.c: (process_single_reg_class_operands): Call ira_init_register_move_cost_if_necessary. Use ira_register_move_cost instead of ira_get_register_move_cost. 2010-08-13 Vladimir Makarov <vmakarov@redhat.com> * ira-int.h (struct target_ira_int): Remove x_cost_classes. * ira-costs.c: Fix formatting. (cost_classes, cost_classes_num): Remove. (struct cost_classes, cost_classes_t, const_cost_classes_t): New. (regno_cost_classes, cost_classes_hash, cost_classes_eq): New. (cost_classes_del, cost_classes_htab): New. (cost_classes_aclass_cache, cost_classes_mode_cache): New. (initiate_regno_cost_classes, setup_cost_classes): New. (setup_regno_cost_classes_by_aclass): New. (setup_regno_cost_classes_by_mode, finish_regno_cost_classes): New. (record_reg_classes): Use regno_cost_classes instead of cost_classes. Move checking opposite operand up. (record_address_regs): Use regno_cost_classes instead of cost_classes. (scan_one_insn): Ditto. Use always general register. (print_allocno_costs): Use regno_cost_classes instead of cost_classes. (print_pseudo_costs): Ditto. Use Reg_N_REFS. (find_costs_and_classes): Set up cost classes for each registers. Use also their mode for this. Use regno_cost_classes instead of cost_classes. (setup_allocno_class_and_costs): Use regno_cost_classes instead of cost_classes. (free_ira_costs, ira_init_costs): Don't use cost_classes. (ira_costs, ira_set_pseudo_classes): Call initiate_regno_cost_classes and finish_regno_cost_classes. 2010-10-04 Vladimir Makarov <vmakarov@redhat.com> * target-def.h (TARGET_IRA_COVER_CLASSES): Remove. * target.def (ira_cover_classes): Remove. * doc/tm.texi: Remove TARGET_IRA_COVER_CLASSES and IRA_COVER_CLASSES. * doc/tm.texi.in: Ditto. * ira-conflicts.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_COVER_CLASS_COST instead of ALLOCNO_CLASS_COST. Fix formatting. * targhooks.c (default_ira_cover_classes): Remove. * targhooks.h (default_ira_cover_classes): Ditto. * haifa-sched.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_regno_birth_or_death, setup_insn_reg_pressure_info): Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira-int.h: Add 2010 to Copyright. Remove mentioning cover classes from the file. (object_hard_regs_t, object_hard_regs_node_t): New typedefs. (struct object_hard_regs, struct object_hard_regs_node): New. (struct ira_object): New members profitable_hard_regs, hard_regs_node, hard_regs_subnodes_start, hard_regs_subnodes_num. (struct ira_allocno): Rename cover_class to aclass. Rename cover_class_cost and updated_cover_class_cost to class_cost and updated_class_cost. Remove splay_removed_p and left_conflict_size. Add new members colorable_p. (ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICTS_SIZE): Remove. (ALLOCNO_COLORABLE_P): New macro. (ALLOCNO_COVER_CLASS): Rename to ALLOCNO_CLASS. (ALLOCNO_COVER_CLASS_COST, ALLOCNO_UPDATED_COVER_CLASS_COST): Rename to ALLOCNO_CLASS_COST and ALLOCNO_UPDATED__CLASS_COST. (OBJECT_...): Rename parameter C to O. (OBJECT_PROFITABLE_HARD_REGS): New macro. (OBJECT_HARD_REGS_NODE, OBJECT_HARD_REGS_SUBNODES_START) (OBJECT_HARD_REGS_SUBNODES_NUM): New macros. (struct target_ira_int): New members x_ira_max_memory_move_cost, x_ira_max_register_move_cost, x_ira_max_may_move_in_cost, x_ira_max_may_move_out_cost, x_ira_reg_allocno_class_p, x_ira_reg_pressure_class_p, x_ira_important_class_nums, x_ira_reg_class_superunion. Rename x_prohibited_class_mode_reg to x_ira_prohibited_class_mode_reg. Rename x_ira_reg_class_union to x_ira_reg_class_subunion. (ira_max_memory_move_cost, ira_max_register_move_cost) (ira_max_may_move_in_cost, ira_max_may_move_out_cost) (ira_reg_allocno_class_p, ira_reg_pressure_class_p) (ira_important_class_nums, ira_reg_class_superunion): New macros. (prohibited_class_mode_regs): Rename to ira_prohibited_class_mode_regs. (ira_reg_class_union): Rename to ira_reg_class_subunion. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. (ira_debug_hard_regs_forest): New. (ira_object_conflict_iter_init, ira_object_conflict_iter_cond) (ira_object_conflict_iter_next): Fix comments. (ira_hard_reg_set_intersection_p, hard_reg_set_size): New functions. (ira_allocate_and_set_costs, ira_allocate_and_copy_costs): Rename cover_class to aclass. (ira_allocate_and_accumulate_costs): Ditto. (ira_allocate_and_set_or_copy_costs): Ditto. * opts.c (decode_options): Remove ira_cover_class check. * ira-color.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS, ALLOCNO_CLASS_COST, and ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_COVER_CLASS, ALLOCNO_COVER_CLASS_COST, and ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (splay-tree.h): Remove include. (allocno_coalesced_p, processed_coalesced_allocno_bitmap): Move before copy_freq_compare_func. (allocnos_for_spilling, removed_splay_allocno_vec): Remove. (object_hard_regs_vec, object_hard_regs_htab, node_check_tick): New definitions. (hard_regs_roots, hard_regs_node_vec): Ditto. (object_hard_regs_hash, object_hard_regs_eq, find_hard_regs): Ditto. (insert_hard_regs, init_object_hard_regs, add_object_hard_regs): Ditto. (finish_object_hard_regs, object_hard_regs_compare): Ditto. (create_new_object_hard_regs_node): Ditto. (add_new_object_hard_regs_node_to_forest): Ditto. (add_object_hard_regs_to_forest, collect_object_hard_regs_cover): Ditto. (setup_object_hard_regs_nodes_parent, first_common_ancestor_node): Ditto. (print_hard_reg_set, print_hard_regs_subforest): Ditto. (print_hard_regs_forest, ira_debug_hard_regs_forest): Ditto. (remove_unused_object_hard_regs_nodes): Ditto. (enumerate_object_hard_regs_nodes): Ditto. (object_hard_regs_nodes_num, object_hard_regs_nodes): Ditto. (object_hard_regs_subnode_t): Ditto. (struct object_hard_regs_subnode): Ditto. (object_hard_regs_subnodes, object_hard_regs_subnode_index): Ditto. (setup_object_hard_regs_subnode_index): Ditto. (get_object_hard_regs_subnodes_num): Ditto. (form_object_hard_regs_nodes_forest): Ditto. (finish_object_hard_regs_nodes_tree): Ditto. (finish_object_hard_regs_nodes_forest): Ditto. (allocnos_have_intersected_live_ranges_p): Rename to allocnos_conflict_by_live_ranges_p. Move before copy_freq_compare_func. (pseudos_have_intersected_live_ranges_p): Rename to conflict_by_live_ranges_p. Move before copy_freq_compare_func. (setup_left_conflict_sizes_p, update_left_conflict_sizes_p): Ditto. (empty_profitable_hard_regs, setup_profitable_hard_regs): Ditto. (update_copy_costs): Remove assert. Skip cost update if the hard reg does not belong the class. (assign_hard_reg): Process only profitable hard regs. (uncolorable_allocnos_num): Make it scalar. (allocno_spill_priority): Use ALLOCNO_EXCESS_PRESSURE_POINTS_NUM and ira_reg_class_max_nregs instead of ALLOCNO_LEFT_CONFLICTS_SIZE and ira_reg_class_max_nregs. (bucket_allocno_compare_func): Check frequency first. (sort_bucket): Add compare function as a parameter. (add_allocno_to_ordered_bucket): Assume no coalesced allocnos. (uncolorable_allocnos_splay_tree, USE_SPLAY_P): Remove. (push_allocno_to_stack): Rewrite for checking new allocno colorability. (remove_allocno_from_bucket_and_push): Print cost too. Remove assert. (push_only_colorable): Pass new parameter to sort_bucket. (push_allocno_to_spill): Remove. (allocno_spill_priority_compare): Make it inline and rewrite. (splay_tree_allocate, splay_tree_free): Remove. (allocno_spill_sort_compare): New function. (push_allocnos_to_stack): Sort allocnos for spilling once. Don't build and use splay tree. Choose first allocno in uncolorable allocno bucket to spill. Remove setting spill cost. (all_conflicting_hard_regs): Remove. (setup_allocno_available_regs_num): Check only profitable hard regs. Print info about hard regs nodes. (setup_allocno_left_conflicts_size): Remove. (put_allocno_into_bucket): Don't call setup_allocno_left_conflicts_size. Use setup_left_conflict_sizes_p. (improve_allocation): New. (color_allocnos): Call setup_profitable_hard_regs, form_object_hard_regs_nodes_forest, improve_allocation, finish_object_hard_regs_nodes_forest. Setup spill cost. (print_loop_title): Use pressure classes. (color_allocnso): Ditto. (do_coloring): Remove allocation and freeing splay_tree_node_pool and allocnos_for_spilling. (ira_sort_regnos_for_alter_reg): Don't setup members {first,next}_coalesced_allocno. (color): Remove allocating and freeing removed_splay_allocno_vec. (fast_allocation): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. * ira-lives.c: Remove mentioning cover classes from the file. Fix formatting. (update_allocno_pressure_excess_length): Use pressure classes. (inc_register_pressure, dec_register_pressure): Check for pressure class. (mark_pseudo_regno_live, mark_pseudo_regno_subword_live): Use pressure class. Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (mark_pseudo_regno_dead, mark_pseudo_regno_subword_dead): Ditto. (mark_hard_reg_live, mark_hard_reg_dead): Use pressure class. (single_reg_class): Use ira_reg_class_nregs instead of ira_reg_class_max_nregs. (process_bb_node_lives): Use pressure classes. * ira-emit.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (change_loop): Use pressure classes. (modify_move_list): Call ira_set_allocno_class instead of ira_set_allocno_cover_class. * ira-build.c: Remove mentioning cover classes from the file. Use ALLOCNO_CLASS and ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS and ALLOCNO_COVER_CLASS_COST. Use ALLOCNO_UPDATED_CLASS_COST instead of ALLOCNO_UPDATED_COVER_CLASS_COST. Fix formatting. (ira_create_object): Initiate OBJECT_PROFITABLE_HARD_REGS. (ira_create_allocno): Remove initialization of ALLOCNO_SPLAY_REMOVED_P, ALLOCNO_LEFT_CONFLICT_SIZE. Initialize ALLOCNO_COLORABLE_P. (ira_set_allocno_cover_class): Rename to ira_set_allocno_class. Update conflict regs for the objects. (create_cap_allocno): Remove assert. Don't propagate ALLOCNO_AVAILABLE_REGS_NUM. (ira_free_allocno_costs): New function. (finish_allocno): Change a part of code into call of ira_free_allocno_costs. (low_pressure_loop_node_p): Use pressure classes. (object_range_compare_func): Don't compare classes. (setup_min_max_conflict_allocno_ids): Ditto. * loop-invariant.c: Remove mentioning cover classes from the file. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. Fix formatting. (get_cover_class_and_nregs): Rename to get_cover_pressure_and_nregs. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. Use reg_allocno_class instead of reg_cover_class. (get_inv_cost): Use instead ira_stack_reg_pressure_class of STACK_REG_COVER_CLASS. (get_regno_cover_class): Rename to get_regno_pressure_class. (move_loop_invariants): Initialize and finalize regstat. * ira.c: Remove mentioning cover classes from the file. Add comments about coloring without cover classes. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Fix formatting. (alloc_reg_class_subclasses, setup_reg_subclasses): Move it before setup_class_subset_and_memory_move_costs. (setup_stack_reg_pressure_class, setup_pressure_classes): New. (setup_cover_and_important_classes): Rename to setup_allocno_and_important_classes. (setup_class_translate_array): New. (setup_class_translate): Call it for allocno and pressure classes. (cover_class_order): Rename to allocno_class_order. (comp_reg_classes_func): Use ira_allocno_class_translate instead of ira_class_translate. (reorder_important_classes): Set up ira_important_class_nums. (setup_reg_class_relations): Set up ira_reg_class_superunion. (print_class_cover): Rename to print_classes. Add parameter. (ira_debug_class_cover): Rename to ira_debug_allocno_classes. Print pressure classes too. (find_reg_class_closure): Rename to find_reg_classes. Don't call setup_reg_subclasses. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (setup_prohibited_class_mode_regs): Use ira_prohibited_class_mode_regs instead of prohibited_class_mode_regs. (clarify_prohibited_class_mode_regs): New function. (ira_init_register_move_cost): Set up ira_max_register_move_cost, ira_max_may_move_in_cost, and ira_max_may_move_out_cost. (ira_init_once): Initialize them. (free_register_move_costs): Process them. (ira_init): Move calls of find_reg_classes and setup_hard_regno_aclass after setup_prohibited_class_mode_regs. Call clarify_prohibited_class_mode_regs. (ira_no_alloc_reg): Remove. (too_high_register_pressure_p): Use pressure classes. * sched-deps.c: Remove mentioning cover classes from the file. Use ira_reg_pressure_cover instead of ira_reg_class_cover. Use ira_pressure_classes and ira_pressure_classes_num instead of ira_reg_class_cover_size and ira_reg_class_cover. (mark_insn_hard_regno_birth, mark_hard_regno_death): Use sched_regno_pressure_class instead of sched_regno_cover_class. (mark_insn_pseudo_birth, mark_pseudo_death): Ditto. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * ira.h: Add 2010 to Copyright. (ira_no_alloc_reg): Remove external. (struct target_ira): Rename x_ira_hard_regno_cover_class, x_ira_reg_class_cover_size, x_ira_reg_class_cover, and x_ira_class_translate to x_ira_hard_regno_allocno_class, x_ira_allocno_classes_num, x_ira_allocno_classes, and x_ira_allocno_class_translate. Add x_ira_pressure_classes_num, x_ira_pressure_classes, x_ira_pressure_class_translate, and x_ira_stack_reg_pressure_class. Rename x_ira_reg_class_nregs to x_ira_reg_class_max_nregs. Add x_ira_reg_class_min_nregs and x_ira_no_alloc_regs. (ira_hard_regno_cover_class): Rename to ira_hard_regno_allocno_class. (ira_reg_class_cover_size, ira_reg_class_cover): Rename to ira_allocno_classes_num and ira_allocno_classes. (ira_class_translate): Rename to ira_allocno_class_translate. (ira_pressure_classes_num, ira_pressure_classes): New definitions. (ira_pressure_class_translate, ira_stack_reg_pressure_class): Ditto. (ira_reg_class_nregs): Rename to ira_reg_class_max_nregs. (ira_reg_class_min_nregs, ira_stack_reg_pressure_class): New (ira_no_alloc_regs): New. * ira-costs.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. Use ALLOCNO_CLASS instead of ALLOCNO_COVER_CLASS. Use ALLOCNO_CLASS_COST instead of ALLOCNO_COVER_CLASS_COST. (regno_cover_class): Rename to regno_aclass. (record_reg_classes): Use ira_reg_class_subunion instead of ira_reg_class_union. (record_address_regs): Check overflow. (scan_one_insn): Ditto. (print_allocno_costs): Print total mem cost fore regional allocation. (print_pseudo_costs): Use REG_N_REFS. (find_costs_and_classes): Use classes intersected with them on the 1st pass. Check overflow. Use ira_reg_class_subunion instead of ira_reg_class_union. Use ira_allocno_class_translate and regno_aclass instead of ira_class_translate and regno_cover_class. Modify code for finding regno_aclass. Setup preferred classes for the next pass. (setup_allocno_cover_class_and_costs): Rename to setup_allocno_class_and_costs. Use regno_aclass instead of regno_cover_class. Use ira_set_allocno_class instead of ira_set_allocno_cover_class. (init_costs, finish_costs): Use regno_aclass instead of regno_cover_class. (ira_costs): Use setup_allocno_class_and_costs instead of setup_allocno_cover_class_and_costs. (ira_tune_allocno_costs_and_cover_classes): Rename to ira_tune_allocno_costs. Check overflow. Skip conflict hard regs by processing objects. Use ira_reg_class_max_nregs instead of ira_reg_class_nregs. * rtl.h (reg_cover_class): Rename to reg_allocno_class. * sched-int.h: Remove mentioning cover classes from the file. (sched_regno_cover_class): Rename to sched_regno_pressure_class. * reginfo.c: Add 2010 to Copyright. Remove mentioning cover classes from the file. (struct reg_pref): Rename coverclass into allocnoclass. (reg_cover_class): Rename to reg_allocno_class. * Makefile.in (ira-color.o): Remove SPLAY_TREE_H from dependencies. * config/alpha/alpha.h (IRA_COVER_CLASSES): Remove. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/avr/avr.h (IRA_COVER_CLASSES): Ditto. * config/bfin/bfin.h (IRA_COVER_CLASSES): Ditto. * config/cris/cris.h (IRA_COVER_CLASSES): Ditto. * config/fr30/fr30.h (IRA_COVER_CLASSES): Ditto. * config/frv/frv.h (IRA_COVER_CLASSES): Ditto. * config/h8300/h8300.h (IRA_COVER_CLASSES): Ditto. * config/i386/i386.h (STACK_REG_COVER_CLASS): Ditto. * config/i386/i386.c (TARGET_IRA_COVER_CLASSES) (i386_ira_cover_classes): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Ditto. * config/m32r/m32r.h (IRA_COVER_CLASSES): Ditto. * config/m68k/m68k.h (IRA_COVER_CLASSES): Ditto. * config/mcore/mcore.h (IRA_COVER_CLASSES): Ditto. * config/mep/mep.h (IRA_COVER_CLASSES): Ditto. * config/mips/mips.c (TARGET_IRA_COVER_CLASSES) (mips_ira_cover_classes): Ditto. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): Ditto. * config/moxie/moxie.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa64-regs.h (IRA_COVER_CLASSES): Ditto. * config/pa/pa32-regs.h (IRA_COVER_CLASSES): Ditto. * config/picochip/picochip.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES_PRE_VSX) (IRA_COVER_CLASSES_VSX): Ditto. * config/rs6000/rs6000.c (TARGET_IRA_COVER_CLASSES) (rs6000_ira_cover_classes): Ditto. * config/rx/rx.h (IRA_COVER_CLASSES): Ditto. * config/s390/s390.h (IRA_COVER_CLASSES): Ditto. * config/score/score.h (IRA_COVER_CLASSES): Ditto. * config/sh/sh.h (IRA_COVER_CLASSES): Ditto. * config/sparc/sparc.h (IRA_COVER_CLASSES): Ditto. * config/spu/spu.h (IRA_COVER_CLASSES): Ditto. * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Ditto. * config/v850/v850.h (IRA_COVER_CLASSES): Ditto. * config/vax/vax.h (IRA_COVER_CLASSES): Ditto. * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Ditto. From-SVN: r171649
2011-03-29 03:02:05 +02:00
*vec = reg_costs = ira_allocate_cost_vector (aclass);
len = ira_class_hard_regs_num[aclass];
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
if (src != NULL)
memcpy (reg_costs, src, sizeof (int) * len);
else
{
for (i = 0; i < len; i++)
reg_costs[i] = val;
}
}
extern rtx ira_create_new_reg (rtx);
extern int first_moveable_pseudo, last_moveable_pseudo;
#endif /* GCC_IRA_INT_H */