summaryrefslogtreecommitdiff
path: root/gcc/ira-color.c
diff options
context:
space:
mode:
authorvmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4>2012-01-19 20:46:31 +0000
committervmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4>2012-01-19 20:46:31 +0000
commit9f8ac54664b3f8f1c9a25cac135bc9885e19c91f (patch)
tree0d29df176c3620279d71202389bdc2b5691fc410 /gcc/ira-color.c
parent799347b4f3a31352a3d3e3797b28abc41580cdf5 (diff)
downloadgcc-9f8ac54664b3f8f1c9a25cac135bc9885e19c91f.tar.gz
2012-01-19 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/40761 * ira-int.h (struct ira_loop_tree_node): Add comment for member loop. Add new member loop_num. (IRA_LOOP_NODE_BY_INDEX): Modify the check. (ira_build): Remove the parameter. * ira.c (ira_print_disposition): Use loop_num instead of loop->num. (ira.c): Do not build CFG loops for one region allocation. Remove argument from ira_build call. * ira-build.c (init_loop_tree_node): New function. (create_loop_tree_nodes): Use it. Separate the case when CFG loops are not built. (more_one_region_p): Check current_loops. (finish_loop_tree_nodes): Separate the case when CFG loops are not built. (add_loop_to_tree): Process loop equal to NULL too. (form_loop_tree): Separate the case when CFG loops are not built. Use explicitly number for the root. (rebuild_regno_allocno_maps, create_loop_tree_node_allocnos): Add an assertion. (ira_print_expanded_allocno, loop_compare_func): Use loop_num instead of loop->num. (mark_loops_for_removal): Ditto. Use loop_num instead of loop->num. (mark_all_loops_for_removal): Ditto. (remove_unnecessary_regions): Separate the case when CFG loops are not built. (ira_build): Remove the parameter. Use explicit number of regions when CFG loops are not built. * ira-color.c (print_loop_title): Separate the case for the root node. Use loop_num instead of loop->num. (move_spill_restore): Use loop_num instead of loop->num. * ira-emit.c (setup_entered_from_non_parent_p): Add an assertion. (change_loop): Ditto. (change_loop): Use loop_num instead of loop->num. * ira-lives.c (process_bb_node_lives): Ditto. * ira-costs.c (print_allocno_costs, find_costs_and_classes): Ditto. * ira-conflicts.c (print_allocno_conflicts): Ditto. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183312 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ira-color.c')
-rw-r--r--gcc/ira-color.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/gcc/ira-color.c b/gcc/ira-color.c
index 92f68bf0f19..c638e58f333 100644
--- a/gcc/ira-color.c
+++ b/gcc/ira-color.c
@@ -1670,7 +1670,6 @@ assign_hard_reg (ira_allocno_t a, bool retry_p)
update_conflict_hard_regno_costs (full_costs, aclass, false);
}
min_cost = min_full_cost = INT_MAX;
-
/* We don't care about giving callee saved registers to allocnos no
living through calls because call clobbered registers are
allocated first (it is usual practice to put them first in
@@ -2011,7 +2010,7 @@ ira_loop_edge_freq (ira_loop_tree_node_t loop_node, int regno, bool exit_p)
edge e;
VEC (edge, heap) *edges;
- ira_assert (loop_node->loop != NULL
+ ira_assert (current_loops != NULL && loop_node->loop != NULL
&& (regno < 0 || regno >= FIRST_PSEUDO_REGISTER));
freq = 0;
if (! exit_p)
@@ -2662,14 +2661,19 @@ print_loop_title (ira_loop_tree_node_t loop_tree_node)
edge e;
edge_iterator ei;
- ira_assert (loop_tree_node->loop != NULL);
- fprintf (ira_dump_file,
- "\n Loop %d (parent %d, header bb%d, depth %d)\n bbs:",
- loop_tree_node->loop->num,
- (loop_tree_node->parent == NULL
- ? -1 : loop_tree_node->parent->loop->num),
- loop_tree_node->loop->header->index,
- loop_depth (loop_tree_node->loop));
+ if (loop_tree_node->parent == NULL)
+ fprintf (ira_dump_file,
+ "\n Loop 0 (parent -1, header bb%d, depth 0)\n bbs:",
+ NUM_FIXED_BLOCKS);
+ else
+ {
+ ira_assert (current_loops != NULL && loop_tree_node->loop != NULL);
+ fprintf (ira_dump_file,
+ "\n Loop %d (parent %d, header bb%d, depth %d)\n bbs:",
+ loop_tree_node->loop_num, loop_tree_node->parent->loop_num,
+ loop_tree_node->loop->header->index,
+ loop_depth (loop_tree_node->loop));
+ }
for (subloop_node = loop_tree_node->children;
subloop_node != NULL;
subloop_node = subloop_node->next)
@@ -2681,7 +2685,7 @@ print_loop_title (ira_loop_tree_node_t loop_tree_node)
&& ((dest_loop_node = IRA_BB_NODE (e->dest)->parent)
!= loop_tree_node))
fprintf (ira_dump_file, "(->%d:l%d)",
- e->dest->index, dest_loop_node->loop->num);
+ e->dest->index, dest_loop_node->loop_num);
}
fprintf (ira_dump_file, "\n all:");
EXECUTE_IF_SET_IN_BITMAP (loop_tree_node->all_allocnos, 0, j, bi)
@@ -3011,7 +3015,7 @@ move_spill_restore (void)
fprintf
(ira_dump_file,
" Moving spill/restore for a%dr%d up from loop %d",
- ALLOCNO_NUM (a), regno, loop_node->loop->num);
+ ALLOCNO_NUM (a), regno, loop_node->loop_num);
fprintf (ira_dump_file, " - profit %d\n", -cost);
}
changed_p = true;