aboutsummaryrefslogtreecommitdiff
path: root/gcc/haifa-sched.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2006-11-11 16:50:16 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2006-11-11 15:50:16 +0000
commit6039a0c74a90a4a344e2c000115acfa46293ef8f (patch)
tree5f4208819ca7ad9f4213c79c692e4029d0966257 /gcc/haifa-sched.c
parentf9f770a8d56552aab041b8de6548858241a03f53 (diff)
downloadgcc-6039a0c74a90a4a344e2c000115acfa46293ef8f.zip
gcc-6039a0c74a90a4a344e2c000115acfa46293ef8f.tar.gz
gcc-6039a0c74a90a4a344e2c000115acfa46293ef8f.tar.bz2
tree-pass.h (pass_purge_lineno_notes): Remove declaration.
* tree-pass.h (pass_purge_lineno_notes): Remove declaration. * modulo-sched.c (find_line_note): Remove. (loop_canon_p): Do not worry about line number notes. (sms_schedule): Likewise. * cse.c (cse_main): Likewise. * regmove.c (fixup_match_1): Likewise * function.c (emit_return_info_block): Likewise. (expand_function_end): Likewise. (thread_prologue_an_epilogue_insns): Likewise. * cfgrtl.c (try_redirect_by_replacing_jump, rtl_tidy_fallthru_edge): Likewise. * emit-rtl.c (find_line_note, emit_insn_after_with_line_notes, emit_note_copy_after): Kill. (emit_note_copy): Do not worry about line numbers. * jump.c (purge_line_number_notes): Kill. (pass_purge_lineno_notes): Kill. * cfgcleanup.c (rest_of_handle_jump2): Kill purge_line_number_notes call. * rtl.h (emit_note_copy_after, emit_insn_after_with_line_notes): Kill. * passes.c (init_optimization_passes): Don't purge_lineno_notes. * sched-ebb.c (schedule_ebbs): Don't do rm_redundant_line_notes. * tree-pass.h (pass_purge_lineno_notes): Kill. * sched-ebb.c (schedule_ebb): Don't rm_line_notes, rm_redundant_line_notes. * sched-rgb.c (schedule_region): Don't rm_line_notes, rm_redundant_line_notes. * sched-int.h (rm_line_notes, rm_redundant_line_notes): Kill. * haifa-sched.c: Update comment about handling notes. (unlink_line_notes): Kill. (rm_line_notes): Kill. (save_line_notes): Simplify. (rm_redundant_line_notes): Kill. From-SVN: r118693
Diffstat (limited to 'gcc/haifa-sched.c')
-rw-r--r--gcc/haifa-sched.c141
1 files changed, 3 insertions, 138 deletions
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index ebe7f24..6cd1fe1 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -511,26 +511,18 @@ static void advance_one_cycle (void);
Generally, NOTES are saved before scheduling and restored after scheduling.
The scheduler distinguishes between three types of notes:
- (1) LINE_NUMBER notes, generated and used for debugging. Here,
- before scheduling a region, a pointer to the LINE_NUMBER note is
- added to the insn following it (in save_line_notes()), and the note
- is removed (in rm_line_notes() and unlink_line_notes()). After
- scheduling the region, this pointer is used for regeneration of
- the LINE_NUMBER note (in restore_line_notes()).
-
- (2) LOOP_BEGIN, LOOP_END, SETJMP, EHREGION_BEG, EHREGION_END notes:
+ (1) LOOP_BEGIN, LOOP_END, SETJMP, EHREGION_BEG, EHREGION_END notes:
Before scheduling a region, a pointer to the note is added to the insn
that follows or precedes it. (This happens as part of the data dependence
computation). After scheduling an insn, the pointer contained in it is
used for regenerating the corresponding note (in reemit_notes).
- (3) All other notes (e.g. INSN_DELETED): Before scheduling a block,
+ (2) All other notes (e.g. INSN_DELETED): Before scheduling a block,
these notes are put in a list (in rm_other_notes() and
unlink_other_notes ()). After scheduling the block, these notes are
inserted at the beginning of the block (in schedule_block()). */
static rtx unlink_other_notes (rtx, rtx);
-static rtx unlink_line_notes (rtx, rtx);
static void reemit_notes (rtx);
static rtx *ready_lastpos (struct ready_list *);
@@ -1276,50 +1268,6 @@ unlink_other_notes (rtx insn, rtx tail)
return insn;
}
-/* Delete line notes beginning with INSN. Record line-number notes so
- they can be reused. Returns the insn following the notes. */
-
-static rtx
-unlink_line_notes (rtx insn, rtx tail)
-{
- rtx prev = PREV_INSN (insn);
-
- while (insn != tail && NOTE_NOT_BB_P (insn))
- {
- rtx next = NEXT_INSN (insn);
-
- if (write_symbols != NO_DEBUG && NOTE_LINE_NUMBER (insn) > 0)
- {
- basic_block bb = BLOCK_FOR_INSN (insn);
-
- /* Delete the note from its current position. */
- if (prev)
- NEXT_INSN (prev) = next;
- if (next)
- PREV_INSN (next) = prev;
-
- if (bb)
- {
- /* Basic block can begin with either LABEL or
- NOTE_INSN_BASIC_BLOCK. */
- gcc_assert (BB_HEAD (bb) != insn);
-
- /* Check if we are removing last insn in the BB. */
- if (BB_END (bb) == insn)
- BB_END (bb) = prev;
- }
-
- /* Record line-number notes so they can be reused. */
- LINE_NOTE (insn) = insn;
- }
- else
- prev = insn;
-
- insn = next;
- }
- return insn;
-}
-
/* Return the head and tail pointers of ebb starting at BEG and ending
at END. */
@@ -1373,34 +1321,6 @@ no_real_insns_p (rtx head, rtx tail)
return 1;
}
-/* Delete line notes from one block. Save them so they can be later restored
- (in restore_line_notes). HEAD and TAIL are the boundaries of the
- block in which notes should be processed. */
-
-void
-rm_line_notes (rtx head, rtx tail)
-{
- rtx next_tail;
- rtx insn;
-
- next_tail = NEXT_INSN (tail);
- for (insn = head; insn != next_tail; insn = NEXT_INSN (insn))
- {
- rtx prev;
-
- /* Farm out notes, and maybe save them in NOTE_LIST.
- This is needed to keep the debugger from
- getting completely deranged. */
- if (NOTE_NOT_BB_P (insn))
- {
- prev = insn;
- insn = unlink_line_notes (insn, next_tail);
-
- gcc_assert (prev != tail && prev != head && insn != next_tail);
- }
- }
-}
-
/* Save line number notes for each insn in block B. HEAD and TAIL are
the boundaries of the block in which notes should be processed. */
@@ -1420,10 +1340,7 @@ save_line_notes (int b, rtx head, rtx tail)
next_tail = NEXT_INSN (tail);
for (insn = head; insn != next_tail; insn = NEXT_INSN (insn))
- if (NOTE_P (insn) && NOTE_LINE_NUMBER (insn) > 0)
- line = insn;
- else
- LINE_NOTE (insn) = line;
+ LINE_NOTE (insn) = line;
}
/* After a block was scheduled, insert line notes into the insns list.
@@ -1497,58 +1414,6 @@ restore_line_notes (rtx head, rtx tail)
fprintf (sched_dump, ";; added %d line-number notes\n", added_notes);
}
-/* After scheduling the function, delete redundant line notes from the
- insns list. */
-
-void
-rm_redundant_line_notes (void)
-{
- rtx line = 0;
- rtx insn = get_insns ();
- int active_insn = 0;
- int notes = 0;
-
- /* Walk the insns deleting redundant line-number notes. Many of these
- are already present. The remainder tend to occur at basic
- block boundaries. */
- for (insn = get_last_insn (); insn; insn = PREV_INSN (insn))
- if (NOTE_P (insn) && NOTE_LINE_NUMBER (insn) > 0)
- {
- /* If there are no active insns following, INSN is redundant. */
- if (active_insn == 0)
- {
- notes++;
- SET_INSN_DELETED (insn);
- }
- /* If the line number is unchanged, LINE is redundant. */
- else if (line
-#ifdef USE_MAPPED_LOCATION
- && NOTE_SOURCE_LOCATION (line) == NOTE_SOURCE_LOCATION (insn)
-#else
- && NOTE_LINE_NUMBER (line) == NOTE_LINE_NUMBER (insn)
- && NOTE_SOURCE_FILE (line) == NOTE_SOURCE_FILE (insn)
-#endif
-)
- {
- notes++;
- SET_INSN_DELETED (line);
- line = insn;
- }
- else
- line = insn;
- active_insn = 0;
- }
- else if (!((NOTE_P (insn)
- && NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED)
- || (NONJUMP_INSN_P (insn)
- && (GET_CODE (PATTERN (insn)) == USE
- || GET_CODE (PATTERN (insn)) == CLOBBER))))
- active_insn++;
-
- if (sched_verbose && notes)
- fprintf (sched_dump, ";; deleted %d line-number notes\n", notes);
-}
-
/* Delete notes between HEAD and TAIL and put them in the chain
of notes ended by NOTE_LIST. */