aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@freesoft.cz>1999-12-16 11:35:14 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>1999-12-16 10:35:14 +0000
commit954d8e993c55366884fa11473e0da7b9b3457184 (patch)
tree86636ce3b4bf44a7d8367b093dcab0e21f08c8a6
parent5ba280dae8c8d278b77979ff64dacd29d497ebe0 (diff)
downloadgcc-954d8e993c55366884fa11473e0da7b9b3457184.zip
gcc-954d8e993c55366884fa11473e0da7b9b3457184.tar.gz
gcc-954d8e993c55366884fa11473e0da7b9b3457184.tar.bz2
regclass.c (loop_depth): Remove
* regclass.c (loop_depth): Remove (scan_one_insn): Do not handle LOOP_NOTE insns. (regclass): Go through basic blocks and set loop_cost From-SVN: r30976
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/regclass.c46
2 files changed, 25 insertions, 27 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 03a8ed9..570e307 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+Thu Dec 16 11:33:57 MET 1999 Jan Hubicka <hubicka@freesoft.cz>
+
+ * regclass.c (loop_depth): Remove
+ (scan_one_insn): Do not handle LOOP_NOTE insns.
+ (regclass): Go through basic blocks and set loop_cost
+
Thu Dec 16 02:56:25 1999 Zack Weinberg <zack@bitmover.com>
* tree.h (DECL_FROM_INLINE): Check DECL_ABSTRACT_ORIGIN too.
diff --git a/gcc/regclass.c b/gcc/regclass.c
index ea131c0..3c28580 100644
--- a/gcc/regclass.c
+++ b/gcc/regclass.c
@@ -716,10 +716,6 @@ static struct reg_pref *reg_pref;
static struct reg_pref *reg_pref_buffer;
-/* Record the depth of loops that we are in. */
-
-static int loop_depth;
-
/* Account for the fact that insns within a loop are executed very commonly,
but don't keep doing this as loops go too deep. */
@@ -821,26 +817,6 @@ scan_one_insn (insn, pass)
rtx set, note;
int i, j;
- /* Show that an insn inside a loop is likely to be executed three
- times more than insns outside a loop. This is much more aggressive
- than the assumptions made elsewhere and is being tried as an
- experiment. */
-
- if (code == NOTE)
- {
- if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_BEG)
- loop_depth++;
- else if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_END)
- loop_depth--;
-
- if (optimize_size)
- loop_cost = 1;
- else
- loop_cost = 1 << (2 * MIN (loop_depth, 5));
-
- return insn;
- }
-
if (GET_RTX_CLASS (code) != 'i')
return insn;
@@ -1085,6 +1061,7 @@ regclass (f, nregs, dump)
for (pass = 0; pass <= flag_expensive_optimizations; pass++)
{
+ int index;
/* Zero out our accumulation of the cost of each class for each reg. */
bzero ((char *) costs, nregs * sizeof (struct costs));
@@ -1093,14 +1070,29 @@ regclass (f, nregs, dump)
bzero (in_inc_dec, nregs);
#endif
- loop_depth = 0, loop_cost = 1;
+ loop_cost = 1;
/* Scan the instructions and record each time it would
save code to put a certain register in a certain class. */
- for (insn = f; insn; insn = NEXT_INSN (insn))
+ for (index = 0; index < n_basic_blocks; index++)
{
- insn = scan_one_insn (insn, pass);
+ basic_block bb = BASIC_BLOCK (index);
+
+ /* Show that an insn inside a loop is likely to be executed three
+ times more than insns outside a loop. This is much more aggressive
+ than the assumptions made elsewhere and is being tried as an
+ experiment. */
+ if (optimize_size)
+ loop_cost = 1;
+ else
+ loop_cost = 1 << (2 * MIN (bb->loop_depth - 1, 5));
+ for (insn = bb->head; ; insn = NEXT_INSN (insn))
+ {
+ insn = scan_one_insn (insn, pass);
+ if (insn == bb->end)
+ break;
+ }
}
/* Now for each register look at how desirable each class is