final.c (final): Remove prescan parameter.

* final.c (final): Remove prescan parameter.  Change all callers.
	(final_scan_insn): Remove prescan parameter.  Change all callers.

From-SVN: r97267
This commit is contained in:
Ian Lance Taylor 2005-03-30 18:53:35 +00:00 committed by Ian Lance Taylor
parent 15f188a462
commit c9d691e977
11 changed files with 32 additions and 66 deletions

View file

@ -1,3 +1,8 @@
2005-03-30 Ian Lance Taylor <ian@airs.com>
* final.c (final): Remove prescan parameter. Change all callers.
(final_scan_insn): Remove prescan parameter. Change all callers.
2005-03-30 Kazu Hirata <kazu@cs.umass.edu>
* tree-vectorizer.c: Fix comment typos.

View file

@ -7911,7 +7911,7 @@ alpha_output_mi_thunk_osf (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
insn_locators_initialize ();
shorten_branches (insn);
final_start_function (insn, file, 1);
final (insn, file, 1, 0);
final (insn, file, 1);
final_end_function ();
}
#endif /* TARGET_ABI_OSF */

View file

@ -8818,7 +8818,7 @@ ia64_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
insn = get_insns ();
shorten_branches (insn);
final_start_function (insn, file, 1);
final (insn, file, 1, 0);
final (insn, file, 1);
final_end_function ();
reload_completed = 0;

View file

@ -6719,7 +6719,7 @@ mips_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
mips16_lay_out_constants ();
shorten_branches (insn);
final_start_function (insn, file, 1);
final (insn, file, 1, 0);
final (insn, file, 1);
final_end_function ();
/* Clean up the vars set above. Note that final_end_function resets
@ -8983,7 +8983,7 @@ mips_output_conditional_branch (rtx insn, rtx *operands, int two_operands_p,
/* Output delay slot instruction. */
rtx insn = final_sequence;
final_scan_insn (XVECEXP (insn, 0, 1), asm_out_file,
optimize, 0, 1, NULL);
optimize, 1, NULL);
INSN_DELETED_P (XVECEXP (insn, 0, 1)) = 1;
}
else
@ -9002,7 +9002,7 @@ mips_output_conditional_branch (rtx insn, rtx *operands, int two_operands_p,
/* Output delay slot instruction. */
rtx insn = final_sequence;
final_scan_insn (XVECEXP (insn, 0, 1), asm_out_file,
optimize, 0, 1, NULL);
optimize, 1, NULL);
INSN_DELETED_P (XVECEXP (insn, 0, 1)) = 1;
}
else

View file

@ -6044,7 +6044,7 @@ output_lbranch (rtx dest, rtx insn)
abort ();
final_scan_insn (NEXT_INSN (insn), asm_out_file,
optimize, 0, 0, NULL);
optimize, 0, NULL);
/* Now delete the delay insn. */
PUT_CODE (NEXT_INSN (insn), NOTE);
@ -7048,7 +7048,7 @@ output_call (rtx insn, rtx call_dest, int sibcall)
&& !sibcall)
{
final_scan_insn (NEXT_INSN (insn), asm_out_file,
optimize, 0, 0, NULL);
optimize, 0, NULL);
/* Now delete the delay insn. */
PUT_CODE (NEXT_INSN (insn), NOTE);
@ -7096,7 +7096,7 @@ output_call (rtx insn, rtx call_dest, int sibcall)
/* A non-jump insn in the delay slot. By definition we can
emit this insn before the call (and in fact before argument
relocating. */
final_scan_insn (NEXT_INSN (insn), asm_out_file, optimize, 0, 0,
final_scan_insn (NEXT_INSN (insn), asm_out_file, optimize, 0,
NULL);
/* Now delete the delay insn. */

View file

@ -13210,7 +13210,7 @@ rs6000_output_function_prologue (FILE *file,
if (TARGET_DEBUG_STACK)
debug_rtx_list (get_insns (), 100);
final (get_insns (), file, FALSE, FALSE);
final (get_insns (), file, FALSE);
end_sequence ();
}
@ -13740,7 +13740,7 @@ rs6000_output_function_epilogue (FILE *file,
if (TARGET_DEBUG_STACK)
debug_rtx_list (get_insns (), 100);
final (get_insns (), file, FALSE, FALSE);
final (get_insns (), file, FALSE);
end_sequence ();
}
}
@ -14110,7 +14110,7 @@ rs6000_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
insn_locators_initialize ();
shorten_branches (insn);
final_start_function (insn, file, 1);
final (insn, file, 1, 0);
final (insn, file, 1);
final_end_function ();
reload_completed = 0;

