]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-optimization/114855 - more update_ssa speedup
authorRichard Biener <rguenther@suse.de>
Tue, 24 Sep 2024 10:53:11 +0000 (12:53 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 24 Sep 2024 10:59:47 +0000 (12:59 +0200)
The following tackles another source of slow bitmap operations,
namely populating blocks_to_update.  We already have that in
tree view around PHI insertion but also the initial population is
slow.  There's unfortunately a conditional inbetween list view
requirement and the bitmap API doesn't allow opportunistic
switching but rejects tree -> tree or list -> list transitions.
So the following patch wraps the early population in a tree view
section with possibly one redundant tree -> list -> tree view
transition.

This cuts tree SSA incremental from 228.25s (21%) to 65.05s (7%).

PR tree-optimization/114855
* tree-into-ssa.cc (update_ssa): Use tree view for the
initial population of blocks_to_update.

gcc/tree-into-ssa.cc

index 1cce9d628090ef663363dbd13c0056bbded11ce9..fc61d47ca777db857509cf62627d30de8347567a 100644 (file)
@@ -3445,6 +3445,7 @@ update_ssa (unsigned update_flags)
   blocks_with_phis_to_rewrite = BITMAP_ALLOC (NULL);
   bitmap_tree_view (blocks_with_phis_to_rewrite);
   blocks_to_update = BITMAP_ALLOC (NULL);
+  bitmap_tree_view (blocks_to_update);
 
   insert_phi_p = (update_flags != TODO_update_ssa_no_phi);
 
@@ -3492,6 +3493,8 @@ update_ssa (unsigned update_flags)
         placement heuristics.  */
       prepare_block_for_update (start_bb, insert_phi_p);
 
+      bitmap_list_view (blocks_to_update);
+
       tree name;
 
       if (flag_checking)
@@ -3517,6 +3520,8 @@ update_ssa (unsigned update_flags)
     }
   else
     {
+      bitmap_list_view (blocks_to_update);
+
       /* Otherwise, the entry block to the region is the nearest
         common dominator for the blocks in BLOCKS.  */
       start_bb = nearest_common_dominator_for_set (CDI_DOMINATORS,