diff options
author | Vladimir Makarov <vmakarov@redhat.com> | 2011-03-28 01:53:24 +0000 |
---|---|---|
committer | Vladimir Makarov <vmakarov@gcc.gnu.org> | 2011-03-28 01:53:24 +0000 |
commit | 99710245becabdfa97984d1f68a01f9876124417 (patch) | |
tree | 761665b37aeeeb5eb4e3f9b4770772ea49679cc0 /gcc/ira-lives.c | |
parent | 0854e22029b6d45bc67140bf5d5493ee5c9294ef (diff) | |
download | gcc-99710245becabdfa97984d1f68a01f9876124417.zip gcc-99710245becabdfa97984d1f68a01f9876124417.tar.gz gcc-99710245becabdfa97984d1f68a01f9876124417.tar.bz2 |
re PR bootstrap/48307 (Bootstrap failure)
2011-03-27 Vladimir Makarov <vmakarov@redhat.com>
PR bootstrap/48307
Revert the previous patch.
From-SVN: r171589
Diffstat (limited to 'gcc/ira-lives.c')
-rw-r--r-- | gcc/ira-lives.c | 157 |
1 files changed, 69 insertions, 88 deletions
diff --git a/gcc/ira-lives.c b/gcc/ira-lives.c index 8eb9c03..5c5c415 100644 --- a/gcc/ira-lives.c +++ b/gcc/ira-lives.c @@ -64,8 +64,8 @@ static int curr_point; register pressure excess. 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. It is defined only for - pressure classes. */ + class available for the allocation. It is defined only for cover + classes. */ static int high_pressure_start_point[N_REG_CLASSES]; /* Objects live at current point in the scan. */ @@ -97,7 +97,6 @@ make_hard_regno_born (int regno) EXECUTE_IF_SET_IN_SPARSESET (objects_live, i) { ira_object_t obj = ira_object_id_map[i]; - SET_HARD_REG_BIT (OBJECT_CONFLICT_HARD_REGS (obj), regno); SET_HARD_REG_BIT (OBJECT_TOTAL_CONFLICT_HARD_REGS (obj), regno); } @@ -135,17 +134,14 @@ update_allocno_pressure_excess_length (ira_object_t obj) { ira_allocno_t a = OBJECT_ALLOCNO (obj); int start, i; - enum reg_class aclass, pclass, cl; + enum reg_class cover_class, cl; live_range_t p; - aclass = ALLOCNO_CLASS (a); - pclass = ira_pressure_class_translate[aclass]; + cover_class = ALLOCNO_COVER_CLASS (a); for (i = 0; - (cl = ira_reg_class_super_classes[pclass][i]) != LIM_REG_CLASSES; + (cl = ira_reg_class_super_classes[cover_class][i]) != LIM_REG_CLASSES; i++) { - if (! ira_reg_pressure_class_p[cl]) - continue; if (high_pressure_start_point[cl] < 0) continue; p = OBJECT_LIVE_RANGES (obj); @@ -170,26 +166,24 @@ make_object_dead (ira_object_t obj) update_allocno_pressure_excess_length (obj); } -/* The current register pressures for each pressure class for the current +/* The current register pressures for each cover class for the current basic block. */ static int curr_reg_pressure[N_REG_CLASSES]; -/* Record that register pressure for PCLASS increased by N registers. - Update the current register pressure, maximal register pressure for - the current BB and the start point of the register pressure - excess. */ +/* Record that register pressure for COVER_CLASS increased by N + registers. Update the current register pressure, maximal register + pressure for the current BB and the start point of the register + pressure excess. */ static void -inc_register_pressure (enum reg_class pclass, int n) +inc_register_pressure (enum reg_class cover_class, int n) { int i; enum reg_class cl; for (i = 0; - (cl = ira_reg_class_super_classes[pclass][i]) != LIM_REG_CLASSES; + (cl = ira_reg_class_super_classes[cover_class][i]) != LIM_REG_CLASSES; i++) { - if (! ira_reg_pressure_class_p[cl]) - continue; curr_reg_pressure[cl] += n; if (high_pressure_start_point[cl] < 0 && (curr_reg_pressure[cl] > ira_available_class_regs[cl])) @@ -199,13 +193,13 @@ inc_register_pressure (enum reg_class pclass, int n) } } -/* Record that register pressure for PCLASS has decreased by NREGS - registers; update current register pressure, start point of the - register pressure excess, and register pressure excess length for - living allocnos. */ +/* Record that register pressure for COVER_CLASS has decreased by + NREGS registers; update current register pressure, start point of + the register pressure excess, and register pressure excess length + for living allocnos. */ static void -dec_register_pressure (enum reg_class pclass, int nregs) +dec_register_pressure (enum reg_class cover_class, int nregs) { int i; unsigned int j; @@ -213,11 +207,9 @@ dec_register_pressure (enum reg_class pclass, int nregs) bool set_p = false; for (i = 0; - (cl = ira_reg_class_super_classes[pclass][i]) != LIM_REG_CLASSES; + (cl = ira_reg_class_super_classes[cover_class][i]) != LIM_REG_CLASSES; i++) { - if (! ira_reg_pressure_class_p[cl]) - continue; curr_reg_pressure[cl] -= nregs; ira_assert (curr_reg_pressure[cl] >= 0); if (high_pressure_start_point[cl] >= 0 @@ -229,15 +221,12 @@ dec_register_pressure (enum reg_class pclass, int nregs) EXECUTE_IF_SET_IN_SPARSESET (objects_live, j) update_allocno_pressure_excess_length (ira_object_id_map[j]); for (i = 0; - (cl = ira_reg_class_super_classes[pclass][i]) != LIM_REG_CLASSES; + (cl = ira_reg_class_super_classes[cover_class][i]) + != LIM_REG_CLASSES; i++) - { - if (! ira_reg_pressure_class_p[cl]) - continue; - if (high_pressure_start_point[cl] >= 0 - && curr_reg_pressure[cl] <= ira_available_class_regs[cl]) - high_pressure_start_point[cl] = -1; - } + if (high_pressure_start_point[cl] >= 0 + && curr_reg_pressure[cl] <= ira_available_class_regs[cl]) + high_pressure_start_point[cl] = -1; } } @@ -247,8 +236,8 @@ static void mark_pseudo_regno_live (int regno) { ira_allocno_t a = ira_curr_regno_allocno_map[regno]; - enum reg_class pclass; int i, n, nregs; + enum reg_class cl; if (a == NULL) return; @@ -257,8 +246,8 @@ mark_pseudo_regno_live (int regno) allocno_saved_at_call[ALLOCNO_NUM (a)] = 0; n = ALLOCNO_NUM_OBJECTS (a); - pclass = ira_pressure_class_translate[ALLOCNO_CLASS (a)]; - nregs = ira_reg_class_max_nregs[ALLOCNO_CLASS (a)][ALLOCNO_MODE (a)]; + cl = ALLOCNO_COVER_CLASS (a); + nregs = ira_reg_class_nregs[cl][ALLOCNO_MODE (a)]; if (n > 1) { /* We track every subobject separately. */ @@ -269,11 +258,10 @@ mark_pseudo_regno_live (int regno) for (i = 0; i < n; i++) { ira_object_t obj = ALLOCNO_OBJECT (a, i); - if (sparseset_bit_p (objects_live, OBJECT_CONFLICT_ID (obj))) continue; - inc_register_pressure (pclass, nregs); + inc_register_pressure (cl, nregs); make_object_born (obj); } } @@ -286,7 +274,7 @@ mark_pseudo_regno_subword_live (int regno, int subword) { ira_allocno_t a = ira_curr_regno_allocno_map[regno]; int n, nregs; - enum reg_class pclass; + enum reg_class cl; ira_object_t obj; if (a == NULL) @@ -302,15 +290,15 @@ mark_pseudo_regno_subword_live (int regno, int subword) return; } - pclass = ira_pressure_class_translate[ALLOCNO_CLASS (a)]; - nregs = ira_reg_class_max_nregs[pclass][ALLOCNO_MODE (a)]; + cl = ALLOCNO_COVER_CLASS (a); + nregs = ira_reg_class_nregs[cl][ALLOCNO_MODE (a)]; gcc_assert (nregs == n); obj = ALLOCNO_OBJECT (a, subword); if (sparseset_bit_p (objects_live, OBJECT_CONFLICT_ID (obj))) return; - inc_register_pressure (pclass, nregs); + inc_register_pressure (cl, nregs); make_object_born (obj); } @@ -325,16 +313,14 @@ mark_hard_reg_live (rtx reg) if (! TEST_HARD_REG_BIT (ira_no_alloc_regs, regno)) { int last = regno + hard_regno_nregs[regno][GET_MODE (reg)]; - enum reg_class aclass, pclass; while (regno < last) { if (! TEST_HARD_REG_BIT (hard_regs_live, regno) && ! TEST_HARD_REG_BIT (eliminable_regset, regno)) { - aclass = ira_hard_regno_allocno_class[regno]; - pclass = ira_pressure_class_translate[aclass]; - inc_register_pressure (pclass, 1); + enum reg_class cover_class = ira_hard_regno_cover_class[regno]; + inc_register_pressure (cover_class, 1); make_hard_regno_born (regno); } regno++; @@ -389,8 +375,8 @@ mark_pseudo_regno_dead (int regno) allocno_saved_at_call[ALLOCNO_NUM (a)] = 0; n = ALLOCNO_NUM_OBJECTS (a); - cl = ira_pressure_class_translate[ALLOCNO_CLASS (a)]; - nregs = ira_reg_class_max_nregs[ALLOCNO_CLASS (a)][ALLOCNO_MODE (a)]; + cl = ALLOCNO_COVER_CLASS (a); + nregs = ira_reg_class_nregs[cl][ALLOCNO_MODE (a)]; if (n > 1) { /* We track every subobject separately. */ @@ -429,8 +415,8 @@ mark_pseudo_regno_subword_dead (int regno, int subword) /* The allocno as a whole doesn't die in this case. */ return; - cl = ira_pressure_class_translate[ALLOCNO_CLASS (a)]; - nregs = ira_reg_class_max_nregs[cl][ALLOCNO_MODE (a)]; + cl = ALLOCNO_COVER_CLASS (a); + nregs = ira_reg_class_nregs[cl][ALLOCNO_MODE (a)]; gcc_assert (nregs == n); obj = ALLOCNO_OBJECT (a, subword); @@ -451,15 +437,13 @@ mark_hard_reg_dead (rtx reg) if (! TEST_HARD_REG_BIT (ira_no_alloc_regs, regno)) { int last = regno + hard_regno_nregs[regno][GET_MODE (reg)]; - enum reg_class aclass, pclass; while (regno < last) { if (TEST_HARD_REG_BIT (hard_regs_live, regno)) { - aclass = ira_hard_regno_allocno_class[regno]; - pclass = ira_pressure_class_translate[aclass]; - dec_register_pressure (pclass, 1); + enum reg_class cover_class = ira_hard_regno_cover_class[regno]; + dec_register_pressure (cover_class, 1); make_hard_regno_dead (regno); } regno++; @@ -528,7 +512,7 @@ make_pseudo_conflict (rtx reg, enum reg_class cl, rtx dreg, rtx orig_dreg, return advance_p; a = ira_curr_regno_allocno_map[REGNO (reg)]; - if (! reg_classes_intersect_p (cl, ALLOCNO_CLASS (a))) + if (! reg_classes_intersect_p (cl, ALLOCNO_COVER_CLASS (a))) return advance_p; if (advance_p) @@ -601,7 +585,7 @@ check_and_make_def_conflict (int alt, int def, enum reg_class def_cl) return; a = ira_curr_regno_allocno_map[REGNO (dreg)]; - acl = ALLOCNO_CLASS (a); + acl = ALLOCNO_COVER_CLASS (a); if (! reg_classes_intersect_p (acl, def_cl)) return; @@ -831,7 +815,7 @@ single_reg_class (const char *constraints, rtx op, rtx equiv_const) : REG_CLASS_FROM_CONSTRAINT (c, constraints)); if ((cl != NO_REGS && next_cl != cl) || (ira_available_class_regs[next_cl] - > ira_reg_class_max_nregs[next_cl][GET_MODE (op)])) + > ira_reg_class_nregs[next_cl][GET_MODE (op)])) return NO_REGS; cl = next_cl; break; @@ -844,7 +828,7 @@ single_reg_class (const char *constraints, rtx op, rtx equiv_const) if ((cl != NO_REGS && next_cl != cl) || next_cl == NO_REGS || (ira_available_class_regs[next_cl] - > ira_reg_class_max_nregs[next_cl][GET_MODE (op)])) + > ira_reg_class_nregs[next_cl][GET_MODE (op)])) return NO_REGS; cl = next_cl; break; @@ -919,7 +903,7 @@ ira_implicitly_set_insn_hard_regs (HARD_REG_SET *set) regs in this class are fixed. */ && ira_available_class_regs[cl] != 0 && (ira_available_class_regs[cl] - <= ira_reg_class_max_nregs[cl][mode])) + <= ira_reg_class_nregs[cl][mode])) IOR_HARD_REG_SET (*set, reg_class_contents[cl]); break; } @@ -960,11 +944,11 @@ process_single_reg_class_operands (bool in_p, int freq) if (REG_P (operand) && (regno = REGNO (operand)) >= FIRST_PSEUDO_REGISTER) { - enum reg_class aclass; + enum reg_class cover_class; operand_a = ira_curr_regno_allocno_map[regno]; - aclass = ALLOCNO_CLASS (operand_a); - if (ira_class_subset_p[cl][aclass] + cover_class = ALLOCNO_COVER_CLASS (operand_a); + if (ira_class_subset_p[cl][cover_class] && ira_class_hard_regs_num[cl] != 0) { /* View the desired allocation of OPERAND as: @@ -984,19 +968,21 @@ process_single_reg_class_operands (bool in_p, int freq) offset = subreg_lowpart_offset (ymode, xmode); yregno = simplify_subreg_regno (xregno, xmode, offset, ymode); if (yregno >= 0 - && ira_class_hard_reg_index[aclass][yregno] >= 0) + && ira_class_hard_reg_index[cover_class][yregno] >= 0) { int cost; ira_allocate_and_set_costs (&ALLOCNO_CONFLICT_HARD_REG_COSTS (operand_a), - aclass, 0); - ira_init_register_move_cost_if_necessary (xmode); - cost = freq * (in_p - ? ira_register_move_cost[xmode][aclass][cl] - : ira_register_move_cost[xmode][cl][aclass]); + cover_class, 0); + cost + = (freq + * (in_p + ? ira_get_register_move_cost (xmode, cover_class, cl) + : ira_get_register_move_cost (xmode, cl, + cover_class))); ALLOCNO_CONFLICT_HARD_REG_COSTS (operand_a) - [ira_class_hard_reg_index[aclass][yregno]] -= cost; + [ira_class_hard_reg_index[cover_class][yregno]] -= cost; } } } @@ -1054,10 +1040,10 @@ process_bb_node_lives (ira_loop_tree_node_t loop_tree_node) bb = loop_tree_node->bb; if (bb != NULL) { - for (i = 0; i < ira_pressure_classes_num; i++) + for (i = 0; i < ira_reg_class_cover_size; i++) { - curr_reg_pressure[ira_pressure_classes[i]] = 0; - high_pressure_start_point[ira_pressure_classes[i]] = -1; + curr_reg_pressure[ira_reg_class_cover[i]] = 0; + high_pressure_start_point[ira_reg_class_cover[i]] = -1; } curr_bb_node = loop_tree_node; reg_live_out = DF_LR_OUT (bb); @@ -1068,17 +1054,14 @@ process_bb_node_lives (ira_loop_tree_node_t loop_tree_node) for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) if (TEST_HARD_REG_BIT (hard_regs_live, i)) { - enum reg_class aclass, pclass, cl; + enum reg_class cover_class, cl; - aclass = ira_allocno_class_translate[REGNO_REG_CLASS (i)]; - pclass = ira_pressure_class_translate[aclass]; + cover_class = ira_class_translate[REGNO_REG_CLASS (i)]; for (j = 0; - (cl = ira_reg_class_super_classes[pclass][j]) + (cl = ira_reg_class_super_classes[cover_class][j]) != LIM_REG_CLASSES; j++) { - if (! ira_reg_pressure_class_p[cl]) - continue; curr_reg_pressure[cl]++; if (curr_bb_node->reg_pressure[cl] < curr_reg_pressure[cl]) curr_bb_node->reg_pressure[cl] = curr_reg_pressure[cl]; @@ -1278,7 +1261,6 @@ process_bb_node_lives (ira_loop_tree_node_t loop_tree_node) EXECUTE_IF_SET_IN_SPARSESET (objects_live, px) { ira_allocno_t a = OBJECT_ALLOCNO (ira_object_id_map[px]); - ALLOCNO_NO_STACK_REG_P (a) = true; ALLOCNO_TOTAL_NO_STACK_REG_P (a) = true; } @@ -1302,15 +1284,15 @@ process_bb_node_lives (ira_loop_tree_node_t loop_tree_node) } /* Propagate register pressure to upper loop tree nodes: */ if (loop_tree_node != ira_loop_tree_root) - for (i = 0; i < ira_pressure_classes_num; i++) + for (i = 0; i < ira_reg_class_cover_size; i++) { - enum reg_class pclass; + enum reg_class cover_class; - pclass = ira_pressure_classes[i]; - if (loop_tree_node->reg_pressure[pclass] - > loop_tree_node->parent->reg_pressure[pclass]) - loop_tree_node->parent->reg_pressure[pclass] - = loop_tree_node->reg_pressure[pclass]; + cover_class = ira_reg_class_cover[i]; + if (loop_tree_node->reg_pressure[cover_class] + > loop_tree_node->parent->reg_pressure[cover_class]) + loop_tree_node->parent->reg_pressure[cover_class] + = loop_tree_node->reg_pressure[cover_class]; } } @@ -1442,7 +1424,6 @@ print_allocno_live_ranges (FILE *f, ira_allocno_t a) { int n = ALLOCNO_NUM_OBJECTS (a); int i; - for (i = 0; i < n; i++) { fprintf (f, " a%d(r%d", ALLOCNO_NUM (a), ALLOCNO_REGNO (a)); |