Better fix for loop unrolling problem.
authorJim Wilson <wilson@cygnus.com>
Tue, 2 Dec 1997 20:57:41 +0000 (20:57 +0000)
committerJim Wilson <wilson@gcc.gnu.org>
Tue, 2 Dec 1997 20:57:41 +0000 (12:57 -0800)
* unroll.c (find_splittable_givs):  Remove last change.  Handle givs
with a dest_reg that was created by loop.

From-SVN: r16893

gcc/ChangeLog
gcc/unroll.c

index 70a34a6c78f45286b4ee7a04de3c7203ec6ef7c0..aea5be07b1140082757c10086e8e63a2231a4385 100644 (file)
@@ -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.
index 29f01b8c213759154bc3d37f917b0c33591a97b6..688ee648da4b7f0744c7f5de72b114fa65bfd776 100644 (file)
@@ -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)))