[patch] reload1.c: Very minor speedup.

Kazu Hirata kazu@cs.umass.edu
Fri Feb 6 22:10:00 GMT 2004


Hi,

Attached is a patch to micro-optimize the reset of can_eliminate in
reload1.c.

It would be nice if the if-conversion pass could take care of this.

Bootstrapped on i686-pc-linux-gnu.  Committed as obvious.

Kazu Hirata

2004-02-06  Kazu Hirata  <kazu@cs.umass.edu>

	* reload1.c (check_eliminable_occurrences): Optimize the reset
	of can_eliminate.
	(eliminate_regs_in_insn): Likewise.

Index: reload1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/reload1.c,v
retrieving revision 1.426
diff -u -p -r1.426 reload1.c
--- reload1.c	6 Feb 2004 05:58:11 -0000	1.426
+++ reload1.c	6 Feb 2004 22:06:34 -0000
@@ -2834,7 +2834,7 @@ check_eliminable_occurrences (rtx x)
       struct elim_table *ep;
 
       for (ep = reg_eliminate; ep < &reg_eliminate[NUM_ELIMINABLE_REGS]; ep++)
-	if (ep->from_rtx == x && ep->can_eliminate)
+	if (ep->from_rtx == x)
 	  ep->can_eliminate = 0;
       return;
     }
@@ -3100,7 +3100,7 @@ eliminate_regs_in_insn (rtx insn, int re
 		 eliminate this reg.  */
 	      for (ep = reg_eliminate; ep < &reg_eliminate[NUM_ELIMINABLE_REGS];
 		   ep++)
-		if (ep->from_rtx == orig_operand[i] && ep->can_eliminate)
+		if (ep->from_rtx == orig_operand[i])
 		  ep->can_eliminate = 0;
 	    }
 



More information about the Gcc-patches mailing list