This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] jump.c (rtx_renumbered_equal_p): Very tiny speedup.


Hi,

Attached is a patch to speed up rtx_renumbered_equal_p().

CONST_INT's are always shared, so

  INTVAL (x) == INTVAL (y) iff x == y

Since the function returns 1 very early if x == y, after that we
know that INTVAL (x) != INTVAL (y).

Tested on i686-pc-linux-gnu.  OK to apply?

Kazu Hirata

2003-06-27  Kazu Hirata  <kazu@cs.umass.edu>

	* jump.c (rtx_renumbered_equal_p): Replace an expression that
	is known to be 0 with 0.

Index: jump.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/jump.c,v
retrieving revision 1.229
diff -u -r1.229 jump.c
--- jump.c	25 Jun 2003 03:45:12 -0000	1.229
+++ jump.c	26 Jun 2003 19:58:55 -0000
@@ -2326,10 +2326,8 @@
     case CC0:
     case ADDR_VEC:
     case ADDR_DIFF_VEC:
-      return 0;
-
     case CONST_INT:
-      return INTVAL (x) == INTVAL (y);
+      return 0;
 
     case LABEL_REF:
       /* We can't assume nonlocal labels have their following insns yet.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]