rtl.h (insn_first_p): Don't declare.
authorJ"orn Rennecke <amylaar@cygnus.co.uk>
Thu, 25 Feb 1999 11:16:17 +0000 (11:16 +0000)
committerJoern Rennecke <amylaar@gcc.gnu.org>
Thu, 25 Feb 1999 11:16:17 +0000 (11:16 +0000)
* rtl.h (insn_first_p): Don't declare.
* rtlanal.c (insn_first_p): Delete.
* loop.c (loop_insn_first_p): Faster implementation.

From-SVN: r25436

gcc/ChangeLog
gcc/loop.c
gcc/rtl.h
gcc/rtlanal.c

index 931b283..b1d72ee 100644 (file)
@@ -1,3 +1,9 @@
+Thu Feb 25 19:13:42 1999  J"orn Rennecke <amylaar@cygnus.co.uk>
+
+       * rtl.h (insn_first_p): Don't declare.
+       * rtlanal.c (insn_first_p): Delete.
+       * loop.c (loop_insn_first_p): Faster implementation.
+
 Thu Feb 25 10:44:35 1999  Richard Earnshaw (rearnsha@arm.com)
 
        * arm.h (TARGET_SWITCHES): Delete deprecated switches -m[236].
index f658933..c5666f9 100644 (file)
@@ -8106,18 +8106,32 @@ maybe_eliminate_biv (bl, loop_start, end, eliminate_p, threshold, insn_count)
 }
 \f
 /* INSN and REFERENCE are instructions in the same insn chain.
-   Return non-zero if INSN is first.
-   This is like insn_first_p, except that we use the luid information if
-   available.  */
+   Return non-zero if INSN is first.  */
 
 int
 loop_insn_first_p (insn, reference)
      rtx insn, reference;
 {
-  return ((INSN_UID (insn) < max_uid_for_loop
-          && INSN_UID (reference) < max_uid_for_loop)
-         ? INSN_LUID (insn) < INSN_LUID (reference)
-         : insn_first_p (insn, reference));
+  rtx p, q;
+
+  for (p = insn, q = reference; ;)
+    {
+      /* Start with test for not first so that INSN == REFERENCE yields not
+         first.  */
+      if (q == insn || ! p)
+        return 0;
+      if (p == reference || ! q)
+        return 1;
+
+      if (INSN_UID (p) < max_uid_for_loop
+         && INSN_UID (q) < max_uid_for_loop)
+       return INSN_LUID (p) < INSN_LUID (q);
+
+      if (INSN_UID (p) >= max_uid_for_loop)
+       p = NEXT_INSN (p);
+      if (INSN_UID (q) >= max_uid_for_loop)
+       q = NEXT_INSN (q);
+    }
 }
 
 /* We are trying to eliminate BIV in INSN using GIV.  Return non-zero if
index 2839c88..3d51c88 100644 (file)
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -1036,7 +1036,6 @@ extern rtx replace_regs                   PROTO((rtx, rtx *, int, int));
 extern int computed_jump_p             PROTO((rtx));
 typedef int (*rtx_function)             PROTO((rtx *, void *));
 extern int for_each_rtx                 PROTO((rtx *, rtx_function, void *));
-extern int insn_first_p                        PROTO((rtx, rtx));
 extern rtx regno_use_in                        PROTO((int, rtx));
 
 /* flow.c */
index 1dabc36..d061273 100644 (file)
@@ -2204,26 +2204,6 @@ for_each_rtx (x, f, data)
   return 0;
 }
 
-/* INSN and REFERENCE are instructions in the same insn chain.
-   Return non-zero if INSN is first.  */
-int
-insn_first_p (insn, reference)
-     rtx insn, reference;
-{
-  rtx p, q;
-
-  for (p = insn, q = reference; ; p = NEXT_INSN (p), q = NEXT_INSN (q))
-    {
-      /* Start with test for not first so that INSN == REFERENCE yields not
-        first.  */
-      if (q == insn || ! p)
-       return 0;
-      if (p == reference || ! q)
-       return 1;
-    }
-}
-
-
 /* Searches X for any reference to REGNO, returning the rtx of the
    reference found if any.  Otherwise, returns NULL_RTX.  */