Use mark_ssa_maybe_undefs in PHI-OPT

The following removes gimple_uses_undefined_value_p and instead
uses the conservative mark_ssa_maybe_undefs in PHI-OPT, the last
user of the other API.

	* tree-ssa-phiopt.cc (pass_phiopt::execute): Mark SSA undefs.
	(empty_bb_or_one_feeding_into_p): Check for them.
	* tree-ssa.h (gimple_uses_undefined_value_p): Remove.
	* tree-ssa.cc (gimple_uses_undefined_value_p): Likewise.
This commit is contained in:
Richard Biener 2023-07-04 10:46:35 +02:00
parent 6eea7eaf11
commit 1135073424
3 changed files with 6 additions and 20 deletions

View file

@ -630,8 +630,11 @@ empty_bb_or_one_feeding_into_p (basic_block bb,
|| gimple_has_side_effects (stmt_to_move))
return false;
if (gimple_uses_undefined_value_p (stmt_to_move))
return false;
ssa_op_iter it;
tree use;
FOR_EACH_SSA_TREE_OPERAND (use, stmt_to_move, it, SSA_OP_USE)
if (ssa_name_maybe_undef_p (use))
return false;
/* Allow assignments but allow some builtin/internal calls.
As const calls don't match any of the above, yet they could
@ -3967,6 +3970,7 @@ pass_phiopt::execute (function *)
bool cfgchanged = false;
calculate_dominance_info (CDI_DOMINATORS);
mark_ssa_maybe_undefs ();
/* Search every basic block for COND_EXPR we may be able to optimize.

View file

@ -1377,23 +1377,6 @@ ssa_undefined_value_p (tree t, bool partial)
}
/* Return TRUE iff STMT, a gimple statement, references an undefined
SSA name. */
bool
gimple_uses_undefined_value_p (gimple *stmt)
{
ssa_op_iter iter;
tree op;
FOR_EACH_SSA_TREE_OPERAND (op, stmt, iter, SSA_OP_USE)
if (ssa_undefined_value_p (op))
return true;
return false;
}
/* Return TRUE iff there are any non-PHI uses of VAR that dominate the
end of BB. If we return TRUE and BB is a loop header, then VAR we
be assumed to be defined within the loop, even if it is marked as

View file

@ -54,7 +54,6 @@ extern tree find_released_ssa_name (tree *, int *, void *);
extern bool ssa_defined_default_def_p (tree t);
extern bool ssa_undefined_value_p (tree, bool = true);
extern bool gimple_uses_undefined_value_p (gimple *);
bool ssa_name_any_use_dominates_bb_p (tree var, basic_block bb);