https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85964

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |8.2

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Maintaining dominators is costly.

diff --git a/gcc/dominance.c b/gcc/dominance.c
index 20671983f98..5ba765c82be 100644
--- a/gcc/dominance.c
+++ b/gcc/dominance.c
@@ -1475,6 +1475,8 @@ iterate_fix_dominators (enum cdi_direction dir,
vec<basic_block> bbs,
       return;
     }

+  timevar_push (TV_DOMINANCE);
+
   /* Construct the graph G.  */
   hash_map<basic_block, int> map (251);
   FOR_EACH_VEC_ELT (bbs, i, bb)
@@ -1537,6 +1539,8 @@ iterate_fix_dominators (enum cdi_direction dir,
vec<basic_block> bbs,
   free (parent);

   free_graph (g);
+
+  timevar_pop (TV_DOMINANCE);
 }

 void

shows

 backwards jump threading           :   9.02 ( 37%)   0.00 (  0%)   9.01 ( 37%)
      0 kB (  0%)
 dominance computation              :   9.89 ( 40%)   0.01 ( 33%)  10.02 ( 41%)
      0 kB (  0%)

so there are two offenders.  The dominance one is from CFG cleanup as
-ftime-report-details shows:

 tree CFG cleanup                   :   3.52 ( 14%)   0.01 ( 25%)   3.43 ( 14%)
    773 kB (  3%)
 `- dominance computation           :   9.66 ( 39%)   0.01 ( 25%)   9.77 ( 39%)
      0 kB (  0%)
 `- tree operand scan               :   0.00 (  0%)   0.00 (  0%)   0.01 (  0%)
      0 kB (  0%)
 `- CFG verifier                    :   0.04 (  0%)   0.00 (  0%)   0.02 (  0%)
      0 kB (  0%)

Reply via email to