From fe882b360713f88b177c68705379069f2d3707c1 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Mon, 30 Dec 2013 20:35:09 -0500 Subject: [PATCH 027/159] FIXME: convert final,final_scan_insn, try_split --- gcc/emit-rtl.c | 7 ++++--- gcc/final.c | 26 +++++++++++++++----------- gcc/function.c | 2 +- gcc/output.h | 4 ++-- gcc/recog.c | 14 +++++++------- gcc/rtl.h | 2 +- 6 files changed, 30 insertions(+), 25 deletions(-) diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 1122ed8..d313e17 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -3492,13 +3492,14 @@ mark_label_nuses (rtx x) replacement insn depending on the value of LAST. Otherwise, it returns TRIAL. If the insn to be returned can be split, it will be. */ -rtx -try_split (rtx pat, rtx trial, int last) +rtx_base_insn +try_split (rtx pat, rtx_base_insn trial, int last) { rtx before = PREV_INSN (trial); rtx after = NEXT_INSN (trial); int has_barrier = 0; - rtx note, seq, tem; + rtx note, seq; + rtx_base_insn tem; int probability; rtx insn_last, insn; int njumps = 0; diff --git a/gcc/final.c b/gcc/final.c index b010493..047461f 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -1954,9 +1954,9 @@ dump_basic_block_info (FILE *file, rtx insn, basic_block *start_to_bb, For description of args, see `final_start_function', above. */ void -final (rtx first, FILE *file, int optimize_p) +final (rtx_base_insn first, FILE *file, int optimize_p) { - rtx insn, next; + rtx_base_insn insn, next; int seen = 0; /* Used for -dA dump. */ @@ -2133,14 +2133,15 @@ call_from_call_insn (rtx insn) at the beginning of the second basic block, whichever comes first. */ -rtx -final_scan_insn (rtx insn, FILE *file, int optimize_p ATTRIBUTE_UNUSED, +rtx_base_insn +final_scan_insn (rtx_base_insn insn, FILE *file, + int optimize_p ATTRIBUTE_UNUSED, int nopeepholes ATTRIBUTE_UNUSED, int *seen) { #ifdef HAVE_cc0 rtx set; #endif - rtx next; + rtx_base_insn next; insn_counter++; @@ -2350,7 +2351,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize_p ATTRIBUTE_UNUSED, case NOTE_INSN_VAR_LOCATION: case NOTE_INSN_CALL_ARG_LOCATION: if (!DECL_IGNORED_P (current_function_decl)) - debug_hooks->var_location (insn->as_an_rtx_base_insn ()); + debug_hooks->var_location (insn); break; default: @@ -2630,7 +2631,9 @@ final_scan_insn (rtx insn, FILE *file, int optimize_p 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, 1, seen); + next = + final_scan_insn (XVECEXP (body, 0, 0)->as_an_rtx_base_insn (), + file, 0, 1, seen); if (next != XVECEXP (body, 0, 1)) { final_sequence = 0; @@ -2639,8 +2642,9 @@ final_scan_insn (rtx insn, FILE *file, int optimize_p ATTRIBUTE_UNUSED, for (i = 1; i < XVECLEN (body, 0); i++) { - rtx insn = XVECEXP (body, 0, i); - rtx next = NEXT_INSN (insn); + rtx_base_insn insn = + XVECEXP (body, 0, i)->as_an_rtx_base_insn (); + rtx_base_insn next = NEXT_INSN (insn); /* We loop in case any instruction in a delay slot gets split. */ do @@ -2934,7 +2938,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize_p ATTRIBUTE_UNUSED, needs to be reinserted. */ if (templ == 0) { - rtx prev; + rtx_base_insn prev; gcc_assert (prev_nonnote_insn (insn) == last_ignored_compare); @@ -2957,7 +2961,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize_p ATTRIBUTE_UNUSED, be split. */ if (templ[0] == '#' && templ[1] == '\0') { - rtx new_rtx = try_split (body, insn, 0); + rtx_base_insn new_rtx = try_split (body, insn, 0); /* If we didn't split the insn, go away. */ if (new_rtx == insn && PATTERN (new_rtx) == body) diff --git a/gcc/function.c b/gcc/function.c index 636966b..9406e04 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -6421,7 +6421,7 @@ thread_prologue_and_epilogue_insns (void) EPILOGUE_BEG note and mark the insns as epilogue insns. */ FOR_EACH_EDGE (e, ei, EXIT_BLOCK_PTR_FOR_FN (cfun)->preds) { - rtx prev, last, trial; + rtx_base_insn prev, last, trial; if (e->flags & EDGE_FALLTHRU) continue; diff --git a/gcc/output.h b/gcc/output.h index 7b26256..e7a2e15 100644 --- a/gcc/output.h +++ b/gcc/output.h @@ -65,12 +65,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); +extern void final (rtx_base_insn, 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 *); +extern rtx_base_insn final_scan_insn (rtx_base_insn, FILE *, int, int, int *); /* Replace a SUBREG with a REG or a MEM, based on the thing it is a subreg of. */ diff --git a/gcc/recog.c b/gcc/recog.c index 7f59756..616bb65 100644 --- a/gcc/recog.c +++ b/gcc/recog.c @@ -59,7 +59,7 @@ along with GCC; see the file COPYING3. If not see static void validate_replace_rtx_1 (rtx *, rtx, rtx, rtx, bool); static void validate_replace_src_1 (rtx *, void *); -static rtx split_insn (rtx); +static rtx_base_insn split_insn (rtx_base_insn); /* Nonzero means allow operands to be volatile. This should be 0 if you are generating rtl, such as if you are calling @@ -2838,16 +2838,16 @@ reg_fits_class_p (const_rtx operand, reg_class_t cl, int offset, split_all_insns_noflow. Return last insn in the sequence if successful, or NULL if unsuccessful. */ -static rtx -split_insn (rtx insn) +static rtx_base_insn +split_insn (rtx_base_insn insn) { /* Split insns here to get max fine-grain parallelism. */ rtx first = PREV_INSN (insn); - rtx last = try_split (PATTERN (insn), insn, 1); + rtx_base_insn last = try_split (PATTERN (insn), insn, 1); rtx insn_set, last_set, note; if (last == insn) - return NULL_RTX; + return NULL_RTX_BASE_INSN; /* If the original instruction was a single set that was known to be equivalent to a constant, see if we can say the same about the last @@ -2904,7 +2904,7 @@ split_all_insns (void) FOR_EACH_BB_REVERSE (bb) { - rtx insn, next; + rtx_base_insn insn, next; bool finish = false; rtl_profile_for_bb (bb); @@ -2960,7 +2960,7 @@ split_all_insns (void) unsigned int split_all_insns_noflow (void) { - rtx next, insn; + rtx_base_insn next, insn; for (insn = get_insns (); insn; insn = next) { diff --git a/gcc/rtl.h b/gcc/rtl.h index f5ef378..e02e24d 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -2204,7 +2204,7 @@ extern rtx delete_related_insns (rtx); extern rtx *find_constant_term_loc (rtx *); /* In emit-rtl.c */ -extern rtx try_split (rtx, rtx, int); +extern rtx_base_insn try_split (rtx, rtx_base_insn, int); extern int split_branch_probability; /* In unknown file */ -- 1.7.11.7