[patch] Strength reduction for autoincrement generation

Michael Hayes m.hayes@elec.canterbury.ac.nz
Mon Jan 22 14:00:00 GMT 2001


Without this patch autoincrement addressing are only generated with
extremely good luck.  A discussion (well a monologue) of the problem
can be found on gcc.gnu.org/ml/gcc/2001-01/msg00548.html.

OK to commit?

Michael.


2001-01-23  Michael Hayes  <m.hayes@elec.canterbury.ac.nz>

	* loop.c (loop_giv_reduce_benefit): Tweak autoincrement generation
	heuristic.

Index: loop.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/loop.c,v
retrieving revision 1.320
diff -c -3 -p -r1.320 loop.c
*** loop.c	2001/01/12 04:09:42	1.320
--- loop.c	2001/01/22 21:41:39
*************** loop_giv_reduce_benefit (loop, bl, v, te
*** 4131,4137 ****
        /* Increasing the benefit is risky, since this is only a guess.
  	 Avoid increasing register pressure in cases where there would
  	 be no other benefit from reducing this giv.  */
!       && benefit > 0
        && GET_CODE (v->mult_val) == CONST_INT)
      {
        if (HAVE_POST_INCREMENT
--- 4131,4137 ----
        /* Increasing the benefit is risky, since this is only a guess.
  	 Avoid increasing register pressure in cases where there would
  	 be no other benefit from reducing this giv.  */
!       && (benefit + add_cost * bl->biv_count) > 0
        && GET_CODE (v->mult_val) == CONST_INT)
      {
        if (HAVE_POST_INCREMENT


More information about the Gcc-patches mailing list