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]

Re: Reload patch version 3


>  I fixed a bug that could lead to such a failure this
>  morning. Unfortunately I haven't brought a diff today,
>  but here's what you have to do: in global.c, find the
>  following piece of code in the function build_insn_chain:

>  There is another bug in reload1.c: in function reload,
>  find the following fragment:

I got a correct 3-stage build on m68k-next-nextstep3 with these changes.
For easy reference, I include the patch as I applied it below.

What perhaps was to be expected is that, aside from better register  
allocation for code size reasons, we also get a slight speedup:

Our Weather Forecasting code, using egcs-1.1-pre-9808252130UTC
(options: -g -O3 -funroll-loops -fforce-addr -fomit-frame-pointer):

0SUPOBS TOOK :       19.71701049805
0DATACH TOOK :      8543.5947265625
0ANAEVA TOOK :     12056.1015625000
0GRPEVA TOOK :     23052.5234375000
0HUMSUP TOOK :        1.64062500000
0DATACH TOOK :       519.8203125000
0HUMEVA TOOK :       302.9570312500
0GRPEVA TOOK :       386.7460937500
 PREPARATIONS TOOK         51.0064 SECONDS
 FORECAST TOOK        289.8130 SECONDS
 PREPARATIONS TOOK         53.7827 SECONDS
 FORECAST TOOK      32359.9570 SECONDS

and with Bernd's Reload Patch Version 3
(-g -O3 -funroll-loops -fforce-addr -fomit-frame-pointer  
-fno-caller-saves):

0SUPOBS TOOK :       19.16668701172
0DATACH TOOK :      8338.3203125000
0ANAEVA TOOK :     12248.1699218750
0GRPEVA TOOK :     22964.7558593750
0HUMSUP TOOK :        1.62500000000
0DATACH TOOK :       514.2734375000
0HUMEVA TOOK :       301.6914062500
0GRPEVA TOOK :       385.0312500000
 PREPARATIONS TOOK         49.5170 SECONDS
 FORECAST TOOK        277.7242 SECONDS
 PREPARATIONS TOOK         52.8479 SECONDS
 FORECAST TOOK      31944.9082 SECONDS

Interestingly, the speedup is not consistent (see third item) !

Cheers,
Toon.

Here's the patch:

*** global.c.orig       Fri Aug 28 16:44:30 1998
--- global.c    Fri Aug 28 16:46:45 1998
*************** build_insn_chain (first)
*** 1745,1748 ****
--- 1745,1759 ----
        struct insn_chain *c;

+     if (first == basic_block_head[b])
+       {
+         int regno;
+         bzero ((char *)inverse_renumber, sizeof inverse_renumber);
+         EXECUTE_IF_SET_IN_REG_SET (basic_block_live_at_start[b],
+                                  0, regno,
+                                   {
+                                     regno_becomes_live (regno,  
VOIDmode);
+                                   });
+       }
+
        if (GET_CODE (first) != NOTE && GET_CODE (first) != BARRIER)
        {
*************** build_insn_chain (first)
*** 1754,1768 ****
          c->insn = first;
          c->block = b;
-
-         if (first == basic_block_head[b])
-           {
-             int regno;
-             bzero ((char *)inverse_renumber, sizeof inverse_renumber);
-             EXECUTE_IF_SET_IN_REG_SET (basic_block_live_at_start[b],
-                                        0, regno,
-                                         {
-                                           regno_becomes_live  
(regno, VOIDmode);
-                                         });
-           }

          bcopy (inverse_renumber, c->inverse_renum_before, sizeof  
inverse_renumber);
--- 1765,1768 ----
*** reload1.c.orig      Fri Aug 28 16:47:52 1998
--- reload1.c   Fri Aug 28 16:49:35 1998
*************** reload (first, global, dumpfile)
*** 1201,1204 ****
--- 1201,1206 ----
         will need a spill register.  */

+       CLEAR_REG_SET (spilled_pseudos);
+
        if (caller_save_needed)
        {
*************** reload (first, global, dumpfile)
*** 1269,1273 ****
         no elimination of the frame pointer that we can perform.  */

-       CLEAR_REG_SET (spilled_pseudos);
        frame_pointer_needed = 1;
        for (ep = reg_eliminate; ep <  
&reg_eliminate[NUM_ELIMINABLE_REGS]; ep++)
--- 1271,1274 ----


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