]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
loop.c (scan_loop): Be more selective about what invariants are moved out of a loop.
authorGeoff Keating <geoffk@ozemail.com.au>
Mon, 19 Oct 1998 12:24:48 +0000 (12:24 +0000)
committerJeff Law <law@gcc.gnu.org>
Mon, 19 Oct 1998 12:24:48 +0000 (06:24 -0600)
       * loop.c (scan_loop): Be more selective about what invariants are
        moved out of a loop.

From-SVN: r23179

gcc/ChangeLog
gcc/loop.c

index b678ae2b24c2152b2d0ad8a688ca17650c41e447..6d810e0a636ff553d38fcf40b1a0f32e517b520c 100644 (file)
@@ -1,3 +1,8 @@
+Mon Oct 19 13:22:13 1998  Geoff Keating  <geoffk@ozemail.com.au>
+
+        * loop.c (scan_loop): Be more selective about what invariants are 
+        moved out of a loop.
+
 Wed Oct 14 23:27:08 1998  Didier FORT (didier.fort@fedex.com)
 
        * fixincludes: Fix up rpc/{clnt,svr,xdr}.h for SunOS.
index 3af6750de26ae1bbc34885bab3e12d58a9a734a9..702711477715a5eb964c6e85393f93d1a033557b 100644 (file)
@@ -786,18 +786,13 @@ scan_loop (loop_start, end, nregs, unroll_p)
             We don't know its life-span, so we can't compute the benefit.  */
          if (REGNO (SET_DEST (set)) >= max_reg_before_loop)
            ;
-         /* In order to move a register, we need to have one of three cases:
+         /* In order to move a register, we need to have either:
             (1) it is used only in the same basic block as the set
-            (2) it is not a user variable and it is not used in the
-                exit test (this can cause the variable to be used
-                before it is set just like a user-variable).
-            (3) the set is guaranteed to be executed once the loop starts,
+            (2) the set is guaranteed to be executed once the loop starts,
                 and the reg is not used until after that.  */
          else if (! ((! maybe_never
                       && ! loop_reg_used_before_p (set, p, loop_start,
                                                    scan_start, end))
-                     || (! REG_USERVAR_P (SET_DEST (set))
-                         && ! REG_LOOP_TEST_P (SET_DEST (set)))
                      || reg_in_basic_block_p (p, SET_DEST (set))))
            ;
          else if ((tem = invariant_p (src))