summaryrefslogtreecommitdiff
path: root/gcc/ira-conflicts.c
diff options
context:
space:
mode:
authorbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-14 01:53:35 +0000
committerbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-14 01:53:35 +0000
commitae9587ed110597fc000021d88e1e5080628e4c66 (patch)
treefe78855d67c4408f0380b53d7b9fc52d0f6ffd91 /gcc/ira-conflicts.c
parent483df1400516d9df4df37c34ad46b02561331336 (diff)
downloadgcc-ae9587ed110597fc000021d88e1e5080628e4c66.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162166 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ira-conflicts.c')
-rw-r--r--gcc/ira-conflicts.c232
1 files changed, 130 insertions, 102 deletions
diff --git a/gcc/ira-conflicts.c b/gcc/ira-conflicts.c
index c95c7b22809..df6d0689ce3 100644
--- a/gcc/ira-conflicts.c
+++ b/gcc/ira-conflicts.c
@@ -51,40 +51,38 @@ along with GCC; see the file COPYING3. If not see
corresponding allocnos see function build_allocno_conflicts. */
static IRA_INT_TYPE **conflicts;
-/* Macro to test a conflict of A1 and A2 in `conflicts'. */
-#define CONFLICT_ALLOCNO_P(A1, A2) \
- (ALLOCNO_MIN (A1) <= ALLOCNO_CONFLICT_ID (A2) \
- && ALLOCNO_CONFLICT_ID (A2) <= ALLOCNO_MAX (A1) \
- && TEST_MINMAX_SET_BIT (conflicts[ALLOCNO_NUM (A1)], \
- ALLOCNO_CONFLICT_ID (A2), \
- ALLOCNO_MIN (A1), \
- ALLOCNO_MAX (A1)))
+/* Macro to test a conflict of C1 and C2 in `conflicts'. */
+#define OBJECTS_CONFLICT_P(C1, C2) \
+ (OBJECT_MIN (C1) <= OBJECT_CONFLICT_ID (C2) \
+ && OBJECT_CONFLICT_ID (C2) <= OBJECT_MAX (C1) \
+ && TEST_MINMAX_SET_BIT (conflicts[OBJECT_CONFLICT_ID (C1)], \
+ OBJECT_CONFLICT_ID (C2), \
+ OBJECT_MIN (C1), OBJECT_MAX (C1)))
-
/* Build allocno conflict table by processing allocno live ranges.
Return true if the table was built. The table is not built if it
is too big. */
static bool
build_conflict_bit_table (void)
{
- int i, num, id, allocated_words_num, conflict_bit_vec_words_num;
+ int i;
unsigned int j;
enum reg_class cover_class;
- ira_allocno_t allocno, live_a;
+ int object_set_words, allocated_words_num, conflict_bit_vec_words_num;
live_range_t r;
+ ira_allocno_t allocno;
ira_allocno_iterator ai;
- sparseset allocnos_live;
- int allocno_set_words;
+ sparseset objects_live;
- allocno_set_words = (ira_allocnos_num + IRA_INT_BITS - 1) / IRA_INT_BITS;
allocated_words_num = 0;
FOR_EACH_ALLOCNO (allocno, ai)
{
- if (ALLOCNO_MAX (allocno) < ALLOCNO_MIN (allocno))
+ ira_object_t obj = ALLOCNO_OBJECT (allocno);
+ if (OBJECT_MAX (obj) < OBJECT_MIN (obj))
continue;
conflict_bit_vec_words_num
- = ((ALLOCNO_MAX (allocno) - ALLOCNO_MIN (allocno) + IRA_INT_BITS)
+ = ((OBJECT_MAX (obj) - OBJECT_MIN (obj) + IRA_INT_BITS)
/ IRA_INT_BITS);
allocated_words_num += conflict_bit_vec_words_num;
if ((unsigned long long) allocated_words_num * sizeof (IRA_INT_TYPE)
@@ -98,70 +96,90 @@ build_conflict_bit_table (void)
return false;
}
}
- allocnos_live = sparseset_alloc (ira_allocnos_num);
+
conflicts = (IRA_INT_TYPE **) ira_allocate (sizeof (IRA_INT_TYPE *)
- * ira_allocnos_num);
+ * ira_objects_num);
allocated_words_num = 0;
FOR_EACH_ALLOCNO (allocno, ai)
{
- num = ALLOCNO_NUM (allocno);
- if (ALLOCNO_MAX (allocno) < ALLOCNO_MIN (allocno))
+ ira_object_t obj = ALLOCNO_OBJECT (allocno);
+ int id = OBJECT_CONFLICT_ID (obj);
+ if (OBJECT_MAX (obj) < OBJECT_MIN (obj))
{
- conflicts[num] = NULL;
+ conflicts[id] = NULL;
continue;
}
conflict_bit_vec_words_num
- = ((ALLOCNO_MAX (allocno) - ALLOCNO_MIN (allocno) + IRA_INT_BITS)
+ = ((OBJECT_MAX (obj) - OBJECT_MIN (obj) + IRA_INT_BITS)
/ IRA_INT_BITS);
allocated_words_num += conflict_bit_vec_words_num;
- conflicts[num]
+ conflicts[id]
= (IRA_INT_TYPE *) ira_allocate (sizeof (IRA_INT_TYPE)
* conflict_bit_vec_words_num);
- memset (conflicts[num], 0,
+ memset (conflicts[id], 0,
sizeof (IRA_INT_TYPE) * conflict_bit_vec_words_num);
}
+
+ object_set_words = (ira_objects_num + IRA_INT_BITS - 1) / IRA_INT_BITS;
if (internal_flag_ira_verbose > 0 && ira_dump_file != NULL)
fprintf
(ira_dump_file,
"+++Allocating %ld bytes for conflict table (uncompressed size %ld)\n",
(long) allocated_words_num * sizeof (IRA_INT_TYPE),
- (long) allocno_set_words * ira_allocnos_num * sizeof (IRA_INT_TYPE));
+ (long) object_set_words * ira_objects_num * sizeof (IRA_INT_TYPE));
+
+ objects_live = sparseset_alloc (ira_objects_num);
for (i = 0; i < ira_max_point; i++)
{
for (r = ira_start_point_ranges[i]; r != NULL; r = r->start_next)
{
- allocno = r->allocno;
- num = ALLOCNO_NUM (allocno);
- id = ALLOCNO_CONFLICT_ID (allocno);
+ ira_allocno_t allocno = r->allocno;
+ ira_object_t obj = ALLOCNO_OBJECT (allocno);
+ int id = OBJECT_CONFLICT_ID (obj);
+
cover_class = ALLOCNO_COVER_CLASS (allocno);
- sparseset_set_bit (allocnos_live, num);
- EXECUTE_IF_SET_IN_SPARSESET (allocnos_live, j)
+ sparseset_set_bit (objects_live, id);
+ EXECUTE_IF_SET_IN_SPARSESET (objects_live, j)
{
- live_a = ira_allocnos[j];
- if (ira_reg_classes_intersect_p
- [cover_class][ALLOCNO_COVER_CLASS (live_a)]
+ ira_object_t live_cr = ira_object_id_map[j];
+ ira_allocno_t live_a = OBJECT_ALLOCNO (live_cr);
+ enum reg_class live_cover_class = ALLOCNO_COVER_CLASS (live_a);
+
+ if (ira_reg_classes_intersect_p[cover_class][live_cover_class]
/* Don't set up conflict for the allocno with itself. */
- && num != (int) j)
+ && id != (int) j)
{
- SET_MINMAX_SET_BIT (conflicts[num],
- ALLOCNO_CONFLICT_ID (live_a),
- ALLOCNO_MIN (allocno),
- ALLOCNO_MAX (allocno));
+ SET_MINMAX_SET_BIT (conflicts[id], j,
+ OBJECT_MIN (obj),
+ OBJECT_MAX (obj));
SET_MINMAX_SET_BIT (conflicts[j], id,
- ALLOCNO_MIN (live_a),
- ALLOCNO_MAX (live_a));
+ OBJECT_MIN (live_cr),
+ OBJECT_MAX (live_cr));
}
}
}
for (r = ira_finish_point_ranges[i]; r != NULL; r = r->finish_next)
- sparseset_clear_bit (allocnos_live, ALLOCNO_NUM (r->allocno));
+ {
+ ira_allocno_t allocno = r->allocno;
+ ira_object_t obj = ALLOCNO_OBJECT (allocno);
+ sparseset_clear_bit (objects_live, OBJECT_CONFLICT_ID (obj));
+ }
}
- sparseset_free (allocnos_live);
+ sparseset_free (objects_live);
return true;
}
-
+/* Return true iff allocnos A1 and A2 cannot be allocated to the same
+ register due to conflicts. */
+
+static bool
+allocnos_conflict_p (ira_allocno_t a1, ira_allocno_t a2)
+{
+ ira_object_t obj1 = ALLOCNO_OBJECT (a1);
+ ira_object_t obj2 = ALLOCNO_OBJECT (a2);
+ return OBJECTS_CONFLICT_P (obj1, obj2);
+}
/* Return TRUE if the operand constraint STR is commutative. */
static bool
@@ -366,19 +384,21 @@ process_regs_for_copy (rtx reg1, rtx reg2, bool constraint_p,
allocno_preferenced_hard_regno = REGNO (reg2) + offset2 - offset1;
a = ira_curr_regno_allocno_map[REGNO (reg1)];
}
- else if (!CONFLICT_ALLOCNO_P (ira_curr_regno_allocno_map[REGNO (reg1)],
- ira_curr_regno_allocno_map[REGNO (reg2)])
- && offset1 == offset2)
+ else
{
- cp = ira_add_allocno_copy (ira_curr_regno_allocno_map[REGNO (reg1)],
- ira_curr_regno_allocno_map[REGNO (reg2)],
- freq, constraint_p, insn,
- ira_curr_loop_tree_node);
- bitmap_set_bit (ira_curr_loop_tree_node->local_copies, cp->num);
- return true;
+ ira_allocno_t a1 = ira_curr_regno_allocno_map[REGNO (reg1)];
+ ira_allocno_t a2 = ira_curr_regno_allocno_map[REGNO (reg2)];
+ if (!allocnos_conflict_p (a1, a2) && offset1 == offset2)
+ {
+ cp = ira_add_allocno_copy (a1, a2, freq, constraint_p, insn,
+ ira_curr_loop_tree_node);
+ bitmap_set_bit (ira_curr_loop_tree_node->local_copies, cp->num);
+ return true;
+ }
+ else
+ return false;
}
- else
- return false;
+
if (! IN_RANGE (allocno_preferenced_hard_regno, 0, FIRST_PSEUDO_REGISTER - 1))
/* Can not be tied. */
return false;
@@ -448,7 +468,7 @@ add_insn_allocno_copies (rtx insn)
const char *str;
bool commut_p, bound_p[MAX_RECOG_OPERANDS];
int i, j, n, freq;
-
+
freq = REG_FREQ_FROM_BB (BLOCK_FOR_INSN (insn));
if (freq == 0)
freq = 1;
@@ -541,14 +561,14 @@ propagate_copies (void)
parent_a1 = ira_parent_or_cap_allocno (a1);
parent_a2 = ira_parent_or_cap_allocno (a2);
ira_assert (parent_a1 != NULL && parent_a2 != NULL);
- if (! CONFLICT_ALLOCNO_P (parent_a1, parent_a2))
+ if (! allocnos_conflict_p (parent_a1, parent_a2))
ira_add_allocno_copy (parent_a1, parent_a2, cp->freq,
cp->constraint_p, cp->insn, cp->loop_tree_node);
}
}
/* Array used to collect all conflict allocnos for given allocno. */
-static ira_allocno_t *collected_conflict_allocnos;
+static ira_object_t *collected_conflict_objects;
/* Build conflict vectors or bit conflict vectors (whatever is more
profitable) for allocno A from the conflict table and propagate the
@@ -558,50 +578,56 @@ build_allocno_conflicts (ira_allocno_t a)
{
int i, px, parent_num;
int conflict_bit_vec_words_num;
- ira_allocno_t parent_a, another_a, another_parent_a;
- ira_allocno_t *vec;
+ ira_allocno_t parent_a, another_parent_a;
+ ira_object_t *vec;
IRA_INT_TYPE *allocno_conflicts;
+ ira_object_t obj, parent_obj;
minmax_set_iterator asi;
- allocno_conflicts = conflicts[ALLOCNO_NUM (a)];
+ obj = ALLOCNO_OBJECT (a);
+ allocno_conflicts = conflicts[OBJECT_CONFLICT_ID (obj)];
px = 0;
FOR_EACH_BIT_IN_MINMAX_SET (allocno_conflicts,
- ALLOCNO_MIN (a), ALLOCNO_MAX (a), i, asi)
+ OBJECT_MIN (obj), OBJECT_MAX (obj), i, asi)
{
- another_a = ira_conflict_id_allocno_map[i];
+ 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_COVER_CLASS (a)][ALLOCNO_COVER_CLASS (another_a)]);
- collected_conflict_allocnos[px++] = another_a;
+ collected_conflict_objects[px++] = another_obj;
}
- if (ira_conflict_vector_profitable_p (a, px))
+ if (ira_conflict_vector_profitable_p (obj, px))
{
- ira_allocate_allocno_conflict_vec (a, px);
- vec = (ira_allocno_t*) ALLOCNO_CONFLICT_ALLOCNO_ARRAY (a);
- memcpy (vec, collected_conflict_allocnos, sizeof (ira_allocno_t) * px);
+ ira_allocate_conflict_vec (obj, px);
+ vec = OBJECT_CONFLICT_VEC (obj);
+ memcpy (vec, collected_conflict_objects, sizeof (ira_object_t) * px);
vec[px] = NULL;
- ALLOCNO_CONFLICT_ALLOCNOS_NUM (a) = px;
+ OBJECT_NUM_CONFLICTS (obj) = px;
}
else
{
- ALLOCNO_CONFLICT_ALLOCNO_ARRAY (a) = conflicts[ALLOCNO_NUM (a)];
- if (ALLOCNO_MAX (a) < ALLOCNO_MIN (a))
+ OBJECT_CONFLICT_ARRAY (obj) = allocno_conflicts;
+ if (OBJECT_MAX (obj) < OBJECT_MIN (obj))
conflict_bit_vec_words_num = 0;
else
conflict_bit_vec_words_num
- = ((ALLOCNO_MAX (a) - ALLOCNO_MIN (a) + IRA_INT_BITS)
+ = ((OBJECT_MAX (obj) - OBJECT_MIN (obj) + IRA_INT_BITS)
/ IRA_INT_BITS);
- ALLOCNO_CONFLICT_ALLOCNO_ARRAY_SIZE (a)
+ OBJECT_CONFLICT_ARRAY_SIZE (obj)
= conflict_bit_vec_words_num * sizeof (IRA_INT_TYPE);
}
parent_a = ira_parent_or_cap_allocno (a);
if (parent_a == NULL)
return;
ira_assert (ALLOCNO_COVER_CLASS (a) == ALLOCNO_COVER_CLASS (parent_a));
- parent_num = ALLOCNO_NUM (parent_a);
+ parent_obj = ALLOCNO_OBJECT (parent_a);
+ parent_num = OBJECT_CONFLICT_ID (parent_obj);
FOR_EACH_BIT_IN_MINMAX_SET (allocno_conflicts,
- ALLOCNO_MIN (a), ALLOCNO_MAX (a), i, asi)
+ OBJECT_MIN (obj), OBJECT_MAX (obj), i, asi)
{
- another_a = ira_conflict_id_allocno_map[i];
+ ira_object_t another_obj = ira_object_id_map[i];
+ ira_allocno_t another_a = OBJECT_ALLOCNO (another_obj);
+
ira_assert (ira_reg_classes_intersect_p
[ALLOCNO_COVER_CLASS (a)][ALLOCNO_COVER_CLASS (another_a)]);
another_parent_a = ira_parent_or_cap_allocno (another_a);
@@ -611,9 +637,9 @@ build_allocno_conflicts (ira_allocno_t a)
ira_assert (ALLOCNO_COVER_CLASS (another_a)
== ALLOCNO_COVER_CLASS (another_parent_a));
SET_MINMAX_SET_BIT (conflicts[parent_num],
- ALLOCNO_CONFLICT_ID (another_parent_a),
- ALLOCNO_MIN (parent_a),
- ALLOCNO_MAX (parent_a));
+ OBJECT_CONFLICT_ID (ALLOCNO_OBJECT (another_parent_a)),
+ OBJECT_MIN (parent_obj),
+ OBJECT_MAX (parent_obj));
}
}
@@ -625,9 +651,9 @@ build_conflicts (void)
int i;
ira_allocno_t a, cap;
- collected_conflict_allocnos
- = (ira_allocno_t *) ira_allocate (sizeof (ira_allocno_t)
- * ira_allocnos_num);
+ collected_conflict_objects
+ = (ira_object_t *) ira_allocate (sizeof (ira_object_t)
+ * ira_objects_num);
for (i = max_reg_num () - 1; i >= FIRST_PSEUDO_REGISTER; i--)
for (a = ira_regno_allocno_map[i];
a != NULL;
@@ -637,7 +663,7 @@ build_conflicts (void)
for (cap = ALLOCNO_CAP (a); cap != NULL; cap = ALLOCNO_CAP (cap))
build_allocno_conflicts (cap);
}
- ira_free (collected_conflict_allocnos);
+ ira_free (collected_conflict_objects);
}
@@ -675,6 +701,7 @@ static void
print_allocno_conflicts (FILE * file, bool reg_p, ira_allocno_t a)
{
HARD_REG_SET conflicting_hard_regs;
+ ira_object_t obj;
ira_allocno_t conflict_a;
ira_allocno_conflict_iterator aci;
basic_block bb;
@@ -690,8 +717,10 @@ print_allocno_conflicts (FILE * file, bool reg_p, ira_allocno_t a)
fprintf (file, "l%d", ALLOCNO_LOOP_TREE_NODE (a)->loop->num);
putc (')', file);
}
+
fputs (" conflicts:", file);
- if (ALLOCNO_CONFLICT_ALLOCNO_ARRAY (a) != NULL)
+ obj = ALLOCNO_OBJECT (a);
+ if (OBJECT_CONFLICT_ARRAY (obj) != NULL)
FOR_EACH_ALLOCNO_CONFLICT (a, conflict_a, aci)
{
if (reg_p)
@@ -707,15 +736,15 @@ print_allocno_conflicts (FILE * file, bool reg_p, ira_allocno_t a)
ALLOCNO_LOOP_TREE_NODE (conflict_a)->loop->num);
}
}
- COPY_HARD_REG_SET (conflicting_hard_regs,
- ALLOCNO_TOTAL_CONFLICT_HARD_REGS (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_COVER_CLASS (a)]);
print_hard_reg_set (file, "\n;; total conflict hard regs:",
conflicting_hard_regs);
- COPY_HARD_REG_SET (conflicting_hard_regs,
- ALLOCNO_CONFLICT_HARD_REGS (a));
+
+ 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_COVER_CLASS (a)]);
@@ -760,19 +789,22 @@ ira_build_conflicts (void)
ira_conflicts_p = build_conflict_bit_table ();
if (ira_conflicts_p)
{
+ ira_object_t obj;
+ ira_object_iterator oi;
+
build_conflicts ();
ira_traverse_loop_tree (true, ira_loop_tree_root, NULL, add_copies);
/* We need finished conflict table for the subsequent call. */
if (flag_ira_region == IRA_REGION_ALL
|| flag_ira_region == IRA_REGION_MIXED)
propagate_copies ();
+
/* Now we can free memory for the conflict table (see function
build_allocno_conflicts for details). */
- FOR_EACH_ALLOCNO (a, ai)
+ FOR_EACH_OBJECT (obj, oi)
{
- if (ALLOCNO_CONFLICT_ALLOCNO_ARRAY (a)
- != conflicts[ALLOCNO_NUM (a)])
- ira_free (conflicts[ALLOCNO_NUM (a)]);
+ if (OBJECT_CONFLICT_ARRAY (obj) != conflicts[OBJECT_CONFLICT_ID (obj)])
+ ira_free (conflicts[OBJECT_CONFLICT_ID (obj)]);
}
ira_free (conflicts);
}
@@ -788,6 +820,7 @@ ira_build_conflicts (void)
}
FOR_EACH_ALLOCNO (a, ai)
{
+ ira_object_t obj = ALLOCNO_OBJECT (a);
reg_attrs *attrs;
tree decl;
@@ -800,21 +833,16 @@ ira_build_conflicts (void)
&& VAR_OR_FUNCTION_DECL_P (decl)
&& ! DECL_ARTIFICIAL (decl)))
{
- IOR_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a),
- call_used_reg_set);
- IOR_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (a),
- call_used_reg_set);
+ IOR_HARD_REG_SET (OBJECT_TOTAL_CONFLICT_HARD_REGS (obj), call_used_reg_set);
+ IOR_HARD_REG_SET (OBJECT_CONFLICT_HARD_REGS (obj), call_used_reg_set);
}
else if (ALLOCNO_CALLS_CROSSED_NUM (a) != 0)
{
- IOR_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a),
- no_caller_save_reg_set);
- IOR_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a),
- temp_hard_reg_set);
- IOR_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (a),
+ IOR_HARD_REG_SET (OBJECT_TOTAL_CONFLICT_HARD_REGS (obj),
no_caller_save_reg_set);
- IOR_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (a),
- temp_hard_reg_set);
+ IOR_HARD_REG_SET (OBJECT_TOTAL_CONFLICT_HARD_REGS (obj), temp_hard_reg_set);
+ IOR_HARD_REG_SET (OBJECT_CONFLICT_HARD_REGS (obj), no_caller_save_reg_set);
+ IOR_HARD_REG_SET (OBJECT_CONFLICT_HARD_REGS (obj), temp_hard_reg_set);
}
}
if (optimize && ira_conflicts_p