aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Matz <matz@suse.de>2003-10-13 13:02:27 +0000
committerMichael Matz <matz@suse.de>2003-10-13 13:02:27 +0000
commit37b7dacf6738d13be37a8d4979d87487cdd13618 (patch)
treef094c4e051f6f5ccbae69d43af8b5b309b8b3e91
parentacd4180769a8b6b1660c5361f57058c843f97498 (diff)
* ra.c (flag_ra_split_webs): New.
(free_mem): Use it. (reg_alloc): Set it (with cutoff). * ra.h (flag_ra_split_webs): Declare. * ra-rewrite.c (actual_spill): Use it. * ra-colorize.c (colorize_one_web, try_recolor_web, check_colors, ra_colorize_graph): Ditto. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/new-regalloc-branch@72429 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog.RA10
-rw-r--r--gcc/ra-colorize.c22
-rw-r--r--gcc/ra-rewrite.c3
-rw-r--r--gcc/ra.c9
-rw-r--r--gcc/ra.h2
5 files changed, 36 insertions, 10 deletions
diff --git a/gcc/ChangeLog.RA b/gcc/ChangeLog.RA
index abb01b28448..995571c8b5f 100644
--- a/gcc/ChangeLog.RA
+++ b/gcc/ChangeLog.RA
@@ -1,5 +1,15 @@
2003-10-13 Michael Matz <matz@suse.de>
+ * ra.c (flag_ra_split_webs): New.
+ (free_mem): Use it.
+ (reg_alloc): Set it (with cutoff).
+ * ra.h (flag_ra_split_webs): Declare.
+ * ra-rewrite.c (actual_spill): Use it.
+ * ra-colorize.c (colorize_one_web, try_recolor_web, check_colors,
+ ra_colorize_graph): Ditto.
+
+2003-10-13 Michael Matz <matz@suse.de>
+
* pre-reload.c (prefer_swapped): Change exit test to not
apply BLOCK_FOR_INSN on barriers.
diff --git a/gcc/ra-colorize.c b/gcc/ra-colorize.c
index 7e2aeaec98c..5fe424c5758 100644
--- a/gcc/ra-colorize.c
+++ b/gcc/ra-colorize.c
@@ -1721,7 +1721,8 @@ colorize_one_web (struct web *web, int hard)
" to spill %d was a good idea\n",
try->id);
remove_list (try->dlink, &WEBS(SPILLED));
- unsplit_web (try);
+ if (flag_ra_split_webs)
+ unsplit_web (try);
if (try->was_spilled)
colorize_one_web (try, 0);
else
@@ -1773,7 +1774,7 @@ colorize_one_web (struct web *web, int hard)
web->color = -1;
}
/* Try to split WEB, but only if we didn't find _any_ color for us. */
- if (web->type == SPILLED && bestc < 0)
+ if (flag_ra_split_webs && web->type == SPILLED && bestc < 0)
find_splits (web);
}
@@ -1963,7 +1964,8 @@ try_recolor_web (struct web *web)
/* Allow webs to be spilled. */
if (web2->spill_temp == 0 || web2->spill_temp == 2)
web2->was_spilled = 1;
- unsplit_web (web2);
+ if (flag_ra_split_webs)
+ unsplit_web (web2);
colorize_one_web (web2, 1);
if (web2->type == SPILLED)
cost += web2->spill_cost;
@@ -2189,8 +2191,9 @@ check_colors (void)
if (aweb->color >= web2->color + nregs2
|| web2->color >= aweb->color + nregs)
continue;
- if (bitmap_bit_p (split_around[aweb->id], web2->id)
- || bitmap_bit_p (split_around[web2->id], aweb->id))
+ if (flag_ra_split_webs
+ && (bitmap_bit_p (split_around[aweb->id], web2->id)
+ || bitmap_bit_p (split_around[web2->id], aweb->id)))
continue;
/*abort ();*/
}
@@ -2216,8 +2219,10 @@ check_colors (void)
if ((tcol + tofs >= scol + sofs + ssize)
|| (scol + sofs >= tcol + tofs + tsize))
continue;
- if (bitmap_bit_p (split_around[aweb->id], alias(wl->t)->id)
- || bitmap_bit_p (split_around[alias (wl->t)->id], aweb->id))
+ if (flag_ra_split_webs
+ && (bitmap_bit_p (split_around[aweb->id], alias(wl->t)->id)
+ || bitmap_bit_p (split_around[alias (wl->t)->id],
+ aweb->id)))
continue;
/*abort ();*/
}
@@ -3103,7 +3108,8 @@ ra_colorize_graph (struct df *df)
extended_coalesce_2 ();
}
- init_split_costs ();
+ if (flag_ra_split_webs)
+ init_split_costs ();
/* Now build the select stack. */
do
diff --git a/gcc/ra-rewrite.c b/gcc/ra-rewrite.c
index c04cfba132a..d2d2d20d881 100644
--- a/gcc/ra-rewrite.c
+++ b/gcc/ra-rewrite.c
@@ -2151,7 +2151,8 @@ actual_spill (int spill_p ATTRIBUTE_UNUSED)
delete_useless_defs ();
BITMAP_XFREE (useless_defs);
split_webs = BITMAP_XMALLOC ();
- insert_splits (new_deaths);
+ if (flag_ra_split_webs)
+ insert_splits (new_deaths);
sbitmap_free (insns_with_deaths);
insns_with_deaths = sbitmap_alloc (get_max_uid ());
death_insns_max_uid = get_max_uid ();
diff --git a/gcc/ra.c b/gcc/ra.c
index 93453c51a9a..383f7e2c320 100644
--- a/gcc/ra.c
+++ b/gcc/ra.c
@@ -173,6 +173,7 @@ int flag_ra_dump_only_costs = 0;
int flag_ra_biased = 0;
int flag_ra_improved_spilling = 0;
int flag_ra_ir_spilling = 0;
+int flag_ra_split_webs = 0;
int flag_ra_optimistic_coalescing = 0;
int flag_ra_break_aliases = 0;
int flag_ra_merge_spill_costs = 0;
@@ -425,7 +426,8 @@ free_mem (struct df *df ATTRIBUTE_UNUSED)
{
free_insn_info ();
ra_build_free ();
- free_split_costs ();
+ if (flag_ra_split_webs)
+ free_split_costs ();
}
/* Free all memory allocated for the register allocator. Used, when
@@ -995,12 +997,17 @@ reg_alloc (void)
flag_ra_spill_every_use = 0;
flag_ra_improved_spilling = 1;
flag_ra_ir_spilling = 0;
+ flag_ra_split_webs = 1;
flag_ra_break_aliases = 0;
flag_ra_optimistic_coalescing = 1;
flag_ra_merge_spill_costs = 1;
if (flag_ra_optimistic_coalescing)
flag_ra_break_aliases = 1;
flag_ra_dump_notes = 0;
+ if (max_reg_num () > 9000)
+ flag_ra_split_webs = 0;
+ if (flag_ra_ir_spilling && flag_ra_split_webs)
+ abort ();
make_insns_structurally_valid ();
/* Allocate the global df structure. */
diff --git a/gcc/ra.h b/gcc/ra.h
index 6087ffff1a3..e564662622d 100644
--- a/gcc/ra.h
+++ b/gcc/ra.h
@@ -565,6 +565,8 @@ extern int flag_ra_improved_spilling;
Chaintin style spilling (only at deaths). */
extern int flag_ra_ir_spilling;
+extern int flag_ra_split_webs;
+
/* Nonzero if we use optimistic coalescing, zero for iterated
coalescing. */
extern int flag_ra_optimistic_coalescing;