This is the mail archive of the gcc@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]

Re: Bootstrap times on mainline are getting worse


On Sat, Oct 19, 2002 at 11:52:06AM +0200, Pop Sébastian wrote:
> On Fri, Oct 18, 2002 at 11:34:11AM -0400, Diego Novillo wrote:
> > On Fri, 18 Oct 2002, Kaveh R. Ghazi wrote:
> > 
> > > Care to take a stab?
> > > 
> > Heh, having the time to do that would be nice.  A cursory look at
> > the .diff files doesn't reveal anything blatantly obvious.  Only
> > three potential candidates:
> > 
> > +2002-10-04  Roger Sayle  <roger@eyesopen.com>
> > +
> > +       * config/i386/i386.h (processor_costs): Add new fields fadd,
> > +       fmul, fdiv, fabs, fchs and fsqrt to costs structure.
> > +       (RTX_COSTS): Use these fields to determine the RTX costs
> > +       of floating point addition/subtraction, multiplication,
> > +       division, fabs, negation and square root respectively.
> > +       * config/i386/i386.c (size_cost): Provide instruction sizes
> > +       for these new fields.
> > +       (i386_cost, i486_cost, pentium_cost, pentiumpro_cost,
> > +       k6_cost, athlon_cost, pentium4_cost): Provide typical cycle
> > +       counts for these new fields for all x86 processor variants.
> > +
> > 
> A 'time make bootstrap' on version "2002-10-03" gives:
> 
> real    57m38.632s
> user    51m20.200s
> sys     4m55.500s
> 
> 
> With this patch I get:
> 
> real    58m16.766s
> user    51m14.720s
> sys     5m0.850s

I smell cache blowout.  Notice how the real and system times went up,
but the user time went down?

The processor_costs tables are entirely populated with values which we
can reasonably expect will never rise above 256.  So I propose to
change all the fields to unsigned char.  Would you mind trying out the
appended patch on top of 2002-10-03+Roger's patch?

zw

	* config/i386/i386.h (struct processor_costs):
	Make all fields const unsigned char.

===================================================================
Index: config/i386/i386.h
--- config/i386/i386.h	19 Oct 2002 08:48:37 -0000	1.297
+++ config/i386/i386.h	19 Oct 2002 17:16:36 -0000
@@ -37,50 +37,53 @@ Boston, MA 02111-1307, USA.  */
 /* Define the specific costs for a given cpu */
 
 struct processor_costs {
-  const int add;		/* cost of an add instruction */
-  const int lea;		/* cost of a lea instruction */
-  const int shift_var;		/* variable shift costs */
-  const int shift_const;	/* constant shift costs */
-  const int mult_init;		/* cost of starting a multiply */
-  const int mult_bit;		/* cost of multiply per each bit set */
-  const int divide;		/* cost of a divide/mod */
-  int movsx;			/* The cost of movsx operation.  */
-  int movzx;			/* The cost of movzx operation.  */
-  const int large_insn;		/* insns larger than this cost more */
-  const int move_ratio;		/* The threshold of number of scalar
-				   memory-to-memory move insns.  */
-  const int movzbl_load;	/* cost of loading using movzbl */
-  const int int_load[3];	/* cost of loading integer registers
-				   in QImode, HImode and SImode relative
-				   to reg-reg move (2).  */
-  const int int_store[3];	/* cost of storing integer register
-				   in QImode, HImode and SImode */
-  const int fp_move;		/* cost of reg,reg fld/fst */
-  const int fp_load[3];		/* cost of loading FP register
-				   in SFmode, DFmode and XFmode */
-  const int fp_store[3];	/* cost of storing FP register
-				   in SFmode, DFmode and XFmode */
-  const int mmx_move;		/* cost of moving MMX register.  */
-  const int mmx_load[2];	/* cost of loading MMX register
-				   in SImode and DImode */
-  const int mmx_store[2];	/* cost of storing MMX register
-				   in SImode and DImode */
-  const int sse_move;		/* cost of moving SSE register.  */
-  const int sse_load[3];	/* cost of loading SSE register
-				   in SImode, DImode and TImode*/
-  const int sse_store[3];	/* cost of storing SSE register
-				   in SImode, DImode and TImode*/
-  const int mmxsse_to_integer;	/* cost of moving mmxsse register to
-				   integer and vice versa.  */
-  const int prefetch_block;	/* bytes moved to cache for prefetch.  */
-  const int simultaneous_prefetches; /* number of parallel prefetch
-				   operations.  */
-  const int fadd;		/* cost of FADD and FSUB instructions.  */
-  const int fmul;		/* cost of FMUL instruction.  */
-  const int fdiv;		/* cost of FDIV instruction.  */
-  const int fabs;		/* cost of FABS instruction.  */
-  const int fchs;		/* cost of FCHS instruction.  */
-  const int fsqrt;		/* cost of FSQRT instruction.  */
+#define cuchar const unsigned char
+  cuchar add;		/* cost of an add instruction */
+  cuchar lea;		/* cost of a lea instruction */
+  cuchar shift_var;	/* variable shift costs */
+  cuchar shift_const;	/* constant shift costs */
+  cuchar mult_init;	/* cost of starting a multiply */
+  cuchar mult_bit;	/* cost of multiply per each bit set */
+  cuchar divide;	/* cost of a divide/mod */
+  cuchar movsx;		/* The cost of movsx operation.  */
+  cuchar movzx;		/* The cost of movzx operation.  */
+  cuchar large_insn;	/* insns larger than this cost more */
+  cuchar move_ratio;	/* The threshold of number of scalar
+			   memory-to-memory move insns.  */
+  cuchar movzbl_load;	/* cost of loading using movzbl */
+  cuchar int_load[3];	/* cost of loading integer registers
+			   in QImode, HImode and SImode relative
+			   to reg-reg move (2).  */
+  cuchar int_store[3];	/* cost of storing integer register
+			   in QImode, HImode and SImode */
+  cuchar fp_move;	/* cost of reg,reg fld/fst */
+  cuchar fp_load[3];	/* cost of loading FP register
+			   in SFmode, DFmode and XFmode */
+  cuchar fp_store[3];	/* cost of storing FP register
+			   in SFmode, DFmode and XFmode */
+  cuchar mmx_move;	/* cost of moving MMX register.  */
+  cuchar mmx_load[2];	/* cost of loading MMX register
+			   in SImode and DImode.   */
+  cuchar mmx_store[2];	/* cost of storing MMX register
+			   in SImode and DImode.  */
+  cuchar sse_move;	/* cost of moving SSE register.  */
+  cuchar sse_load[3];	/* cost of loading SSE register
+			   in SImode, DImode and TImode.  */
+  cuchar sse_store[3];	/* cost of storing SSE register
+			   in SImode, DImode and TImode.  */
+  cuchar mmxsse_to_integer;
+			 /* cost of moving mmxsse register to integer
+			    and vice versa.  */
+  cuchar prefetch_block; /* bytes moved to cache for prefetch.  */
+  cuchar simultaneous_prefetches;
+  			 /* number of parallel prefetch operations.  */
+  cuchar fadd;		 /* cost of FADD and FSUB instructions.  */
+  cuchar fmul;		 /* cost of FMUL instruction.  */
+  cuchar fdiv;		 /* cost of FDIV instruction.  */
+  cuchar fabs;		 /* cost of FABS instruction.  */
+  cuchar fchs;		 /* cost of FCHS instruction.  */
+  cuchar fsqrt;		 /* cost of FSQRT instruction.  */
+#undef cuchar
 };
 
 extern const struct processor_costs *ix86_cost;


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