diff options
author | vmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-11-19 21:20:44 +0000 |
---|---|---|
committer | vmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-11-19 21:20:44 +0000 |
commit | 69f8e08094a3f6e518c08f323bc2687ffe696c9e (patch) | |
tree | 5b79c7c3d997c7b687af33f6229b6111cc84177b /gcc/ira.c | |
parent | d046014d4feb3098f10fd9f83d0288772628c3aa (diff) | |
download | gcc-69f8e08094a3f6e518c08f323bc2687ffe696c9e.tar.gz |
2008-11-15 Vladimir Makarov <vmakarov@redhat.com>
PR bootstrap/37790
* ira-int.h (ira_copy_allocno_live_range_list,
ira_merge_allocno_live_ranges,
ira_allocno_live_ranges_intersect_p,
ira_finish_allocno_live_range_list): New prototypes.
(ira_allocno_live_ranges_intersect_p,
ira_pseudo_live_ranges_intersect_p): Remove.
* ira-conflicts.c (ira_allocno_live_ranges_intersect_p,
ira_pseudo_live_ranges_intersect_p): Rename to
allocnos_have_intersected_live_ranges_p and
pseudos_have_intersected_live_ranges_p. Move them from here to
...
* ira-color.c: ... here
(coalesced_allocno_conflict_p): Use
allocnos_have_intersected_live_ranges_p.
(coalesced_allocnos_living_at_program_points,
coalesced_allocnos_live_at_points_p,
set_coalesced_allocnos_live_points): Remove.
(slot_coalesced_allocnos_live_ranges,
slot_coalesced_allocno_live_ranges_intersect_p,
setup_slot_coalesced_allocno_live_ranges): New.
(coalesce_spill_slots): Use ranges of coalesced allocnos.
(ira_sort_regnos_for_alter_reg): Use
allocnos_have_intersected_live_ranges_p.
(ira_reuse_stack_slot): Use
pseudos_have_intersected_live_ranges_p.
* global.c (pseudo_for_reload_consideration_p): Check
flag_ira_share_spill_slots too.
* ira-build.c (copy_allocno_live_range_list): Rename to
ira_copy_allocno_live_range_list. Make it external.
(merge_ranges): Rename to ira_merge_allocno_live_ranges. Make it
external.
(ira_allocno_live_ranges_intersect_p): New.
(ira_finish_allocno_live_range_list): New.
(finish_allocno): Use it.
(remove_unnecessary_allocnos): Use ira_merge_allocno_live_ranges.
(copy_info_to_removed_store_destinations): Ditto. Use
ira_copy_allocno_live_range_list.
(ira_flattening): Use ira_merge_allocno_live_ranges.
* ira.c (too_high_register_pressure_p): New function.
(ira): Switch off sharing spill slots if the pressure is too high.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@142017 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ira.c')
-rw-r--r-- | gcc/ira.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/ira.c b/gcc/ira.c index d0232f75a1e..d7f4e3d0dab 100644 --- a/gcc/ira.c +++ b/gcc/ira.c @@ -1695,6 +1695,23 @@ expand_reg_info (int old_size) } } +/* Return TRUE if there is too high register pressure in the function. + It is used to decide when stack slot sharing is worth to do. */ +static bool +too_high_register_pressure_p (void) +{ + int i; + enum reg_class cover_class; + + for (i = 0; i < ira_reg_class_cover_size; i++) + { + cover_class = ira_reg_class_cover[i]; + if (ira_loop_tree_root->reg_pressure[cover_class] > 10000) + return true; + } + return false; +} + /* All natural loops. */ @@ -1709,6 +1726,7 @@ ira (FILE *f) int max_regno_before_ira, ira_max_point_before_emit; int rebuild_p; int saved_flag_ira_algorithm; + int saved_flag_ira_share_spill_slots; basic_block bb; timevar_push (TV_IRA); @@ -1792,6 +1810,13 @@ ira (FILE *f) loops_p = ira_build (optimize && (flag_ira_algorithm == IRA_ALGORITHM_REGIONAL || flag_ira_algorithm == IRA_ALGORITHM_MIXED)); + + saved_flag_ira_share_spill_slots = flag_ira_share_spill_slots; + if (too_high_register_pressure_p ()) + /* It is just wasting compiler's time to pack spilled pseudos into + stack slots in this case -- prohibit it. */ + flag_ira_share_spill_slots = FALSE; + ira_color (); ira_max_point_before_emit = ira_max_point; @@ -1902,6 +1927,8 @@ ira (FILE *f) fprintf (ira_dump_file, "+++Overall after reload %d\n", ira_overall_cost); ira_destroy (); + flag_ira_share_spill_slots = saved_flag_ira_share_spill_slots; + flow_loops_free (&ira_loops); free_dominance_info (CDI_DOMINATORS); FOR_ALL_BB (bb) |