* df-problems.c (df_set_note): Avoid C++ keywords.
* df-scan.c (df_ref_change_reg_with_loc_1): Likewise.
* dse.c (record_store, remove_useless_values): Likewise.
* emit-rtl.c (gen_reg_rtx, update_reg_offset, gen_rtx_REG_offset,
gen_reg_rtx_offset, operand_subword, change_address_1,
change_address, adjust_address_1, offset_address,
widen_memory_access, emit_copy_of_insn_after): Likewise.
* explow.c (round_push, allocate_dynamic_stack_space): Likewise.
* fwprop.c (should_replace_address, propagate_rtx_1,
propagate_rtx, try_fwprop_subst, forward_propagate_and_simplify):
Likewise.
* gcse.c (cprop_jump, find_implicit_sets, bypass_block,
gcse_emit_move_after, update_ld_motion_stores): Likewise.
* lcm.c (compute_insert_delete, pre_edge_lcm,
compute_rev_insert_delete, pre_edge_rev_lcm): Likewise.
* lower-subreg.c (resolve_reg_notes): Likewise.
* mode-switching.c (optimize_mode_switching): Likewise.
From-SVN: r137848
+2008-07-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * df-problems.c (df_set_note): Avoid C++ keywords.
+ * df-scan.c (df_ref_change_reg_with_loc_1): Likewise.
+ * dse.c (record_store, remove_useless_values): Likewise.
+ * emit-rtl.c (gen_reg_rtx, update_reg_offset, gen_rtx_REG_offset,
+ gen_reg_rtx_offset, operand_subword, change_address_1,
+ change_address, adjust_address_1, offset_address,
+ widen_memory_access, emit_copy_of_insn_after): Likewise.
+ * explow.c (round_push, allocate_dynamic_stack_space): Likewise.
+ * fwprop.c (should_replace_address, propagate_rtx_1,
+ propagate_rtx, try_fwprop_subst, forward_propagate_and_simplify):
+ Likewise.
+ * gcse.c (cprop_jump, find_implicit_sets, bypass_block,
+ gcse_emit_move_after, update_ld_motion_stores): Likewise.
+ * lcm.c (compute_insert_delete, pre_edge_lcm,
+ compute_rev_insert_delete, pre_edge_rev_lcm): Likewise.
+ * lower-subreg.c (resolve_reg_notes): Likewise.
+ * mode-switching.c (optimize_mode_switching): Likewise.
+
2008-07-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* bt-load.c (add_btr_def, migrate_btr_def,
static inline rtx
df_set_note (enum reg_note note_type, rtx insn, rtx old, rtx reg)
{
- rtx this = old;
+ rtx curr = old;
rtx prev = NULL;
- while (this)
- if (XEXP (this, 0) == reg)
+ while (curr)
+ if (XEXP (curr, 0) == reg)
{
if (prev)
- XEXP (prev, 1) = XEXP (this, 1);
+ XEXP (prev, 1) = XEXP (curr, 1);
else
- old = XEXP (this, 1);
- XEXP (this, 1) = REG_NOTES (insn);
- REG_NOTES (insn) = this;
+ old = XEXP (curr, 1);
+ XEXP (curr, 1) = REG_NOTES (insn);
+ REG_NOTES (insn) = curr;
return old;
}
else
{
- prev = this;
- this = XEXP (this, 1);
+ prev = curr;
+ curr = XEXP (curr, 1);
}
/* Did not find the note. */
/* Helper function for df_ref_change_reg_with_loc. */
static void
-df_ref_change_reg_with_loc_1 (struct df_reg_info *old, struct df_reg_info *new,
+df_ref_change_reg_with_loc_1 (struct df_reg_info *old_df, struct df_reg_info *new_df,
int new_regno, rtx loc)
{
- struct df_ref *the_ref = old->reg_chain;
+ struct df_ref *the_ref = old_df->reg_chain;
while (the_ref)
{
if (prev_ref)
prev_ref->next_reg = next_ref;
else
- old->reg_chain = next_ref;
+ old_df->reg_chain = next_ref;
if (next_ref)
next_ref->prev_reg = prev_ref;
- old->n_refs--;
+ old_df->n_refs--;
/* Put the ref into the new regno chain. */
the_ref->prev_reg = NULL;
- the_ref->next_reg = new->reg_chain;
- if (new->reg_chain)
- new->reg_chain->prev_reg = the_ref;
- new->reg_chain = the_ref;
- new->n_refs++;
+ the_ref->next_reg = new_df->reg_chain;
+ if (new_df->reg_chain)
+ new_df->reg_chain->prev_reg = the_ref;
+ new_df->reg_chain = the_ref;
+ new_df->n_refs++;
df_set_bb_dirty (DF_REF_BB (the_ref));
/* Need to resort the record that the ref was in because the
{
insn_info_t next = ptr->next_local_store;
store_info_t s_info = ptr->store_rec;
- bool delete = true;
+ bool del = true;
/* Skip the clobbers. We delete the active insn if this insn
shadows the set. To have been put on the active list, it
s_info = s_info->next;
if (s_info->alias_set != spill_alias_set)
- delete = false;
+ del = false;
else if (s_info->alias_set)
{
struct clear_alias_mode_holder *entry
if ((GET_MODE (mem) == GET_MODE (s_info->mem))
&& (GET_MODE (mem) == entry->mode))
{
- delete = true;
+ del = true;
s_info->positions_needed = (unsigned HOST_WIDE_INT) 0;
}
if (dump_file)
/* An insn can be deleted if every position of every one of
its s_infos is zero. */
if (s_info->positions_needed != (unsigned HOST_WIDE_INT) 0)
- delete = false;
+ del = false;
- if (delete)
+ if (del)
{
insn_info_t insn_to_delete = ptr;
while (insn_info)
{
store_info_t store_info = insn_info->store_rec;
- bool delete = false;
+ bool del = false;
/* If ANY of the store_infos match the cselib group that is
being deleted, then the insn can not be deleted. */
if ((store_info->group_id == -1)
&& (store_info->cse_base == base))
{
- delete = true;
+ del = true;
break;
}
store_info = store_info->next;
}
- if (delete)
+ if (del)
{
if (last)
last->next_local_store = insn_info->next_local_store;
if (reg_rtx_no == crtl->emit.regno_pointer_align_length)
{
int old_size = crtl->emit.regno_pointer_align_length;
- char *new;
+ char *tmp;
rtx *new1;
- new = XRESIZEVEC (char, crtl->emit.regno_pointer_align, old_size * 2);
- memset (new + old_size, 0, old_size);
- crtl->emit.regno_pointer_align = (unsigned char *) new;
+ tmp = XRESIZEVEC (char, crtl->emit.regno_pointer_align, old_size * 2);
+ memset (tmp + old_size, 0, old_size);
+ crtl->emit.regno_pointer_align = (unsigned char *) tmp;
new1 = GGC_RESIZEVEC (rtx, regno_reg_rtx, old_size * 2);
memset (new1 + old_size, 0, old_size * sizeof (rtx));
to the REG_OFFSET. */
static void
-update_reg_offset (rtx new, rtx reg, int offset)
+update_reg_offset (rtx new_rtx, rtx reg, int offset)
{
- REG_ATTRS (new) = get_reg_attrs (REG_EXPR (reg),
+ REG_ATTRS (new_rtx) = get_reg_attrs (REG_EXPR (reg),
REG_OFFSET (reg) + offset);
}
gen_rtx_REG_offset (rtx reg, enum machine_mode mode, unsigned int regno,
int offset)
{
- rtx new = gen_rtx_REG (mode, regno);
+ rtx new_rtx = gen_rtx_REG (mode, regno);
- update_reg_offset (new, reg, offset);
- return new;
+ update_reg_offset (new_rtx, reg, offset);
+ return new_rtx;
}
/* Generate a new pseudo-register with the same attributes as REG, but
rtx
gen_reg_rtx_offset (rtx reg, enum machine_mode mode, int offset)
{
- rtx new = gen_reg_rtx (mode);
+ rtx new_rtx = gen_reg_rtx (mode);
- update_reg_offset (new, reg, offset);
- return new;
+ update_reg_offset (new_rtx, reg, offset);
+ return new_rtx;
}
/* Adjust REG in-place so that it has mode MODE. It is assumed that the
/* Form a new MEM at the requested address. */
if (MEM_P (op))
{
- rtx new = adjust_address_nv (op, word_mode, offset * UNITS_PER_WORD);
+ rtx new_rtx = adjust_address_nv (op, word_mode, offset * UNITS_PER_WORD);
if (! validate_address)
- return new;
+ return new_rtx;
else if (reload_completed)
{
- if (! strict_memory_address_p (word_mode, XEXP (new, 0)))
+ if (! strict_memory_address_p (word_mode, XEXP (new_rtx, 0)))
return 0;
}
else
- return replace_equiv_address (new, XEXP (new, 0));
+ return replace_equiv_address (new_rtx, XEXP (new_rtx, 0));
}
/* Rest can be handled by simplify_subreg. */
static rtx
change_address_1 (rtx memref, enum machine_mode mode, rtx addr, int validate)
{
- rtx new;
+ rtx new_rtx;
gcc_assert (MEM_P (memref));
if (mode == VOIDmode)
if (rtx_equal_p (addr, XEXP (memref, 0)) && mode == GET_MODE (memref))
return memref;
- new = gen_rtx_MEM (mode, addr);
- MEM_COPY_ATTRIBUTES (new, memref);
- return new;
+ new_rtx = gen_rtx_MEM (mode, addr);
+ MEM_COPY_ATTRIBUTES (new_rtx, memref);
+ return new_rtx;
}
/* Like change_address_1 with VALIDATE nonzero, but we are not saying in what
rtx
change_address (rtx memref, enum machine_mode mode, rtx addr)
{
- rtx new = change_address_1 (memref, mode, addr, 1), size;
- enum machine_mode mmode = GET_MODE (new);
+ rtx new_rtx = change_address_1 (memref, mode, addr, 1), size;
+ enum machine_mode mmode = GET_MODE (new_rtx);
unsigned int align;
size = mmode == BLKmode ? 0 : GEN_INT (GET_MODE_SIZE (mmode));
align = mmode == BLKmode ? BITS_PER_UNIT : GET_MODE_ALIGNMENT (mmode);
/* If there are no changes, just return the original memory reference. */
- if (new == memref)
+ if (new_rtx == memref)
{
if (MEM_ATTRS (memref) == 0
|| (MEM_EXPR (memref) == NULL
&& MEM_OFFSET (memref) == NULL
&& MEM_SIZE (memref) == size
&& MEM_ALIGN (memref) == align))
- return new;
+ return new_rtx;
- new = gen_rtx_MEM (mmode, XEXP (memref, 0));
- MEM_COPY_ATTRIBUTES (new, memref);
+ new_rtx = gen_rtx_MEM (mmode, XEXP (memref, 0));
+ MEM_COPY_ATTRIBUTES (new_rtx, memref);
}
- MEM_ATTRS (new)
+ MEM_ATTRS (new_rtx)
= get_mem_attrs (MEM_ALIAS_SET (memref), 0, 0, size, align, mmode);
- return new;
+ return new_rtx;
}
/* Return a memory reference like MEMREF, but with its mode changed
int validate, int adjust)
{
rtx addr = XEXP (memref, 0);
- rtx new;
+ rtx new_rtx;
rtx memoffset = MEM_OFFSET (memref);
rtx size = 0;
unsigned int memalign = MEM_ALIGN (memref);
addr = plus_constant (addr, offset);
}
- new = change_address_1 (memref, mode, addr, validate);
+ new_rtx = change_address_1 (memref, mode, addr, validate);
/* Compute the new values of the memory attributes due to this adjustment.
We add the offsets and update the alignment. */
(unsigned HOST_WIDE_INT) (offset & -offset) * BITS_PER_UNIT);
/* We can compute the size in a number of ways. */
- if (GET_MODE (new) != BLKmode)
- size = GEN_INT (GET_MODE_SIZE (GET_MODE (new)));
+ if (GET_MODE (new_rtx) != BLKmode)
+ size = GEN_INT (GET_MODE_SIZE (GET_MODE (new_rtx)));
else if (MEM_SIZE (memref))
size = plus_constant (MEM_SIZE (memref), -offset);
- MEM_ATTRS (new) = get_mem_attrs (MEM_ALIAS_SET (memref), MEM_EXPR (memref),
- memoffset, size, memalign, GET_MODE (new));
+ MEM_ATTRS (new_rtx) = get_mem_attrs (MEM_ALIAS_SET (memref), MEM_EXPR (memref),
+ memoffset, size, memalign, GET_MODE (new_rtx));
/* At some point, we should validate that this offset is within the object,
if all the appropriate values are known. */
- return new;
+ return new_rtx;
}
/* Return a memory reference like MEMREF, but with its mode changed
rtx
offset_address (rtx memref, rtx offset, unsigned HOST_WIDE_INT pow2)
{
- rtx new, addr = XEXP (memref, 0);
+ rtx new_rtx, addr = XEXP (memref, 0);
- new = simplify_gen_binary (PLUS, Pmode, addr, offset);
+ new_rtx = simplify_gen_binary (PLUS, Pmode, addr, offset);
/* At this point we don't know _why_ the address is invalid. It
could have secondary memory references, multiplies or anything.
being able to recognize the magic around pic_offset_table_rtx.
This stuff is fragile, and is yet another example of why it is
bad to expose PIC machinery too early. */
- if (! memory_address_p (GET_MODE (memref), new)
+ if (! memory_address_p (GET_MODE (memref), new_rtx)
&& GET_CODE (addr) == PLUS
&& XEXP (addr, 0) == pic_offset_table_rtx)
{
addr = force_reg (GET_MODE (addr), addr);
- new = simplify_gen_binary (PLUS, Pmode, addr, offset);
+ new_rtx = simplify_gen_binary (PLUS, Pmode, addr, offset);
}
- update_temp_slot_address (XEXP (memref, 0), new);
- new = change_address_1 (memref, VOIDmode, new, 1);
+ update_temp_slot_address (XEXP (memref, 0), new_rtx);
+ new_rtx = change_address_1 (memref, VOIDmode, new_rtx, 1);
/* If there are no changes, just return the original memory reference. */
- if (new == memref)
- return new;
+ if (new_rtx == memref)
+ return new_rtx;
/* Update the alignment to reflect the offset. Reset the offset, which
we don't know. */
- MEM_ATTRS (new)
+ MEM_ATTRS (new_rtx)
= get_mem_attrs (MEM_ALIAS_SET (memref), MEM_EXPR (memref), 0, 0,
MIN (MEM_ALIGN (memref), pow2 * BITS_PER_UNIT),
- GET_MODE (new));
- return new;
+ GET_MODE (new_rtx));
+ return new_rtx;
}
/* Return a memory reference like MEMREF, but with its address changed to
rtx
widen_memory_access (rtx memref, enum machine_mode mode, HOST_WIDE_INT offset)
{
- rtx new = adjust_address_1 (memref, mode, offset, 1, 1);
- tree expr = MEM_EXPR (new);
- rtx memoffset = MEM_OFFSET (new);
+ rtx new_rtx = adjust_address_1 (memref, mode, offset, 1, 1);
+ tree expr = MEM_EXPR (new_rtx);
+ rtx memoffset = MEM_OFFSET (new_rtx);
unsigned int size = GET_MODE_SIZE (mode);
/* If there are no changes, just return the original memory reference. */
- if (new == memref)
- return new;
+ if (new_rtx == memref)
+ return new_rtx;
/* If we don't know what offset we were at within the expression, then
we can't know if we've overstepped the bounds. */
/* The widened memory may alias other stuff, so zap the alias set. */
/* ??? Maybe use get_alias_set on any remaining expression. */
- MEM_ATTRS (new) = get_mem_attrs (0, expr, memoffset, GEN_INT (size),
- MEM_ALIGN (new), mode);
+ MEM_ATTRS (new_rtx) = get_mem_attrs (0, expr, memoffset, GEN_INT (size),
+ MEM_ALIGN (new_rtx), mode);
- return new;
+ return new_rtx;
}
\f
/* Return a newly created CODE_LABEL rtx with a unique label number. */
rtx
emit_copy_of_insn_after (rtx insn, rtx after)
{
- rtx new, link;
+ rtx new_rtx, link;
switch (GET_CODE (insn))
{
case INSN:
- new = emit_insn_after (copy_insn (PATTERN (insn)), after);
+ new_rtx = emit_insn_after (copy_insn (PATTERN (insn)), after);
break;
case JUMP_INSN:
- new = emit_jump_insn_after (copy_insn (PATTERN (insn)), after);
+ new_rtx = emit_jump_insn_after (copy_insn (PATTERN (insn)), after);
break;
case CALL_INSN:
- new = emit_call_insn_after (copy_insn (PATTERN (insn)), after);
+ new_rtx = emit_call_insn_after (copy_insn (PATTERN (insn)), after);
if (CALL_INSN_FUNCTION_USAGE (insn))
- CALL_INSN_FUNCTION_USAGE (new)
+ CALL_INSN_FUNCTION_USAGE (new_rtx)
= copy_insn (CALL_INSN_FUNCTION_USAGE (insn));
- SIBLING_CALL_P (new) = SIBLING_CALL_P (insn);
- RTL_CONST_CALL_P (new) = RTL_CONST_CALL_P (insn);
- RTL_PURE_CALL_P (new) = RTL_PURE_CALL_P (insn);
- RTL_LOOPING_CONST_OR_PURE_CALL_P (new)
+ SIBLING_CALL_P (new_rtx) = SIBLING_CALL_P (insn);
+ RTL_CONST_CALL_P (new_rtx) = RTL_CONST_CALL_P (insn);
+ RTL_PURE_CALL_P (new_rtx) = RTL_PURE_CALL_P (insn);
+ RTL_LOOPING_CONST_OR_PURE_CALL_P (new_rtx)
= RTL_LOOPING_CONST_OR_PURE_CALL_P (insn);
break;
}
/* Update LABEL_NUSES. */
- mark_jump_label (PATTERN (new), new, 0);
+ mark_jump_label (PATTERN (new_rtx), new_rtx, 0);
- INSN_LOCATOR (new) = INSN_LOCATOR (insn);
+ INSN_LOCATOR (new_rtx) = INSN_LOCATOR (insn);
/* If the old insn is frame related, then so is the new one. This is
primarily needed for IA-64 unwind info which marks epilogue insns,
which may be duplicated by the basic block reordering code. */
- RTX_FRAME_RELATED_P (new) = RTX_FRAME_RELATED_P (insn);
+ RTX_FRAME_RELATED_P (new_rtx) = RTX_FRAME_RELATED_P (insn);
/* Copy all REG_NOTES except REG_LABEL_OPERAND since mark_jump_label
will make them. REG_LABEL_TARGETs are created there too, but are
if (REG_NOTE_KIND (link) != REG_LABEL_OPERAND)
{
if (GET_CODE (link) == EXPR_LIST)
- add_reg_note (new, REG_NOTE_KIND (link),
+ add_reg_note (new_rtx, REG_NOTE_KIND (link),
copy_insn_1 (XEXP (link, 0)));
else
- add_reg_note (new, REG_NOTE_KIND (link), XEXP (link, 0));
+ add_reg_note (new_rtx, REG_NOTE_KIND (link), XEXP (link, 0));
}
- INSN_CODE (new) = INSN_CODE (insn);
- return new;
+ INSN_CODE (new_rtx) = INSN_CODE (insn);
+ return new_rtx;
}
static GTY((deletable)) rtx hard_reg_clobbers [NUM_MACHINE_MODES][FIRST_PSEUDO_REGISTER];
if (GET_CODE (size) == CONST_INT)
{
- HOST_WIDE_INT new = (INTVAL (size) + align - 1) / align * align;
+ HOST_WIDE_INT new_size = (INTVAL (size) + align - 1) / align * align;
- if (INTVAL (size) != new)
- size = GEN_INT (new);
+ if (INTVAL (size) != new_size)
+ size = GEN_INT (new_size);
}
else
{
if (GET_CODE (size) == CONST_INT)
{
- HOST_WIDE_INT new = INTVAL (size) / align * align;
+ HOST_WIDE_INT new_size = INTVAL (size) / align * align;
- if (INTVAL (size) != new)
- size = GEN_INT (new);
+ if (INTVAL (size) != new_size)
+ size = GEN_INT (new_size);
}
else
{
for a memory access in the given MODE. */
static bool
-should_replace_address (rtx old, rtx new, enum machine_mode mode)
+should_replace_address (rtx old_rtx, rtx new_rtx, enum machine_mode mode)
{
int gain;
- if (rtx_equal_p (old, new) || !memory_address_p (mode, new))
+ if (rtx_equal_p (old_rtx, new_rtx) || !memory_address_p (mode, new_rtx))
return false;
/* Copy propagation is always ok. */
- if (REG_P (old) && REG_P (new))
+ if (REG_P (old_rtx) && REG_P (new_rtx))
return true;
/* Prefer the new address if it is less expensive. */
- gain = address_cost (old, mode) - address_cost (new, mode);
+ gain = address_cost (old_rtx, mode) - address_cost (new_rtx, mode);
/* If the addresses have equivalent cost, prefer the new address
if it has the highest `rtx_cost'. That has the potential of
eliminating the most insns without additional costs, and it
is the same that cse.c used to do. */
if (gain == 0)
- gain = rtx_cost (new, SET) - rtx_cost (old, SET);
+ gain = rtx_cost (new_rtx, SET) - rtx_cost (old_rtx, SET);
return (gain > 0);
}
that is because there is no simplify_gen_* function for LO_SUM). */
static bool
-propagate_rtx_1 (rtx *px, rtx old, rtx new, int flags)
+propagate_rtx_1 (rtx *px, rtx old_rtx, rtx new_rtx, int flags)
{
rtx x = *px, tem = NULL_RTX, op0, op1, op2;
enum rtx_code code = GET_CODE (x);
/* If X is OLD_RTX, return NEW_RTX. But not if replacing only within an
address, and we are *not* inside one. */
- if (x == old)
+ if (x == old_rtx)
{
- *px = new;
+ *px = new_rtx;
return can_appear;
}
case RTX_UNARY:
op0 = XEXP (x, 0);
op_mode = GET_MODE (op0);
- valid_ops &= propagate_rtx_1 (&op0, old, new, flags);
+ valid_ops &= propagate_rtx_1 (&op0, old_rtx, new_rtx, flags);
if (op0 == XEXP (x, 0))
return true;
tem = simplify_gen_unary (code, mode, op0, op_mode);
case RTX_COMM_ARITH:
op0 = XEXP (x, 0);
op1 = XEXP (x, 1);
- valid_ops &= propagate_rtx_1 (&op0, old, new, flags);
- valid_ops &= propagate_rtx_1 (&op1, old, new, flags);
+ valid_ops &= propagate_rtx_1 (&op0, old_rtx, new_rtx, flags);
+ valid_ops &= propagate_rtx_1 (&op1, old_rtx, new_rtx, flags);
if (op0 == XEXP (x, 0) && op1 == XEXP (x, 1))
return true;
tem = simplify_gen_binary (code, mode, op0, op1);
op0 = XEXP (x, 0);
op1 = XEXP (x, 1);
op_mode = GET_MODE (op0) != VOIDmode ? GET_MODE (op0) : GET_MODE (op1);
- valid_ops &= propagate_rtx_1 (&op0, old, new, flags);
- valid_ops &= propagate_rtx_1 (&op1, old, new, flags);
+ valid_ops &= propagate_rtx_1 (&op0, old_rtx, new_rtx, flags);
+ valid_ops &= propagate_rtx_1 (&op1, old_rtx, new_rtx, flags);
if (op0 == XEXP (x, 0) && op1 == XEXP (x, 1))
return true;
tem = simplify_gen_relational (code, mode, op_mode, op0, op1);
op1 = XEXP (x, 1);
op2 = XEXP (x, 2);
op_mode = GET_MODE (op0);
- valid_ops &= propagate_rtx_1 (&op0, old, new, flags);
- valid_ops &= propagate_rtx_1 (&op1, old, new, flags);
- valid_ops &= propagate_rtx_1 (&op2, old, new, flags);
+ valid_ops &= propagate_rtx_1 (&op0, old_rtx, new_rtx, flags);
+ valid_ops &= propagate_rtx_1 (&op1, old_rtx, new_rtx, flags);
+ valid_ops &= propagate_rtx_1 (&op2, old_rtx, new_rtx, flags);
if (op0 == XEXP (x, 0) && op1 == XEXP (x, 1) && op2 == XEXP (x, 2))
return true;
if (op_mode == VOIDmode)
if (code == SUBREG)
{
op0 = XEXP (x, 0);
- valid_ops &= propagate_rtx_1 (&op0, old, new, flags);
+ valid_ops &= propagate_rtx_1 (&op0, old_rtx, new_rtx, flags);
if (op0 == XEXP (x, 0))
return true;
tem = simplify_gen_subreg (mode, op0, GET_MODE (SUBREG_REG (x)),
break;
case RTX_OBJ:
- if (code == MEM && x != new)
+ if (code == MEM && x != new_rtx)
{
rtx new_op0;
op0 = XEXP (x, 0);
return true;
op0 = new_op0 = targetm.delegitimize_address (op0);
- valid_ops &= propagate_rtx_1 (&new_op0, old, new,
+ valid_ops &= propagate_rtx_1 (&new_op0, old_rtx, new_rtx,
flags | PR_CAN_APPEAR);
/* Dismiss transformation that we do not want to carry on. */
canonicalize_address (new_op0);
/* Copy propagations are always ok. Otherwise check the costs. */
- if (!(REG_P (old) && REG_P (new))
+ if (!(REG_P (old_rtx) && REG_P (new_rtx))
&& !should_replace_address (op0, new_op0, GET_MODE (x)))
return true;
/* The only simplification we do attempts to remove references to op0
or make it constant -- in both cases, op0's invalidity will not
make the result invalid. */
- propagate_rtx_1 (&op0, old, new, flags | PR_CAN_APPEAR);
- valid_ops &= propagate_rtx_1 (&op1, old, new, flags);
+ propagate_rtx_1 (&op0, old_rtx, new_rtx, flags | PR_CAN_APPEAR);
+ valid_ops &= propagate_rtx_1 (&op1, old_rtx, new_rtx, flags);
if (op0 == XEXP (x, 0) && op1 == XEXP (x, 1))
return true;
else if (code == REG)
{
- if (rtx_equal_p (x, old))
+ if (rtx_equal_p (x, old_rtx))
{
- *px = new;
+ *px = new_rtx;
return can_appear;
}
}
Otherwise, we accept simplifications that have a lower or equal cost. */
static rtx
-propagate_rtx (rtx x, enum machine_mode mode, rtx old, rtx new)
+propagate_rtx (rtx x, enum machine_mode mode, rtx old_rtx, rtx new_rtx)
{
rtx tem;
bool collapsed;
int flags;
- if (REG_P (new) && REGNO (new) < FIRST_PSEUDO_REGISTER)
+ if (REG_P (new_rtx) && REGNO (new_rtx) < FIRST_PSEUDO_REGISTER)
return NULL_RTX;
flags = 0;
- if (REG_P (new) || CONSTANT_P (new))
+ if (REG_P (new_rtx) || CONSTANT_P (new_rtx))
flags |= PR_CAN_APPEAR;
- if (!for_each_rtx (&new, varying_mem_p, NULL))
+ if (!for_each_rtx (&new_rtx, varying_mem_p, NULL))
flags |= PR_HANDLE_MEM;
tem = x;
- collapsed = propagate_rtx_1 (&tem, old, copy_rtx (new), flags);
+ collapsed = propagate_rtx_1 (&tem, old_rtx, copy_rtx (new_rtx), flags);
if (tem == x || !collapsed)
return NULL_RTX;
performed. */
static bool
-try_fwprop_subst (struct df_ref *use, rtx *loc, rtx new, rtx def_insn, bool set_reg_equal)
+try_fwprop_subst (struct df_ref *use, rtx *loc, rtx new_rtx, rtx def_insn, bool set_reg_equal)
{
rtx insn = DF_REF_INSN (use);
enum df_ref_type type = DF_REF_TYPE (use);
fprintf (dump_file, "\nIn insn %d, replacing\n ", INSN_UID (insn));
print_inline_rtx (dump_file, *loc, 2);
fprintf (dump_file, "\n with ");
- print_inline_rtx (dump_file, new, 2);
+ print_inline_rtx (dump_file, new_rtx, 2);
fprintf (dump_file, "\n");
}
- validate_unshare_change (insn, loc, new, true);
+ validate_unshare_change (insn, loc, new_rtx, true);
if (!verify_changes (0))
{
if (dump_file)
num_changes++;
df_ref_remove (use);
- if (!CONSTANT_P (new))
+ if (!CONSTANT_P (new_rtx))
{
struct df_insn_info *insn_info = DF_INSN_INFO_GET (def_insn);
update_df (insn, loc, DF_INSN_INFO_USES (insn_info), type, flags);
if (dump_file)
fprintf (dump_file, " Setting REG_EQUAL note\n");
- set_unique_reg_note (insn, REG_EQUAL, copy_rtx (new));
+ set_unique_reg_note (insn, REG_EQUAL, copy_rtx (new_rtx));
/* ??? Is this still necessary if we add the note through
set_unique_reg_note? */
- if (!CONSTANT_P (new))
+ if (!CONSTANT_P (new_rtx))
{
struct df_insn_info *insn_info = DF_INSN_INFO_GET (def_insn);
update_df (insn, loc, DF_INSN_INFO_USES (insn_info),
{
rtx use_insn = DF_REF_INSN (use);
rtx use_set = single_set (use_insn);
- rtx src, reg, new, *loc;
+ rtx src, reg, new_rtx, *loc;
bool set_reg_equal;
enum machine_mode mode;
if (x != src)
{
rtx note = find_reg_note (use_insn, REG_EQUAL, NULL_RTX);
- rtx old = note ? XEXP (note, 0) : SET_SRC (use_set);
- rtx new = simplify_replace_rtx (old, src, x);
- if (old != new)
- set_unique_reg_note (use_insn, REG_EQUAL, copy_rtx (new));
+ rtx old_rtx = note ? XEXP (note, 0) : SET_SRC (use_set);
+ rtx new_rtx = simplify_replace_rtx (old_rtx, src, x);
+ if (old_rtx != new_rtx)
+ set_unique_reg_note (use_insn, REG_EQUAL, copy_rtx (new_rtx));
}
return false;
}
else
mode = GET_MODE (*loc);
- new = propagate_rtx (*loc, mode, reg, src);
+ new_rtx = propagate_rtx (*loc, mode, reg, src);
- if (!new)
+ if (!new_rtx)
return false;
- return try_fwprop_subst (use, loc, new, def_insn, set_reg_equal);
+ return try_fwprop_subst (use, loc, new_rtx, def_insn, set_reg_equal);
}
static int
cprop_jump (basic_block bb, rtx setcc, rtx jump, rtx from, rtx src)
{
- rtx new, set_src, note_src;
+ rtx new_rtx, set_src, note_src;
rtx set = pc_set (jump);
rtx note = find_reg_equal_equiv_note (jump);
else
setcc = NULL_RTX;
- new = simplify_replace_rtx (set_src, from, src);
+ new_rtx = simplify_replace_rtx (set_src, from, src);
/* If no simplification can be made, then try the next register. */
- if (rtx_equal_p (new, SET_SRC (set)))
+ if (rtx_equal_p (new_rtx, SET_SRC (set)))
return 0;
/* If this is now a no-op delete it, otherwise this must be a valid insn. */
- if (new == pc_rtx)
+ if (new_rtx == pc_rtx)
delete_insn (jump);
else
{
/* Ensure the value computed inside the jump insn to be equivalent
to one computed by setcc. */
- if (setcc && modified_in_p (new, setcc))
+ if (setcc && modified_in_p (new_rtx, setcc))
return 0;
- if (! validate_unshare_change (jump, &SET_SRC (set), new, 0))
+ if (! validate_unshare_change (jump, &SET_SRC (set), new_rtx, 0))
{
/* When (some) constants are not valid in a comparison, and there
are two registers to be replaced by constants before the entire
we need to attach a note to the branch itself to make this
optimization work. */
- if (!rtx_equal_p (new, note_src))
- set_unique_reg_note (jump, REG_EQUAL, copy_rtx (new));
+ if (!rtx_equal_p (new_rtx, note_src))
+ set_unique_reg_note (jump, REG_EQUAL, copy_rtx (new_rtx));
return 0;
}
/* If a conditional jump has been changed into unconditional jump, remove
the jump and make the edge fallthru - this is always called in
cfglayout mode. */
- if (new != pc_rtx && simplejump_p (jump))
+ if (new_rtx != pc_rtx && simplejump_p (jump))
{
edge e;
edge_iterator ei;
{
basic_block bb, dest;
unsigned int count;
- rtx cond, new;
+ rtx cond, new_rtx;
count = 0;
FOR_EACH_BB (bb)
if (dest && single_pred_p (dest)
&& dest != EXIT_BLOCK_PTR)
{
- new = gen_rtx_SET (VOIDmode, XEXP (cond, 0),
+ new_rtx = gen_rtx_SET (VOIDmode, XEXP (cond, 0),
XEXP (cond, 1));
- implicit_sets[dest->index] = new;
+ implicit_sets[dest->index] = new_rtx;
if (dump_file)
{
fprintf(dump_file, "Implicit set of reg %d in ",
unsigned int regno = REGNO (reg_used->reg_rtx);
basic_block dest, old_dest;
struct expr *set;
- rtx src, new;
+ rtx src, new_rtx;
if (regno >= max_gcse_regno)
continue;
SET_DEST (PATTERN (setcc)),
SET_SRC (PATTERN (setcc)));
- new = simplify_replace_rtx (src, reg_used->reg_rtx,
+ new_rtx = simplify_replace_rtx (src, reg_used->reg_rtx,
SET_SRC (set->expr));
/* Jump bypassing may have already placed instructions on
has instructions associated with it, as these insns won't
get executed if the incoming edge is redirected. */
- if (new == pc_rtx)
+ if (new_rtx == pc_rtx)
{
edest = FALLTHRU_EDGE (bb);
dest = edest->insns.r ? NULL : edest->dest;
}
- else if (GET_CODE (new) == LABEL_REF)
+ else if (GET_CODE (new_rtx) == LABEL_REF)
{
- dest = BLOCK_FOR_INSN (XEXP (new, 0));
+ dest = BLOCK_FOR_INSN (XEXP (new_rtx, 0));
/* Don't bypass edges containing instructions. */
edest = find_edge (bb, dest);
if (edest && edest->insns.r)
static rtx
gcse_emit_move_after (rtx src, rtx dest, rtx insn)
{
- rtx new;
+ rtx new_rtx;
rtx set = single_set (insn), set2;
rtx note;
rtx eqv;
/* This should never fail since we're creating a reg->reg copy
we've verified to be valid. */
- new = emit_insn_after (gen_move_insn (dest, src), insn);
+ new_rtx = emit_insn_after (gen_move_insn (dest, src), insn);
/* Note the equivalence for local CSE pass. */
- set2 = single_set (new);
+ set2 = single_set (new_rtx);
if (!set2 || !rtx_equal_p (SET_DEST (set2), dest))
- return new;
+ return new_rtx;
if ((note = find_reg_equal_equiv_note (insn)))
eqv = XEXP (note, 0);
else
eqv = SET_SRC (set);
- set_unique_reg_note (new, REG_EQUAL, copy_insn_1 (eqv));
+ set_unique_reg_note (new_rtx, REG_EQUAL, copy_insn_1 (eqv));
- return new;
+ return new_rtx;
}
/* Delete redundant computations.
rtx pat = PATTERN (insn);
rtx src = SET_SRC (pat);
rtx reg = expr->reaching_reg;
- rtx copy, new;
+ rtx copy, new_rtx;
/* If we've already copied it, continue. */
if (expr->reaching_reg == src)
}
copy = gen_move_insn ( reg, copy_rtx (SET_SRC (pat)));
- new = emit_insn_before (copy, insn);
- record_one_set (REGNO (reg), new);
+ new_rtx = emit_insn_before (copy, insn);
+ record_one_set (REGNO (reg), new_rtx);
SET_SRC (pat) = reg;
df_insn_rescan (insn);
static void
compute_insert_delete (struct edge_list *edge_list, sbitmap *antloc,
sbitmap *later, sbitmap *laterin, sbitmap *insert,
- sbitmap *delete)
+ sbitmap *del)
{
int x;
basic_block bb;
FOR_EACH_BB (bb)
- sbitmap_difference (delete[bb->index], antloc[bb->index],
+ sbitmap_difference (del[bb->index], antloc[bb->index],
laterin[bb->index]);
for (x = 0; x < NUM_EDGES (edge_list); x++)
struct edge_list *
pre_edge_lcm (int n_exprs, sbitmap *transp,
sbitmap *avloc, sbitmap *antloc, sbitmap *kill,
- sbitmap **insert, sbitmap **delete)
+ sbitmap **insert, sbitmap **del)
{
sbitmap *antin, *antout, *earliest;
sbitmap *avin, *avout;
sbitmap_vector_free (earliest);
*insert = sbitmap_vector_alloc (num_edges, n_exprs);
- *delete = sbitmap_vector_alloc (last_basic_block, n_exprs);
- compute_insert_delete (edge_list, antloc, later, laterin, *insert, *delete);
+ *del = sbitmap_vector_alloc (last_basic_block, n_exprs);
+ compute_insert_delete (edge_list, antloc, later, laterin, *insert, *del);
sbitmap_vector_free (laterin);
sbitmap_vector_free (later);
if (dump_file)
{
dump_sbitmap_vector (dump_file, "pre_insert_map", "", *insert, num_edges);
- dump_sbitmap_vector (dump_file, "pre_delete_map", "", *delete,
+ dump_sbitmap_vector (dump_file, "pre_delete_map", "", *del,
last_basic_block);
}
#endif
static void
compute_rev_insert_delete (struct edge_list *edge_list, sbitmap *st_avloc,
sbitmap *nearer, sbitmap *nearerout,
- sbitmap *insert, sbitmap *delete)
+ sbitmap *insert, sbitmap *del)
{
int x;
basic_block bb;
FOR_EACH_BB (bb)
- sbitmap_difference (delete[bb->index], st_avloc[bb->index],
+ sbitmap_difference (del[bb->index], st_avloc[bb->index],
nearerout[bb->index]);
for (x = 0; x < NUM_EDGES (edge_list); x++)
struct edge_list *
pre_edge_rev_lcm (int n_exprs, sbitmap *transp,
sbitmap *st_avloc, sbitmap *st_antloc, sbitmap *kill,
- sbitmap **insert, sbitmap **delete)
+ sbitmap **insert, sbitmap **del)
{
sbitmap *st_antin, *st_antout;
sbitmap *st_avout, *st_avin, *farthest;
sbitmap_vector_free (farthest);
*insert = sbitmap_vector_alloc (num_edges, n_exprs);
- *delete = sbitmap_vector_alloc (last_basic_block, n_exprs);
+ *del = sbitmap_vector_alloc (last_basic_block, n_exprs);
compute_rev_insert_delete (edge_list, st_avloc, nearer, nearerout,
- *insert, *delete);
+ *insert, *del);
sbitmap_vector_free (nearerout);
sbitmap_vector_free (nearer);
if (dump_file)
{
dump_sbitmap_vector (dump_file, "pre_insert_map", "", *insert, num_edges);
- dump_sbitmap_vector (dump_file, "pre_delete_map", "", *delete,
+ dump_sbitmap_vector (dump_file, "pre_delete_map", "", *del,
last_basic_block);
}
#endif
pnote = ®_NOTES (insn);
while (*pnote != NULL_RTX)
{
- bool delete = false;
+ bool del = false;
note = *pnote;
switch (REG_NOTE_KIND (note))
case REG_DEAD:
case REG_UNUSED:
if (resolve_reg_p (XEXP (note, 0)))
- delete = true;
+ del = true;
break;
default:
break;
}
- if (delete)
+ if (del)
*pnote = XEXP (note, 1);
else
pnote = &XEXP (note, 1);
for (i = 0; i < max_num_modes; i++)
{
int current_mode[N_ENTITIES];
- sbitmap *delete;
+ sbitmap *del;
sbitmap *insert;
/* Set the anticipatable and computing arrays. */
FOR_EACH_BB (bb)
sbitmap_not (kill[bb->index], transp[bb->index]);
edge_list = pre_edge_lcm (n_entities, transp, comp, antic,
- kill, &insert, &delete);
+ kill, &insert, &del);
for (j = n_entities - 1; j >= 0; j--)
{
}
FOR_EACH_BB_REVERSE (bb)
- if (TEST_BIT (delete[bb->index], j))
+ if (TEST_BIT (del[bb->index], j))
{
make_preds_opaque (bb, j);
/* Cancel the 'deleted' mode set. */
}
}
- sbitmap_vector_free (delete);
+ sbitmap_vector_free (del);
sbitmap_vector_free (insert);
clear_aux_for_edges ();
free_edge_list (edge_list);