gengtype.c (adjust_field_rtx_def): Use NOTE_KIND instead of NOTE_LINE_NUMBER...
* gengtype.c (adjust_field_rtx_def): Use NOTE_KIND instead of NOTE_LINE_NUMBER; use NOTE_INSN_BASIC_BLOCK_P when possible. * ddg.c (create_ddg): LIkewise. * final.c (final): Remove hunk moving line numbernotes around since they are no longer present at this stage. (final_scan_insn): Use NOTE_KIND instead of NOTE_LINE_NUMBER; use NOTE_INSN_BASIC_BLOCK_P when possible. (output_asm_label): Likewise. * reorg.c (dbr_schedule): Likewise. * haifa-sched.c (unlink_other_notes): Likewise. * mode-switching.c (optimize_mode_switching): Likewise. * graph.c (start_bb): Likewise. * rtl.def (NOTE): Update description. * jump.c (squeeze_notes): Delete. (mark_jump_label): Use NOTE_KIND instead of NOTE_LINE_NUMBER; use NOTE_INSN_BASIC_BLOCK_P when possible. * ifcvt.c (dead_or_predicable): Remove call of squeeze_notes. * dwarf2out.c (gen_label_die): Use NOTE_KIND instead of NOTE_LINE_NUMBER; use NOTE_INSN_BASIC_BLOCK_P when possible. (dwarf2out_var_location): Likewise. * cfgbuild.c (make_edges): Likewise. (find_basic_blocks_1): Likewise. * function.c (reorder_blocks_1): Likewise. (epilogue_done): Likewise. (reposition_prologue_and_epilogue_notes): Likewise. * print-rtl.c (print_rtx): Likewise; drop code for printing line number notes. (print_rtl): Likewise. (print_rtl_single): Likewise. * gcse.c (insert_insn_start_bb): Likewise. * alias.c (init_alias_analysis): Likewise. * calls.c (fixup_tail_calls): Likewise. * except.c (sjlj_emit_function_enter): Likewise. * emit-rtl.c (add_insn_after): Likeiwse. (emit_label_before): Likewise. (emit_label_after): Likewise. (emit_note_before, emit_note_after, emit_note): Update parameter to be enum insn_note; do not deal with source files. * cfgcleanup.c (merge_blocks_move_predecessor_nojumps): Use NOTE_KIND instead of NOTE_LINE_NUMBER; use NOTE_INSN_BASIC_BLOCK_P when possible. (merge_blocks_move_successor_nojumps): Simplify now when we don't have BLOCK notes. (try_optimize_cfg): Likewise. * cfglayout.c (skip_insns_after_block): Likewise. (record_effective_endpoints): Likewise. (duplicate_insn_chain): Likewise. * varasm.c (output_constant_pool_1): Likewise. * sched-deps.c (sched_analyze): Likewise. * rtl.c (NOTE_INSN_MAX_isnt_negative_adjust_NOTE_INSN_BIAS): Exterminate. (note_insn_name): Simplify now when NOTE_INSN_BIAS is gone. * rtl.h (NOTE_SOURCE_LOCATION, NOTE_EXPANDED_LOCATION): Exterminate. (SET_INSN_DELETED): Simplify. (NOTE_LINE_NUMBER): Exterminate. (NOTE_LINE_KIND): New. (NOTE_INSN_BASIC_BLOCK_P): Update. (enum insn_note): Simplify. (GET_NOTE_INSN_NAME) Simplify. (emit_note_before, emit_note_after, emit_note): Update prototype. (squeeze_notes): Remove. * sched-int.h (NOTE_NOT_BB_P): Update. * resource.c (mark_target_live_regs): Update. * sched-rgn.c (debug_dependencies): Update. * sched-vis.c (print_insn): Update. * config/alpha/alpha.c (alpha_handle_trap_shadows): Update. * config/i386/i386.c (ix86_output_function_epilogue): Update. * config/sh/sh.c (sh_adjust_unroll_max): Function dead since gcc 4.0.0. (TARGET_ADJUST_UNROLL_MAX): Likewise. (split_branches): Update. (sh_optimize_target_register_callee_saved): Remove hunk dead since gcc 4.0.0. (sh_adjust_unroll_max): Exterminate. * config/c4x/c4x.c (c4x_reorg): Use SET_INSN_DELETED. * config/m68hc11/m68hc11.c (m68hc11_check_z_replacement): Likewise. (m68hc11_reorg): Likewise. * config/ia64/ia64.c (emit_insn_group_barriers): Update. (emit_predicate_relation_info): Update. (process_for_unwind_directive): Update. * config/rs6000/rs6000.c (rs6000_output_function_epilogue): Update. (output_call): Update. * config/pa/pa.c (output_lbranch): Update. (output_millicode_call): Update. (output_call): Update. (pa_combine_instructions): Update. * config/mips/mips.c (mips16_gp_pseudo_reg): Update. * config/bfin/bfin.c (gen_one_bundle): Update. * cfgrtl.c (can_delete_note_p): Update. (delete_insn): Update. (rtl_merge_blocks): Update. (commit_one_edge_insertion): Update. (rtl_verify_flow_info): Update. * stmt.c (expand_case): Do not call squeeze_notes. From-SVN: r124895
This commit is contained in:
parent
631abdb20f
commit
a38e7aa544
43 changed files with 226 additions and 651 deletions
|
@ -1,3 +1,100 @@
|
|||
2007-05-20 Jan Hubicka <jh@suse.cz>
|
||||
|
||||
* gengtype.c (adjust_field_rtx_def): Use NOTE_KIND instead of
|
||||
NOTE_LINE_NUMBER; use NOTE_INSN_BASIC_BLOCK_P when possible.
|
||||
* ddg.c (create_ddg): LIkewise.
|
||||
* final.c (final): Remove hunk moving line numbernotes around since
|
||||
they are no longer present at this stage.
|
||||
(final_scan_insn): Use NOTE_KIND instead of
|
||||
NOTE_LINE_NUMBER; use NOTE_INSN_BASIC_BLOCK_P when possible.
|
||||
(output_asm_label): Likewise.
|
||||
* reorg.c (dbr_schedule): Likewise.
|
||||
* haifa-sched.c (unlink_other_notes): Likewise.
|
||||
* mode-switching.c (optimize_mode_switching): Likewise.
|
||||
* graph.c (start_bb): Likewise.
|
||||
* rtl.def (NOTE): Update description.
|
||||
* jump.c (squeeze_notes): Delete.
|
||||
(mark_jump_label): Use NOTE_KIND instead of NOTE_LINE_NUMBER; use
|
||||
NOTE_INSN_BASIC_BLOCK_P when possible.
|
||||
* ifcvt.c (dead_or_predicable): Remove call of squeeze_notes.
|
||||
* dwarf2out.c (gen_label_die): Use NOTE_KIND instead of
|
||||
NOTE_LINE_NUMBER; use NOTE_INSN_BASIC_BLOCK_P when possible.
|
||||
(dwarf2out_var_location): Likewise.
|
||||
* cfgbuild.c (make_edges): Likewise.
|
||||
(find_basic_blocks_1): Likewise.
|
||||
* function.c (reorder_blocks_1): Likewise.
|
||||
(epilogue_done): Likewise.
|
||||
(reposition_prologue_and_epilogue_notes): Likewise.
|
||||
* print-rtl.c (print_rtx): Likewise; drop code for printing line number
|
||||
notes.
|
||||
(print_rtl): Likewise.
|
||||
(print_rtl_single): Likewise.
|
||||
* gcse.c (insert_insn_start_bb): Likewise.
|
||||
* alias.c (init_alias_analysis): Likewise.
|
||||
* calls.c (fixup_tail_calls): Likewise.
|
||||
* except.c (sjlj_emit_function_enter): Likewise.
|
||||
* emit-rtl.c (add_insn_after): Likeiwse.
|
||||
(emit_label_before): Likewise.
|
||||
(emit_label_after): Likewise.
|
||||
(emit_note_before, emit_note_after, emit_note): Update
|
||||
parameter to be enum insn_note; do not deal with source
|
||||
files.
|
||||
* cfgcleanup.c (merge_blocks_move_predecessor_nojumps):
|
||||
Use NOTE_KIND instead of NOTE_LINE_NUMBER; use NOTE_INSN_BASIC_BLOCK_P
|
||||
when possible.
|
||||
(merge_blocks_move_successor_nojumps): Simplify now when
|
||||
we don't have BLOCK notes.
|
||||
(try_optimize_cfg): Likewise.
|
||||
* cfglayout.c (skip_insns_after_block): Likewise.
|
||||
(record_effective_endpoints): Likewise.
|
||||
(duplicate_insn_chain): Likewise.
|
||||
* varasm.c (output_constant_pool_1): Likewise.
|
||||
* sched-deps.c (sched_analyze): Likewise.
|
||||
* rtl.c (NOTE_INSN_MAX_isnt_negative_adjust_NOTE_INSN_BIAS):
|
||||
Exterminate.
|
||||
(note_insn_name): Simplify now when NOTE_INSN_BIAS is gone.
|
||||
* rtl.h (NOTE_SOURCE_LOCATION, NOTE_EXPANDED_LOCATION): Exterminate.
|
||||
(SET_INSN_DELETED): Simplify.
|
||||
(NOTE_LINE_NUMBER): Exterminate.
|
||||
(NOTE_LINE_KIND): New.
|
||||
(NOTE_INSN_BASIC_BLOCK_P): Update.
|
||||
(enum insn_note): Simplify.
|
||||
(GET_NOTE_INSN_NAME) Simplify.
|
||||
(emit_note_before, emit_note_after, emit_note): Update prototype.
|
||||
(squeeze_notes): Remove.
|
||||
* sched-int.h (NOTE_NOT_BB_P): Update.
|
||||
* resource.c (mark_target_live_regs): Update.
|
||||
* sched-rgn.c (debug_dependencies): Update.
|
||||
* sched-vis.c (print_insn): Update.
|
||||
* config/alpha/alpha.c (alpha_handle_trap_shadows): Update.
|
||||
* config/i386/i386.c (ix86_output_function_epilogue): Update.
|
||||
* config/sh/sh.c (sh_adjust_unroll_max): Function dead since gcc 4.0.0.
|
||||
(TARGET_ADJUST_UNROLL_MAX): Likewise.
|
||||
(split_branches): Update.
|
||||
(sh_optimize_target_register_callee_saved): Remove hunk dead since gcc
|
||||
4.0.0.
|
||||
(sh_adjust_unroll_max): Exterminate.
|
||||
* config/c4x/c4x.c (c4x_reorg): Use SET_INSN_DELETED.
|
||||
* config/m68hc11/m68hc11.c (m68hc11_check_z_replacement): Likewise.
|
||||
(m68hc11_reorg): Likewise.
|
||||
* config/ia64/ia64.c (emit_insn_group_barriers): Update.
|
||||
(emit_predicate_relation_info): Update.
|
||||
(process_for_unwind_directive): Update.
|
||||
* config/rs6000/rs6000.c (rs6000_output_function_epilogue): Update.
|
||||
(output_call): Update.
|
||||
* config/pa/pa.c (output_lbranch): Update.
|
||||
(output_millicode_call): Update.
|
||||
(output_call): Update.
|
||||
(pa_combine_instructions): Update.
|
||||
* config/mips/mips.c (mips16_gp_pseudo_reg): Update.
|
||||
* config/bfin/bfin.c (gen_one_bundle): Update.
|
||||
* cfgrtl.c (can_delete_note_p): Update.
|
||||
(delete_insn): Update.
|
||||
(rtl_merge_blocks): Update.
|
||||
(commit_one_edge_insertion): Update.
|
||||
(rtl_verify_flow_info): Update.
|
||||
* stmt.c (expand_case): Do not call squeeze_notes.
|
||||
|
||||
2007-05-20 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
|
||||
|
||||
PR middle-end/7651
|
||||
|
|
|
@ -2546,7 +2546,7 @@ init_alias_analysis (void)
|
|||
}
|
||||
}
|
||||
else if (NOTE_P (insn)
|
||||
&& NOTE_LINE_NUMBER (insn) == NOTE_INSN_FUNCTION_BEG)
|
||||
&& NOTE_KIND (insn) == NOTE_INSN_FUNCTION_BEG)
|
||||
copying_arguments = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -3173,7 +3173,7 @@ fixup_tail_calls (void)
|
|||
/* There are never REG_EQUIV notes for the incoming arguments
|
||||
after the NOTE_INSN_FUNCTION_BEG note, so stop if we see it. */
|
||||
if (NOTE_P (insn)
|
||||
&& NOTE_LINE_NUMBER (insn) == NOTE_INSN_FUNCTION_BEG)
|
||||
&& NOTE_KIND (insn) == NOTE_INSN_FUNCTION_BEG)
|
||||
break;
|
||||
|
||||
note = find_reg_note (insn, REG_EQUIV, 0);
|
||||
|
|
|
@ -402,7 +402,7 @@ make_edges (basic_block min, basic_block max, int update_p)
|
|||
|
||||
while (insn
|
||||
&& NOTE_P (insn)
|
||||
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_BASIC_BLOCK)
|
||||
&& NOTE_KIND (insn) != NOTE_INSN_BASIC_BLOCK)
|
||||
insn = NEXT_INSN (insn);
|
||||
|
||||
if (!insn)
|
||||
|
@ -469,22 +469,18 @@ find_basic_blocks_1 (rtx f)
|
|||
switch (code)
|
||||
{
|
||||
case NOTE:
|
||||
{
|
||||
int kind = NOTE_LINE_NUMBER (insn);
|
||||
|
||||
/* Look for basic block notes with which to keep the
|
||||
basic_block_info pointers stable. Unthread the note now;
|
||||
we'll put it back at the right place in create_basic_block.
|
||||
Or not at all if we've already found a note in this block. */
|
||||
if (kind == NOTE_INSN_BASIC_BLOCK)
|
||||
{
|
||||
if (bb_note == NULL_RTX)
|
||||
bb_note = insn;
|
||||
else
|
||||
next = delete_insn (insn);
|
||||
}
|
||||
break;
|
||||
}
|
||||
/* Look for basic block notes with which to keep the
|
||||
basic_block_info pointers stable. Unthread the note now;
|
||||
we'll put it back at the right place in create_basic_block.
|
||||
Or not at all if we've already found a note in this block. */
|
||||
if (NOTE_INSN_BASIC_BLOCK_P (insn))
|
||||
{
|
||||
if (bb_note == NULL_RTX)
|
||||
bb_note = insn;
|
||||
else
|
||||
next = delete_insn (insn);
|
||||
}
|
||||
break;
|
||||
|
||||
case CODE_LABEL:
|
||||
case JUMP_INSN:
|
||||
|
|
|
@ -623,7 +623,6 @@ static void
|
|||
merge_blocks_move_predecessor_nojumps (basic_block a, basic_block b)
|
||||
{
|
||||
rtx barrier;
|
||||
bool only_notes;
|
||||
|
||||
/* If we are partitioning hot/cold basic blocks, we don't want to
|
||||
mess up unconditional or indirect jumps that cross between hot
|
||||
|
@ -642,16 +641,6 @@ merge_blocks_move_predecessor_nojumps (basic_block a, basic_block b)
|
|||
gcc_assert (BARRIER_P (barrier));
|
||||
delete_insn (barrier);
|
||||
|
||||
/* Move block and loop notes out of the chain so that we do not
|
||||
disturb their order.
|
||||
|
||||
??? A better solution would be to squeeze out all the non-nested notes
|
||||
and adjust the block trees appropriately. Even better would be to have
|
||||
a tighter connection between block trees and rtl so that this is not
|
||||
necessary. */
|
||||
only_notes = squeeze_notes (&BB_HEAD (a), &BB_END (a));
|
||||
gcc_assert (!only_notes);
|
||||
|
||||
/* Scramble the insn chain. */
|
||||
if (BB_END (a) != PREV_INSN (BB_HEAD (b)))
|
||||
reorder_insns_nobb (BB_HEAD (a), BB_END (a), PREV_INSN (BB_HEAD (b)));
|
||||
|
@ -679,7 +668,6 @@ merge_blocks_move_successor_nojumps (basic_block a, basic_block b)
|
|||
{
|
||||
rtx barrier, real_b_end;
|
||||
rtx label, table;
|
||||
bool only_notes;
|
||||
|
||||
/* If we are partitioning hot/cold basic blocks, we don't want to
|
||||
mess up unconditional or indirect jumps that cross between hot
|
||||
|
@ -709,16 +697,6 @@ merge_blocks_move_successor_nojumps (basic_block a, basic_block b)
|
|||
if (barrier && BARRIER_P (barrier))
|
||||
delete_insn (barrier);
|
||||
|
||||
/* Move block and loop notes out of the chain so that we do not
|
||||
disturb their order.
|
||||
|
||||
??? A better solution would be to squeeze out all the non-nested notes
|
||||
and adjust the block trees appropriately. Even better would be to have
|
||||
a tighter connection between block trees and rtl so that this is not
|
||||
necessary. */
|
||||
only_notes = squeeze_notes (&BB_HEAD (b), &BB_END (b));
|
||||
gcc_assert (!only_notes);
|
||||
|
||||
|
||||
/* Scramble the insn chain. */
|
||||
reorder_insns_nobb (BB_HEAD (b), BB_END (b), BB_END (a));
|
||||
|
@ -2028,7 +2006,7 @@ try_optimize_cfg (int mode)
|
|||
delete_insn_chain (label, label);
|
||||
/* In the case label is undeletable, move it after the
|
||||
BASIC_BLOCK note. */
|
||||
if (NOTE_LINE_NUMBER (BB_HEAD (b)) == NOTE_INSN_DELETED_LABEL)
|
||||
if (NOTE_KIND (BB_HEAD (b)) == NOTE_INSN_DELETED_LABEL)
|
||||
{
|
||||
rtx bb_note = NEXT_INSN (BB_HEAD (b));
|
||||
|
||||
|
|
|
@ -98,15 +98,11 @@ skip_insns_after_block (basic_block bb)
|
|||
continue;
|
||||
|
||||
case NOTE:
|
||||
switch (NOTE_LINE_NUMBER (insn))
|
||||
switch (NOTE_KIND (insn))
|
||||
{
|
||||
case NOTE_INSN_BLOCK_END:
|
||||
last_insn = insn;
|
||||
gcc_unreachable ();
|
||||
continue;
|
||||
case NOTE_INSN_DELETED:
|
||||
case NOTE_INSN_DELETED_LABEL:
|
||||
continue;
|
||||
|
||||
default:
|
||||
continue;
|
||||
break;
|
||||
|
@ -146,9 +142,11 @@ skip_insns_after_block (basic_block bb)
|
|||
{
|
||||
prev = PREV_INSN (insn);
|
||||
if (NOTE_P (insn))
|
||||
switch (NOTE_LINE_NUMBER (insn))
|
||||
switch (NOTE_KIND (insn))
|
||||
{
|
||||
case NOTE_INSN_BLOCK_END:
|
||||
gcc_unreachable ();
|
||||
break;
|
||||
case NOTE_INSN_DELETED:
|
||||
case NOTE_INSN_DELETED_LABEL:
|
||||
continue;
|
||||
|
@ -191,7 +189,7 @@ record_effective_endpoints (void)
|
|||
for (insn = get_insns ();
|
||||
insn
|
||||
&& NOTE_P (insn)
|
||||
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_BASIC_BLOCK;
|
||||
&& NOTE_KIND (insn) != NOTE_INSN_BASIC_BLOCK;
|
||||
insn = NEXT_INSN (insn))
|
||||
continue;
|
||||
/* No basic blocks at all? */
|
||||
|
@ -1033,7 +1031,7 @@ duplicate_insn_chain (rtx from, rtx to)
|
|||
break;
|
||||
|
||||
case NOTE:
|
||||
switch (NOTE_LINE_NUMBER (insn))
|
||||
switch (NOTE_KIND (insn))
|
||||
{
|
||||
/* In case prologue is empty and function contain label
|
||||
in first BB, we may want to copy the block. */
|
||||
|
@ -1059,11 +1057,7 @@ duplicate_insn_chain (rtx from, rtx to)
|
|||
default:
|
||||
/* All other notes should have already been eliminated.
|
||||
*/
|
||||
gcc_assert (NOTE_LINE_NUMBER (insn) >= 0);
|
||||
|
||||
/* It is possible that no_line_number is set and the note
|
||||
won't be emitted. */
|
||||
emit_note_copy (insn);
|
||||
gcc_unreachable ();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
14
gcc/cfgrtl.c
14
gcc/cfgrtl.c
|
@ -85,8 +85,8 @@ static void rtl_make_forwarder_block (edge);
|
|||
static int
|
||||
can_delete_note_p (rtx note)
|
||||
{
|
||||
return (NOTE_LINE_NUMBER (note) == NOTE_INSN_DELETED
|
||||
|| NOTE_LINE_NUMBER (note) == NOTE_INSN_BASIC_BLOCK);
|
||||
return (NOTE_KIND (note) == NOTE_INSN_DELETED
|
||||
|| NOTE_KIND (note) == NOTE_INSN_BASIC_BLOCK);
|
||||
}
|
||||
|
||||
/* True if a given label can be deleted. */
|
||||
|
@ -120,7 +120,7 @@ delete_insn (rtx insn)
|
|||
|
||||
really_delete = false;
|
||||
PUT_CODE (insn, NOTE);
|
||||
NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED_LABEL;
|
||||
NOTE_KIND (insn) = NOTE_INSN_DELETED_LABEL;
|
||||
NOTE_DELETED_LABEL_NAME (insn) = name;
|
||||
}
|
||||
|
||||
|
@ -580,7 +580,7 @@ rtl_merge_blocks (basic_block a, basic_block b)
|
|||
|
||||
for (prev = PREV_INSN (a_end); ; prev = PREV_INSN (prev))
|
||||
if (!NOTE_P (prev)
|
||||
|| NOTE_LINE_NUMBER (prev) == NOTE_INSN_BASIC_BLOCK
|
||||
|| NOTE_INSN_BASIC_BLOCK_P (prev)
|
||||
|| prev == BB_HEAD (a))
|
||||
break;
|
||||
|
||||
|
@ -1408,8 +1408,7 @@ commit_one_edge_insertion (edge e)
|
|||
bb_note = NULL_RTX;
|
||||
for (cur_insn = BB_HEAD (bb); cur_insn != NEXT_INSN (BB_END (bb));
|
||||
cur_insn = NEXT_INSN (cur_insn))
|
||||
if (NOTE_P (cur_insn)
|
||||
&& NOTE_LINE_NUMBER (cur_insn) == NOTE_INSN_BASIC_BLOCK)
|
||||
if (NOTE_INSN_BASIC_BLOCK_P (cur_insn))
|
||||
{
|
||||
bb_note = cur_insn;
|
||||
break;
|
||||
|
@ -1969,8 +1968,7 @@ rtl_verify_flow_info (void)
|
|||
for (insn = BB_END (bb); !insn || !BARRIER_P (insn);
|
||||
insn = NEXT_INSN (insn))
|
||||
if (!insn
|
||||
|| (NOTE_P (insn)
|
||||
&& NOTE_LINE_NUMBER (insn) == NOTE_INSN_BASIC_BLOCK))
|
||||
|| NOTE_INSN_BASIC_BLOCK_P (insn))
|
||||
{
|
||||
error ("missing barrier after block %i", bb->index);
|
||||
err = 1;
|
||||
|
|
|
@ -8593,7 +8593,7 @@ alpha_handle_trap_shadows (void)
|
|||
{
|
||||
if (GET_CODE (i) == NOTE)
|
||||
{
|
||||
switch (NOTE_LINE_NUMBER (i))
|
||||
switch (NOTE_KIND (i))
|
||||
{
|
||||
case NOTE_INSN_EH_REGION_BEG:
|
||||
exception_nesting++;
|
||||
|
|
|
@ -4111,7 +4111,7 @@ gen_one_bundle (rtx slot[3])
|
|||
while (t != slot[1])
|
||||
{
|
||||
if (GET_CODE (t) != NOTE
|
||||
|| NOTE_LINE_NUMBER (t) != NOTE_INSN_DELETED)
|
||||
|| NOTE_KIND (t) != NOTE_INSN_DELETED)
|
||||
return false;
|
||||
t = NEXT_INSN (t);
|
||||
}
|
||||
|
@ -4122,7 +4122,7 @@ gen_one_bundle (rtx slot[3])
|
|||
while (t != slot[2])
|
||||
{
|
||||
if (GET_CODE (t) != NOTE
|
||||
|| NOTE_LINE_NUMBER (t) != NOTE_INSN_DELETED)
|
||||
|| NOTE_KIND (t) != NOTE_INSN_DELETED)
|
||||
return false;
|
||||
t = NEXT_INSN (t);
|
||||
}
|
||||
|
|
|
@ -2443,11 +2443,7 @@ c4x_reorg (void)
|
|||
with only the 'deleted' bit set. Transform it into a note
|
||||
to avoid confusion of subsequent processing. */
|
||||
if (INSN_DELETED_P (old))
|
||||
{
|
||||
PUT_CODE (old, NOTE);
|
||||
NOTE_LINE_NUMBER (old) = NOTE_INSN_DELETED;
|
||||
NOTE_SOURCE_FILE (old) = 0;
|
||||
}
|
||||
SET_INSN_DELETED (old);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6256,12 +6256,12 @@ ix86_output_function_epilogue (FILE *file ATTRIBUTE_UNUSED,
|
|||
rtx insn = get_last_insn ();
|
||||
while (insn
|
||||
&& NOTE_P (insn)
|
||||
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_DELETED_LABEL)
|
||||
&& NOTE_KIND (insn) != NOTE_INSN_DELETED_LABEL)
|
||||
insn = PREV_INSN (insn);
|
||||
if (insn
|
||||
&& (LABEL_P (insn)
|
||||
|| (NOTE_P (insn)
|
||||
&& NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED_LABEL)))
|
||||
&& NOTE_KIND (insn) == NOTE_INSN_DELETED_LABEL)))
|
||||
fputs ("\tnop\n", file);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -5960,7 +5960,7 @@ emit_insn_group_barriers (FILE *dump)
|
|||
insns_since_last_label = 0;
|
||||
}
|
||||
else if (GET_CODE (insn) == NOTE
|
||||
&& NOTE_LINE_NUMBER (insn) == NOTE_INSN_BASIC_BLOCK)
|
||||
&& NOTE_KIND (insn) == NOTE_INSN_BASIC_BLOCK)
|
||||
{
|
||||
if (insns_since_last_label)
|
||||
last_label = insn;
|
||||
|
@ -8332,8 +8332,7 @@ emit_predicate_relation_info (void)
|
|||
/* We only need such notes at code labels. */
|
||||
if (GET_CODE (head) != CODE_LABEL)
|
||||
continue;
|
||||
if (GET_CODE (NEXT_INSN (head)) == NOTE
|
||||
&& NOTE_LINE_NUMBER (NEXT_INSN (head)) == NOTE_INSN_BASIC_BLOCK)
|
||||
if (NOTE_INSN_BASIC_BLOCK_P (NEXT_INSN (head)) == NOTE_INSN_BASIC_BLOCK)
|
||||
head = NEXT_INSN (head);
|
||||
|
||||
/* Skip p0, which may be thought to be live due to (reg:DI p0)
|
||||
|
@ -8969,8 +8968,7 @@ process_for_unwind_directive (FILE *asm_out_file, rtx insn)
|
|||
{
|
||||
rtx pat;
|
||||
|
||||
if (GET_CODE (insn) == NOTE
|
||||
&& NOTE_LINE_NUMBER (insn) == NOTE_INSN_BASIC_BLOCK)
|
||||
if (NOTE_INSN_BASIC_BLOCK_P (insn) == NOTE_INSN_BASIC_BLOCK)
|
||||
{
|
||||
last_block = NOTE_BASIC_BLOCK (insn)->next_bb == EXIT_BLOCK_PTR;
|
||||
|
||||
|
|
|
@ -4247,9 +4247,7 @@ m68hc11_check_z_replacement (rtx insn, struct replace_info *info)
|
|||
info->must_restore_reg = 0;
|
||||
info->found_call = 1;
|
||||
info->can_use_d = 0;
|
||||
PUT_CODE (insn, NOTE);
|
||||
NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
|
||||
NOTE_SOURCE_FILE (insn) = 0;
|
||||
SET_INSN_DELETED (insn);
|
||||
info->last = NEXT_INSN (insn);
|
||||
return 0;
|
||||
}
|
||||
|
@ -4330,9 +4328,7 @@ m68hc11_check_z_replacement (rtx insn, struct replace_info *info)
|
|||
info->must_restore_reg = 0;
|
||||
info->found_call = 1;
|
||||
info->can_use_d = 0;
|
||||
PUT_CODE (insn, NOTE);
|
||||
NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
|
||||
NOTE_SOURCE_FILE (insn) = 0;
|
||||
SET_INSN_DELETED (insn);
|
||||
info->last = NEXT_INSN (insn);
|
||||
return 0;
|
||||
}
|
||||
|
@ -5098,9 +5094,7 @@ m68hc11_reorg (void)
|
|||
if (GET_CODE (body) == SET
|
||||
&& rtx_equal_p (SET_SRC (body), SET_DEST (body)))
|
||||
{
|
||||
PUT_CODE (insn, NOTE);
|
||||
NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
|
||||
NOTE_SOURCE_FILE (insn) = 0;
|
||||
SET_INSN_DELETED (insn);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7955,7 +7955,7 @@ mips16_gp_pseudo_reg (void)
|
|||
note, so that it will be integrated. */
|
||||
for (scan = get_insns (); scan != NULL_RTX; scan = NEXT_INSN (scan))
|
||||
if (NOTE_P (scan)
|
||||
&& NOTE_LINE_NUMBER (scan) == NOTE_INSN_FUNCTION_BEG)
|
||||
&& NOTE_KIND (scan) == NOTE_INSN_FUNCTION_BEG)
|
||||
break;
|
||||
if (scan == NULL_RTX)
|
||||
scan = get_insns ();
|
||||
|
|
|
@ -6201,9 +6201,7 @@ output_lbranch (rtx dest, rtx insn, int xdelay)
|
|||
optimize, 0, NULL);
|
||||
|
||||
/* Now delete the delay insn. */
|
||||
PUT_CODE (NEXT_INSN (insn), NOTE);
|
||||
NOTE_LINE_NUMBER (NEXT_INSN (insn)) = NOTE_INSN_DELETED;
|
||||
NOTE_SOURCE_FILE (NEXT_INSN (insn)) = 0;
|
||||
SET_INSN_DELETED (NEXT_INSN (insn));
|
||||
}
|
||||
|
||||
/* Output an insn to save %r1. The runtime documentation doesn't
|
||||
|
@ -7219,9 +7217,7 @@ output_millicode_call (rtx insn, rtx call_dest)
|
|||
output_asm_insn ("nop\n\tb,n %0", xoperands);
|
||||
|
||||
/* Delete the jump. */
|
||||
PUT_CODE (NEXT_INSN (insn), NOTE);
|
||||
NOTE_LINE_NUMBER (NEXT_INSN (insn)) = NOTE_INSN_DELETED;
|
||||
NOTE_SOURCE_FILE (NEXT_INSN (insn)) = 0;
|
||||
SET_INSN_DELETED (NEXT_INSN (insn));
|
||||
|
||||
return "";
|
||||
}
|
||||
|
@ -7364,9 +7360,7 @@ output_call (rtx insn, rtx call_dest, int sibcall)
|
|||
optimize, 0, NULL);
|
||||
|
||||
/* Now delete the delay insn. */
|
||||
PUT_CODE (NEXT_INSN (insn), NOTE);
|
||||
NOTE_LINE_NUMBER (NEXT_INSN (insn)) = NOTE_INSN_DELETED;
|
||||
NOTE_SOURCE_FILE (NEXT_INSN (insn)) = 0;
|
||||
SET_INSN_DELETED (NEXT_INSN (insn));
|
||||
delay_insn_deleted = 1;
|
||||
}
|
||||
|
||||
|
@ -7414,9 +7408,7 @@ output_call (rtx insn, rtx call_dest, int sibcall)
|
|||
NULL);
|
||||
|
||||
/* Now delete the delay insn. */
|
||||
PUT_CODE (NEXT_INSN (insn), NOTE);
|
||||
NOTE_LINE_NUMBER (NEXT_INSN (insn)) = NOTE_INSN_DELETED;
|
||||
NOTE_SOURCE_FILE (NEXT_INSN (insn)) = 0;
|
||||
SET_INSN_DELETED (NEXT_INSN (insn));
|
||||
delay_insn_deleted = 1;
|
||||
}
|
||||
|
||||
|
@ -7601,9 +7593,7 @@ output_call (rtx insn, rtx call_dest, int sibcall)
|
|||
output_asm_insn ("b,n %0", xoperands);
|
||||
|
||||
/* Delete the jump. */
|
||||
PUT_CODE (NEXT_INSN (insn), NOTE);
|
||||
NOTE_LINE_NUMBER (NEXT_INSN (insn)) = NOTE_INSN_DELETED;
|
||||
NOTE_SOURCE_FILE (NEXT_INSN (insn)) = 0;
|
||||
SET_INSN_DELETED (NEXT_INSN (insn));
|
||||
|
||||
return "";
|
||||
}
|
||||
|
@ -8854,9 +8844,7 @@ pa_combine_instructions (void)
|
|||
PATTERN (floater))),
|
||||
anchor);
|
||||
|
||||
PUT_CODE (anchor, NOTE);
|
||||
NOTE_LINE_NUMBER (anchor) = NOTE_INSN_DELETED;
|
||||
NOTE_SOURCE_FILE (anchor) = 0;
|
||||
SET_INSN_DELETED (anchor);
|
||||
|
||||
/* Emit a special USE insn for FLOATER, then delete
|
||||
the floating insn. */
|
||||
|
@ -8878,9 +8866,7 @@ pa_combine_instructions (void)
|
|||
anchor);
|
||||
|
||||
JUMP_LABEL (temp) = JUMP_LABEL (anchor);
|
||||
PUT_CODE (anchor, NOTE);
|
||||
NOTE_LINE_NUMBER (anchor) = NOTE_INSN_DELETED;
|
||||
NOTE_SOURCE_FILE (anchor) = 0;
|
||||
SET_INSN_DELETED (anchor);
|
||||
|
||||
/* Emit a special USE insn for FLOATER, then delete
|
||||
the floating insn. */
|
||||
|
|
|
@ -15763,12 +15763,12 @@ rs6000_output_function_epilogue (FILE *file,
|
|||
rtx insn = get_last_insn ();
|
||||
while (insn
|
||||
&& NOTE_P (insn)
|
||||
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_DELETED_LABEL)
|
||||
&& NOTE_KIND (insn) != NOTE_INSN_DELETED_LABEL)
|
||||
insn = PREV_INSN (insn);
|
||||
if (insn
|
||||
&& (LABEL_P (insn)
|
||||
|| (NOTE_P (insn)
|
||||
&& NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED_LABEL)))
|
||||
&& NOTE_KIND (insn) == NOTE_INSN_DELETED_LABEL)))
|
||||
fputs ("\tnop\n", file);
|
||||
}
|
||||
#endif
|
||||
|
@ -19215,17 +19215,13 @@ output_call (rtx insn, rtx *operands, int dest_operand_number,
|
|||
|
||||
if (no_previous_def (funname))
|
||||
{
|
||||
int line_number = 0;
|
||||
rtx label_rtx = gen_label_rtx ();
|
||||
char *label_buf, temp_buf[256];
|
||||
ASM_GENERATE_INTERNAL_LABEL (temp_buf, "L",
|
||||
CODE_LABEL_NUMBER (label_rtx));
|
||||
label_buf = temp_buf[0] == '*' ? temp_buf + 1 : temp_buf;
|
||||
labelname = get_identifier (label_buf);
|
||||
for (; insn && GET_CODE (insn) != NOTE; insn = PREV_INSN (insn));
|
||||
if (insn)
|
||||
line_number = NOTE_LINE_NUMBER (insn);
|
||||
add_compiler_branch_island (labelname, funname, line_number);
|
||||
add_compiler_branch_island (labelname, funname, insn_line (insn));
|
||||
}
|
||||
else
|
||||
labelname = get_prev_label (funname);
|
||||
|
|
|
@ -242,9 +242,6 @@ static bool unspec_caller_rtx_p (rtx);
|
|||
static bool sh_cannot_copy_insn_p (rtx);
|
||||
static bool sh_rtx_costs (rtx, int, int, int *);
|
||||
static int sh_address_cost (rtx);
|
||||
#ifdef TARGET_ADJUST_UNROLL_MAX
|
||||
static int sh_adjust_unroll_max (struct loop *, int, int, int, int);
|
||||
#endif
|
||||
static int sh_pr_n_sets (void);
|
||||
static rtx sh_allocate_initial_value (rtx);
|
||||
static int shmedia_target_regs_stack_space (HARD_REG_SET *);
|
||||
|
@ -469,11 +466,6 @@ static int hard_regs_intersect_p (HARD_REG_SET *, HARD_REG_SET *);
|
|||
|
||||
#endif /* SYMBIAN */
|
||||
|
||||
#ifdef TARGET_ADJUST_UNROLL_MAX
|
||||
#undef TARGET_ADJUST_UNROLL_MAX
|
||||
#define TARGET_ADJUST_UNROLL_MAX sh_adjust_unroll_max
|
||||
#endif
|
||||
|
||||
#undef TARGET_SECONDARY_RELOAD
|
||||
#define TARGET_SECONDARY_RELOAD sh_secondary_reload
|
||||
|
||||
|
@ -5240,9 +5232,7 @@ split_branches (rtx first)
|
|||
{
|
||||
/* Shorten_branches would split this instruction again,
|
||||
so transform it into a note. */
|
||||
PUT_CODE (insn, NOTE);
|
||||
NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
|
||||
NOTE_SOURCE_FILE (insn) = 0;
|
||||
SET_INSN_DELETED (insn);
|
||||
}
|
||||
else if (GET_CODE (insn) == JUMP_INSN
|
||||
/* Don't mess with ADDR_DIFF_VEC */
|
||||
|
@ -9432,30 +9422,6 @@ sh_optimize_target_register_callee_saved (bool after_prologue_epilogue_gen)
|
|||
return 0;
|
||||
if (calc_live_regs (&dummy) >= 6 * 8)
|
||||
return 1;
|
||||
#if 0
|
||||
/* This is a borderline case. See if we got a nested loop, or a loop
|
||||
with a call, or with more than 4 labels inside. */
|
||||
for (insn = get_insns(); insn; insn = NEXT_INSN (insn))
|
||||
{
|
||||
if (GET_CODE (insn) == NOTE
|
||||
&& NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_BEG)
|
||||
{
|
||||
int labels = 0;
|
||||
|
||||
do
|
||||
{
|
||||
insn = NEXT_INSN (insn);
|
||||
if ((GET_CODE (insn) == NOTE
|
||||
&& NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_BEG)
|
||||
|| GET_CODE (insn) == CALL_INSN
|
||||
|| (GET_CODE (insn) == CODE_LABEL && ++labels > 4))
|
||||
return 1;
|
||||
}
|
||||
while (GET_CODE (insn) != NOTE
|
||||
|| NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_END);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -10692,275 +10658,6 @@ lose:
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifdef TARGET_ADJUST_UNROLL_MAX
|
||||
static int
|
||||
sh_adjust_unroll_max (struct loop * loop, int insn_count,
|
||||
int max_unrolled_insns, int strength_reduce_p,
|
||||
int unroll_type)
|
||||
{
|
||||
/* This doesn't work in 4.0 because the old unroller & loop.h is gone. */
|
||||
if (TARGET_ADJUST_UNROLL && TARGET_SHMEDIA)
|
||||
{
|
||||
/* Throttle back loop unrolling so that the costs of using more
|
||||
targets than the eight target register we have don't outweigh
|
||||
the benefits of unrolling. */
|
||||
rtx insn;
|
||||
int n_labels = 0, n_calls = 0, n_exit_dest = 0, n_inner_loops = -1;
|
||||
int n_barriers = 0;
|
||||
rtx dest;
|
||||
int i;
|
||||
rtx exit_dest[8];
|
||||
int threshold;
|
||||
int unroll_benefit = 0, mem_latency = 0;
|
||||
int base_cost, best_cost, cost;
|
||||
int factor, best_factor;
|
||||
int n_dest;
|
||||
unsigned max_iterations = 32767;
|
||||
int n_iterations;
|
||||
int need_precond = 0, precond = 0;
|
||||
basic_block * bbs = get_loop_body (loop);
|
||||
struct niter_desc *desc;
|
||||
|
||||
/* Assume that all labels inside the loop are used from inside the
|
||||
loop. If the loop has multiple entry points, it is unlikely to
|
||||
be unrolled anyways.
|
||||
Also assume that all calls are to different functions. That is
|
||||
somewhat pessimistic, but if you have lots of calls, unrolling the
|
||||
loop is not likely to gain you much in the first place. */
|
||||
i = loop->num_nodes - 1;
|
||||
for (insn = BB_HEAD (bbs[i]); ; )
|
||||
{
|
||||
if (GET_CODE (insn) == CODE_LABEL)
|
||||
n_labels++;
|
||||
else if (GET_CODE (insn) == CALL_INSN)
|
||||
n_calls++;
|
||||
else if (GET_CODE (insn) == NOTE
|
||||
&& NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_BEG)
|
||||
n_inner_loops++;
|
||||
else if (GET_CODE (insn) == BARRIER)
|
||||
n_barriers++;
|
||||
if (insn != BB_END (bbs[i]))
|
||||
insn = NEXT_INSN (insn);
|
||||
else if (--i >= 0)
|
||||
insn = BB_HEAD (bbs[i]);
|
||||
else
|
||||
break;
|
||||
}
|
||||
free (bbs);
|
||||
/* One label for the loop top is normal, and it won't be duplicated by
|
||||
unrolling. */
|
||||
if (n_labels <= 1)
|
||||
return max_unrolled_insns;
|
||||
if (n_inner_loops > 0)
|
||||
return 0;
|
||||
for (dest = loop->exit_labels; dest && n_exit_dest < 8;
|
||||
dest = LABEL_NEXTREF (dest))
|
||||
{
|
||||
for (i = n_exit_dest - 1;
|
||||
i >= 0 && XEXP (dest, 0) != XEXP (exit_dest[i], 0); i--);
|
||||
if (i < 0)
|
||||
exit_dest[n_exit_dest++] = dest;
|
||||
}
|
||||
/* If the loop top and call and exit destinations are enough to fill up
|
||||
the target registers, we're unlikely to do any more damage by
|
||||
unrolling. */
|
||||
if (n_calls + n_exit_dest >= 7)
|
||||
return max_unrolled_insns;
|
||||
|
||||
/* ??? In the new loop unroller, there is no longer any strength
|
||||
reduction information available. Thus, when it comes to unrolling,
|
||||
we know the cost of everything, but we know the value of nothing. */
|
||||
#if 0
|
||||
if (strength_reduce_p
|
||||
&& (unroll_type == LPT_UNROLL_RUNTIME
|
||||
|| unroll_type == LPT_UNROLL_CONSTANT
|
||||
|| unroll_type == LPT_PEEL_COMPLETELY))
|
||||
{
|
||||
struct loop_ivs *ivs = LOOP_IVS (loop);
|
||||
struct iv_class *bl;
|
||||
|
||||
/* We'll save one compare-and-branch in each loop body copy
|
||||
but the last one. */
|
||||
unroll_benefit = 1;
|
||||
/* Assess the benefit of removing biv & giv updates. */
|
||||
for (bl = ivs->list; bl; bl = bl->next)
|
||||
{
|
||||
rtx increment = biv_total_increment (bl);
|
||||
struct induction *v;
|
||||
|
||||
if (increment && GET_CODE (increment) == CONST_INT)
|
||||
{
|
||||
unroll_benefit++;
|
||||
for (v = bl->giv; v; v = v->next_iv)
|
||||
{
|
||||
if (! v->ignore && v->same == 0
|
||||
&& GET_CODE (v->mult_val) == CONST_INT)
|
||||
unroll_benefit++;
|
||||
/* If this giv uses an array, try to determine
|
||||
a maximum iteration count from the size of the
|
||||
array. This need not be correct all the time,
|
||||
but should not be too far off the mark too often. */
|
||||
while (v->giv_type == DEST_ADDR)
|
||||
{
|
||||
rtx mem = PATTERN (v->insn);
|
||||
tree mem_expr, type, size_tree;
|
||||
|
||||
if (GET_CODE (SET_SRC (mem)) == MEM)
|
||||
mem = SET_SRC (mem);
|
||||
else if (GET_CODE (SET_DEST (mem)) == MEM)
|
||||
mem = SET_DEST (mem);
|
||||
else
|
||||
break;
|
||||
mem_expr = MEM_EXPR (mem);
|
||||
if (! mem_expr)
|
||||
break;
|
||||
type = TREE_TYPE (mem_expr);
|
||||
if (TREE_CODE (type) != ARRAY_TYPE
|
||||
|| ! TYPE_SIZE (type) || ! TYPE_SIZE_UNIT (type))
|
||||
break;
|
||||
size_tree = fold_build2 (TRUNC_DIV_EXPR,
|
||||
bitsizetype,
|
||||
TYPE_SIZE (type),
|
||||
TYPE_SIZE_UNIT (type));
|
||||
if (TREE_CODE (size_tree) == INTEGER_CST
|
||||
&& ! TREE_INT_CST_HIGH (size_tree)
|
||||
&& TREE_INT_CST_LOW (size_tree) < max_iterations)
|
||||
max_iterations = TREE_INT_CST_LOW (size_tree);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#else /* 0 */
|
||||
/* Assume there is at least some benefit. */
|
||||
unroll_benefit = 1;
|
||||
#endif /* 0 */
|
||||
|
||||
desc = get_simple_loop_desc (loop);
|
||||
n_iterations = desc->const_iter ? desc->niter : 0;
|
||||
max_iterations
|
||||
= max_iterations < desc->niter_max ? max_iterations : desc->niter_max;
|
||||
|
||||
if (! strength_reduce_p || ! n_iterations)
|
||||
need_precond = 1;
|
||||
if (! n_iterations)
|
||||
{
|
||||
n_iterations
|
||||
= max_iterations < 3 ? max_iterations : max_iterations * 3 / 4;
|
||||
if (! n_iterations)
|
||||
return 0;
|
||||
}
|
||||
#if 0 /* ??? See above - missing induction variable information. */
|
||||
while (unroll_benefit > 1) /* no loop */
|
||||
{
|
||||
/* We include the benefit of biv/ giv updates. Check if some or
|
||||
all of these updates are likely to fit into a scheduling
|
||||
bubble of a load.
|
||||
We check for the following case:
|
||||
- All the insns leading to the first JUMP_INSN are in a strict
|
||||
dependency chain.
|
||||
- there is at least one memory reference in them.
|
||||
|
||||
When we find such a pattern, we assume that we can hide as many
|
||||
updates as the total of the load latency is, if we have an
|
||||
unroll factor of at least two. We might or might not also do
|
||||
this without unrolling, so rather than considering this as an
|
||||
extra unroll benefit, discount it in the unroll benefits of unroll
|
||||
factors higher than two. */
|
||||
|
||||
rtx set, last_set;
|
||||
|
||||
insn = next_active_insn (loop->start);
|
||||
last_set = single_set (insn);
|
||||
if (! last_set)
|
||||
break;
|
||||
if (GET_CODE (SET_SRC (last_set)) == MEM)
|
||||
mem_latency += 2;
|
||||
for (insn = NEXT_INSN (insn); insn != end; insn = NEXT_INSN (insn))
|
||||
{
|
||||
if (! INSN_P (insn))
|
||||
continue;
|
||||
if (GET_CODE (insn) == JUMP_INSN)
|
||||
break;
|
||||
if (! reg_referenced_p (SET_DEST (last_set), PATTERN (insn)))
|
||||
{
|
||||
/* Check if this is a to-be-reduced giv insn. */
|
||||
struct loop_ivs *ivs = LOOP_IVS (loop);
|
||||
struct iv_class *bl;
|
||||
struct induction *v;
|
||||
for (bl = ivs->list; bl; bl = bl->next)
|
||||
{
|
||||
if (bl->biv->insn == insn)
|
||||
goto is_biv;
|
||||
for (v = bl->giv; v; v = v->next_iv)
|
||||
if (v->insn == insn)
|
||||
goto is_giv;
|
||||
}
|
||||
mem_latency--;
|
||||
is_biv:
|
||||
is_giv:
|
||||
continue;
|
||||
}
|
||||
set = single_set (insn);
|
||||
if (! set)
|
||||
continue;
|
||||
if (GET_CODE (SET_SRC (set)) == MEM)
|
||||
mem_latency += 2;
|
||||
last_set = set;
|
||||
}
|
||||
if (mem_latency < 0)
|
||||
mem_latency = 0;
|
||||
else if (mem_latency > unroll_benefit - 1)
|
||||
mem_latency = unroll_benefit - 1;
|
||||
break;
|
||||
}
|
||||
#endif /* 0 */
|
||||
if (n_labels + (unroll_benefit + n_labels * 8) / n_iterations
|
||||
<= unroll_benefit)
|
||||
return max_unrolled_insns;
|
||||
|
||||
n_dest = n_labels + n_calls + n_exit_dest;
|
||||
base_cost = n_dest <= 8 ? 0 : n_dest - 7;
|
||||
best_cost = 0;
|
||||
best_factor = 1;
|
||||
if (n_barriers * 2 > n_labels - 1)
|
||||
n_barriers = (n_labels - 1) / 2;
|
||||
for (factor = 2; factor <= 8; factor++)
|
||||
{
|
||||
/* Bump up preconditioning cost for each power of two. */
|
||||
if (! (factor & (factor-1)))
|
||||
precond += 4;
|
||||
/* When preconditioning, only powers of two will be considered. */
|
||||
else if (need_precond)
|
||||
continue;
|
||||
n_dest = ((unroll_type != LPT_PEEL_COMPLETELY)
|
||||
+ (n_labels - 1) * factor + n_calls + n_exit_dest
|
||||
- (n_barriers * factor >> 1)
|
||||
+ need_precond);
|
||||
cost
|
||||
= ((n_dest <= 8 ? 0 : n_dest - 7)
|
||||
- base_cost * factor
|
||||
- ((factor > 2 ? unroll_benefit - mem_latency : unroll_benefit)
|
||||
* (factor - (unroll_type != LPT_PEEL_COMPLETELY)))
|
||||
+ ((unroll_benefit + 1 + (n_labels - 1) * factor)
|
||||
/ n_iterations));
|
||||
if (need_precond)
|
||||
cost += (precond + unroll_benefit * factor / 2) / n_iterations;
|
||||
if (cost < best_cost)
|
||||
{
|
||||
best_cost = cost;
|
||||
best_factor = factor;
|
||||
}
|
||||
}
|
||||
threshold = best_factor * insn_count;
|
||||
if (max_unrolled_insns > threshold)
|
||||
max_unrolled_insns = threshold;
|
||||
}
|
||||
return max_unrolled_insns;
|
||||
}
|
||||
#endif /* TARGET_ADJUST_UNROLL_MAX */
|
||||
|
||||
/* Replace any occurrence of FROM(n) in X with TO(n). The function does
|
||||
not enter into CONST_DOUBLE for the replace.
|
||||
|
||||
|
|
|
@ -488,7 +488,7 @@ create_ddg (basic_block bb, struct df *df, int closing_branch_deps)
|
|||
if (! INSN_P (insn))
|
||||
{
|
||||
if (! first_note && NOTE_P (insn)
|
||||
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_BASIC_BLOCK)
|
||||
&& NOTE_KIND (insn) != NOTE_INSN_BASIC_BLOCK)
|
||||
first_note = insn;
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -12234,7 +12234,7 @@ gen_label_die (tree decl, dw_die_ref context_die)
|
|||
if (insn
|
||||
&& (LABEL_P (insn)
|
||||
|| ((NOTE_P (insn)
|
||||
&& NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED_LABEL))))
|
||||
&& NOTE_KIND (insn) == NOTE_INSN_DELETED_LABEL))))
|
||||
{
|
||||
/* When optimization is enabled (via -O) some parts of the compiler
|
||||
(e.g. jump.c and cse.c) may try to delete CODE_LABEL insns which
|
||||
|
@ -13850,7 +13850,7 @@ dwarf2out_var_location (rtx loc_note)
|
|||
if (last_insn != NULL_RTX
|
||||
&& last_insn == prev_insn
|
||||
&& NOTE_P (prev_insn)
|
||||
&& NOTE_LINE_NUMBER (prev_insn) == NOTE_INSN_VAR_LOCATION)
|
||||
&& NOTE_KIND (prev_insn) == NOTE_INSN_VAR_LOCATION)
|
||||
{
|
||||
newloc->label = last_label;
|
||||
}
|
||||
|
|
|
@ -3437,8 +3437,7 @@ add_insn_after (rtx insn, rtx after)
|
|||
if (BB_END (bb) == after
|
||||
/* Avoid clobbering of structure when creating new BB. */
|
||||
&& !BARRIER_P (insn)
|
||||
&& (!NOTE_P (insn)
|
||||
|| NOTE_LINE_NUMBER (insn) != NOTE_INSN_BASIC_BLOCK))
|
||||
&& !NOTE_INSN_BASIC_BLOCK_P (insn))
|
||||
BB_END (bb) = insn;
|
||||
}
|
||||
|
||||
|
@ -3503,8 +3502,7 @@ add_insn_before (rtx insn, rtx before)
|
|||
gcc_assert (BB_HEAD (bb) != insn
|
||||
/* Avoid clobbering of structure when creating new BB. */
|
||||
|| BARRIER_P (insn)
|
||||
|| (NOTE_P (insn)
|
||||
&& NOTE_LINE_NUMBER (insn) == NOTE_INSN_BASIC_BLOCK));
|
||||
|| NOTE_INSN_BASIC_BLOCK_P (insn));
|
||||
}
|
||||
|
||||
PREV_INSN (before) = insn;
|
||||
|
@ -3877,14 +3875,11 @@ emit_label_before (rtx label, rtx before)
|
|||
/* Emit a note of subtype SUBTYPE before the insn BEFORE. */
|
||||
|
||||
rtx
|
||||
emit_note_before (int subtype, rtx before)
|
||||
emit_note_before (enum insn_note subtype, rtx before)
|
||||
{
|
||||
rtx note = rtx_alloc (NOTE);
|
||||
INSN_UID (note) = cur_insn_uid++;
|
||||
#ifndef USE_MAPPED_LOCATION
|
||||
NOTE_SOURCE_FILE (note) = 0;
|
||||
#endif
|
||||
NOTE_LINE_NUMBER (note) = subtype;
|
||||
NOTE_KIND (note) = subtype;
|
||||
BLOCK_FOR_INSN (note) = NULL;
|
||||
|
||||
add_insn_before (note, before);
|
||||
|
@ -4077,14 +4072,11 @@ emit_label_after (rtx label, rtx after)
|
|||
/* Emit a note of subtype SUBTYPE after the insn AFTER. */
|
||||
|
||||
rtx
|
||||
emit_note_after (int subtype, rtx after)
|
||||
emit_note_after (enum insn_note subtype, rtx after)
|
||||
{
|
||||
rtx note = rtx_alloc (NOTE);
|
||||
INSN_UID (note) = cur_insn_uid++;
|
||||
#ifndef USE_MAPPED_LOCATION
|
||||
NOTE_SOURCE_FILE (note) = 0;
|
||||
#endif
|
||||
NOTE_LINE_NUMBER (note) = subtype;
|
||||
NOTE_KIND (note) = subtype;
|
||||
BLOCK_FOR_INSN (note) = NULL;
|
||||
add_insn_after (note, after);
|
||||
return note;
|
||||
|
@ -4444,7 +4436,7 @@ emit_note_copy (rtx orig)
|
|||
|
||||
INSN_UID (note) = cur_insn_uid++;
|
||||
NOTE_DATA (note) = NOTE_DATA (orig);
|
||||
NOTE_LINE_NUMBER (note) = NOTE_LINE_NUMBER (orig);
|
||||
NOTE_KIND (note) = NOTE_KIND (orig);
|
||||
BLOCK_FOR_INSN (note) = NULL;
|
||||
add_insn (note);
|
||||
|
||||
|
@ -4455,13 +4447,13 @@ emit_note_copy (rtx orig)
|
|||
and add it to the end of the doubly-linked list. */
|
||||
|
||||
rtx
|
||||
emit_note (int note_no)
|
||||
emit_note (enum insn_note kind)
|
||||
{
|
||||
rtx note;
|
||||
|
||||
note = rtx_alloc (NOTE);
|
||||
INSN_UID (note) = cur_insn_uid++;
|
||||
NOTE_LINE_NUMBER (note) = note_no;
|
||||
NOTE_KIND (note) = kind;
|
||||
memset (&NOTE_DATA (note), 0, sizeof (NOTE_DATA (note)));
|
||||
BLOCK_FOR_INSN (note) = NULL;
|
||||
add_insn (note);
|
||||
|
|
|
@ -1898,9 +1898,9 @@ sjlj_emit_function_enter (rtx dispatch_label)
|
|||
for (fn_begin = get_insns (); ; fn_begin = NEXT_INSN (fn_begin))
|
||||
if (NOTE_P (fn_begin))
|
||||
{
|
||||
if (NOTE_LINE_NUMBER (fn_begin) == NOTE_INSN_FUNCTION_BEG)
|
||||
if (NOTE_KIND (fn_begin) == NOTE_INSN_FUNCTION_BEG)
|
||||
break;
|
||||
else if (NOTE_LINE_NUMBER (fn_begin) == NOTE_INSN_BASIC_BLOCK)
|
||||
else if (NOTE_INSN_BASIC_BLOCK_P (fn_begin))
|
||||
fn_begin_outside_block = false;
|
||||
}
|
||||
|
||||
|
|
36
gcc/final.c
36
gcc/final.c
|
@ -1545,33 +1545,6 @@ final (rtx first, FILE *file, int optimize)
|
|||
|
||||
last_ignored_compare = 0;
|
||||
|
||||
#ifdef SDB_DEBUGGING_INFO
|
||||
/* When producing SDB debugging info, delete troublesome line number
|
||||
notes from inlined functions in other files as well as duplicate
|
||||
line number notes. */
|
||||
if (write_symbols == SDB_DEBUG)
|
||||
{
|
||||
rtx last = 0;
|
||||
for (insn = first; insn; insn = NEXT_INSN (insn))
|
||||
if (NOTE_P (insn) && NOTE_LINE_NUMBER (insn) > 0)
|
||||
{
|
||||
if (last != 0
|
||||
#ifdef USE_MAPPED_LOCATION
|
||||
&& NOTE_SOURCE_LOCATION (insn) == NOTE_SOURCE_LOCATION (last)
|
||||
#else
|
||||
&& NOTE_LINE_NUMBER (insn) == NOTE_LINE_NUMBER (last)
|
||||
&& NOTE_SOURCE_FILE (insn) == NOTE_SOURCE_FILE (last)
|
||||
#endif
|
||||
)
|
||||
{
|
||||
delete_insn (insn); /* Use delete_note. */
|
||||
continue;
|
||||
}
|
||||
last = insn;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
for (insn = first; insn; insn = NEXT_INSN (insn))
|
||||
{
|
||||
if (INSN_UID (insn) > max_uid) /* Find largest UID. */
|
||||
|
@ -1695,7 +1668,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
|
|||
switch (GET_CODE (insn))
|
||||
{
|
||||
case NOTE:
|
||||
switch (NOTE_LINE_NUMBER (insn))
|
||||
switch (NOTE_KIND (insn))
|
||||
{
|
||||
case NOTE_INSN_DELETED:
|
||||
break;
|
||||
|
@ -1818,11 +1791,8 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
|
|||
(*debug_hooks->var_location) (insn);
|
||||
break;
|
||||
|
||||
case 0:
|
||||
break;
|
||||
|
||||
default:
|
||||
gcc_assert (NOTE_LINE_NUMBER (insn) > 0);
|
||||
gcc_unreachable ();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
@ -3235,7 +3205,7 @@ output_asm_label (rtx x)
|
|||
x = XEXP (x, 0);
|
||||
if (LABEL_P (x)
|
||||
|| (NOTE_P (x)
|
||||
&& NOTE_LINE_NUMBER (x) == NOTE_INSN_DELETED_LABEL))
|
||||
&& NOTE_KIND (x) == NOTE_INSN_DELETED_LABEL))
|
||||
ASM_GENERATE_INTERNAL_LABEL (buf, "L", CODE_LABEL_NUMBER (x));
|
||||
else
|
||||
output_operand_lossage ("'%%l' operand isn't a label");
|
||||
|
|
|
@ -3567,7 +3567,7 @@ reorder_blocks_1 (rtx insns, tree current_block, VEC(tree,heap) **p_block_stack)
|
|||
{
|
||||
if (NOTE_P (insn))
|
||||
{
|
||||
if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_BEG)
|
||||
if (NOTE_KIND (insn) == NOTE_INSN_BLOCK_BEG)
|
||||
{
|
||||
tree block = NOTE_BLOCK (insn);
|
||||
tree origin;
|
||||
|
@ -3608,7 +3608,7 @@ reorder_blocks_1 (rtx insns, tree current_block, VEC(tree,heap) **p_block_stack)
|
|||
}
|
||||
VEC_safe_push (tree, heap, *p_block_stack, block);
|
||||
}
|
||||
else if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_END)
|
||||
else if (NOTE_KIND (insn) == NOTE_INSN_BLOCK_END)
|
||||
{
|
||||
NOTE_BLOCK (insn) = VEC_pop (tree, *p_block_stack);
|
||||
BLOCK_SUBBLOCKS (current_block)
|
||||
|
@ -5237,7 +5237,7 @@ epilogue_done:
|
|||
{
|
||||
next = NEXT_INSN (insn);
|
||||
if (NOTE_P (insn)
|
||||
&& (NOTE_LINE_NUMBER (insn) == NOTE_INSN_FUNCTION_BEG))
|
||||
&& (NOTE_KIND (insn) == NOTE_INSN_FUNCTION_BEG))
|
||||
reorder_insns (insn, insn, PREV_INSN (epilogue_end));
|
||||
}
|
||||
}
|
||||
|
@ -5265,7 +5265,7 @@ reposition_prologue_and_epilogue_notes (rtx f ATTRIBUTE_UNUSED)
|
|||
{
|
||||
if (NOTE_P (insn))
|
||||
{
|
||||
if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_PROLOGUE_END)
|
||||
if (NOTE_KIND (insn) == NOTE_INSN_PROLOGUE_END)
|
||||
note = insn;
|
||||
}
|
||||
else if (contains (insn, &prologue))
|
||||
|
@ -5284,7 +5284,7 @@ reposition_prologue_and_epilogue_notes (rtx f ATTRIBUTE_UNUSED)
|
|||
{
|
||||
for (note = last; (note = NEXT_INSN (note));)
|
||||
if (NOTE_P (note)
|
||||
&& NOTE_LINE_NUMBER (note) == NOTE_INSN_PROLOGUE_END)
|
||||
&& NOTE_KIND (note) == NOTE_INSN_PROLOGUE_END)
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -5306,7 +5306,7 @@ reposition_prologue_and_epilogue_notes (rtx f ATTRIBUTE_UNUSED)
|
|||
{
|
||||
if (NOTE_P (insn))
|
||||
{
|
||||
if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EPILOGUE_BEG)
|
||||
if (NOTE_KIND (insn) == NOTE_INSN_EPILOGUE_BEG)
|
||||
note = insn;
|
||||
}
|
||||
else if (contains (insn, &epilogue))
|
||||
|
@ -5325,7 +5325,7 @@ reposition_prologue_and_epilogue_notes (rtx f ATTRIBUTE_UNUSED)
|
|||
{
|
||||
for (note = insn; (note = PREV_INSN (note));)
|
||||
if (NOTE_P (note)
|
||||
&& NOTE_LINE_NUMBER (note) == NOTE_INSN_EPILOGUE_BEG)
|
||||
&& NOTE_KIND (note) == NOTE_INSN_EPILOGUE_BEG)
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -6159,8 +6159,7 @@ insert_insn_start_bb (rtx insn, basic_block bb)
|
|||
while (before != 0)
|
||||
{
|
||||
if (! LABEL_P (before)
|
||||
&& (! NOTE_P (before)
|
||||
|| NOTE_LINE_NUMBER (before) != NOTE_INSN_BASIC_BLOCK))
|
||||
&& !NOTE_INSN_BASIC_BLOCK_P (before))
|
||||
break;
|
||||
prev = before;
|
||||
if (prev == BB_END (bb))
|
||||
|
|
|
@ -1088,6 +1088,8 @@ adjust_field_rtx_def (type_p t, options_p ARG_UNUSED (opt))
|
|||
t = rtx_tp, subname = "rt_rtx";
|
||||
else if (i == NOTE && aindex == 4)
|
||||
t = note_union_tp, subname = "";
|
||||
else if (i == NOTE && aindex == 5)
|
||||
t = scalar_tp, subname = "rt_int";
|
||||
else if (i == NOTE && aindex >= 7)
|
||||
t = scalar_tp, subname = "rt_int";
|
||||
else if (i == ADDR_DIFF_VEC && aindex == 4)
|
||||
|
@ -1167,7 +1169,7 @@ adjust_field_rtx_def (type_p t, options_p ARG_UNUSED (opt))
|
|||
subfields->opt = nodot;
|
||||
if (t == note_union_tp)
|
||||
subfields->opt = create_option (subfields->opt, "desc",
|
||||
"NOTE_LINE_NUMBER (&%0)");
|
||||
"NOTE_KIND (&%0)");
|
||||
if (t == symbol_union_tp)
|
||||
subfields->opt = create_option (subfields->opt, "desc",
|
||||
"CONSTANT_POOL_ADDRESS_P (&%0)");
|
||||
|
|
|
@ -146,9 +146,8 @@ darkgrey\n shape: ellipse" : "white",
|
|||
/* Print the RTL. */
|
||||
if (NOTE_P (tmp_rtx))
|
||||
{
|
||||
const char *name = "";
|
||||
if (NOTE_LINE_NUMBER (tmp_rtx) < 0)
|
||||
name = GET_NOTE_INSN_NAME (NOTE_LINE_NUMBER (tmp_rtx));
|
||||
const char *name;
|
||||
name = GET_NOTE_INSN_NAME (NOTE_KIND (tmp_rtx));
|
||||
fprintf (fp, " %s", name);
|
||||
}
|
||||
else if (INSN_P (tmp_rtx))
|
||||
|
|
|
@ -1305,8 +1305,8 @@ unlink_other_notes (rtx insn, rtx tail)
|
|||
}
|
||||
|
||||
/* See sched_analyze to see how these are handled. */
|
||||
if (NOTE_LINE_NUMBER (insn) != NOTE_INSN_EH_REGION_BEG
|
||||
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_EH_REGION_END)
|
||||
if (NOTE_KIND (insn) != NOTE_INSN_EH_REGION_BEG
|
||||
&& NOTE_KIND (insn) != NOTE_INSN_EH_REGION_END)
|
||||
{
|
||||
/* Insert the note at the end of the notes list. */
|
||||
PREV_INSN (insn) = note_list;
|
||||
|
|
|
@ -3899,9 +3899,6 @@ dead_or_predicable (basic_block test_bb, basic_block merge_bb,
|
|||
if (end == BB_END (merge_bb))
|
||||
BB_END (merge_bb) = PREV_INSN (head);
|
||||
|
||||
if (squeeze_notes (&head, &end))
|
||||
return TRUE;
|
||||
|
||||
/* PR 21767: When moving insns above a conditional branch, REG_EQUAL
|
||||
notes might become invalid. */
|
||||
insn = head;
|
||||
|
|
58
gcc/jump.c
58
gcc/jump.c
|
@ -227,62 +227,6 @@ mark_all_labels (rtx f)
|
|||
}
|
||||
}
|
||||
|
||||
/* Move all block-beg, block-end and loop-beg notes between START and END out
|
||||
before START. START and END may be such notes. Returns the values of the
|
||||
new starting and ending insns, which may be different if the original ones
|
||||
were such notes. Return true if there were only such notes and no real
|
||||
instructions. */
|
||||
|
||||
bool
|
||||
squeeze_notes (rtx* startp, rtx* endp)
|
||||
{
|
||||
rtx start = *startp;
|
||||
rtx end = *endp;
|
||||
|
||||
rtx insn;
|
||||
rtx next;
|
||||
rtx last = NULL;
|
||||
rtx past_end = NEXT_INSN (end);
|
||||
|
||||
for (insn = start; insn != past_end; insn = next)
|
||||
{
|
||||
next = NEXT_INSN (insn);
|
||||
if (NOTE_P (insn)
|
||||
&& (NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_END
|
||||
|| NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_BEG))
|
||||
{
|
||||
/* BLOCK_BEG or BLOCK_END notes only exist in the `final' pass. */
|
||||
gcc_assert (NOTE_LINE_NUMBER (insn) != NOTE_INSN_BLOCK_BEG
|
||||
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_BLOCK_END);
|
||||
|
||||
if (insn == start)
|
||||
start = next;
|
||||
else
|
||||
{
|
||||
rtx prev = PREV_INSN (insn);
|
||||
PREV_INSN (insn) = PREV_INSN (start);
|
||||
NEXT_INSN (insn) = start;
|
||||
NEXT_INSN (PREV_INSN (insn)) = insn;
|
||||
PREV_INSN (NEXT_INSN (insn)) = insn;
|
||||
NEXT_INSN (prev) = next;
|
||||
PREV_INSN (next) = prev;
|
||||
}
|
||||
}
|
||||
else
|
||||
last = insn;
|
||||
}
|
||||
|
||||
/* There were no real instructions. */
|
||||
if (start == past_end)
|
||||
return true;
|
||||
|
||||
end = last;
|
||||
|
||||
*startp = start;
|
||||
*endp = end;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Given a comparison (CODE ARG0 ARG1), inside an insn, INSN, return a code
|
||||
of reversed comparison if it is possible to do so. Otherwise return UNKNOWN.
|
||||
UNKNOWN may be returned in case we are having CC_MODE compare and we don't
|
||||
|
@ -1014,7 +958,7 @@ mark_jump_label (rtx x, rtx insn, int in_mem)
|
|||
/* Ignore remaining references to unreachable labels that
|
||||
have been deleted. */
|
||||
if (NOTE_P (label)
|
||||
&& NOTE_LINE_NUMBER (label) == NOTE_INSN_DELETED_LABEL)
|
||||
&& NOTE_KIND (label) == NOTE_INSN_DELETED_LABEL)
|
||||
break;
|
||||
|
||||
gcc_assert (LABEL_P (label));
|
||||
|
|
|
@ -664,9 +664,7 @@ optimize_mode_switching (void)
|
|||
if (mode_set != NULL_RTX)
|
||||
{
|
||||
emited = true;
|
||||
if (NOTE_P (ptr->insn_ptr)
|
||||
&& (NOTE_LINE_NUMBER (ptr->insn_ptr)
|
||||
== NOTE_INSN_BASIC_BLOCK))
|
||||
if (NOTE_INSN_BASIC_BLOCK_P (ptr->insn_ptr))
|
||||
emit_insn_after (mode_set, ptr->insn_ptr);
|
||||
else
|
||||
emit_insn_before (mode_set, ptr->insn_ptr);
|
||||
|
|
|
@ -270,7 +270,7 @@ print_rtx (rtx in_rtx)
|
|||
#endif
|
||||
else if (i == 4 && NOTE_P (in_rtx))
|
||||
{
|
||||
switch (NOTE_LINE_NUMBER (in_rtx))
|
||||
switch (NOTE_KIND (in_rtx))
|
||||
{
|
||||
case NOTE_INSN_EH_REGION_BEG:
|
||||
case NOTE_INSN_EH_REGION_END:
|
||||
|
@ -330,22 +330,7 @@ print_rtx (rtx in_rtx)
|
|||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
const char * const str = X0STR (in_rtx, i);
|
||||
|
||||
if (NOTE_LINE_NUMBER (in_rtx) < 0)
|
||||
;
|
||||
else if (str == 0)
|
||||
fputs (dump_for_graph ? " \\\"\\\"" : " \"\"", outfile);
|
||||
else
|
||||
{
|
||||
if (dump_for_graph)
|
||||
fprintf (outfile, " (\\\"%s\\\")", str);
|
||||
else
|
||||
fprintf (outfile, " (\"%s\")", str);
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -412,7 +397,7 @@ print_rtx (rtx in_rtx)
|
|||
{
|
||||
/* This field is only used for NOTE_INSN_DELETED_LABEL, and
|
||||
other times often contains garbage from INSN->NOTE death. */
|
||||
if (NOTE_LINE_NUMBER (in_rtx) == NOTE_INSN_DELETED_LABEL)
|
||||
if (NOTE_KIND (in_rtx) == NOTE_INSN_DELETED_LABEL)
|
||||
fprintf (outfile, " %d", XINT (in_rtx, i));
|
||||
}
|
||||
else
|
||||
|
@ -476,11 +461,7 @@ print_rtx (rtx in_rtx)
|
|||
/* Print NOTE_INSN names rather than integer codes. */
|
||||
|
||||
case 'n':
|
||||
if (XINT (in_rtx, i) >= (int) NOTE_INSN_BIAS
|
||||
&& XINT (in_rtx, i) < (int) NOTE_INSN_MAX)
|
||||
fprintf (outfile, " %s", GET_NOTE_INSN_NAME (XINT (in_rtx, i)));
|
||||
else
|
||||
fprintf (outfile, " %d", XINT (in_rtx, i));
|
||||
fprintf (outfile, " %s", GET_NOTE_INSN_NAME (XINT (in_rtx, i)));
|
||||
sawclose = 0;
|
||||
break;
|
||||
|
||||
|
@ -493,7 +474,7 @@ print_rtx (rtx in_rtx)
|
|||
if (GET_CODE (in_rtx) == LABEL_REF)
|
||||
{
|
||||
if (subc == NOTE
|
||||
&& NOTE_LINE_NUMBER (sub) == NOTE_INSN_DELETED_LABEL)
|
||||
&& NOTE_KIND (sub) == NOTE_INSN_DELETED_LABEL)
|
||||
{
|
||||
if (flag_dump_unnumbered)
|
||||
fprintf (outfile, " [# deleted]");
|
||||
|
@ -724,8 +705,6 @@ debug_rtx_find (rtx x, int uid)
|
|||
void
|
||||
print_rtl (FILE *outf, rtx rtx_first)
|
||||
{
|
||||
rtx tmp_rtx;
|
||||
|
||||
outfile = outf;
|
||||
sawclose = 0;
|
||||
|
||||
|
@ -743,14 +722,6 @@ print_rtl (FILE *outf, rtx rtx_first)
|
|||
case NOTE:
|
||||
case CODE_LABEL:
|
||||
case BARRIER:
|
||||
for (tmp_rtx = rtx_first; tmp_rtx != 0; tmp_rtx = NEXT_INSN (tmp_rtx))
|
||||
if (! flag_dump_unnumbered
|
||||
|| !NOTE_P (tmp_rtx) || NOTE_LINE_NUMBER (tmp_rtx) < 0)
|
||||
{
|
||||
fputs (print_rtx_head, outfile);
|
||||
print_rtx (tmp_rtx);
|
||||
fprintf (outfile, "\n");
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -767,8 +738,7 @@ print_rtl_single (FILE *outf, rtx x)
|
|||
{
|
||||
outfile = outf;
|
||||
sawclose = 0;
|
||||
if (! flag_dump_unnumbered
|
||||
|| !NOTE_P (x) || NOTE_LINE_NUMBER (x) < 0)
|
||||
if (! flag_dump_unnumbered)
|
||||
{
|
||||
fputs (print_rtx_head, outfile);
|
||||
print_rtx (x);
|
||||
|
|
|
@ -1005,6 +1005,15 @@ branch_prob (void)
|
|||
if (EXPR_HAS_LOCATION (stmt))
|
||||
output_location (EXPR_FILENAME (stmt), EXPR_LINENO (stmt),
|
||||
&offset, bb);
|
||||
/* Take into account modify statements nested in return
|
||||
produced by C++ NRV transformation. */
|
||||
if (TREE_CODE (stmt) == RETURN_EXPR
|
||||
&& TREE_OPERAND (stmt, 0)
|
||||
&& TREE_CODE (TREE_OPERAND (stmt, 0)) == MODIFY_EXPR
|
||||
&& EXPR_HAS_LOCATION (TREE_OPERAND (stmt, 0)))
|
||||
output_location (EXPR_FILENAME (TREE_OPERAND (stmt, 0)),
|
||||
EXPR_LINENO (TREE_OPERAND (stmt, 0)),
|
||||
&offset, bb);
|
||||
}
|
||||
|
||||
/* Notice GOTO expressions we eliminated while constructing the
|
||||
|
|
|
@ -3807,7 +3807,7 @@ dbr_schedule (rtx first)
|
|||
if (INSN_UID (insn) > max_uid)
|
||||
max_uid = INSN_UID (insn);
|
||||
if (NOTE_P (insn)
|
||||
&& NOTE_LINE_NUMBER (insn) == NOTE_INSN_EPILOGUE_BEG)
|
||||
&& NOTE_KIND (insn) == NOTE_INSN_EPILOGUE_BEG)
|
||||
epilogue_insn = insn;
|
||||
}
|
||||
|
||||
|
|
|
@ -1099,7 +1099,7 @@ mark_target_live_regs (rtx insns, rtx target, struct resources *res)
|
|||
RTL chain when there are no epilogue insns. Certain resources
|
||||
are implicitly required at that point. */
|
||||
else if (NOTE_P (real_insn)
|
||||
&& NOTE_LINE_NUMBER (real_insn) == NOTE_INSN_EPILOGUE_BEG)
|
||||
&& NOTE_KIND (real_insn) == NOTE_INSN_EPILOGUE_BEG)
|
||||
IOR_HARD_REG_SET (current_live_regs, start_of_epilogue_needs.regs);
|
||||
}
|
||||
|
||||
|
|
|
@ -119,15 +119,10 @@ const unsigned char rtx_code_size[NUM_RTX_CODE] = {
|
|||
#undef DEF_RTL_EXPR
|
||||
};
|
||||
|
||||
/* Make sure all NOTE_INSN_* values are negative. */
|
||||
extern char NOTE_INSN_MAX_isnt_negative_adjust_NOTE_INSN_BIAS
|
||||
[NOTE_INSN_MAX < 0 ? 1 : -1];
|
||||
|
||||
/* Names for kinds of NOTEs and REG_NOTEs. */
|
||||
|
||||
const char * const note_insn_name[NOTE_INSN_MAX - NOTE_INSN_BIAS] =
|
||||
const char * const note_insn_name[NOTE_INSN_MAX] =
|
||||
{
|
||||
"",
|
||||
#define DEF_INSN_NOTE(NAME) #NAME,
|
||||
#include "insn-notes.def"
|
||||
#undef DEF_INSN_NOTE
|
||||
|
|
14
gcc/rtl.def
14
gcc/rtl.def
|
@ -137,20 +137,12 @@ DEF_RTL_EXPR(BARRIER, "barrier", "iuu000000", RTX_EXTRA)
|
|||
7: is the user-given name of the label, if any. */
|
||||
DEF_RTL_EXPR(CODE_LABEL, "code_label", "iuuB00is", RTX_EXTRA)
|
||||
|
||||
#ifdef USE_MAPPED_LOCATION
|
||||
/* Say where in the code a source line starts, for symbol table's sake.
|
||||
Operand:
|
||||
4: unused if line number > 0, note-specific data otherwise.
|
||||
5: line number if > 0, enum note_insn otherwise.
|
||||
6: CODE_LABEL_NUMBER if line number == NOTE_INSN_DELETED_LABEL. */
|
||||
#else
|
||||
/* Say where in the code a source line starts, for symbol table's sake.
|
||||
Operand:
|
||||
4: filename, if line number > 0, note-specific data otherwise.
|
||||
5: line number if > 0, enum note_insn otherwise.
|
||||
4: note-specific data
|
||||
5: unused (memory layout has to match code_label above)
|
||||
6: unique number if line number == note_insn_deleted_label. */
|
||||
#endif
|
||||
DEF_RTL_EXPR(NOTE, "note", "iuuB0ni", RTX_EXTRA)
|
||||
DEF_RTL_EXPR(NOTE, "note", "iuuB00i", RTX_EXTRA)
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
Top level constituents of INSN, JUMP_INSN and CALL_INSN.
|
||||
|
|
33
gcc/rtl.h
33
gcc/rtl.h
|
@ -834,19 +834,12 @@ extern const char * const reg_note_name[];
|
|||
#define NOTE_DATA(INSN) RTL_CHECKC1 (INSN, 4, NOTE)
|
||||
#define NOTE_DELETED_LABEL_NAME(INSN) XCSTR (INSN, 4, NOTE)
|
||||
#ifdef USE_MAPPED_LOCATION
|
||||
#define NOTE_SOURCE_LOCATION(INSN) XCUINT (INSN, 5, NOTE)
|
||||
#define NOTE_EXPANDED_LOCATION(XLOC, INSN) \
|
||||
(XLOC) = expand_location (NOTE_SOURCE_LOCATION (INSN))
|
||||
#define SET_INSN_DELETED(INSN) \
|
||||
(PUT_CODE (INSN, NOTE), NOTE_LINE_NUMBER (INSN) = NOTE_INSN_DELETED)
|
||||
(PUT_CODE (INSN, NOTE), NOTE_KIND (INSN) = NOTE_INSN_DELETED)
|
||||
#else
|
||||
#define NOTE_EXPANDED_LOCATION(XLOC, INSN) \
|
||||
((XLOC).file = NOTE_SOURCE_FILE (INSN), \
|
||||
(XLOC).line = NOTE_LINE_NUMBER (INSN))
|
||||
#define NOTE_SOURCE_FILE(INSN) XCSTR (INSN, 4, NOTE)
|
||||
#define SET_INSN_DELETED(INSN) \
|
||||
(PUT_CODE (INSN, NOTE), NOTE_SOURCE_FILE (INSN) = 0, \
|
||||
NOTE_LINE_NUMBER (INSN) = NOTE_INSN_DELETED)
|
||||
(PUT_CODE (INSN, NOTE), \
|
||||
NOTE_KIND (INSN) = NOTE_INSN_DELETED)
|
||||
#endif
|
||||
#define NOTE_BLOCK(INSN) XCTREE (INSN, 4, NOTE)
|
||||
#define NOTE_EH_HANDLER(INSN) XCINT (INSN, 4, NOTE)
|
||||
|
@ -855,12 +848,12 @@ extern const char * const reg_note_name[];
|
|||
|
||||
/* In a NOTE that is a line number, this is the line number.
|
||||
Other kinds of NOTEs are identified by negative numbers here. */
|
||||
#define NOTE_LINE_NUMBER(INSN) XCINT (INSN, 5, NOTE)
|
||||
#define NOTE_KIND(INSN) XCINT (INSN, 5, NOTE)
|
||||
|
||||
/* Nonzero if INSN is a note marking the beginning of a basic block. */
|
||||
#define NOTE_INSN_BASIC_BLOCK_P(INSN) \
|
||||
(GET_CODE (INSN) == NOTE \
|
||||
&& NOTE_LINE_NUMBER (INSN) == NOTE_INSN_BASIC_BLOCK)
|
||||
&& NOTE_KIND (INSN) == NOTE_INSN_BASIC_BLOCK)
|
||||
|
||||
/* Variable declaration and the location of a variable. */
|
||||
#define NOTE_VAR_LOCATION_DECL(INSN) (XCTREE (XCEXP (INSN, 4, NOTE), \
|
||||
|
@ -868,7 +861,7 @@ extern const char * const reg_note_name[];
|
|||
#define NOTE_VAR_LOCATION_LOC(INSN) (XCEXP (XCEXP (INSN, 4, NOTE), \
|
||||
1, VAR_LOCATION))
|
||||
|
||||
/* Codes that appear in the NOTE_LINE_NUMBER field for kinds of notes
|
||||
/* Codes that appear in the NOTE_KIND field for kinds of notes
|
||||
that are not line numbers. These codes are all negative.
|
||||
|
||||
Notice that we do not try to use zero here for any of
|
||||
|
@ -879,9 +872,6 @@ extern const char * const reg_note_name[];
|
|||
|
||||
enum insn_note
|
||||
{
|
||||
/* Keep all of these numbers negative. Adjust as needed. */
|
||||
NOTE_INSN_BIAS = -100,
|
||||
|
||||
#define DEF_INSN_NOTE(NAME) NAME,
|
||||
#include "insn-notes.def"
|
||||
#undef DEF_INSN_NOTE
|
||||
|
@ -891,9 +881,9 @@ enum insn_note
|
|||
|
||||
/* Names for NOTE insn's other than line numbers. */
|
||||
|
||||
extern const char * const note_insn_name[NOTE_INSN_MAX - NOTE_INSN_BIAS];
|
||||
extern const char * const note_insn_name[NOTE_INSN_MAX];
|
||||
#define GET_NOTE_INSN_NAME(NOTE_CODE) \
|
||||
(note_insn_name[(NOTE_CODE) - (int) NOTE_INSN_BIAS])
|
||||
(note_insn_name[(NOTE_CODE)])
|
||||
|
||||
/* The name of a label, in case it corresponds to an explicit label
|
||||
in the input source code. */
|
||||
|
@ -1542,7 +1532,7 @@ extern rtx emit_call_insn_before_noloc (rtx, rtx);
|
|||
extern rtx emit_call_insn_before_setloc (rtx, rtx, int);
|
||||
extern rtx emit_barrier_before (rtx);
|
||||
extern rtx emit_label_before (rtx, rtx);
|
||||
extern rtx emit_note_before (int, rtx);
|
||||
extern rtx emit_note_before (enum insn_note, rtx);
|
||||
extern rtx emit_insn_after (rtx, rtx);
|
||||
extern rtx emit_insn_after_noloc (rtx, rtx);
|
||||
extern rtx emit_insn_after_setloc (rtx, rtx, int);
|
||||
|
@ -1554,13 +1544,13 @@ extern rtx emit_call_insn_after_noloc (rtx, rtx);
|
|||
extern rtx emit_call_insn_after_setloc (rtx, rtx, int);
|
||||
extern rtx emit_barrier_after (rtx);
|
||||
extern rtx emit_label_after (rtx, rtx);
|
||||
extern rtx emit_note_after (int, rtx);
|
||||
extern rtx emit_note_after (enum insn_note, rtx);
|
||||
extern rtx emit_insn (rtx);
|
||||
extern rtx emit_jump_insn (rtx);
|
||||
extern rtx emit_call_insn (rtx);
|
||||
extern rtx emit_label (rtx);
|
||||
extern rtx emit_barrier (void);
|
||||
extern rtx emit_note (int);
|
||||
extern rtx emit_note (enum insn_note);
|
||||
extern rtx emit_note_copy (rtx);
|
||||
extern rtx make_insn_raw (rtx);
|
||||
extern rtx make_jump_insn_raw (rtx);
|
||||
|
@ -1598,7 +1588,6 @@ extern void mark_jump_label (rtx, rtx, int);
|
|||
extern unsigned int cleanup_barriers (void);
|
||||
|
||||
/* In jump.c */
|
||||
extern bool squeeze_notes (rtx *, rtx *);
|
||||
extern rtx delete_related_insns (rtx);
|
||||
|
||||
/* In recog.c */
|
||||
|
|
|
@ -1937,8 +1937,8 @@ sched_analyze (struct deps *deps, rtx head, rtx tail)
|
|||
/* EH_REGION insn notes can not appear until well after we complete
|
||||
scheduling. */
|
||||
if (NOTE_P (insn))
|
||||
gcc_assert (NOTE_LINE_NUMBER (insn) != NOTE_INSN_EH_REGION_BEG
|
||||
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_EH_REGION_END);
|
||||
gcc_assert (NOTE_KIND (insn) != NOTE_INSN_EH_REGION_BEG
|
||||
&& NOTE_KIND (insn) != NOTE_INSN_EH_REGION_END);
|
||||
|
||||
if (current_sched_info->use_cselib)
|
||||
cselib_process_insn (insn);
|
||||
|
|
|
@ -745,7 +745,7 @@ enum SPEC_SCHED_FLAGS {
|
|||
PREFER_NON_CONTROL_SPEC = PREFER_NON_DATA_SPEC << 1
|
||||
};
|
||||
|
||||
#define NOTE_NOT_BB_P(NOTE) (NOTE_P (NOTE) && (NOTE_LINE_NUMBER (NOTE) \
|
||||
#define NOTE_NOT_BB_P(NOTE) (NOTE_P (NOTE) && (NOTE_KIND (NOTE) \
|
||||
!= NOTE_INSN_BASIC_BLOCK))
|
||||
|
||||
extern FILE *sched_dump;
|
||||
|
|
|
@ -2598,9 +2598,8 @@ void debug_dependencies (rtx head, rtx tail)
|
|||
fprintf (sched_dump, ";; %6d ", INSN_UID (insn));
|
||||
if (NOTE_P (insn))
|
||||
{
|
||||
n = NOTE_LINE_NUMBER (insn);
|
||||
if (n < 0)
|
||||
fprintf (sched_dump, "%s\n", GET_NOTE_INSN_NAME (n));
|
||||
n = NOTE_KIND (insn);
|
||||
fprintf (sched_dump, "%s\n", GET_NOTE_INSN_NAME (n));
|
||||
}
|
||||
else
|
||||
fprintf (sched_dump, " {%s}\n", GET_RTX_NAME (GET_CODE (insn)));
|
||||
|
|
|
@ -677,16 +677,8 @@ print_insn (char *buf, rtx x, int verbose)
|
|||
sprintf (buf, "i%4d: barrier", INSN_UID (x));
|
||||
break;
|
||||
case NOTE:
|
||||
if (NOTE_LINE_NUMBER (x) > 0)
|
||||
{
|
||||
expanded_location xloc;
|
||||
NOTE_EXPANDED_LOCATION (xloc, x);
|
||||
sprintf (buf, " %4d note \"%s\" %d", INSN_UID (x),
|
||||
xloc.file, xloc.line);
|
||||
}
|
||||
else
|
||||
sprintf (buf, " %4d %s", INSN_UID (x),
|
||||
GET_NOTE_INSN_NAME (NOTE_LINE_NUMBER (x)));
|
||||
sprintf (buf, " %4d %s", INSN_UID (x),
|
||||
GET_NOTE_INSN_NAME (NOTE_KIND (x)));
|
||||
break;
|
||||
default:
|
||||
sprintf (buf, "i%4d <What %s?>", INSN_UID (x),
|
||||
|
|
|
@ -2317,7 +2317,7 @@ expand_case (tree exp)
|
|||
rtx table_label;
|
||||
int ncases;
|
||||
rtx *labelvec;
|
||||
int i, fail;
|
||||
int i;
|
||||
rtx before_case, end, lab;
|
||||
|
||||
tree vec = SWITCH_LABELS (exp);
|
||||
|
@ -2591,8 +2591,6 @@ expand_case (tree exp)
|
|||
|
||||
before_case = NEXT_INSN (before_case);
|
||||
end = get_last_insn ();
|
||||
fail = squeeze_notes (&before_case, &end);
|
||||
gcc_assert (!fail);
|
||||
reorder_insns (before_case, end, start);
|
||||
}
|
||||
|
||||
|
|
|
@ -3695,7 +3695,7 @@ output_constant_pool_1 (struct constant_descriptor_rtx *desc,
|
|||
tmp = XEXP (x, 0);
|
||||
gcc_assert (!INSN_DELETED_P (tmp));
|
||||
gcc_assert (!NOTE_P (tmp)
|
||||
|| NOTE_LINE_NUMBER (tmp) != NOTE_INSN_DELETED);
|
||||
|| NOTE_KIND (tmp) != NOTE_INSN_DELETED);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
Loading…
Add table
Reference in a new issue