diff options
author | Vladimir Makarov <vmakarov@redhat.com> | 2010-08-10 21:39:13 +0000 |
---|---|---|
committer | Vladimir Makarov <vmakarov@gcc.gnu.org> | 2010-08-10 21:39:13 +0000 |
commit | 9995f209120e33ba64ed75e753bf309c8f10bee9 (patch) | |
tree | ce457536ee73c1a7b613023a34b7124c9f96d491 /gcc | |
parent | 009c04bf7b5f056a6f6d3865eeb3bde125c0bf08 (diff) | |
download | gcc-9995f209120e33ba64ed75e753bf309c8f10bee9.zip gcc-9995f209120e33ba64ed75e753bf309c8f10bee9.tar.gz gcc-9995f209120e33ba64ed75e753bf309c8f10bee9.tar.bz2 |
ira-live.c: Include sbitmap.h.
2010-08-10 Vladimir Makarov <vmakarov@redhat.com>
* ira-live.c: Include sbitmap.h.
(remove_some_program_points_and_update_live_ranges): Use sbitmaps.
Compress live ranges even more.
From-SVN: r163080
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/ira-lives.c | 39 |
2 files changed, 35 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 332c986..9c838ba 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2010-08-10 Vladimir Makarov <vmakarov@redhat.com> + + * ira-live.c: Include sbitmap.h. + (remove_some_program_points_and_update_live_ranges): Use sbitmaps. + Compress live ranges even more. + 2010-08-10 Nathan Froyd <froydnj@codesourcery.com> * coverage.c (ctr_labels): Delete. diff --git a/gcc/ira-lives.c b/gcc/ira-lives.c index 5b75f54..1ffed78 100644 --- a/gcc/ira-lives.c +++ b/gcc/ira-lives.c @@ -37,6 +37,7 @@ along with GCC; see the file COPYING3. If not see #include "toplev.h" #include "params.h" #include "df.h" +#include "sbitmap.h" #include "sparseset.h" #include "ira-int.h" @@ -1308,25 +1309,43 @@ remove_some_program_points_and_update_live_ranges (void) ira_object_t obj; ira_object_iterator oi; live_range_t r; - bitmap born_or_died; - bitmap_iterator bi; - - born_or_died = ira_allocate_bitmap (); + sbitmap born_or_dead, born, dead; + sbitmap_iterator sbi; + bool born_p, dead_p, prev_born_p, prev_dead_p; + + born = sbitmap_alloc (ira_max_point); + dead = sbitmap_alloc (ira_max_point); + sbitmap_zero (born); + sbitmap_zero (dead); FOR_EACH_OBJECT (obj, oi) for (r = OBJECT_LIVE_RANGES (obj); r != NULL; r = r->next) { ira_assert (r->start <= r->finish); - bitmap_set_bit (born_or_died, r->start); - bitmap_set_bit (born_or_died, r->finish); + SET_BIT (born, r->start); + SET_BIT (dead, r->finish); } + born_or_dead = sbitmap_alloc (ira_max_point); + sbitmap_a_or_b (born_or_dead, born, dead); map = (int *) ira_allocate (sizeof (int) * ira_max_point); - n = 0; - EXECUTE_IF_SET_IN_BITMAP(born_or_died, 0, i, bi) + n = -1; + prev_born_p = prev_dead_p = false; + EXECUTE_IF_SET_IN_SBITMAP (born_or_dead, 0, i, sbi) { - map[i] = n++; + born_p = TEST_BIT (born, i); + dead_p = TEST_BIT (dead, i); + if ((prev_born_p && ! prev_dead_p && born_p && ! dead_p) + || (prev_dead_p && ! prev_born_p && dead_p && ! born_p)) + map[i] = n; + else + map[i] = ++n; + prev_born_p = born_p; + prev_dead_p = dead_p; } - ira_free_bitmap (born_or_died); + sbitmap_free (born_or_dead); + sbitmap_free (born); + sbitmap_free (dead); + n++; if (internal_flag_ira_verbose > 1 && ira_dump_file != NULL) fprintf (ira_dump_file, "Compressing live ranges: from %d to %d - %d%%\n", ira_max_point, n, 100 * n / ira_max_point); |