Patchwork [lra] patch for speeding up elimination pass for PR54146

login
register
mail settings
Submitter Vladimir Makarov
Date Oct. 9, 2012, 4:08 p.m.
Message ID <50744C00.4090508@redhat.com>
Download mbox | patch
Permalink /patch/190357/
State New
Headers show

Comments

Vladimir Makarov - Oct. 9, 2012, 4:08 p.m.
I committed the following patch to speed up the elimination patch (rev. 
192262).

The patch was successfully bootstrapped on x86/x86-64.

2012-10-09  Vladimir Makarov  <vmakarov@redhat.com>

         * lra-eliminations.c (lra_eliminate): Use direct access to insns
         through lra_insn_recog_data for process_insn_for_elimination.

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: