summaryrefslogtreecommitdiff
path: root/gcc/ira-build.c
diff options
context:
space:
mode:
authorvmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4>2008-09-03 20:20:57 +0000
committervmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4>2008-09-03 20:20:57 +0000
commit2bae4acc54e8f37edc1d5e913c6be6f8284fe3cf (patch)
tree9019b331be1659d737cfbcd55b9525108bc47b83 /gcc/ira-build.c
parenta15b4a3c5dce9d98a9ddbca764a998e6c12e60cb (diff)
downloadgcc-2bae4acc54e8f37edc1d5e913c6be6f8284fe3cf.tar.gz
2008-09-03 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-opt/37243 * ira-int.h (ira_loop_tree_node): Rename mentioned_allocnos to all_allocnos. * ira-color.c (print_loop_title): Use all_allocnos. (color_pass): Ditto. Don't add border_allocnos. Check that subloop allocno in the correspdoning bitmap all_allocnos. * ira-emit.c (change_loop): Use all_allocnos. * ira-build.c (create_loop_tree_nodes, finish_loop_tree_node): Ditto. (ira_create_allocno): Set up all_allocnos bit for the created allocno. (create_cap_allocno): Remove setting mentioned_allocnos. (create_insn_allocnos): Ditto. (remove_unnecessary_allocnos): Use all_allocnos. (check_allocno_creation): Check that allocnos are in the corresponding bitmap all_allocnos. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139952 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ira-build.c')
-rw-r--r--gcc/ira-build.c36
1 files changed, 16 insertions, 20 deletions
diff --git a/gcc/ira-build.c b/gcc/ira-build.c
index 979a3c86685..4f2fb8f5396 100644
--- a/gcc/ira-build.c
+++ b/gcc/ira-build.c
@@ -113,7 +113,7 @@ create_loop_tree_nodes (bool loops_p)
ira_bb_nodes[i].regno_allocno_map = NULL;
memset (ira_bb_nodes[i].reg_pressure, 0,
sizeof (ira_bb_nodes[i].reg_pressure));
- ira_bb_nodes[i].mentioned_allocnos = NULL;
+ ira_bb_nodes[i].all_allocnos = NULL;
ira_bb_nodes[i].modified_regnos = NULL;
ira_bb_nodes[i].border_allocnos = NULL;
ira_bb_nodes[i].local_copies = NULL;
@@ -156,7 +156,7 @@ create_loop_tree_nodes (bool loops_p)
sizeof (ira_allocno_t) * max_regno);
memset (ira_loop_nodes[i].reg_pressure, 0,
sizeof (ira_loop_nodes[i].reg_pressure));
- ira_loop_nodes[i].mentioned_allocnos = ira_allocate_bitmap ();
+ ira_loop_nodes[i].all_allocnos = ira_allocate_bitmap ();
ira_loop_nodes[i].modified_regnos = ira_allocate_bitmap ();
ira_loop_nodes[i].border_allocnos = ira_allocate_bitmap ();
ira_loop_nodes[i].local_copies = ira_allocate_bitmap ();
@@ -188,7 +188,7 @@ finish_loop_tree_node (ira_loop_tree_node_t loop)
ira_free_bitmap (loop->local_copies);
ira_free_bitmap (loop->border_allocnos);
ira_free_bitmap (loop->modified_regnos);
- ira_free_bitmap (loop->mentioned_allocnos);
+ ira_free_bitmap (loop->all_allocnos);
ira_free (loop->regno_allocno_map);
loop->regno_allocno_map = NULL;
}
@@ -212,8 +212,8 @@ finish_loop_tree_nodes (void)
ira_free_bitmap (ira_bb_nodes[i].border_allocnos);
if (ira_bb_nodes[i].modified_regnos != NULL)
ira_free_bitmap (ira_bb_nodes[i].modified_regnos);
- if (ira_bb_nodes[i].mentioned_allocnos != NULL)
- ira_free_bitmap (ira_bb_nodes[i].mentioned_allocnos);
+ if (ira_bb_nodes[i].all_allocnos != NULL)
+ ira_free_bitmap (ira_bb_nodes[i].all_allocnos);
if (ira_bb_nodes[i].regno_allocno_map != NULL)
ira_free (ira_bb_nodes[i].regno_allocno_map);
}
@@ -437,6 +437,7 @@ ira_create_allocno (int regno, bool cap_p, ira_loop_tree_node_t loop_tree_node)
ALLOCNO_CAP (a) = NULL;
ALLOCNO_CAP_MEMBER (a) = NULL;
ALLOCNO_NUM (a) = ira_allocnos_num;
+ bitmap_set_bit (loop_tree_node->all_allocnos, ALLOCNO_NUM (a));
ALLOCNO_CONFLICT_ALLOCNO_ARRAY (a) = NULL;
ALLOCNO_CONFLICT_ALLOCNOS_NUM (a) = 0;
COPY_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (a), ira_no_alloc_regs);
@@ -765,7 +766,6 @@ create_cap_allocno (ira_allocno_t a)
ira_set_allocno_cover_class (cap, cover_class);
ALLOCNO_AVAILABLE_REGS_NUM (cap) = ALLOCNO_AVAILABLE_REGS_NUM (a);
ALLOCNO_CAP_MEMBER (cap) = a;
- bitmap_set_bit (parent->mentioned_allocnos, ALLOCNO_NUM (cap));
ALLOCNO_CAP (a) = cap;
ALLOCNO_COVER_CLASS_COST (cap) = ALLOCNO_COVER_CLASS_COST (a);
ALLOCNO_MEMORY_COST (cap) = ALLOCNO_MEMORY_COST (a);
@@ -1290,8 +1290,6 @@ create_insn_allocnos (rtx x, bool output_p)
ALLOCNO_NREFS (a)++;
ALLOCNO_FREQ (a) += REG_FREQ_FROM_BB (curr_bb);
- bitmap_set_bit (ira_curr_loop_tree_node->mentioned_allocnos,
- ALLOCNO_NUM (a));
if (output_p)
bitmap_set_bit (ira_curr_loop_tree_node->modified_regnos, regno);
}
@@ -1709,7 +1707,7 @@ remove_unnecessary_allocnos (void)
prev_a = a;
ALLOCNO_LOOP_TREE_NODE (a) = parent;
parent->regno_allocno_map[regno] = a;
- bitmap_set_bit (parent->mentioned_allocnos, ALLOCNO_NUM (a));
+ bitmap_set_bit (parent->all_allocnos, ALLOCNO_NUM (a));
}
else
{
@@ -2358,20 +2356,18 @@ check_allocno_creation (void)
FOR_EACH_ALLOCNO (a, ai)
{
- if (ALLOCNO_LOOP_TREE_NODE (a) == ira_loop_tree_root)
+ loop_tree_node = ALLOCNO_LOOP_TREE_NODE (a);
+ ira_assert (bitmap_bit_p (loop_tree_node->all_allocnos,
+ ALLOCNO_NUM (a)));
+ if (loop_tree_node == ira_loop_tree_root)
continue;
if (ALLOCNO_CAP_MEMBER (a) != NULL)
- {
- ira_assert (ALLOCNO_CAP (a) != NULL);
- }
+ ira_assert (ALLOCNO_CAP (a) != NULL);
else if (ALLOCNO_CAP (a) == NULL)
- {
- loop_tree_node = ALLOCNO_LOOP_TREE_NODE (a);
- ira_assert (loop_tree_node->parent
- ->regno_allocno_map[ALLOCNO_REGNO (a)] != NULL
- && bitmap_bit_p (loop_tree_node->border_allocnos,
- ALLOCNO_NUM (a)));
- }
+ ira_assert (loop_tree_node->parent
+ ->regno_allocno_map[ALLOCNO_REGNO (a)] != NULL
+ && bitmap_bit_p (loop_tree_node->border_allocnos,
+ ALLOCNO_NUM (a)));
}
}
#endif