View file

@ -1278,7 +1278,7 @@ output_movedouble (rtx insn ATTRIBUTE_UNUSED, rtx operands[],
static void
print_slot (rtx insn)
{
final_scan_insn (XVECEXP (insn, 0, 1), asm_out_file, optimize, 0, 1, NULL);
final_scan_insn (XVECEXP (insn, 0, 1), asm_out_file, optimize, 1, NULL);
INSN_DELETED_P (XVECEXP (insn, 0, 1)) = 1;
}
@ -9869,7 +9869,7 @@ sh_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
dbr_schedule (insns, dump_file);
shorten_branches (insns);
final_start_function (insns, file, 1);
final (insns, file, 1, 0);
final (insns, file, 1);
final_end_function ();
if (optimize > 0 && flag_schedule_insns_after_reload)

View file

@ -9115,7 +9115,7 @@ sparc_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
insn_locators_initialize ();
shorten_branches (insn);
final_start_function (insn, file, 1);
final (insn, file, 1, 0);
final (insn, file, 1);
final_end_function ();
reload_completed = 0;

View file

@ -1491,18 +1491,10 @@ final_end_function (void)
}
/* Output assembler code for some insns: all or part of a function.
For description of args, see `final_start_function', above.
PRESCAN is 1 if we are not really outputting,
just scanning as if we were outputting.
Prescanning deletes and rearranges insns just like ordinary output.
PRESCAN is -2 if we are outputting after having prescanned.
In this case, don't try to delete or rearrange insns
because that has already been done.
Prescanning is done only on certain machines. */
For description of args, see `final_start_function', above. */
void
final (rtx first, FILE *file, int optimize, int prescan)
final (rtx first, FILE *file, int optimize)
{
rtx insn;
int max_uid = 0;
@ -1574,7 +1566,7 @@ final (rtx first, FILE *file, int optimize, int prescan)
insn_current_address = INSN_ADDRESSES (INSN_UID (insn));
#endif /* HAVE_ATTR_length */
insn = final_scan_insn (insn, file, optimize, prescan, 0, &seen);
insn = final_scan_insn (insn, file, optimize, 0, &seen);
}
}
@ -1672,8 +1664,7 @@ scan_ahead_for_unlikely_executed_note (rtx insn)
rtx
final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
int prescan, int nopeepholes ATTRIBUTE_UNUSED,
int *seen)
int nopeepholes ATTRIBUTE_UNUSED, int *seen)
{
#ifdef HAVE_cc0
rtx set;
@ -1690,9 +1681,6 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
switch (GET_CODE (insn))
{
case NOTE:
if (prescan > 0)
break;
switch (NOTE_LINE_NUMBER (insn))
{
case NOTE_INSN_DELETED:
@ -1904,8 +1892,6 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
}
}
#endif
if (prescan > 0)
break;
if (LABEL_NAME (insn))
(*debug_hooks->label) (insn);
@ -2022,9 +2008,6 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
int vlen, idx;
#endif
if (prescan > 0)
break;
if (! JUMP_TABLES_IN_TEXT_SECTION)
targetm.asm_out.function_rodata_section (current_function_decl);
else
@ -2103,8 +2086,6 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
/* There's no telling what that did to the condition codes. */
CC_STATUS_INIT;
if (prescan > 0)
break;
if (string[0])
{
@ -2127,8 +2108,6 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
/* There's no telling what that did to the condition codes. */
CC_STATUS_INIT;
if (prescan > 0)
break;
/* Get out the operand values. */
string = decode_asm_operands (body, ops, NULL, NULL, NULL);
@ -2155,7 +2134,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
break;
}
if (prescan <= 0 && app_on)
if (app_on)
{
fputs (ASM_APP_OFF, file);
app_on = 0;
@ -2166,8 +2145,6 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
/* A delayed-branch sequence */
int i;
if (prescan > 0)
break;
final_sequence = body;
/* Record the delay slots' frame information before the branch.
@ -2183,7 +2160,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
thought unnecessary. If that happens, cancel this sequence
and cause that insn to be restored. */
next = final_scan_insn (XVECEXP (body, 0, 0), file, 0, prescan, 1, seen);
next = final_scan_insn (XVECEXP (body, 0, 0), file, 0, 1, seen);
if (next != XVECEXP (body, 0, 1))
{
final_sequence = 0;
@ -2197,7 +2174,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
/* We loop in case any instruction in a delay slot gets
split. */
do
insn = final_scan_insn (insn, file, 0, prescan, 1, seen);
insn = final_scan_insn (insn, file, 0, 1, seen);
while (insn != next);
}
#ifdef DBR_OUTPUT_SEQEND
@ -2280,10 +2257,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
&& SET_DEST (body) == pc_rtx
&& GET_CODE (SET_SRC (body)) == IF_THEN_ELSE
&& COMPARISON_P (XEXP (SET_SRC (body), 0))
&& XEXP (XEXP (SET_SRC (body), 0), 0) == cc0_rtx
/* This is done during prescan; it is not done again
in final scan when prescan has been done. */
&& prescan >= 0)
&& XEXP (XEXP (SET_SRC (body), 0), 0) == cc0_rtx)
{
/* This function may alter the contents of its argument
and clear some of the cc_status.flags bits.
@ -2383,21 +2357,11 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
emit them before the peephole. */
if (next != 0 && next != NEXT_INSN (insn))
{
rtx note, prev = PREV_INSN (insn);
rtx note;
for (note = NEXT_INSN (insn); note != next;
note = NEXT_INSN (note))
final_scan_insn (note, file, optimize, prescan, nopeepholes, seen);
/* In case this is prescan, put the notes
in proper position for later rescan. */
note = NEXT_INSN (insn);
PREV_INSN (note) = prev;
NEXT_INSN (prev) = note;
NEXT_INSN (PREV_INSN (next)) = insn;
PREV_INSN (insn) = PREV_INSN (next);
NEXT_INSN (insn) = next;
PREV_INSN (next) = insn;
final_scan_insn (note, file, optimize, nopeepholes, seen);
}
/* PEEPHOLE might have changed this. */
@ -2503,9 +2467,6 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
return new;
}
if (prescan > 0)
break;
#ifdef TARGET_UNWIND_INFO
/* ??? This will put the directives in the wrong place if
get_insn_template outputs assembly directly. However calling it

View file

@ -66,12 +66,12 @@ extern void final_start_function (rtx, FILE *, int);
extern void final_end_function (void);
/* Output assembler code for some insns: all or part of a function. */
extern void final (rtx, FILE *, int, int);
extern void final (rtx, FILE *, int);
/* The final scan for one insn, INSN. Args are same as in `final', except
that INSN is the insn being scanned. Value returned is the next insn to
be scanned. */
extern rtx final_scan_insn (rtx, FILE *, int, int, int, int *);
extern rtx final_scan_insn (rtx, FILE *, int, int, int *);
/* Replace a SUBREG with a REG or a MEM, based on the thing it is a
subreg of. */

View file

@ -294,7 +294,7 @@ rest_of_handle_final (void)
assemble_start_function (current_function_decl, fnname);
final_start_function (get_insns (), asm_out_file, optimize);
final (get_insns (), asm_out_file, optimize, 0);
final (get_insns (), asm_out_file, optimize);
final_end_function ();
#ifdef TARGET_UNWIND_INFO