http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46590

--- Comment #31 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-08-23 
11:41:50 UTC ---
Btw, I have experimented with

Index: tree-into-ssa.c
===================================================================
--- tree-into-ssa.c     (revision 190594)
+++ tree-into-ssa.c     (working copy)
@@ -3224,11 +3224,35 @@ update_ssa (unsigned update_flags)
       bitmap_head *dfs;

       /* If the caller requested PHI nodes to be added, compute
-        dominance frontiers.  */
+        dominance frontiers for all interesting blocks
+        up to the dominating start_bb.  */
       dfs = XNEWVEC (bitmap_head, last_basic_block);
       FOR_EACH_BB (bb)
        bitmap_initialize (&dfs[bb->index], &bitmap_default_obstack);
-      compute_dominance_frontiers (dfs);
+      EXECUTE_IF_SET_IN_BITMAP (blocks_to_update, 0, i, bi)
+       {
+         basic_block b = BASIC_BLOCK (i);
+         edge_iterator ei;
+         edge p;
+         if (EDGE_COUNT (b->preds) >= 2)
+           FOR_EACH_EDGE (p, ei, b->preds)
+             {
+               basic_block runner = p->src;
+               basic_block domsb;
+               if (runner == start_bb)
+                 continue;
+
+               domsb = get_immediate_dominator (CDI_DOMINATORS, b);
+               while (runner != domsb)
+                 {
+                   if (!bitmap_set_bit (&dfs[runner->index],
+                                        b->index))
+                     break;
+                   runner = get_immediate_dominator (CDI_DOMINATORS,
+                                                     runner);
+                 }
+             }
+       }

       if (sbitmap_first_set_bit (old_ssa_names) >= 0)
        {

which helps reducing the time spent in computing dominance frontiers.  But
as we no longer have bitmaps but bitmap_heads in dfs it's hard to verify
we only ever access dfs for entries we computed ... but we should,
looking at how compute_idf works(?).

Reply via email to