Patchwork [lra] another patch to speed more compilation of PR54146

login
register
mail settings
Submitter Vladimir Makarov
Date Oct. 8, 2012, 8:25 p.m.
Message ID <507336B3.6030806@redhat.com>
Download mbox | patch
Permalink /patch/190119/
State New
Headers show

Comments

Vladimir Makarov - Oct. 8, 2012, 8:25 p.m.
On 10/07/2012 07:00 PM, Steven Bosscher wrote:
> Hello,
>
> This patch changes the worklist-like bitmap in lra_eliminate() to an
> sbitmap.  Effect on compile time:
>
> lra r192183: LRA virtuals elimination:  51.56 ( 6%)
> with patch: LRA virtuals elimination:  14.02 ( 2%)
>
> OK for the branch after bootstrap&test on x86_64-unknown-linux-gnu?
>
>
Actually I have a simpler and better patch:

gcc17 is too busy now :) (i am getting sporadically 'out of memory' as 
there is not enough virtual memory),
So I check on Intel machine with 16GB. memory

With yours patch:
  integrated RA           :  48.70 (13%) usr   0.27 ( 4%) sys  49.00 
(13%) wall  223608 kB (19%) ggc
  LRA non-specific        :  20.99 ( 6%) usr   0.05 ( 1%) sys  21.11 ( 
5%) wall   41590 kB ( 4%) ggc
  LRA virtuals elimination:   5.18 ( 1%) usr   0.01 ( 0%) sys   5.20 ( 
1%) wall   36048 kB ( 3%) ggc
  LRA reload inheritance  :   0.12 ( 0%) usr   0.00 ( 0%) sys   0.10 ( 
0%) wall    1200 kB ( 0%) ggc
  LRA create live ranges  :  16.32 ( 4%) usr   0.01 ( 0%) sys  16.50 ( 
4%) wall    5194 kB ( 0%) ggc
  LRA hard reg assignment :   0.33 ( 0%) usr   0.01 ( 0%) sys   0.40 ( 
0%) wall       0 kB ( 0%) ggc
  reload                  :   2.51 ( 1%) usr   0.04 ( 1%) sys   2.58 ( 
1%) wall       0 kB ( 0%) ggc
real=385.86 user=376.67 system=7.94 share=99%% maxrss=30761024 ins=0 
outs=92544 mfaults=3926163 waits=13
    text    data     bss     dec     hex filename
6395363      16     607 6395986  619852 s.o

With mine patch:
  integrated RA           :  48.81 (13%) usr   0.36 ( 5%) sys  49.39 
(13%) wall  223608 kB (19%) ggc
  LRA non-specific        :  21.08 ( 6%) usr   0.03 ( 0%) sys  21.12 ( 
6%) wall   41590 kB ( 4%) ggc
  LRA virtuals elimination:   0.33 ( 0%) usr   0.02 ( 0%) sys   0.35 ( 
0%) wall   36048 kB ( 3%) ggc
  LRA reload inheritance  :   0.13 ( 0%) usr   0.00 ( 0%) sys   0.12 ( 
0%) wall    1200 kB ( 0%) ggc
  LRA create live ranges  :  16.87 ( 5%) usr   0.00 ( 0%) sys  16.80 ( 
4%) wall    5194 kB ( 0%) ggc
  LRA hard reg assignment :   0.33 ( 0%) usr   0.02 ( 0%) sys   0.44 ( 
0%) wall       0 kB ( 0%) ggc
  LRA coalesce pseudo regs:   0.01 ( 0%) usr   0.00 ( 0%) sys   0.00 ( 
0%) wall       0 kB ( 0%) ggc
  reload                  :   2.56 ( 1%) usr   0.04 ( 1%) sys   2.60 ( 
1%) wall       0 kB ( 0%) ggc
real=381.71 user=372.78 system=7.69 share=99%% maxrss=30760656 ins=0 
outs=92544 mfaults=3925988 waits=15
    text    data     bss     dec     hex filename
6395363      16     607 6395986  619852 s.o

Elimination before the patches took 5% on the Intel machine.
Steven Bosscher - Oct. 8, 2012, 8:41 p.m.
On Mon, Oct 8, 2012 at 10:25 PM, Vladimir Makarov <vmakarov@redhat.com> wrote:

> Actually I have a simpler and better patch:

Ah, lra_insn_recog_data, I couldn't find out how to get the insn itself :-)

The OOM you're seeing on gcc17 is probably because we're both working
on that machine. If we're both trying to compile slow.cc we're using
more memory than there's available on gcc17. I've moved to another
machine now.

Ciao!
Steven

Patch

Index: lra-eliminations.c
===================================================================
--- lra-eliminations.c	(revision 192169)
+++ lra-eliminations.c	(working copy)
@@ -1291,9 +1291,10 @@  void
 lra_eliminate (bool final_p)
 {
   int i;
-  basic_block bb;
-  rtx insn, temp, mem_loc, invariant;
+  unsigned int uid;
+  rtx mem_loc, invariant;
   bitmap_head insns_with_changed_offsets;
+  bitmap_iterator bi;
   struct elim_table *ep;
   int regs_num = max_reg_num ();
 
@@ -1344,12 +1345,8 @@  lra_eliminate (bool final_p)
 	  fprintf (lra_dump_file,
 		   "Updating elimination of equiv for reg %d\n", i);
       }
-  FOR_EACH_BB (bb)
-    FOR_BB_INSNS_SAFE (bb, insn, temp)
-      {
-	if (bitmap_bit_p (&insns_with_changed_offsets, INSN_UID (insn)))
-	  process_insn_for_elimination (insn, final_p);
-      }
+  EXECUTE_IF_SET_IN_BITMAP (&insns_with_changed_offsets, 0, uid, bi)
+    process_insn_for_elimination (lra_insn_recog_data[uid]->insn, final_p);
   bitmap_clear (&insns_with_changed_offsets);
 
 lra_eliminate_done: