diff options
author | vmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-03-28 01:53:24 +0000 |
---|---|---|
committer | vmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-03-28 01:53:24 +0000 |
commit | a5af08d26ce1678e462f91bb3fb9336e30d02ca8 (patch) | |
tree | 761665b37aeeeb5eb4e3f9b4770772ea49679cc0 /gcc/ira-conflicts.c | |
parent | 24b0a129a158dc3987a676c625817b9b21e9d4e9 (diff) | |
download | gcc-a5af08d26ce1678e462f91bb3fb9336e30d02ca8.tar.gz |
2011-03-27 Vladimir Makarov <vmakarov@redhat.com>
PR bootstrap/48307
Revert the previous patch.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@171589 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ira-conflicts.c')
-rw-r--r-- | gcc/ira-conflicts.c | 63 |
1 files changed, 27 insertions, 36 deletions
diff --git a/gcc/ira-conflicts.c b/gcc/ira-conflicts.c index 04d881e99de..498b38b3bd6 100644 --- a/gcc/ira-conflicts.c +++ b/gcc/ira-conflicts.c @@ -97,7 +97,7 @@ build_conflict_bit_table (void) { int i; unsigned int j; - enum reg_class aclass; + enum reg_class cover_class; int object_set_words, allocated_words_num, conflict_bit_vec_words_num; live_range_t r; ira_allocno_t allocno; @@ -170,15 +170,15 @@ build_conflict_bit_table (void) gcc_assert (id < ira_objects_num); - aclass = ALLOCNO_CLASS (allocno); + cover_class = ALLOCNO_COVER_CLASS (allocno); sparseset_set_bit (objects_live, id); EXECUTE_IF_SET_IN_SPARSESET (objects_live, j) { ira_object_t live_obj = ira_object_id_map[j]; ira_allocno_t live_a = OBJECT_ALLOCNO (live_obj); - enum reg_class live_aclass = ALLOCNO_CLASS (live_a); + enum reg_class live_cover_class = ALLOCNO_COVER_CLASS (live_a); - if (ira_reg_classes_intersect_p[aclass][live_aclass] + if (ira_reg_classes_intersect_p[cover_class][live_cover_class] /* Don't set up conflict for the allocno with itself. */ && live_a != allocno) { @@ -205,7 +205,6 @@ allocnos_conflict_for_copy_p (ira_allocno_t a1, ira_allocno_t a2) the lowest order words. */ ira_object_t obj1 = ALLOCNO_OBJECT (a1, 0); ira_object_t obj2 = ALLOCNO_OBJECT (a2, 0); - return OBJECTS_CONFLICT_P (obj1, obj2); } @@ -390,7 +389,7 @@ process_regs_for_copy (rtx reg1, rtx reg2, bool constraint_p, int allocno_preferenced_hard_regno, cost, index, offset1, offset2; bool only_regs_p; ira_allocno_t a; - enum reg_class rclass, aclass; + enum reg_class rclass, cover_class; enum machine_mode mode; ira_copy_t cp; @@ -427,37 +426,35 @@ process_regs_for_copy (rtx reg1, rtx reg2, bool constraint_p, return false; } - if (! IN_RANGE (allocno_preferenced_hard_regno, - 0, FIRST_PSEUDO_REGISTER - 1)) + if (! IN_RANGE (allocno_preferenced_hard_regno, 0, FIRST_PSEUDO_REGISTER - 1)) /* Can not be tied. */ return false; rclass = REGNO_REG_CLASS (allocno_preferenced_hard_regno); mode = ALLOCNO_MODE (a); - aclass = ALLOCNO_CLASS (a); + cover_class = ALLOCNO_COVER_CLASS (a); if (only_regs_p && insn != NULL_RTX && reg_class_size[rclass] <= (unsigned) CLASS_MAX_NREGS (rclass, mode)) /* It is already taken into account in ira-costs.c. */ return false; - index = ira_class_hard_reg_index[aclass][allocno_preferenced_hard_regno]; + index = ira_class_hard_reg_index[cover_class][allocno_preferenced_hard_regno]; if (index < 0) - /* Can not be tied. It is not in the allocno class. */ + /* Can not be tied. It is not in the cover class. */ return false; - ira_init_register_move_cost_if_necessary (mode); if (HARD_REGISTER_P (reg1)) - cost = ira_register_move_cost[mode][aclass][rclass] * freq; + cost = ira_get_register_move_cost (mode, cover_class, rclass) * freq; else - cost = ira_register_move_cost[mode][rclass][aclass] * freq; + cost = ira_get_register_move_cost (mode, rclass, cover_class) * freq; do { ira_allocate_and_set_costs - (&ALLOCNO_HARD_REG_COSTS (a), aclass, - ALLOCNO_CLASS_COST (a)); + (&ALLOCNO_HARD_REG_COSTS (a), cover_class, + ALLOCNO_COVER_CLASS_COST (a)); ira_allocate_and_set_costs - (&ALLOCNO_CONFLICT_HARD_REG_COSTS (a), aclass, 0); + (&ALLOCNO_CONFLICT_HARD_REG_COSTS (a), cover_class, 0); ALLOCNO_HARD_REG_COSTS (a)[index] -= cost; ALLOCNO_CONFLICT_HARD_REG_COSTS (a)[index] -= cost; - if (ALLOCNO_HARD_REG_COSTS (a)[index] < ALLOCNO_CLASS_COST (a)) - ALLOCNO_CLASS_COST (a) = ALLOCNO_HARD_REG_COSTS (a)[index]; + if (ALLOCNO_HARD_REG_COSTS (a)[index] < ALLOCNO_COVER_CLASS_COST (a)) + ALLOCNO_COVER_CLASS_COST (a) = ALLOCNO_HARD_REG_COSTS (a)[index]; a = ira_parent_or_cap_allocno (a); } while (a != NULL); @@ -510,8 +507,7 @@ add_insn_allocno_copies (rtx insn) ? SET_SRC (set) : SUBREG_REG (SET_SRC (set))) != NULL_RTX) { - process_regs_for_copy (SET_DEST (set), SET_SRC (set), - false, insn, freq); + process_regs_for_copy (SET_DEST (set), SET_SRC (set), false, insn, freq); return; } /* Fast check of possibility of constraint or shuffle copies. If @@ -612,7 +608,6 @@ build_object_conflicts (ira_object_t obj) ira_allocno_t a = OBJECT_ALLOCNO (obj); IRA_INT_TYPE *object_conflicts; minmax_set_iterator asi; - int parent_min, parent_max; object_conflicts = conflicts[OBJECT_CONFLICT_ID (obj)]; px = 0; @@ -621,9 +616,8 @@ build_object_conflicts (ira_object_t obj) { ira_object_t another_obj = ira_object_id_map[i]; ira_allocno_t another_a = OBJECT_ALLOCNO (obj); - ira_assert (ira_reg_classes_intersect_p - [ALLOCNO_CLASS (a)][ALLOCNO_CLASS (another_a)]); + [ALLOCNO_COVER_CLASS (a)][ALLOCNO_COVER_CLASS (another_a)]); collected_conflict_objects[px++] = another_obj; } if (ira_conflict_vector_profitable_p (obj, px)) @@ -638,7 +632,6 @@ build_object_conflicts (ira_object_t obj) else { int conflict_bit_vec_words_num; - OBJECT_CONFLICT_ARRAY (obj) = object_conflicts; if (OBJECT_MAX (obj) < OBJECT_MIN (obj)) conflict_bit_vec_words_num = 0; @@ -653,12 +646,10 @@ build_object_conflicts (ira_object_t obj) parent_a = ira_parent_or_cap_allocno (a); if (parent_a == NULL) return; - ira_assert (ALLOCNO_CLASS (a) == ALLOCNO_CLASS (parent_a)); + ira_assert (ALLOCNO_COVER_CLASS (a) == ALLOCNO_COVER_CLASS (parent_a)); ira_assert (ALLOCNO_NUM_OBJECTS (a) == ALLOCNO_NUM_OBJECTS (parent_a)); parent_obj = ALLOCNO_OBJECT (parent_a, OBJECT_SUBWORD (obj)); parent_num = OBJECT_CONFLICT_ID (parent_obj); - parent_min = OBJECT_MIN (parent_obj); - parent_max = OBJECT_MAX (parent_obj); FOR_EACH_BIT_IN_MINMAX_SET (object_conflicts, OBJECT_MIN (obj), OBJECT_MAX (obj), i, asi) { @@ -667,20 +658,21 @@ build_object_conflicts (ira_object_t obj) int another_word = OBJECT_SUBWORD (another_obj); ira_assert (ira_reg_classes_intersect_p - [ALLOCNO_CLASS (a)][ALLOCNO_CLASS (another_a)]); + [ALLOCNO_COVER_CLASS (a)][ALLOCNO_COVER_CLASS (another_a)]); another_parent_a = ira_parent_or_cap_allocno (another_a); if (another_parent_a == NULL) continue; ira_assert (ALLOCNO_NUM (another_parent_a) >= 0); - ira_assert (ALLOCNO_CLASS (another_a) - == ALLOCNO_CLASS (another_parent_a)); + ira_assert (ALLOCNO_COVER_CLASS (another_a) + == ALLOCNO_COVER_CLASS (another_parent_a)); ira_assert (ALLOCNO_NUM_OBJECTS (another_a) == ALLOCNO_NUM_OBJECTS (another_parent_a)); SET_MINMAX_SET_BIT (conflicts[parent_num], OBJECT_CONFLICT_ID (ALLOCNO_OBJECT (another_parent_a, - another_word)), - parent_min, parent_max); + another_word)), + OBJECT_MIN (parent_obj), + OBJECT_MAX (parent_obj)); } } @@ -800,14 +792,14 @@ print_allocno_conflicts (FILE * file, bool reg_p, ira_allocno_t a) COPY_HARD_REG_SET (conflicting_hard_regs, OBJECT_TOTAL_CONFLICT_HARD_REGS (obj)); AND_COMPL_HARD_REG_SET (conflicting_hard_regs, ira_no_alloc_regs); AND_HARD_REG_SET (conflicting_hard_regs, - reg_class_contents[ALLOCNO_CLASS (a)]); + reg_class_contents[ALLOCNO_COVER_CLASS (a)]); print_hard_reg_set (file, "\n;; total conflict hard regs:", conflicting_hard_regs); COPY_HARD_REG_SET (conflicting_hard_regs, OBJECT_CONFLICT_HARD_REGS (obj)); AND_COMPL_HARD_REG_SET (conflicting_hard_regs, ira_no_alloc_regs); AND_HARD_REG_SET (conflicting_hard_regs, - reg_class_contents[ALLOCNO_CLASS (a)]); + reg_class_contents[ALLOCNO_COVER_CLASS (a)]); print_hard_reg_set (file, ";; conflict hard regs:", conflicting_hard_regs); putc ('\n', file); @@ -884,7 +876,6 @@ ira_build_conflicts (void) FOR_EACH_ALLOCNO (a, ai) { int i, n = ALLOCNO_NUM_OBJECTS (a); - for (i = 0; i < n; i++) { ira_object_t obj = ALLOCNO_OBJECT (a, i); |