{
if (CONSTANT_P (v->locs->loc)
&& (GET_CODE (v->locs->loc) != CONST
- || !references_value_p (v->locs->loc, 0)))
+ || !references_value_p (v->locs->loc)))
return true;
/* Although a debug expr may be bound to different expressions,
we can preserve it as if it was constant, to get unification
removed. */
bool
-references_value_p (const_rtx x, int only_useless)
+references_value_p (const_rtx x)
{
- const enum rtx_code code = GET_CODE (x);
- const char *fmt = GET_RTX_FORMAT (code);
- int i, j;
-
- if (GET_CODE (x) == VALUE
- && (! only_useless
- || (CSELIB_VAL_PTR (x)->locs == 0 && !PRESERVED_VALUE_P (x))))
- return true;
-
- for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
- {
- if (fmt[i] == 'e' && references_value_p (XEXP (x, i), only_useless))
- return true;
- else if (fmt[i] == 'E')
- for (j = 0; j < XVECLEN (x, i); j++)
- if (references_value_p (XVECEXP (x, i, j), only_useless))
- return true;
- }
-
+ subrtx_iterator::array_type array;
+ FOR_EACH_SUBRTX (iter, array, x, ALL)
+ if (GET_CODE (*iter) == VALUE)
+ return true;
return false;
}
extern machine_mode cselib_reg_set_mode (const_rtx);
extern bool rtx_equal_for_cselib_1 (rtx, rtx, machine_mode, int);
extern bool cselib_redundant_set_p (rtx);
-extern bool references_value_p (const_rtx, int);
+extern bool references_value_p (const_rtx);
extern rtx cselib_expand_value_rtx (rtx, bitmap, int);
typedef rtx (*cselib_expand_callback)(rtx, bitmap, int, void *);
extern rtx cselib_expand_value_rtx_cb (rtx, bitmap, int,
prefer non-ENTRY_VALUE locations whenever possible. */
for (l = v->locs, count = 0; l; l = l->next, count++)
if (CONSTANT_P (l->loc)
- && (GET_CODE (l->loc) != CONST || !references_value_p (l->loc, 0)))
+ && (GET_CODE (l->loc) != CONST || !references_value_p (l->loc)))
return;
/* Avoid creating too large locs lists. */
else if (count == param_max_vartrack_reverse_op_size)