summaryrefslogtreecommitdiff
path: root/gcc/loop.c
diff options
context:
space:
mode:
authoramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>1999-02-16 17:34:35 +0000
committeramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>1999-02-16 17:34:35 +0000
commitdd8b2ce459f1fb56f5a79767f43bfff7ab2ea8be (patch)
tree163da2e367f4d231b64af0c0b9417c77704a1a7c /gcc/loop.c
parentac0cd4fb8d1f2689e605c4fb211bc724cda9da52 (diff)
downloadgcc-dd8b2ce459f1fb56f5a79767f43bfff7ab2ea8be.tar.gz
* loop.c (strength_reduce): Calculate maybe_dead before
calling recombine_givs. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@25251 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/loop.c')
-rw-r--r--gcc/loop.c52
1 files changed, 30 insertions, 22 deletions
diff --git a/gcc/loop.c b/gcc/loop.c
index 81ed3e13e4e..0979b999e5c 100644
--- a/gcc/loop.c
+++ b/gcc/loop.c
@@ -4621,6 +4621,35 @@ strength_reduce (scan_start, end, loop_top, insn_count,
}
}
+ /* Check for givs whose first use is their definition and whose
+ last use is the definition of another giv. If so, it is likely
+ dead and should not be used to derive another giv nor to
+ eliminate a biv. */
+ for (v = bl->giv; v; v = v->next_iv)
+ {
+ if (v->ignore
+ || (v->same && v->same->ignore))
+ continue;
+
+ if (v->last_use)
+ {
+ struct induction *v1;
+
+ for (v1 = bl->giv; v1; v1 = v1->next_iv)
+ if (v->last_use == v1->insn)
+ v->maybe_dead = 1;
+ }
+ else if (v->giv_type == DEST_REG
+ && REGNO_FIRST_UID (REGNO (v->dest_reg)) == INSN_UID (v->insn))
+ {
+ struct induction *v1;
+
+ for (v1 = bl->giv; v1; v1 = v1->next_iv)
+ if (REGNO_LAST_UID (REGNO (v->dest_reg)) == INSN_UID (v1->insn))
+ v->maybe_dead = 1;
+ }
+ }
+
#if 0
/* XXX Temporary. */
/* Now that we know which givs will be reduced, try to rearrange the
@@ -4789,11 +4818,8 @@ strength_reduce (scan_start, end, loop_top, insn_count,
For each giv register that can be reduced now: if replaceable,
substitute reduced reg wherever the old giv occurs;
- else add new move insn "giv_reg = reduced_reg".
+ else add new move insn "giv_reg = reduced_reg". */
- Also check for givs whose first use is their definition and whose
- last use is the definition of another giv. If so, it is likely
- dead and should not be used to eliminate a biv. */
for (v = bl->giv; v; v = v->next_iv)
{
if (v->same && v->same->ignore)
@@ -4802,24 +4828,6 @@ strength_reduce (scan_start, end, loop_top, insn_count,
if (v->ignore)
continue;
- if (v->last_use)
- {
- struct induction *v1;
-
- for (v1 = bl->giv; v1; v1 = v1->next_iv)
- if (v->last_use == v1->insn)
- v->maybe_dead = 1;
- }
- else if (v->giv_type == DEST_REG
- && REGNO_FIRST_UID (REGNO (v->dest_reg)) == INSN_UID (v->insn))
- {
- struct induction *v1;
-
- for (v1 = bl->giv; v1; v1 = v1->next_iv)
- if (REGNO_LAST_UID (REGNO (v->dest_reg)) == INSN_UID (v1->insn))
- v->maybe_dead = 1;
- }
-
/* Update expression if this was combined, in case other giv was
replaced. */
if (v->same)