diff options
author | dmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-08-22 19:38:50 +0000 |
---|---|---|
committer | dmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-08-22 19:38:50 +0000 |
commit | 3aeaa53f8517f8af51f62faeea903519381650b6 (patch) | |
tree | 53ad22734838df49138bb59b6d5a311d45c0df84 | |
parent | a62433bc41c25503a41eb125dd14d1cd6bd7e619 (diff) | |
download | gcc-3aeaa53f8517f8af51f62faeea903519381650b6.tar.gz |
postreload.c: Use rtx_insn (also touches rtl.h and cprop.c)
gcc/
* rtl.h (fis_get_condition): Strengthen param "jump" from rtx to
rtx_insn *.
* cprop.c (fis_get_condition): Likewise.
* postreload.c (reload_cse_regs): Likewise for param "first".
(reload_cse_simplify): Likewise for param "insn".
(reload_cse_regs_1): Likewise for local "insn".
(reload_cse_simplify_set): Likewise for param "insn".
(reload_cse_simplify_operands): Likewise.
(struct reg_use): Likewise for field "insn".
(reload_combine_purge_insn_uses): Likewise for param "insn".
(fixup_debug_insns): Likewise for params "from", "to" and local
"insn".
(try_replace_in_use): Likewise for local "use_insn".
(reload_combine_recognize_const_pattern): Likewise for param
"insn" and locals "add_moved_after_insn", "use_insn".
(reload_combine_recognize_pattern): Likewise for param "insn" and
local "prev".
(reload_combine): Likewise for locals "insn", "prev".
(reload_combine_note_use): Likewise for param "insn".
(move2add_use_add2_insn): Likewise.
(move2add_use_add3_insn): Likewise.
(reload_cse_move2add): Likewise, also for local "next".
(move2add_note_store): Likewise for local "insn".
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@214358 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 28 | ||||
-rw-r--r-- | gcc/cprop.c | 2 | ||||
-rw-r--r-- | gcc/postreload.c | 56 | ||||
-rw-r--r-- | gcc/rtl.h | 2 |
4 files changed, 58 insertions, 30 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6e6c06adcff..0bdcef7d8b5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,33 @@ 2014-08-22 David Malcolm <dmalcolm@redhat.com> + * rtl.h (fis_get_condition): Strengthen param "jump" from rtx to + rtx_insn *. + + * cprop.c (fis_get_condition): Likewise. + + * postreload.c (reload_cse_regs): Likewise for param "first". + (reload_cse_simplify): Likewise for param "insn". + (reload_cse_regs_1): Likewise for local "insn". + (reload_cse_simplify_set): Likewise for param "insn". + (reload_cse_simplify_operands): Likewise. + (struct reg_use): Likewise for field "insn". + (reload_combine_purge_insn_uses): Likewise for param "insn". + (fixup_debug_insns): Likewise for params "from", "to" and local + "insn". + (try_replace_in_use): Likewise for local "use_insn". + (reload_combine_recognize_const_pattern): Likewise for param + "insn" and locals "add_moved_after_insn", "use_insn". + (reload_combine_recognize_pattern): Likewise for param "insn" and + local "prev". + (reload_combine): Likewise for locals "insn", "prev". + (reload_combine_note_use): Likewise for param "insn". + (move2add_use_add2_insn): Likewise. + (move2add_use_add3_insn): Likewise. + (reload_cse_move2add): Likewise, also for local "next". + (move2add_note_store): Likewise for local "insn". + +2014-08-22 David Malcolm <dmalcolm@redhat.com> + * postreload-gcse.c (struct occr): Strengthen field "insn" from rtx to rtx_insn *. (struct unoccr): Likewise. diff --git a/gcc/cprop.c b/gcc/cprop.c index 6d2615e8702..1f73781bb11 100644 --- a/gcc/cprop.c +++ b/gcc/cprop.c @@ -1285,7 +1285,7 @@ local_cprop_pass (void) but this would require some code reorganization. */ rtx -fis_get_condition (rtx jump) +fis_get_condition (rtx_insn *jump) { return get_condition (jump, NULL, false, true); } diff --git a/gcc/postreload.c b/gcc/postreload.c index 69df18c9401..dae4bd89be1 100644 --- a/gcc/postreload.c +++ b/gcc/postreload.c @@ -46,23 +46,23 @@ along with GCC; see the file COPYING3. If not see #include "dbgcnt.h" static int reload_cse_noop_set_p (rtx); -static bool reload_cse_simplify (rtx, rtx); +static bool reload_cse_simplify (rtx_insn *, rtx); static void reload_cse_regs_1 (void); -static int reload_cse_simplify_set (rtx, rtx); -static int reload_cse_simplify_operands (rtx, rtx); +static int reload_cse_simplify_set (rtx, rtx_insn *); +static int reload_cse_simplify_operands (rtx_insn *, rtx); static void reload_combine (void); -static void reload_combine_note_use (rtx *, rtx, int, rtx); +static void reload_combine_note_use (rtx *, rtx_insn *, int, rtx); static void reload_combine_note_store (rtx, const_rtx, void *); -static bool reload_cse_move2add (rtx); +static bool reload_cse_move2add (rtx_insn *); static void move2add_note_store (rtx, const_rtx, void *); /* Call cse / combine like post-reload optimization phases. FIRST is the first instruction. */ static void -reload_cse_regs (rtx first ATTRIBUTE_UNUSED) +reload_cse_regs (rtx_insn *first ATTRIBUTE_UNUSED) { bool moves_converted; reload_cse_regs_1 (); @@ -88,7 +88,7 @@ reload_cse_noop_set_p (rtx set) /* Try to simplify INSN. Return true if the CFG may have changed. */ static bool -reload_cse_simplify (rtx insn, rtx testreg) +reload_cse_simplify (rtx_insn *insn, rtx testreg) { rtx body = PATTERN (insn); basic_block insn_bb = BLOCK_FOR_INSN (insn); @@ -207,7 +207,7 @@ reload_cse_regs_1 (void) { bool cfg_changed = false; basic_block bb; - rtx insn; + rtx_insn *insn; rtx testreg = gen_rtx_REG (VOIDmode, -1); cselib_init (CSELIB_RECORD_MEMORY); @@ -236,7 +236,7 @@ reload_cse_regs_1 (void) and change the set into a register copy. */ static int -reload_cse_simplify_set (rtx set, rtx insn) +reload_cse_simplify_set (rtx set, rtx_insn *insn) { int did_change = 0; int dreg; @@ -380,7 +380,7 @@ reload_cse_simplify_set (rtx set, rtx insn) hard registers. */ static int -reload_cse_simplify_operands (rtx insn, rtx testreg) +reload_cse_simplify_operands (rtx_insn *insn, rtx testreg) { int i, j; @@ -672,7 +672,7 @@ reload_cse_simplify_operands (rtx insn, rtx testreg) struct reg_use { /* The insn where a register has been used. */ - rtx insn; + rtx_insn *insn; /* Points to the memory reference enclosing the use, if any, NULL_RTX otherwise. */ rtx containing_mem; @@ -770,7 +770,7 @@ reload_combine_split_ruids (int split_ruid) information about uses in that particular insn. */ static void -reload_combine_purge_insn_uses (rtx insn) +reload_combine_purge_insn_uses (rtx_insn *insn) { unsigned i; @@ -855,9 +855,9 @@ reload_combine_closest_single_use (unsigned regno, int ruid_limit) should make this change on debug insns. */ static void -fixup_debug_insns (rtx reg, rtx replacement, rtx from, rtx to) +fixup_debug_insns (rtx reg, rtx replacement, rtx_insn *from, rtx_insn *to) { - rtx insn; + rtx_insn *insn; for (insn = from; insn != to; insn = NEXT_INSN (insn)) { rtx t; @@ -878,7 +878,7 @@ fixup_debug_insns (rtx reg, rtx replacement, rtx from, rtx to) static bool try_replace_in_use (struct reg_use *use, rtx reg, rtx src) { - rtx use_insn = use->insn; + rtx_insn *use_insn = use->insn; rtx mem = use->containing_mem; bool speed = optimize_bb_for_speed_p (BLOCK_FOR_INSN (use_insn)); @@ -933,14 +933,14 @@ try_replace_in_use (struct reg_use *use, rtx reg, rtx src) recognized and should be handled normally. */ static bool -reload_combine_recognize_const_pattern (rtx insn) +reload_combine_recognize_const_pattern (rtx_insn *insn) { int from_ruid = reload_combine_ruid; rtx set, pat, reg, src, addreg; unsigned int regno; struct reg_use *use; bool must_move_add; - rtx add_moved_after_insn = NULL_RTX; + rtx_insn *add_moved_after_insn = NULL; int add_moved_after_ruid = 0; int clobbered_regno = -1; @@ -996,7 +996,7 @@ reload_combine_recognize_const_pattern (rtx insn) if (use && GET_MODE (*use->usep) == Pmode) { bool delete_add = false; - rtx use_insn = use->insn; + rtx_insn *use_insn = use->insn; int use_ruid = use->ruid; /* Avoid moving the add insn past a jump. */ @@ -1077,7 +1077,7 @@ reload_combine_recognize_const_pattern (rtx insn) INSN; false if it wasn't recognized and should be handled normally. */ static bool -reload_combine_recognize_pattern (rtx insn) +reload_combine_recognize_pattern (rtx_insn *insn) { rtx set, reg, src; unsigned int regno; @@ -1119,7 +1119,7 @@ reload_combine_recognize_pattern (rtx insn) && last_label_ruid < reg_state[regno].use_ruid) { rtx base = XEXP (src, 1); - rtx prev = prev_nonnote_nondebug_insn (insn); + rtx_insn *prev = prev_nonnote_nondebug_insn (insn); rtx prev_set = prev ? single_set (prev) : NULL_RTX; rtx index_reg = NULL_RTX; rtx reg_sum = NULL_RTX; @@ -1228,7 +1228,7 @@ reload_combine_recognize_pattern (rtx insn) static void reload_combine (void) { - rtx insn, prev; + rtx_insn *insn, *prev; basic_block bb; unsigned int r; int min_labelno, n_labels; @@ -1493,7 +1493,7 @@ reload_combine_note_store (rtx dst, const_rtx set, void *data ATTRIBUTE_UNUSED) *XP is the pattern of INSN, or a part of it. Called from reload_combine, and recursively by itself. */ static void -reload_combine_note_use (rtx *xp, rtx insn, int ruid, rtx containing_mem) +reload_combine_note_use (rtx *xp, rtx_insn *insn, int ruid, rtx containing_mem) { rtx x = *xp; enum rtx_code code = x->code; @@ -1747,7 +1747,7 @@ move2add_valid_value_p (int regno, enum machine_mode mode) Return true if we made a change. */ static bool -move2add_use_add2_insn (rtx reg, rtx sym, rtx off, rtx insn) +move2add_use_add2_insn (rtx reg, rtx sym, rtx off, rtx_insn *insn) { rtx pat = PATTERN (insn); rtx src = SET_SRC (pat); @@ -1832,7 +1832,7 @@ move2add_use_add2_insn (rtx reg, rtx sym, rtx off, rtx insn) Return true iff we made a change. */ static bool -move2add_use_add3_insn (rtx reg, rtx sym, rtx off, rtx insn) +move2add_use_add3_insn (rtx reg, rtx sym, rtx off, rtx_insn *insn) { rtx pat = PATTERN (insn); rtx src = SET_SRC (pat); @@ -1906,10 +1906,10 @@ move2add_use_add3_insn (rtx reg, rtx sym, rtx off, rtx insn) /* Convert move insns with constant inputs to additions if they are cheaper. Return true if any changes were made. */ static bool -reload_cse_move2add (rtx first) +reload_cse_move2add (rtx_insn *first) { int i; - rtx insn; + rtx_insn *insn; bool changed = false; for (i = FIRST_PSEUDO_REGISTER - 1; i >= 0; i--) @@ -1989,7 +1989,7 @@ reload_cse_move2add (rtx first) && reg_base_reg[regno] == reg_base_reg[REGNO (src)] && move2add_valid_value_p (REGNO (src), GET_MODE (reg))) { - rtx next = next_nonnote_nondebug_insn (insn); + rtx_insn *next = next_nonnote_nondebug_insn (insn); rtx set = NULL_RTX; if (next) set = single_set (next); @@ -2157,7 +2157,7 @@ reload_cse_move2add (rtx first) static void move2add_note_store (rtx dst, const_rtx set, void *data) { - rtx insn = (rtx) data; + rtx_insn *insn = (rtx_insn *) data; unsigned int regno = 0; enum machine_mode mode = GET_MODE (dst); diff --git a/gcc/rtl.h b/gcc/rtl.h index acd0be95465..82d694ed7f0 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -3188,7 +3188,7 @@ extern void init_lower_subreg (void); /* In gcse.c */ extern bool can_copy_p (enum machine_mode); extern bool can_assign_to_reg_without_clobbers_p (rtx); -extern rtx fis_get_condition (rtx); +extern rtx fis_get_condition (rtx_insn *); /* In ira.c */ #ifdef HARD_CONST |