aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2023-06-23 18:45:42 +0200
committerJan Hubicka <jh@suse.cz>2023-06-23 18:45:42 +0200
commit3124bfb14c0bdc08554b7c2bbec4e2650fad4445 (patch)
tree0f2cf9d4df45ed79d123b255dba7476a7b73e0d4
parentd130ae8499e0c615e1636258d6901372316dfd93 (diff)
downloadgcc-3124bfb14c0bdc08554b7c2bbec4e2650fad4445.zip
gcc-3124bfb14c0bdc08554b7c2bbec4e2650fad4445.tar.gz
gcc-3124bfb14c0bdc08554b7c2bbec4e2650fad4445.tar.bz2
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.
-rw-r--r--gcc/tree-ssa-phiprop.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/tree-ssa-phiprop.cc b/gcc/tree-ssa-phiprop.cc
index 8c9ce90..b01ef44 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