aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Wilson <wilson@cygnus.com>1997-12-02 20:57:41 +0000
committerJim Wilson <wilson@gcc.gnu.org>1997-12-02 12:57:41 -0800
commit9fb82071ffbee07329eeff32ee26f8170f672123 (patch)
tree1b388c79ef08b1f652b1c735f0f366692e6c9c2a
parent898f531b0bb06dfb175c959bd3d3e8aa8eb4f033 (diff)
downloadgcc-9fb82071ffbee07329eeff32ee26f8170f672123.zip
gcc-9fb82071ffbee07329eeff32ee26f8170f672123.tar.gz
gcc-9fb82071ffbee07329eeff32ee26f8170f672123.tar.bz2
Better fix for loop unrolling problem.
* unroll.c (find_splittable_givs): Remove last change. Handle givs with a dest_reg that was created by loop. From-SVN: r16893
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/unroll.c24
2 files changed, 16 insertions, 13 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 70a34a6..aea5be0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+Tue Dec 2 12:54:33 1997 Jim Wilson <wilson@cygnus.com>
+
+ * unroll.c (find_splittable_givs): Remove last change. Handle givs
+ with a dest_reg that was created by loop.
+
Fri Nov 28 10:00:27 1997 Jeffrey A Law (law@cygnus.com)
* configure.in: Fix NCR entries.
diff --git a/gcc/unroll.c b/gcc/unroll.c
index 29f01b8..688ee64 100644
--- a/gcc/unroll.c
+++ b/gcc/unroll.c
@@ -2668,12 +2668,6 @@ find_splittable_givs (bl, unroll_type, loop_start, loop_end, increment,
{
rtx giv_inc, value;
-
- /* If this is a new register, can't handle it since it does not have
- an entry in reg_n_info. */
- if (REGNO (v->dest_reg) >= max_reg_before_loop)
- continue;
-
/* Only split the giv if it has already been reduced, or if the loop is
being completely unrolled. */
if (unroll_type != UNROLL_COMPLETELY && v->ignore)
@@ -2711,13 +2705,17 @@ find_splittable_givs (bl, unroll_type, loop_start, loop_end, increment,
&& (loop_number_exit_count[uid_loop_num[INSN_UID (loop_start)]]
|| unroll_type == UNROLL_NAIVE)
&& v->giv_type != DEST_ADDR
- && ((REGNO_FIRST_UID (REGNO (v->dest_reg)) != INSN_UID (v->insn)
- /* Check for the case where the pseudo is set by a shift/add
- sequence, in which case the first insn setting the pseudo
- is the first insn of the shift/add sequence. */
- && (! (tem = find_reg_note (v->insn, REG_RETVAL, NULL_RTX))
- || (REGNO_FIRST_UID (REGNO (v->dest_reg))
- != INSN_UID (XEXP (tem, 0)))))
+ /* The next part is true if the pseudo is used outside the loop.
+ We assume that this is true for any pseudo created after loop
+ starts, because we don't have a reg_n_info entry for them. */
+ && (REGNO (v->dest_reg) >= max_reg_before_loop
+ || (REGNO_FIRST_UID (REGNO (v->dest_reg)) != INSN_UID (v->insn)
+ /* Check for the case where the pseudo is set by a shift/add
+ sequence, in which case the first insn setting the pseudo
+ is the first insn of the shift/add sequence. */
+ && (! (tem = find_reg_note (v->insn, REG_RETVAL, NULL_RTX))
+ || (REGNO_FIRST_UID (REGNO (v->dest_reg))
+ != INSN_UID (XEXP (tem, 0)))))
/* Line above always fails if INSN was moved by loop opt. */
|| (uid_luid[REGNO_LAST_UID (REGNO (v->dest_reg))]
>= INSN_LUID (loop_end)))