Minor speedup

law@redhat.com law@redhat.com
Fri Jun 7 11:00:00 GMT 2002


I got some interesting data yesterday from profiling the PA port building
my 162 testfiles at -O2.  Here's a trivial fix which improves compile times
by just shy of 1%.

Basically we're doing an insane number of calls into free_INSN_LIST_list,
on the order of 90 million.  Roughly 55 million are calls to free an empty
list from within free_deps.  Opps.

Bootstrapped and regression tested on i686-pc-linux-gnu.  Installed into
the mainline sources.

	* sched-deps.c (free_deps): Avoid calling free_INSN_LIST_list
	on empty lists.

Index: sched-deps.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/sched-deps.c,v
retrieving revision 1.43
diff -c -3 -p -r1.43 sched-deps.c
*** sched-deps.c	4 Jun 2002 17:46:13 -0000	1.43
--- sched-deps.c	7 Jun 2002 17:56:24 -0000
*************** free_deps (deps)
*** 1508,1516 ****
    EXECUTE_IF_SET_IN_REG_SET (&deps->reg_last_in_use, 0, i,
      {
        struct deps_reg *reg_last = &deps->reg_last[i];
!       free_INSN_LIST_list (&reg_last->uses);
!       free_INSN_LIST_list (&reg_last->sets);
!       free_INSN_LIST_list (&reg_last->clobbers);
      });
    CLEAR_REG_SET (&deps->reg_last_in_use);
  
--- 1508,1519 ----
    EXECUTE_IF_SET_IN_REG_SET (&deps->reg_last_in_use, 0, i,
      {
        struct deps_reg *reg_last = &deps->reg_last[i];
!       if (reg_last->uses)
! 	free_INSN_LIST_list (&reg_last->uses);
!       if (reg_last->sets)
! 	free_INSN_LIST_list (&reg_last->sets);
!       if (reg_last->clobbers)
! 	free_INSN_LIST_list (&reg_last->clobbers);
      });
    CLEAR_REG_SET (&deps->reg_last_in_use);
  






More information about the Gcc-patches mailing list