summaryrefslogtreecommitdiffstats
path: root/gcc/loop.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/loop.c')
-rw-r--r--gcc/loop.c91
1 files changed, 7 insertions, 84 deletions
diff --git a/gcc/loop.c b/gcc/loop.c
index 49f86c2887a..f28d890f8b9 100644
--- a/gcc/loop.c
+++ b/gcc/loop.c
@@ -644,8 +644,6 @@ scan_loop (struct loop *loop, int flags)
since in that case saving an insn makes more difference
and more registers are available. */
int threshold;
- /* Nonzero if we are scanning instructions in a sub-loop. */
- int loop_depth = 0;
int in_libcall;
loop->top = 0;
@@ -738,13 +736,8 @@ scan_loop (struct loop *loop, int flags)
insn_count = count_insns_in_loop (loop);
if (loop_dump_stream)
- {
- fprintf (loop_dump_stream, "\nLoop from %d to %d: %d real insns.\n",
- INSN_UID (loop_start), INSN_UID (loop_end), insn_count);
- if (loop->cont)
- fprintf (loop_dump_stream, "Continue at insn %d.\n",
- INSN_UID (loop->cont));
- }
+ fprintf (loop_dump_stream, "\nLoop from %d to %d: %d real insns.\n",
+ INSN_UID (loop_start), INSN_UID (loop_end), insn_count);
/* Scan through the loop finding insns that are safe to move.
Set REGS->ARRAY[I].SET_IN_LOOP negative for the reg I being set, so that
@@ -1120,18 +1113,6 @@ scan_loop (struct loop *loop, int flags)
&& NEXT_INSN (NEXT_INSN (p)) == loop_end
&& any_uncondjump_p (p)))
maybe_never = 1;
- else if (NOTE_P (p))
- {
- /* At the virtual top of a converted loop, insns are again known to
- be executed: logically, the loop begins here even though the exit
- code has been duplicated. */
- if (NOTE_LINE_NUMBER (p) == NOTE_INSN_LOOP_VTOP && loop_depth == 0)
- maybe_never = call_passed = 0;
- else if (NOTE_LINE_NUMBER (p) == NOTE_INSN_LOOP_BEG)
- loop_depth++;
- else if (NOTE_LINE_NUMBER (p) == NOTE_INSN_LOOP_END)
- loop_depth--;
- }
}
/* If one movable subsumes another, ignore that other. */
@@ -2501,7 +2482,7 @@ count_nonfixed_reads (const struct loop *loop, rtx x)
return value;
}
-/* Scan a loop setting the elements `cont', `vtop', `loops_enclosed',
+/* Scan a loop setting the elements `loops_enclosed',
`has_call', `has_nonconst_call', `has_volatile', `has_tablejump',
`unknown_address_altered', `unknown_constant_address_altered', and
`num_mem_sets' in LOOP. Also, fill in the array `mems' and the
@@ -2741,14 +2722,6 @@ find_and_verify_loops (rtx f, struct loops *loops)
current_loop = next_loop;
break;
- case NOTE_INSN_LOOP_CONT:
- current_loop->cont = insn;
- break;
-
- case NOTE_INSN_LOOP_VTOP:
- current_loop->vtop = insn;
- break;
-
case NOTE_INSN_LOOP_END:
if (! current_loop)
abort ();
@@ -4276,7 +4249,6 @@ for_each_insn_in_loop (struct loop *loop, loop_insn_callback fncall)
int not_every_iteration = 0;
int maybe_multiple = 0;
int past_loop_latch = 0;
- int loop_depth = 0;
rtx p;
/* If loop_scan_start points to the loop exit test, we have to be wary of
@@ -4359,24 +4331,6 @@ for_each_insn_in_loop (struct loop *loop, loop_insn_callback fncall)
not_every_iteration = 1;
}
- else if (NOTE_P (p))
- {
- /* At the virtual top of a converted loop, insns are again known to
- be executed each iteration: logically, the loop begins here
- even though the exit code has been duplicated.
-
- Insns are also again known to be executed each iteration at
- the LOOP_CONT note. */
- if ((NOTE_LINE_NUMBER (p) == NOTE_INSN_LOOP_VTOP
- || NOTE_LINE_NUMBER (p) == NOTE_INSN_LOOP_CONT)
- && loop_depth == 0)
- not_every_iteration = 0;
- else if (NOTE_LINE_NUMBER (p) == NOTE_INSN_LOOP_BEG)
- loop_depth++;
- else if (NOTE_LINE_NUMBER (p) == NOTE_INSN_LOOP_END)
- loop_depth--;
- }
-
/* Note if we pass a loop latch. If we do, then we can not clear
NOT_EVERY_ITERATION below when we pass the last CODE_LABEL in
a loop since a jump before the last CODE_LABEL may have started
@@ -4402,8 +4356,7 @@ for_each_insn_in_loop (struct loop *loop, loop_insn_callback fncall)
if (not_every_iteration
&& !past_loop_latch
&& LABEL_P (p)
- && no_labels_between_p (p, loop->end)
- && loop_insn_first_p (p, loop->cont))
+ && no_labels_between_p (p, loop->end))
not_every_iteration = 0;
}
}
@@ -7990,8 +7943,8 @@ check_dbra_loop (struct loop *loop, int insn_count)
sequence and see if we've got another comparison sequence. */
rtx jump1;
- if ((jump1 = prev_nonnote_insn (first_compare)) != loop->cont)
- if (JUMP_P (jump1))
+ if ((jump1 = prev_nonnote_insn (first_compare))
+ && JUMP_P (jump1))
return 0;
}
@@ -8304,17 +8257,6 @@ check_dbra_loop (struct loop *loop, int insn_count)
/* First check if we can do a vanilla loop reversal. */
if (initial_value == const0_rtx
- /* If we have a decrement_and_branch_on_count,
- prefer the NE test, since this will allow that
- instruction to be generated. Note that we must
- use a vanilla loop reversal if the biv is used to
- calculate a giv or has a non-counting use. */
-#if ! defined (HAVE_decrement_and_branch_until_zero) \
-&& defined (HAVE_decrement_and_branch_on_count)
- && (! (add_val == 1 && loop->vtop
- && (bl->biv_count == 0
- || no_use_except_counting)))
-#endif
&& GET_CODE (comparison_value) == CONST_INT
/* Now do postponed overflow checks on COMPARISON_VAL. */
&& ! (((comparison_val - add_val) ^ INTVAL (comparison_value))
@@ -8326,13 +8268,6 @@ check_dbra_loop (struct loop *loop, int insn_count)
nonneg = 1;
cmp_code = GE;
}
- else if (add_val == 1 && loop->vtop
- && (bl->biv_count == 0
- || no_use_except_counting))
- {
- add_adjust = 0;
- cmp_code = NE;
- }
else
return 0;
@@ -10731,15 +10666,9 @@ loop_dump_aux (const struct loop *loop, FILE *file,
if (loop->start)
{
fprintf (file,
- ";; start %d (%d), cont dom %d (%d), cont %d (%d), vtop %d (%d), end %d (%d)\n",
+ ";; start %d (%d), end %d (%d)\n",
LOOP_BLOCK_NUM (loop->start),
LOOP_INSN_UID (loop->start),
- LOOP_BLOCK_NUM (loop->cont),
- LOOP_INSN_UID (loop->cont),
- LOOP_BLOCK_NUM (loop->cont),
- LOOP_INSN_UID (loop->cont),
- LOOP_BLOCK_NUM (loop->vtop),
- LOOP_INSN_UID (loop->vtop),
LOOP_BLOCK_NUM (loop->end),
LOOP_INSN_UID (loop->end));
fprintf (file, ";; top %d (%d), scan start %d (%d)\n",
@@ -10758,12 +10687,6 @@ loop_dump_aux (const struct loop *loop, FILE *file,
}
}
fputs ("\n", file);
-
- /* This can happen when a marked loop appears as two nested loops,
- say from while (a || b) {}. The inner loop won't match
- the loop markers but the outer one will. */
- if (LOOP_BLOCK_NUM (loop->cont) != loop->latch->index)
- fprintf (file, ";; NOTE_INSN_LOOP_CONT not in loop latch\n");
}
}
OpenPOWER on IntegriCloud