Commit c992c066 by Richard Sandiford Committed by Richard Sandiford

cse.c (check_dependence_data): Delete.

gcc/
	* cse.c (check_dependence_data): Delete.
	(check_dependence): Change from being a for_each_rtx callback to being
	a function that examines all subrtxes itself.  Don't handle null rtxes.
	(invalidate): Update call accordingly.

From-SVN: r214628
parent e89b312e
2014-08-28 Richard Sandiford <rdsandiford@googlemail.com> 2014-08-28 Richard Sandiford <rdsandiford@googlemail.com>
* cse.c (check_dependence_data): Delete.
(check_dependence): Change from being a for_each_rtx callback to being
a function that examines all subrtxes itself. Don't handle null rtxes.
(invalidate): Update call accordingly.
2014-08-28 Richard Sandiford <rdsandiford@googlemail.com>
* cse.c: Include rtl-iter.h. * cse.c: Include rtl-iter.h.
(approx_reg_cost_1): Delete. (approx_reg_cost_1): Delete.
(approx_reg_cost): Use FOR_EACH_SUBRTX instead of for_each_rtx. (approx_reg_cost): Use FOR_EACH_SUBRTX instead of for_each_rtx.
......
...@@ -600,7 +600,6 @@ static int check_for_label_ref (rtx *, void *); ...@@ -600,7 +600,6 @@ static int check_for_label_ref (rtx *, void *);
extern void dump_class (struct table_elt*); extern void dump_class (struct table_elt*);
static void get_cse_reg_info_1 (unsigned int regno); static void get_cse_reg_info_1 (unsigned int regno);
static struct cse_reg_info * get_cse_reg_info (unsigned int regno); static struct cse_reg_info * get_cse_reg_info (unsigned int regno);
static int check_dependence (rtx *, void *);
static void flush_hash_table (void); static void flush_hash_table (void);
static bool insn_live_p (rtx_insn *, int *); static bool insn_live_p (rtx_insn *, int *);
...@@ -1816,22 +1815,20 @@ flush_hash_table (void) ...@@ -1816,22 +1815,20 @@ flush_hash_table (void)
} }
} }
/* Function called for each rtx to check whether an anti dependence exist. */ /* Check whether an anti dependence exists between X and EXP. MODE and
struct check_dependence_data ADDR are as for canon_anti_dependence. */
{
enum machine_mode mode;
rtx exp;
rtx addr;
};
static int static bool
check_dependence (rtx *x, void *data) check_dependence (const_rtx x, rtx exp, enum machine_mode mode, rtx addr)
{ {
struct check_dependence_data *d = (struct check_dependence_data *) data; subrtx_iterator::array_type array;
if (*x && MEM_P (*x)) FOR_EACH_SUBRTX (iter, array, x, NONCONST)
return canon_anti_dependence (*x, true, d->exp, d->mode, d->addr); {
else const_rtx x = *iter;
return 0; if (MEM_P (x) && canon_anti_dependence (x, true, exp, mode, addr))
return true;
}
return false;
} }
/* Remove from the hash table, or mark as invalid, all expressions whose /* Remove from the hash table, or mark as invalid, all expressions whose
...@@ -1952,18 +1949,13 @@ invalidate (rtx x, enum machine_mode full_mode) ...@@ -1952,18 +1949,13 @@ invalidate (rtx x, enum machine_mode full_mode)
next = p->next_same_hash; next = p->next_same_hash;
if (p->in_memory) if (p->in_memory)
{ {
struct check_dependence_data d;
/* Just canonicalize the expression once; /* Just canonicalize the expression once;
otherwise each time we call invalidate otherwise each time we call invalidate
true_dependence will canonicalize the true_dependence will canonicalize the
expression again. */ expression again. */
if (!p->canon_exp) if (!p->canon_exp)
p->canon_exp = canon_rtx (p->exp); p->canon_exp = canon_rtx (p->exp);
d.exp = x; if (check_dependence (p->canon_exp, x, full_mode, addr))
d.addr = addr;
d.mode = full_mode;
if (for_each_rtx (&p->canon_exp, check_dependence, &d))
remove_from_table (p, i); remove_from_table (p, i);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment