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]

Speedup find_reloads


Hi,
with -minline-all-stringops shows:
08225f30 129       2.1259     cc1                      find_reloads
that is turned into by:
08225f40 70        1.1706     cc1                      find_reloads
by attached patch.  Bootstrapped/regtested i686-pc-gnu-linux.  OK for
mainline/branch?

Honza

2004-01-25  Jan Hubicka  <jh@suse.cz>
	* reload.c (secondary_memlocs_elim_used): New static variable.
	(get_secondary_mem): Update it.
	(find_reloads): Use it.
Index: reload.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/reload.c,v
retrieving revision 1.230
diff -c -3 -p -r1.230 reload.c
*** reload.c	21 Jan 2004 20:40:03 -0000	1.230
--- reload.c	25 Jan 2004 15:54:13 -0000
*************** struct decomposition
*** 173,178 ****
--- 173,179 ----
  
  static rtx secondary_memlocs[NUM_MACHINE_MODES];
  static rtx secondary_memlocs_elim[NUM_MACHINE_MODES][MAX_RECOG_OPERANDS];
+ static int secondary_memlocs_elim_used = 0;
  #endif
  
  /* The instruction we are doing reloads for;
*************** get_secondary_mem (rtx x ATTRIBUTE_UNUSE
*** 644,649 ****
--- 645,652 ----
      }
  
    secondary_memlocs_elim[(int) mode][opnum] = loc;
+   if (secondary_memlocs_elim_used <= opnum)
+     secondary_memlocs_elim_used = opnum + 1;
    return loc;
  }
  
*************** find_reloads (rtx insn, int replace, int
*** 2540,2546 ****
    /* The eliminated forms of any secondary memory locations are per-insn, so
       clear them out here.  */
  
!   memset (secondary_memlocs_elim, 0, sizeof secondary_memlocs_elim);
  #endif
  
    /* Dispose quickly of (set (reg..) (reg..)) if both have hard regs and it
--- 2543,2554 ----
    /* The eliminated forms of any secondary memory locations are per-insn, so
       clear them out here.  */
  
!   if (secondary_memlocs_elim_used)
!     {
!       memset (secondary_memlocs_elim, 0,
! 	      sizeof (secondary_memlocs_elim[0]) * secondary_memlocs_elim_used);
!       secondary_memlocs_elim_used = 0;
!     }
  #endif
  
    /* Dispose quickly of (set (reg..) (reg..)) if both have hard regs and it


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