2014-08-22 David Malcolm <dmalcolm@redhat.com>
+ * cprop.c (struct occr): Strengthen field "insn" from rtx to
+ rtx_insn *.
+ (reg_available_p): Likewise for param "insn".
+ (insert_set_in_table): Likewise.
+ (hash_scan_set): Likewise.
+ (hash_scan_insn): Likewise.
+ (make_set_regs_unavailable): Likewise.
+ (compute_hash_table_work): Likewise for local "insn".
+ (reg_not_set_p): Strengthen param "insn" from const_rtx to
+ const rtx_insn *.
+ (mark_oprs_set): Strengthen param "insn" from rtx to rtx_insn *.
+ (try_replace_reg): Likewise.
+ (find_avail_set): Likewise.
+ (cprop_jump): Likewise for params "setcc", "jump".
+ (constprop_register): Likewise for param "insn".
+ (cprop_insn): Likewise.
+ (do_local_cprop): Likewise.
+ (local_cprop_pass): Likewise for local "insn".
+ (bypass_block): Likewise for params "setcc" and "jump".
+ (bypass_conditional_jumps): Likewise for locals "setcc" and
+ "insn".
+ (one_cprop_pass): Likewise for local "insn".
+
+2014-08-22 David Malcolm <dmalcolm@redhat.com>
+
* compare-elim.c (struct comparison_use): Strengthen field "insn"
from rtx to rtx_insn *.
(struct comparison): Likewise, also for field "prev_clobber".
/* Next occurrence of this expression. */
struct occr *next;
/* The insn that computes the expression. */
- rtx insn;
+ rtx_insn *insn;
};
typedef struct occr *occr_t;
of INSN's basic block. */
static int
-reg_available_p (const_rtx x, const_rtx insn ATTRIBUTE_UNUSED)
+reg_available_p (const_rtx x, const rtx_insn *insn ATTRIBUTE_UNUSED)
{
return ! REGNO_REG_SET_P (reg_set_bitmap, REGNO (x));
}
IMPLICIT is true if it's an implicit set, false otherwise. */
static void
-insert_set_in_table (rtx dest, rtx src, rtx insn, struct hash_table_d *table,
- bool implicit)
+insert_set_in_table (rtx dest, rtx src, rtx_insn *insn,
+ struct hash_table_d *table, bool implicit)
{
bool found = false;
unsigned int hash;
IMPLICIT is true if it's an implicit set, false otherwise. */
static void
-hash_scan_set (rtx set, rtx insn, struct hash_table_d *table, bool implicit)
+hash_scan_set (rtx set, rtx_insn *insn, struct hash_table_d *table,
+ bool implicit)
{
rtx src = SET_SRC (set);
rtx dest = SET_DEST (set);
/* Process INSN and add hash table entries as appropriate. */
static void
-hash_scan_insn (rtx insn, struct hash_table_d *table)
+hash_scan_insn (rtx_insn *insn, struct hash_table_d *table)
{
rtx pat = PATTERN (insn);
int i;
/* Record as unavailable all registers that are DEF operands of INSN. */
static void
-make_set_regs_unavailable (rtx insn)
+make_set_regs_unavailable (rtx_insn *insn)
{
df_ref def;
FOR_EACH_BB_FN (bb, cfun)
{
- rtx insn;
+ rtx_insn *insn;
/* Reset tables used to keep track of what's not yet invalid [since
the end of the block]. */
start of the basic block containing INSN]. */
static int
-reg_not_set_p (const_rtx x, const_rtx insn ATTRIBUTE_UNUSED)
+reg_not_set_p (const_rtx x, const rtx_insn *insn ATTRIBUTE_UNUSED)
{
return ! REGNO_REG_SET_P (reg_set_bitmap, REGNO (x));
}
This data is used by reg_not_set_p. */
static void
-mark_oprs_set (rtx insn)
+mark_oprs_set (rtx_insn *insn)
{
df_ref def;
Return nonzero if successful. */
static int
-try_replace_reg (rtx from, rtx to, rtx insn)
+try_replace_reg (rtx from, rtx to, rtx_insn *insn)
{
rtx note = find_reg_equal_equiv_note (insn);
rtx src = 0;
NULL no such set is found. */
static struct expr *
-find_avail_set (int regno, rtx insn)
+find_avail_set (int regno, rtx_insn *insn)
{
/* SET1 contains the last set found that can be returned to the caller for
use in a substitution. */
if a change was made. */
static int
-cprop_jump (basic_block bb, rtx setcc, rtx jump, rtx from, rtx src)
+cprop_jump (basic_block bb, rtx_insn *setcc, rtx_insn *jump, rtx from, rtx src)
{
rtx new_rtx, set_src, note_src;
rtx set = pc_set (jump);
setcc_src);
}
else
- setcc = NULL_RTX;
+ setcc = NULL;
new_rtx = simplify_replace_rtx (set_src, from, src);
it and INSN is the instruction where this will be happening. */
static int
-constprop_register (rtx from, rtx src, rtx insn)
+constprop_register (rtx from, rtx src, rtx_insn *insn)
{
rtx sset;
Return nonzero if a change was made. */
static int
-cprop_insn (rtx insn)
+cprop_insn (rtx_insn *insn)
{
unsigned i;
int changed = 0, changed_this_round;
/* Try to perform local const/copy propagation on X in INSN. */
static bool
-do_local_cprop (rtx x, rtx insn)
+do_local_cprop (rtx x, rtx_insn *insn)
{
rtx newreg = NULL, newcnst = NULL;
local_cprop_pass (void)
{
basic_block bb;
- rtx insn;
+ rtx_insn *insn;
bool changed = false;
unsigned i;
these inserted insns when performing its transformations. */
static int
-bypass_block (basic_block bb, rtx setcc, rtx jump)
+bypass_block (basic_block bb, rtx_insn *setcc, rtx_insn *jump)
{
- rtx insn, note;
+ rtx_insn *insn;
+ rtx note;
edge e, edest;
int change;
int may_be_loop_header = false;
{
basic_block bb;
int changed;
- rtx setcc;
- rtx insn;
+ rtx_insn *setcc;
+ rtx_insn *insn;
rtx dest;
/* Note we start at block 1. */
/* Check for more than one predecessor. */
if (!single_pred_p (bb))
{
- setcc = NULL_RTX;
+ setcc = NULL;
FOR_BB_INSNS (bb, insn)
if (DEBUG_INSN_P (insn))
continue;
if (set_hash_table.n_elems > 0)
{
basic_block bb;
- rtx insn;
+ rtx_insn *insn;
alloc_cprop_mem (last_basic_block_for_fn (cfun),
set_hash_table.n_elems);