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]

Patch to improve alias analysis handling of i386 GOT


This patch improves alias analysis handling of i386 PIC addresses
and is basically stolen from the rs6000 backend.

Original BRL-CAD raytracing benchmarks:

Abs	wagner.FEITH.COM	33718.48	16258.43	14557.13	13746.53	16603.69	18976.85	Tue Aug 22 00:33:30 EDT 2000
*vgr	wagner.FEITH.COM	246.10	242.44	259.62	257.61	234.88	248.13	

Abs	wagner.FEITH.COM	33760.26	16346.94	14535.91	13759.62	16614.71	19003.48	Tue Aug 22 02:06:29 EDT 2000
*vgr	wagner.FEITH.COM	246.40	243.76	259.24	257.86	235.03	248.45	

With patch applied:

Abs	wagner.FEITH.COM	33949.21	16438.57	14672.17	13865.32	16739.45	19132.94	Tue Aug 22 00:54:09 EDT 2000
*vgr	wagner.FEITH.COM	247.78	245.13	261.67	259.84	236.80	250.24	

Abs	wagner.FEITH.COM	34013.35	16470.36	14687.32	13901.31	16746.84	19163.83	Tue Aug 22 01:49:35 EDT 2000
*vgr	wagner.FEITH.COM	248.25	245.60	261.94	260.51	236.90	250.64	

There's about a .5 to 1 percent improvement.  The make bootstrap and make
check on FreeBSD-3.5 x86 is still in progress.

ChangeLog:

Tue Aug 22 01:38:34 EDT 2000  John Wehle  (john@feith.com)

	* i386.c (ix86_GOT_alias_set): New.
	(legitimize_pic_address): Use it.

Enjoy!

-- John Wehle
------------------8<------------------------8<------------------------
*** gcc/config/i386/i386.c.ORIGINAL	Thu Aug 17 13:18:10 2000
--- gcc/config/i386/i386.c	Tue Aug 22 00:41:38 2000
*************** static void ix86_emit_restore_regs_using
*** 427,432 ****
--- 427,433 ----
  static void ix86_emit_epilogue_esp_adjustment PARAMS((int));
  static void ix86_sched_reorder_pentium PARAMS((rtx *, rtx *));
  static void ix86_sched_reorder_ppro PARAMS((rtx *, rtx *));
+ static HOST_WIDE_INT ix86_GOT_alias_set PARAMS ((void));
  
  struct ix86_address
  {
*************** report_error:
*** 2553,2558 ****
--- 2554,2570 ----
    return FALSE;
  }
  
+ /* Return an unique alias set for the GOT.  */
+ 
+ static HOST_WIDE_INT   
+ ix86_GOT_alias_set ()
+ {
+     static HOST_WIDE_INT set = -1;
+     if (set == -1)
+       set = new_alias_set ();
+     return set;
+ }   
+ 
  /* Return a legitimate reference for ORIG (an address) using the
     register REG.  If REG is 0, a new pseudo is generated.
  
*************** legitimize_pic_address (orig, reg)
*** 2610,2615 ****
--- 2622,2628 ----
        new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, new);
        new = gen_rtx_MEM (Pmode, new);
        RTX_UNCHANGING_P (new) = 1;
+       MEM_ALIAS_SET (new) = ix86_GOT_alias_set ();	
  
        if (reg == 0)
  	reg = gen_reg_rtx (Pmode);
-------------------------------------------------------------------------
|   Feith Systems  |   Voice: 1-215-646-8000  |  Email: john@feith.com  |
|    John Wehle    |     Fax: 1-215-540-5495  |                         |
-------------------------------------------------------------------------


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