aboutsummaryrefslogtreecommitdiff
path: root/gcc/loop.c
diff options
context:
space:
mode:
authorJ"orn Rennecke <amylaar@cygnus.co.uk>1999-02-25 11:16:17 +0000
committerJoern Rennecke <amylaar@gcc.gnu.org>1999-02-25 11:16:17 +0000
commitf38cbf0fd3367a7dc0df52250ec8f48acfd286cb (patch)
treeb7142fcf64245477de6a9288ec0bd85da437e5b2 /gcc/loop.c
parentdfa08768aa9e461d52b3c5f5e6840f2699be21ab (diff)
downloadgcc-f38cbf0fd3367a7dc0df52250ec8f48acfd286cb.zip
gcc-f38cbf0fd3367a7dc0df52250ec8f48acfd286cb.tar.gz
gcc-f38cbf0fd3367a7dc0df52250ec8f48acfd286cb.tar.bz2
rtl.h (insn_first_p): Don't declare.
* 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
Diffstat (limited to 'gcc/loop.c')
-rw-r--r--gcc/loop.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/gcc/loop.c b/gcc/loop.c
index f658933..c5666f9 100644
--- a/gcc/loop.c
+++ b/gcc/loop.c
@@ -8106,18 +8106,32 @@ maybe_eliminate_biv (bl, loop_start, end, eliminate_p, threshold, insn_count)
}
/* 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