mirror of git://gcc.gnu.org/git/gcc.git
always define AUTO_INC_DEC
gcc/ChangeLog: 2015-07-08 Trevor Saunders <tbsaunde+gcc@tbsaunde.org> * rtl.h: Always define AUTO_INC_DEC. * auto-inc-dec.c (pass_inc_dec::execute): Adjust. * combine.c (combine_instructions): Likewise. (can_combine_p): Likewise. (try_combine): Likewise. * emit-rtl.c (try_split): Likewise. * loop-invariant.c (calculate_loop_reg_pressure): Likewise. * lower-subreg.c (resolve_simple_move): Likewise. * lra.c (update_inc_notes): Likewise. * recog.c (asm_operand_ok): Likewise. (constrain_operands): Likewise. * regrename.c (scan_rtx_address): Likewise. * reload.c (update_auto_inc_notes): Likewise. (find_equiv_reg): Likewise. * reload1.c (reload): Likewise. (reload_as_needed): Likewise. (choose_reload_regs): Likewise. (emit_input_reload_insns): Likewise. (delete_output_reload): Likewise. * sched-deps.c (init_insn_reg_pressure_info): Likewise. * valtrack.c (cleanup_auto_inc_dec): Likewise. From-SVN: r225595
This commit is contained in:
parent
de824c8b5d
commit
16cb56686d
|
|
@ -1,3 +1,27 @@
|
|||
2015-07-08 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
|
||||
|
||||
* rtl.h: Always define AUTO_INC_DEC.
|
||||
* auto-inc-dec.c (pass_inc_dec::execute): Adjust.
|
||||
* combine.c (combine_instructions): Likewise.
|
||||
(can_combine_p): Likewise.
|
||||
(try_combine): Likewise.
|
||||
* emit-rtl.c (try_split): Likewise.
|
||||
* loop-invariant.c (calculate_loop_reg_pressure): Likewise.
|
||||
* lower-subreg.c (resolve_simple_move): Likewise.
|
||||
* lra.c (update_inc_notes): Likewise.
|
||||
* recog.c (asm_operand_ok): Likewise.
|
||||
(constrain_operands): Likewise.
|
||||
* regrename.c (scan_rtx_address): Likewise.
|
||||
* reload.c (update_auto_inc_notes): Likewise.
|
||||
(find_equiv_reg): Likewise.
|
||||
* reload1.c (reload): Likewise.
|
||||
(reload_as_needed): Likewise.
|
||||
(choose_reload_regs): Likewise.
|
||||
(emit_input_reload_insns): Likewise.
|
||||
(delete_output_reload): Likewise.
|
||||
* sched-deps.c (init_insn_reg_pressure_info): Likewise.
|
||||
* valtrack.c (cleanup_auto_inc_dec): Likewise.
|
||||
|
||||
2015-07-08 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
|
||||
|
||||
* combine.c (can_combine_def_p): Don't check the value of
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ along with GCC; see the file COPYING3. If not see
|
|||
before the ref or +c if the increment was after the ref, then if we
|
||||
can do the combination but switch the pre/post bit. */
|
||||
|
||||
#ifdef AUTO_INC_DEC
|
||||
#if AUTO_INC_DEC
|
||||
|
||||
enum form
|
||||
{
|
||||
|
|
@ -1470,7 +1470,7 @@ public:
|
|||
/* opt_pass methods: */
|
||||
virtual bool gate (function *)
|
||||
{
|
||||
#ifdef AUTO_INC_DEC
|
||||
#if AUTO_INC_DEC
|
||||
return (optimize > 0 && flag_auto_inc_dec);
|
||||
#else
|
||||
return false;
|
||||
|
|
@ -1485,7 +1485,7 @@ public:
|
|||
unsigned int
|
||||
pass_inc_dec::execute (function *fun ATTRIBUTE_UNUSED)
|
||||
{
|
||||
#ifdef AUTO_INC_DEC
|
||||
#if AUTO_INC_DEC
|
||||
basic_block bb;
|
||||
int max_reg = max_reg_num ();
|
||||
|
||||
|
|
|
|||
|
|
@ -1197,7 +1197,7 @@ combine_instructions (rtx_insn *f, unsigned int nregs)
|
|||
FOR_BB_INSNS (this_basic_block, insn)
|
||||
if (INSN_P (insn) && BLOCK_FOR_INSN (insn))
|
||||
{
|
||||
#ifdef AUTO_INC_DEC
|
||||
#if AUTO_INC_DEC
|
||||
rtx links;
|
||||
#endif
|
||||
|
||||
|
|
@ -1208,7 +1208,7 @@ combine_instructions (rtx_insn *f, unsigned int nregs)
|
|||
insn);
|
||||
record_dead_and_set_regs (insn);
|
||||
|
||||
#ifdef AUTO_INC_DEC
|
||||
#if AUTO_INC_DEC
|
||||
for (links = REG_NOTES (insn); links; links = XEXP (links, 1))
|
||||
if (REG_NOTE_KIND (links) == REG_INC)
|
||||
set_nonzero_bits_and_sign_copies (XEXP (links, 0), NULL_RTX,
|
||||
|
|
@ -1792,7 +1792,7 @@ can_combine_p (rtx_insn *insn, rtx_insn *i3, rtx_insn *pred ATTRIBUTE_UNUSED,
|
|||
const_rtx set = 0;
|
||||
rtx src, dest;
|
||||
rtx_insn *p;
|
||||
#ifdef AUTO_INC_DEC
|
||||
#if AUTO_INC_DEC
|
||||
rtx link;
|
||||
#endif
|
||||
bool all_adjacent = true;
|
||||
|
|
@ -2073,7 +2073,7 @@ can_combine_p (rtx_insn *insn, rtx_insn *i3, rtx_insn *pred ATTRIBUTE_UNUSED,
|
|||
Also insist that I3 not be a jump; if it were one
|
||||
and the incremented register were spilled, we would lose. */
|
||||
|
||||
#ifdef AUTO_INC_DEC
|
||||
#if AUTO_INC_DEC
|
||||
for (link = REG_NOTES (insn); link; link = XEXP (link, 1))
|
||||
if (REG_NOTE_KIND (link) == REG_INC
|
||||
&& (JUMP_P (i3)
|
||||
|
|
@ -3040,7 +3040,7 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, rtx_insn *i0,
|
|||
|| GET_CODE (XEXP (SET_DEST (PATTERN (i3)), 0)) == POST_DEC)))
|
||||
/* It's not the exception. */
|
||||
#endif
|
||||
#ifdef AUTO_INC_DEC
|
||||
#if AUTO_INC_DEC
|
||||
{
|
||||
rtx link;
|
||||
for (link = REG_NOTES (i3); link; link = XEXP (link, 1))
|
||||
|
|
|
|||
|
|
@ -3588,7 +3588,7 @@ prev_cc0_setter (rtx_insn *insn)
|
|||
return insn;
|
||||
}
|
||||
|
||||
#ifdef AUTO_INC_DEC
|
||||
#if AUTO_INC_DEC
|
||||
/* Find a RTX_AUTOINC class rtx which matches DATA. */
|
||||
|
||||
static int
|
||||
|
|
@ -3776,7 +3776,7 @@ try_split (rtx pat, rtx_insn *trial, int last)
|
|||
}
|
||||
break;
|
||||
|
||||
#ifdef AUTO_INC_DEC
|
||||
#if AUTO_INC_DEC
|
||||
case REG_INC:
|
||||
for (insn = insn_last; insn != NULL_RTX; insn = PREV_INSN (insn))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1992,7 +1992,7 @@ calculate_loop_reg_pressure (void)
|
|||
|
||||
note_stores (PATTERN (insn), mark_reg_store, NULL);
|
||||
|
||||
#ifdef AUTO_INC_DEC
|
||||
#if AUTO_INC_DEC
|
||||
for (link = REG_NOTES (insn); link; link = XEXP (link, 1))
|
||||
if (REG_NOTE_KIND (link) == REG_INC)
|
||||
mark_reg_store (XEXP (link, 0), NULL_RTX, NULL);
|
||||
|
|
|
|||
|
|
@ -940,7 +940,7 @@ resolve_simple_move (rtx set, rtx_insn *insn)
|
|||
|
||||
reg = gen_reg_rtx (orig_mode);
|
||||
|
||||
#ifdef AUTO_INC_DEC
|
||||
#if AUTO_INC_DEC
|
||||
{
|
||||
rtx move = emit_move_insn (reg, src);
|
||||
if (MEM_P (src))
|
||||
|
|
@ -1043,7 +1043,7 @@ resolve_simple_move (rtx set, rtx_insn *insn)
|
|||
mdest = simplify_gen_subreg (orig_mode, dest, GET_MODE (dest), 0);
|
||||
minsn = emit_move_insn (real_dest, mdest);
|
||||
|
||||
#ifdef AUTO_INC_DEC
|
||||
#if AUTO_INC_DEC
|
||||
if (MEM_P (real_dest)
|
||||
&& !(resolve_reg_p (real_dest) || resolve_subreg_p (real_dest)))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2088,7 +2088,7 @@ has_nonexceptional_receiver (void)
|
|||
return false;
|
||||
}
|
||||
|
||||
#ifdef AUTO_INC_DEC
|
||||
#if AUTO_INC_DEC
|
||||
|
||||
/* Process recursively X of INSN and add REG_INC notes if necessary. */
|
||||
static void
|
||||
|
|
@ -2143,7 +2143,7 @@ update_inc_notes (void)
|
|||
else
|
||||
pnote = &XEXP (*pnote, 1);
|
||||
}
|
||||
#ifdef AUTO_INC_DEC
|
||||
#if AUTO_INC_DEC
|
||||
add_auto_inc_notes (insn, PATTERN (insn));
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1704,7 +1704,7 @@ int
|
|||
asm_operand_ok (rtx op, const char *constraint, const char **constraints)
|
||||
{
|
||||
int result = 0;
|
||||
#ifdef AUTO_INC_DEC
|
||||
#if AUTO_INC_DEC
|
||||
bool incdec_ok = false;
|
||||
#endif
|
||||
|
||||
|
|
@ -1774,7 +1774,7 @@ asm_operand_ok (rtx op, const char *constraint, const char **constraints)
|
|||
result = 1;
|
||||
break;
|
||||
|
||||
#ifdef AUTO_INC_DEC
|
||||
#if AUTO_INC_DEC
|
||||
case '<':
|
||||
case '>':
|
||||
/* ??? Before auto-inc-dec, auto inc/dec insns are not supposed
|
||||
|
|
@ -1828,7 +1828,7 @@ asm_operand_ok (rtx op, const char *constraint, const char **constraints)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifdef AUTO_INC_DEC
|
||||
#if AUTO_INC_DEC
|
||||
/* For operands without < or > constraints reject side-effects. */
|
||||
if (!incdec_ok && result && MEM_P (op))
|
||||
switch (GET_CODE (XEXP (op, 0)))
|
||||
|
|
@ -2806,7 +2806,7 @@ constrain_operands (int strict, alternative_mask alternatives)
|
|||
= recog_data.operand[funny_match[funny_match_index].this_op];
|
||||
}
|
||||
|
||||
#ifdef AUTO_INC_DEC
|
||||
#if AUTO_INC_DEC
|
||||
/* For operands without < or > constraints reject side-effects. */
|
||||
if (recog_data.is_asm)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1307,7 +1307,7 @@ scan_rtx_address (rtx_insn *insn, rtx *loc, enum reg_class cl,
|
|||
case PRE_INC:
|
||||
case PRE_DEC:
|
||||
case PRE_MODIFY:
|
||||
#ifndef AUTO_INC_DEC
|
||||
#if !AUTO_INC_DEC
|
||||
/* If the target doesn't claim to handle autoinc, this must be
|
||||
something special, like a stack push. Kill this chain. */
|
||||
action = mark_all_read;
|
||||
|
|
|
|||
|
|
@ -5447,7 +5447,7 @@ static void
|
|||
update_auto_inc_notes (rtx_insn *insn ATTRIBUTE_UNUSED, int regno ATTRIBUTE_UNUSED,
|
||||
int reloadnum ATTRIBUTE_UNUSED)
|
||||
{
|
||||
#ifdef AUTO_INC_DEC
|
||||
#if AUTO_INC_DEC
|
||||
rtx link;
|
||||
|
||||
for (link = REG_NOTES (insn); link; link = XEXP (link, 1))
|
||||
|
|
@ -7081,7 +7081,7 @@ find_equiv_reg (rtx goal, rtx_insn *insn, enum reg_class rclass, int other,
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef AUTO_INC_DEC
|
||||
#if AUTO_INC_DEC
|
||||
/* If this insn auto-increments or auto-decrements
|
||||
either regno or valueno, return 0 now.
|
||||
If GOAL is a memory ref and its address is not constant,
|
||||
|
|
@ -7168,7 +7168,7 @@ find_inc_amount (rtx x, rtx inced)
|
|||
/* Return 1 if registers from REGNO to ENDREGNO are the subjects of a
|
||||
REG_INC note in insn INSN. REGNO must refer to a hard register. */
|
||||
|
||||
#ifdef AUTO_INC_DEC
|
||||
#if AUTO_INC_DEC
|
||||
static int
|
||||
reg_inc_found_and_valid_p (unsigned int regno, unsigned int endregno,
|
||||
rtx insn)
|
||||
|
|
|
|||
|
|
@ -417,7 +417,7 @@ static void delete_output_reload (rtx_insn *, int, int, rtx);
|
|||
static void delete_address_reloads (rtx_insn *, rtx_insn *);
|
||||
static void delete_address_reloads_1 (rtx_insn *, rtx, rtx_insn *);
|
||||
static void inc_for_reload (rtx, rtx, rtx, int);
|
||||
#ifdef AUTO_INC_DEC
|
||||
#if AUTO_INC_DEC
|
||||
static void add_auto_inc_notes (rtx_insn *, rtx);
|
||||
#endif
|
||||
static void substitute (rtx *, const_rtx, rtx);
|
||||
|
|
@ -1250,7 +1250,7 @@ reload (rtx_insn *first, int global)
|
|||
pnote = &XEXP (*pnote, 1);
|
||||
}
|
||||
|
||||
#ifdef AUTO_INC_DEC
|
||||
#if AUTO_INC_DEC
|
||||
add_auto_inc_notes (insn, PATTERN (insn));
|
||||
#endif
|
||||
|
||||
|
|
@ -4581,7 +4581,7 @@ static void
|
|||
reload_as_needed (int live_known)
|
||||
{
|
||||
struct insn_chain *chain;
|
||||
#if defined (AUTO_INC_DEC)
|
||||
#if AUTO_INC_DEC
|
||||
int i;
|
||||
#endif
|
||||
rtx_note *marker;
|
||||
|
|
@ -4604,7 +4604,7 @@ reload_as_needed (int live_known)
|
|||
rtx_insn *prev = 0;
|
||||
rtx_insn *insn = chain->insn;
|
||||
rtx_insn *old_next = NEXT_INSN (insn);
|
||||
#ifdef AUTO_INC_DEC
|
||||
#if AUTO_INC_DEC
|
||||
rtx_insn *old_prev = PREV_INSN (insn);
|
||||
#endif
|
||||
|
||||
|
|
@ -4749,7 +4749,7 @@ reload_as_needed (int live_known)
|
|||
if (NONJUMP_INSN_P (x) && GET_CODE (PATTERN (x)) == CLOBBER)
|
||||
note_stores (PATTERN (x), forget_old_reloads_1, NULL);
|
||||
|
||||
#ifdef AUTO_INC_DEC
|
||||
#if AUTO_INC_DEC
|
||||
/* Likewise for regs altered by auto-increment in this insn.
|
||||
REG_INC notes have been changed by reloading:
|
||||
find_reloads_address_1 records substitutions for them,
|
||||
|
|
@ -6606,7 +6606,7 @@ choose_reload_regs (struct insn_chain *chain)
|
|||
}
|
||||
mode = GET_MODE (rld[r].in_reg);
|
||||
}
|
||||
#ifdef AUTO_INC_DEC
|
||||
#if AUTO_INC_DEC
|
||||
else if (GET_RTX_CLASS (GET_CODE (rld[r].in_reg)) == RTX_AUTOINC
|
||||
&& REG_P (XEXP (rld[r].in_reg, 0)))
|
||||
{
|
||||
|
|
@ -7397,7 +7397,7 @@ emit_input_reload_insns (struct insn_chain *chain, struct reload *rl,
|
|||
is ill-formed and we must reject this optimization. */
|
||||
extract_insn (temp);
|
||||
if (constrain_operands (1, get_enabled_alternatives (temp))
|
||||
#ifdef AUTO_INC_DEC
|
||||
#if AUTO_INC_DEC
|
||||
&& ! find_reg_note (temp, REG_INC, reloadreg)
|
||||
#endif
|
||||
)
|
||||
|
|
@ -8870,7 +8870,7 @@ delete_output_reload (rtx_insn *insn, int j, int last_reload_reg,
|
|||
continue;
|
||||
if (MEM_P (reg2) || reload_override_in[k])
|
||||
reg2 = rld[k].in_reg;
|
||||
#ifdef AUTO_INC_DEC
|
||||
#if AUTO_INC_DEC
|
||||
if (rld[k].out && ! rld[k].out_reg)
|
||||
reg2 = XEXP (rld[k].in_reg, 0);
|
||||
#endif
|
||||
|
|
@ -9266,7 +9266,7 @@ inc_for_reload (rtx reloadreg, rtx in, rtx value, int inc_amount)
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef AUTO_INC_DEC
|
||||
#if AUTO_INC_DEC
|
||||
static void
|
||||
add_auto_inc_notes (rtx_insn *insn, rtx x)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2518,13 +2518,15 @@ do { \
|
|||
|| defined (HAVE_POST_INCREMENT) || defined (HAVE_POST_DECREMENT) \
|
||||
|| defined (HAVE_PRE_MODIFY_DISP) || defined (HAVE_POST_MODIFY_DISP) \
|
||||
|| defined (HAVE_PRE_MODIFY_REG) || defined (HAVE_POST_MODIFY_REG))
|
||||
#define AUTO_INC_DEC
|
||||
#define AUTO_INC_DEC 1
|
||||
#else
|
||||
#define AUTO_INC_DEC 0
|
||||
#endif
|
||||
|
||||
/* Define a macro to look for REG_INC notes,
|
||||
but save time on machines where they never exist. */
|
||||
|
||||
#ifdef AUTO_INC_DEC
|
||||
#if AUTO_INC_DEC
|
||||
#define FIND_REG_INC_NOTE(INSN, REG) \
|
||||
((REG) != NULL_RTX && REG_P ((REG)) \
|
||||
? find_regno_note ((INSN), REG_INC, REGNO (REG)) \
|
||||
|
|
|
|||
|
|
@ -2222,7 +2222,7 @@ init_insn_reg_pressure_info (rtx_insn *insn)
|
|||
|
||||
note_stores (PATTERN (insn), mark_insn_reg_store, insn);
|
||||
|
||||
#ifdef AUTO_INC_DEC
|
||||
#if AUTO_INC_DEC
|
||||
for (link = REG_NOTES (insn); link; link = XEXP (link, 1))
|
||||
if (REG_NOTE_KIND (link) == REG_INC)
|
||||
mark_insn_reg_store (XEXP (link, 0), NULL_RTX, insn);
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ static rtx
|
|||
cleanup_auto_inc_dec (rtx src, machine_mode mem_mode ATTRIBUTE_UNUSED)
|
||||
{
|
||||
rtx x = src;
|
||||
#ifdef AUTO_INC_DEC
|
||||
#if AUTO_INC_DEC
|
||||
const RTX_CODE code = GET_CODE (x);
|
||||
int i;
|
||||
const char *fmt;
|
||||
|
|
|
|||
Loading…
Reference in New Issue