aboutsummaryrefslogtreecommitdiff
path: root/gcc/ira-lives.c
diff options
context:
space:
mode:
authorSteven Bosscher <steven@gcc.gnu.org>2012-10-11 18:54:47 +0000
committerSteven Bosscher <steven@gcc.gnu.org>2012-10-11 18:54:47 +0000
commite6a7da82a98953d0c817367d410ccb080861b7da (patch)
treec1dfc7cfd88768e4decf85c593946bf539aa4254 /gcc/ira-lives.c
parentd2a934a5a55627c87d94fda02d563aa9b69390be (diff)
downloadgcc-e6a7da82a98953d0c817367d410ccb080861b7da.zip
gcc-e6a7da82a98953d0c817367d410ccb080861b7da.tar.gz
gcc-e6a7da82a98953d0c817367d410ccb080861b7da.tar.bz2
ira-build.c (ira_loop_tree_body_rev_postorder): New function.
* ira-build.c (ira_loop_tree_body_rev_postorder): New function. (ira_traverse_loop_tree): Traverse a loop's basic blocks in reverse post-order of the reversed control-flow direction. * ira-conflicts.c (ira_build_conflicts): Pass add_copies as the pre-order function to ira_traverse_loop_tree to preserve the existing semantics. * ira-lives.c (remove_some_program_points_and_update_live_ranges): Squeeze out live range chain elements if their program points are connected. From-SVN: r192378
Diffstat (limited to 'gcc/ira-lives.c')
-rw-r--r--gcc/ira-lives.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/ira-lives.c b/gcc/ira-lives.c
index 853832e..109e3c4 100644
--- a/gcc/ira-lives.c
+++ b/gcc/ira-lives.c
@@ -1458,7 +1458,7 @@ remove_some_program_points_and_update_live_ranges (void)
int *map;
ira_object_t obj;
ira_object_iterator oi;
- live_range_t r;
+ live_range_t r, prev_r, next_r;
sbitmap born_or_dead, born, dead;
sbitmap_iterator sbi;
bool born_p, dead_p, prev_born_p, prev_dead_p;
@@ -1502,10 +1502,19 @@ remove_some_program_points_and_update_live_ranges (void)
ira_max_point = n;
FOR_EACH_OBJECT (obj, oi)
- for (r = OBJECT_LIVE_RANGES (obj); r != NULL; r = r->next)
+ for (r = OBJECT_LIVE_RANGES (obj), prev_r = NULL; r != NULL; r = next_r)
{
+ next_r = r->next;
r->start = map[r->start];
r->finish = map[r->finish];
+ if (prev_r == NULL || prev_r->start > r->finish + 1)
+ {
+ prev_r = r;
+ continue;
+ }
+ prev_r->start = r->start;
+ prev_r->next = next_r;
+ ira_finish_live_range (r);
}
ira_free (map);