diff options
author | bonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-08-25 08:20:11 +0000 |
---|---|---|
committer | bonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-08-25 08:20:11 +0000 |
commit | 5f1278e94650d79ae17ff258af583048e254e36a (patch) | |
tree | cd53bb99b549809d25953645bf0429fe0398dd19 /gcc/loop.c | |
parent | a668be2626dea959ddc34e2a8ddd8fb95327cf3e (diff) | |
download | gcc-5f1278e94650d79ae17ff258af583048e254e36a.tar.gz |
2004-04-25 Paolo Bonzini <bonzini@gnu.org>
* cfglayout.c (duplicate_insn_chain): Remove references to
NOTE_INSN_LOOP_VTOP and NOTE_INSN_LOOP_CONT.
* cfgloop.h (struct loop): Remove fields vtop, cont and cont_dominator.
* cfgrtl.c (rtl_delete_block): Remove handling of NOTE_INSN_LOOP_CONT.
* final.c (final_scan_insn): Remove references to NOTE_INSN_LOOP_VTOP
and NOTE_INSN_LOOP_CONT.
* insn-notes.def (NOTE_INSN_LOOP_VTOP, NOTE_INSN_LOOP_CONT): Remove.
* jump.c (squeeze_notes): Remove references to NOTE_INSN_LOOP_VTOP
and NOTE_INSN_LOOP_CONT.
* loop.c (scan_loops, find_and_verify_loops, for_each_insn_in_loop,
check_dbra_loop, loop_dump_aux): Remove references to removed notes
and fields.
* reorg.c (mostly_true_jump): Do not rely on NOTE_INSN_LOOP_VTOPs.
* unroll.c (unroll_loop, copy_loop_body, loop_iterations): Remove
references to removed notes and fields.
(subtract_reg_term, ujump_to_loop_cont): Remove.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@86542 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/loop.c')
-rw-r--r-- | gcc/loop.c | 91 |
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"); } } |