public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-2051] Tiny phiprop compile time optimization
@ 2023-06-23 16:46 Jan Hubicka
  0 siblings, 0 replies; only message in thread
From: Jan Hubicka @ 2023-06-23 16:46 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:3124bfb14c0bdc08554b7c2bbec4e2650fad4445

commit r14-2051-g3124bfb14c0bdc08554b7c2bbec4e2650fad4445
Author: Jan Hubicka <jh@suse.cz>
Date:   Fri Jun 23 18:45:42 2023 +0200

    Tiny phiprop compile time optimization
    
    gcc/ChangeLog:
    
            * tree-ssa-phiprop.cc (propagate_with_phi): Compute post dominators on
            demand.
            (pass_phiprop::execute): Do not compute it here; return
            update_ssa_only_virtuals if something changed.
            (pass_data_phiprop): Remove TODO_update_ssa from todos.

Diff:
---
 gcc/tree-ssa-phiprop.cc | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/gcc/tree-ssa-phiprop.cc b/gcc/tree-ssa-phiprop.cc
index 8c9ce903472..b01ef4495c2 100644
--- a/gcc/tree-ssa-phiprop.cc
+++ b/gcc/tree-ssa-phiprop.cc
@@ -340,6 +340,9 @@ propagate_with_phi (basic_block bb, gphi *phi, struct phiprop_d *phivn,
       gimple *def_stmt;
       tree vuse;
 
+      if (!dom_info_available_p (cfun, CDI_POST_DOMINATORS))
+	calculate_dominance_info (CDI_POST_DOMINATORS);
+
       /* Only replace loads in blocks that post-dominate the PHI node.  That
          makes sure we don't end up speculating loads.  */
       if (!dominated_by_p (CDI_POST_DOMINATORS,
@@ -485,7 +488,7 @@ const pass_data pass_data_phiprop =
   0, /* properties_provided */
   0, /* properties_destroyed */
   0, /* todo_flags_start */
-  TODO_update_ssa, /* todo_flags_finish */
+  0, /* todo_flags_finish */
 };
 
 class pass_phiprop : public gimple_opt_pass
@@ -513,7 +516,6 @@ pass_phiprop::execute (function *fun)
   size_t n;
 
   calculate_dominance_info (CDI_DOMINATORS);
-  calculate_dominance_info (CDI_POST_DOMINATORS);
 
   n = num_ssa_names;
   phivn = XCNEWVEC (struct phiprop_d, n);
@@ -539,7 +541,7 @@ pass_phiprop::execute (function *fun)
 
   free_dominance_info (CDI_POST_DOMINATORS);
 
-  return 0;
+  return did_something ? TODO_update_ssa_only_virtuals : 0;
 }
 
 } // anon namespace

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-06-23 16:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-23 16:46 [gcc r14-2051] Tiny phiprop compile time optimization Jan Hubicka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).