From a49ae2179409cf9ed7e78e93643ec4891e9ae8fe Mon Sep 17 00:00:00 2001 From: Bernd Schmidt Date: Wed, 14 Jul 2010 01:53:35 +0000 Subject: 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 --- gcc/ira-emit.c | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) (limited to 'gcc/ira-emit.c') diff --git a/gcc/ira-emit.c b/gcc/ira-emit.c index 705a306..b5bfb8c 100644 --- a/gcc/ira-emit.c +++ b/gcc/ira-emit.c @@ -646,7 +646,7 @@ static move_t modify_move_list (move_t list) { int i, n, nregs, hard_regno; - ira_allocno_t to, from, new_allocno; + ira_allocno_t to, from; move_t move, new_move, set_move, first, last; if (list == NULL) @@ -715,6 +715,9 @@ modify_move_list (move_t list) && ALLOCNO_HARD_REGNO (hard_regno_last_set[hard_regno + i]->to) >= 0) { + ira_allocno_t new_allocno; + ira_object_t new_obj; + set_move = hard_regno_last_set[hard_regno + i]; /* It does not matter what loop_tree_node (of TO or FROM) to use for the new allocno because of @@ -726,16 +729,19 @@ modify_move_list (move_t list) ALLOCNO_MODE (new_allocno) = ALLOCNO_MODE (set_move->to); ira_set_allocno_cover_class (new_allocno, ALLOCNO_COVER_CLASS (set_move->to)); + ira_create_allocno_object (new_allocno); ALLOCNO_ASSIGNED_P (new_allocno) = true; ALLOCNO_HARD_REGNO (new_allocno) = -1; ALLOCNO_REG (new_allocno) = create_new_reg (ALLOCNO_REG (set_move->to)); - ALLOCNO_CONFLICT_ID (new_allocno) = ALLOCNO_NUM (new_allocno); + + new_obj = ALLOCNO_OBJECT (new_allocno); + /* Make it possibly conflicting with all earlier created allocnos. Cases where temporary allocnos created to remove the cycles are quite rare. */ - ALLOCNO_MIN (new_allocno) = 0; - ALLOCNO_MAX (new_allocno) = ira_allocnos_num - 1; + OBJECT_MIN (new_obj) = 0; + OBJECT_MAX (new_obj) = ira_objects_num - 1; new_move = create_move (set_move->to, new_allocno); set_move->to = new_allocno; VEC_safe_push (move_t, heap, move_vec, new_move); @@ -911,7 +917,7 @@ add_range_and_copies_from_move_list (move_t list, ira_loop_tree_node_t node, int start, n; unsigned int regno; move_t move; - ira_allocno_t to, from, a; + ira_allocno_t a; ira_copy_t cp; live_range_t r; bitmap_iterator bi; @@ -929,22 +935,23 @@ add_range_and_copies_from_move_list (move_t list, ira_loop_tree_node_t node, start = ira_max_point; for (move = list; move != NULL; move = move->next) { - from = move->from; - to = move->to; - if (ALLOCNO_CONFLICT_ALLOCNO_ARRAY (to) == NULL) + ira_allocno_t from = move->from; + ira_allocno_t to = move->to; + ira_object_t from_obj = ALLOCNO_OBJECT (from); + ira_object_t to_obj = ALLOCNO_OBJECT (to); + if (OBJECT_CONFLICT_ARRAY (to_obj) == NULL) { if (internal_flag_ira_verbose > 2 && ira_dump_file != NULL) fprintf (ira_dump_file, " Allocate conflicts for a%dr%d\n", ALLOCNO_NUM (to), REGNO (ALLOCNO_REG (to))); - ira_allocate_allocno_conflicts (to, n); + ira_allocate_object_conflicts (to_obj, n); } bitmap_clear_bit (live_through, ALLOCNO_REGNO (from)); bitmap_clear_bit (live_through, ALLOCNO_REGNO (to)); - IOR_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (from), hard_regs_live); - IOR_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (to), hard_regs_live); - IOR_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (from), - hard_regs_live); - IOR_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (to), hard_regs_live); + IOR_HARD_REG_SET (OBJECT_CONFLICT_HARD_REGS (from_obj), hard_regs_live); + IOR_HARD_REG_SET (OBJECT_CONFLICT_HARD_REGS (to_obj), hard_regs_live); + IOR_HARD_REG_SET (OBJECT_TOTAL_CONFLICT_HARD_REGS (from_obj), hard_regs_live); + IOR_HARD_REG_SET (OBJECT_TOTAL_CONFLICT_HARD_REGS (to_obj), hard_regs_live); update_costs (from, true, freq); update_costs (to, false, freq); cp = ira_add_allocno_copy (from, to, freq, false, move->insn, NULL); @@ -994,6 +1001,7 @@ add_range_and_copies_from_move_list (move_t list, ira_loop_tree_node_t node, } EXECUTE_IF_SET_IN_BITMAP (live_through, FIRST_PSEUDO_REGISTER, regno, bi) { + ira_allocno_t to; a = node->regno_allocno_map[regno]; if ((to = ALLOCNO_MEM_OPTIMIZED_DEST (a)) != NULL) a = to; -- cgit v1.1