]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
postreload.c (reload_cse_simplify_set): Call cselib_lookup earlier.
authorKazu Hirata <kazu@cs.umass.edu>
Thu, 26 Jun 2003 13:42:33 +0000 (13:42 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Thu, 26 Jun 2003 13:42:33 +0000 (13:42 +0000)
* postreload.c (reload_cse_simplify_set): Call cselib_lookup
earlier.  Don't check if SRC is a constant.

From-SVN: r68533

gcc/ChangeLog
gcc/postreload.c

index ba5cd5bc1072b4a6563e5ace5a9941251a25be2c..48334d73906f67564407d8058131f4ef99ab79af 100644 (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>
 
        * Makefile.in (OBJS): Add postreload.o.
index 78153b64df013aecb2f59430f3ac5dad396e66a7..1c53395be327d9381a108b6f7569fd87a16432c2 100644 (file)
@@ -246,21 +246,19 @@ reload_cse_simplify_set (set, insn)
     return 0;
 #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 (GET_CODE (src) == MEM)
     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)
     old_cost = REGISTER_MOVE_COST (GET_MODE (src),
                                   REGNO_REG_CLASS (REGNO (src)), dclass);
   else
-    /* ???   */
     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)
     {
       rtx this_rtx = l->loc;