diff options
author | Vladimir Makarov <vmakarov@redhat.com> | 2012-01-19 20:46:31 +0000 |
---|---|---|
committer | Vladimir Makarov <vmakarov@gcc.gnu.org> | 2012-01-19 20:46:31 +0000 |
commit | 2608d8414085d05d05fae8cba70ac22c8fe2c8d0 (patch) | |
tree | 0d29df176c3620279d71202389bdc2b5691fc410 /gcc/ira.c | |
parent | 8e19c582b18e18030c172cca406b5607114f80cc (diff) | |
download | gcc-2608d8414085d05d05fae8cba70ac22c8fe2c8d0.zip gcc-2608d8414085d05d05fae8cba70ac22c8fe2c8d0.tar.gz gcc-2608d8414085d05d05fae8cba70ac22c8fe2c8d0.tar.bz2 |
re PR rtl-optimization/40761 (IRA memory hog for insanely nested loops)
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.
From-SVN: r183312
Diffstat (limited to 'gcc/ira.c')
-rw-r--r-- | gcc/ira.c | 21 |
1 files changed, 13 insertions, 8 deletions
@@ -718,7 +718,7 @@ ira_print_disposition (FILE *f) if ((bb = ALLOCNO_LOOP_TREE_NODE (a)->bb) != NULL) fprintf (f, "b%-3d", bb->index); else - fprintf (f, "l%-3d", ALLOCNO_LOOP_TREE_NODE (a)->loop->num); + fprintf (f, "l%-3d", ALLOCNO_LOOP_TREE_NODE (a)->loop_num); if (ALLOCNO_HARD_REGNO (a) >= 0) fprintf (f, " %3d", ALLOCNO_HARD_REGNO (a)); else @@ -3614,14 +3614,16 @@ ira (FILE *f) ira_move_loops_num = ira_additional_jumps_num = 0; ira_assert (current_loops == NULL); - flow_loops_find (&ira_loops); - record_loop_exits (); - current_loops = &ira_loops; + if (flag_ira_region == IRA_REGION_ALL || flag_ira_region == IRA_REGION_MIXED) + { + flow_loops_find (&ira_loops); + record_loop_exits (); + current_loops = &ira_loops; + } if (internal_flag_ira_verbose > 0 && ira_dump_file != NULL) fprintf (ira_dump_file, "Building IRA IR\n"); - loops_p = ira_build (flag_ira_region == IRA_REGION_ALL - || flag_ira_region == IRA_REGION_MIXED); + loops_p = ira_build (); ira_assert (ira_conflicts_p || !loops_p); @@ -3745,8 +3747,11 @@ do_reload (void) flag_ira_share_spill_slots = saved_flag_ira_share_spill_slots; - flow_loops_free (&ira_loops); - free_dominance_info (CDI_DOMINATORS); + if (current_loops != NULL) + { + flow_loops_free (&ira_loops); + free_dominance_info (CDI_DOMINATORS); + } FOR_ALL_BB (bb) bb->loop_father = NULL; current_loops = NULL; |