This is the mail archive of the 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] tree-ssa-dom.c: Speed up record_equivalences_from_phis.


Attached is a patch to speed up record_equivalences_from_phis.

Consider the following "if" statement.

  if (operand_equal_for_phi_arg_p (lhs, t))

Since lhs comes from PHI_RESULT, it is known to be SSA_NAME, so we can
just do a pointer comparison instead.

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

Kazu Hirata

2004-12-12  Kazu Hirata  <>

	* tree-ssa-dom.c (record_equivalences_from_phis): Speed up by
	doing a pointer comparison.

Index: tree-ssa-dom.c
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-dom.c,v
retrieving revision 2.76
diff -u -d -p -r2.76 tree-ssa-dom.c
--- tree-ssa-dom.c	12 Dec 2004 17:03:37 -0000	2.76
+++ tree-ssa-dom.c	12 Dec 2004 19:47:12 -0000
@@ -1178,7 +1178,7 @@ record_equivalences_from_phis (basic_blo
 	  tree t = PHI_ARG_DEF (phi, i);
 	  /* Ignore alternatives which are the same as our LHS.  */
-	  if (operand_equal_for_phi_arg_p (lhs, t))
+	  if (lhs == t)
 	  /* If we have not processed an alternative yet, then set

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