summaryrefslogtreecommitdiff
path: root/gcc/ira-costs.c
diff options
context:
space:
mode:
authorvmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4>2008-11-10 23:21:45 +0000
committervmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4>2008-11-10 23:21:45 +0000
commitb7c06809df0910385638eb0b6d1a30f0a184f220 (patch)
tree7fd0254faf506029de880777901eccc09123341f /gcc/ira-costs.c
parent8a4445c7a7258619444eb21659d0a1637b454635 (diff)
downloadgcc-b7c06809df0910385638eb0b6d1a30f0a184f220.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@141753 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ira-costs.c')
-rw-r--r--gcc/ira-costs.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/gcc/ira-costs.c b/gcc/ira-costs.c
index eade4da4d1c..14d473ed285 100644
--- a/gcc/ira-costs.c
+++ b/gcc/ira-costs.c
@@ -989,11 +989,14 @@ scan_one_insn (rtx insn)
&& (note = find_reg_note (insn, REG_EQUIV, NULL_RTX)) != NULL_RTX
&& MEM_P (XEXP (note, 0)))
{
- COSTS_OF_ALLOCNO (allocno_costs,
- ALLOCNO_NUM (ira_curr_regno_allocno_map
- [REGNO (SET_DEST (set))]))->mem_cost
- -= (ira_memory_move_cost[GET_MODE (SET_DEST (set))][GENERAL_REGS][1]
- * frequency);
+ enum reg_class cl = GENERAL_REGS;
+ rtx reg = SET_DEST (set);
+ int num = ALLOCNO_NUM (ira_curr_regno_allocno_map[REGNO (reg)]);
+
+ if (allocno_pref)
+ cl = allocno_pref[num];
+ COSTS_OF_ALLOCNO (allocno_costs, num)->mem_cost
+ -= ira_memory_move_cost[GET_MODE (reg)][cl][1] * frequency;
record_address_regs (GET_MODE (SET_SRC (set)), XEXP (SET_SRC (set), 0),
0, MEM, SCRATCH, frequency * 2);
}