From: Jan Hubicka Date: Fri, 23 Jun 2023 16:45:42 +0000 (+0200) Subject: Tiny phiprop compile time optimization X-Git-Tag: basepoints/gcc-15~8088 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3124bfb14c0bdc08554b7c2bbec4e2650fad4445;p=thirdparty%2Fgcc.git 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 --git a/gcc/tree-ssa-phiprop.cc b/gcc/tree-ssa-phiprop.cc index 8c9ce903472b..b01ef4495c27 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