postreload.c (reload_cse_simplify_set): Call cselib_lookup earlier.

* postreload.c (reload_cse_simplify_set): Call cselib_lookup
	earlier.  Don't check if SRC is a constant.

From-SVN: r68533
This commit is contained in:
Kazu Hirata 2003-06-26 13:42:33 +00:00 committed by Kazu Hirata
parent 15e35479eb
commit b2948a2caa
2 changed files with 9 additions and 6 deletions

View File

@ -1,3 +1,8 @@
2003-06-26 Kazu Hirata <kazu@cs.umass.edu>
* postreload.c (reload_cse_simplify_set): Call cselib_lookup
earlier. Don't check if SRC is a constant.
2003-06-26 Kazu Hirata <kazu@cs.umass.edu> 2003-06-26 Kazu Hirata <kazu@cs.umass.edu>
* Makefile.in (OBJS): Add postreload.o. * Makefile.in (OBJS): Add postreload.o.

View File

@ -246,21 +246,19 @@ reload_cse_simplify_set (set, insn)
return 0; return 0;
#endif #endif
val = cselib_lookup (src, GET_MODE (SET_DEST (set)), 0);
if (! val)
return 0;
/* If memory loads are cheaper than register copies, don't change them. */ /* If memory loads are cheaper than register copies, don't change them. */
if (GET_CODE (src) == MEM) if (GET_CODE (src) == MEM)
old_cost = MEMORY_MOVE_COST (GET_MODE (src), dclass, 1); old_cost = MEMORY_MOVE_COST (GET_MODE (src), dclass, 1);
else if (CONSTANT_P (src))
old_cost = rtx_cost (src, SET);
else if (GET_CODE (src) == REG) else if (GET_CODE (src) == REG)
old_cost = REGISTER_MOVE_COST (GET_MODE (src), old_cost = REGISTER_MOVE_COST (GET_MODE (src),
REGNO_REG_CLASS (REGNO (src)), dclass); REGNO_REG_CLASS (REGNO (src)), dclass);
else else
/* ??? */
old_cost = rtx_cost (src, SET); old_cost = rtx_cost (src, SET);
val = cselib_lookup (src, GET_MODE (SET_DEST (set)), 0);
if (! val)
return 0;
for (l = val->locs; l; l = l->next) for (l = val->locs; l; l = l->next)
{ {
rtx this_rtx = l->loc; rtx this_rtx = l->loc;