aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJ"orn Rennecke <amylaar@cygnus.co.uk>1999-02-02 11:52:00 +0000
committerJoern Rennecke <amylaar@gcc.gnu.org>1999-02-02 11:52:00 +0000
commit7221f080227636b16826313a5148999c777d8b67 (patch)
tree9289d57fce739fc33850e22a887d052e865e60fb /gcc
parente77dbc56f903af3ca76d16c29d8061385cf80e52 (diff)
downloadgcc-7221f080227636b16826313a5148999c777d8b67.zip
gcc-7221f080227636b16826313a5148999c777d8b67.tar.gz
gcc-7221f080227636b16826313a5148999c777d8b67.tar.bz2
(recombine_givs): Don't use a giv that's likely to be dead to derive others.
* (recombine_givs): Don't use a giv that's likely to be dead to derive others. * loop.c (recombine_givs): Fix test for lifetime overlaps / loop wrap around when deriving givs. From-SVN: r24967
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/loop.c26
2 files changed, 29 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 89fd8ab..cf302bc 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+Tue Feb 2 19:48:29 1999 J"orn Rennecke <amylaar@cygnus.co.uk>
+
+ * (recombine_givs): Don't use a giv that's likely to be dead to
+ derive others.
+
+ * loop.c (recombine_givs): Fix test for lifetime overlaps / loop
+ wrap around when deriving givs.
+
Mon Feb 1 20:00:40 1999 Richard Henderson <rth@cygnus.com>
* recog.c (check_asm_operands): Treat indeterminate operand ok
diff --git a/gcc/loop.c b/gcc/loop.c
index 4b03d36..8323a27 100644
--- a/gcc/loop.c
+++ b/gcc/loop.c
@@ -7293,16 +7293,28 @@ recombine_givs (bl, loop_start, loop_end, unroll_p)
continue;
if (! last_giv)
{
- last_giv = v;
- life_start = stats[i].start_luid;
- life_end = stats[i].end_luid;
+ /* Don't use a giv that's likely to be dead to derive
+ others - that would be likely to keep that giv alive. */
+ if (! v->maybe_dead || v->combined_with)
+ {
+ last_giv = v;
+ life_start = stats[i].start_luid;
+ life_end = stats[i].end_luid;
+ }
continue;
}
/* Use unsigned arithmetic to model loop wrap around. */
if (((unsigned) stats[i].start_luid - life_start
>= (unsigned) life_end - life_start)
&& ((unsigned) stats[i].end_luid - life_start
- >= (unsigned) life_end - life_start)
+ > (unsigned) life_end - life_start)
+ /* Check that the giv insn we're about to use for deriving
+ precedes all uses of that giv. Note that initializing the
+ derived giv would defeat the purpose of reducing register
+ pressure.
+ ??? We could arrange to move the insn. */
+ && ((unsigned) stats[i].end_luid - INSN_LUID (loop_start)
+ > (unsigned) stats[i].start_luid - INSN_LUID (loop_start))
&& rtx_equal_p (last_giv->mult_val, v->mult_val)
/* ??? Could handle libcalls, but would need more logic. */
&& ! find_reg_note (v->insn, REG_RETVAL, NULL_RTX)
@@ -7312,7 +7324,11 @@ recombine_givs (bl, loop_start, loop_end, unroll_p)
don't have this detailed control flow information.
N.B. since last_giv will be reduced, it is valid
anywhere in the loop, so we don't need to check the
- validity of last_giv. */
+ validity of last_giv.
+ We rely here on the fact that v->always_executed implies that
+ there is no jump to someplace else in the loop before the
+ giv insn, and hence any insn that is executed before the
+ giv insn in the loop will have a lower luid. */
&& (v->always_executed || ! v->combined_with)
&& (sum = express_from (last_giv, v))
/* Make sure we don't make the add more expensive. ADD_COST