Enhance hardreg preference heuristic in IRA.
1. Propagate hardreg disfavor as well as hardreg preference.
2. Stop propagate hardreg preference between alternate copies generated from the same insn.
3. Stop propagate hardreg disfavor to allocno with alternate copy.
2014-10-25 Wei Mi <wmi@google.com>
* ira-build.c (struct ira_copy_hasher): New struct.
(ira_copy_hasher::hash): Hash func for copy_list_table.
(ira_copy_hasher::equal): Compare func for copy_list_table.
(initiate_copies): Create copy_list_table.
(ira_create_copy): Initialize copy_list field.
(add_allocno_copy_to_list): Add copy to copy_list_table.
(find_alternate_copy): New func.
(finish_copies): Dispose copy_list_table.
* ira-conflicts.c (process_reg_shuffles): Add a param.
(add_insn_allocno_copies): Add actuals for process_reg_shuffles
and process_regs_for_copy.
* ira-int.h (struct ira_allocno_copy): Add a field copy_list.
* ira-color.c (struct allocno_color_data): Add a field
new_conflict_hard_regs.
(free_a_update_cost_record): New func.
(queue_update_cost): Change param type.
(get_next_update_cost): Ditto.
(update_costs_from_allocno): Adjust heuristic for hardreg
preference and disfavor propagation.
(update_costs_from_prefs): Add an actual for callsite of
update_costs_from_allocno.
(update_costs_from_copies): Ditto.
(restore_costs_from_copies): Ditto.
(restore_costs_from_conflicts): New func. Used to propagate
hardreg disfavor.
(update_conflict_hard_regno_costs): Adjust heuristic for hardreg
preference and disfavor propagation.
(assign_hard_reg): Call restore_costs_from_conflicts.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/google@216697 138bc75d-0d04-0410-961f-82ee72b054a4