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.
This commit is contained in:
Jan Hubicka 2023-06-23 18:45:42 +02:00
parent d130ae8499
commit 3124bfb14c

View file

@ -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