aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-phiopt.cc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2023-07-04 10:46:35 +0200
committerRichard Biener <rguenther@suse.de>2023-07-04 12:32:56 +0200
commit11350734240dbaf9dfe498ad0b7759a23f101ecc (patch)
treee32ab74a733235311d6d431c92ca142754a4462f /gcc/tree-ssa-phiopt.cc
parent6eea7eaf11e2b04670c4bb75f48600747dd76768 (diff)
downloadgcc-11350734240dbaf9dfe498ad0b7759a23f101ecc.zip
gcc-11350734240dbaf9dfe498ad0b7759a23f101ecc.tar.gz
gcc-11350734240dbaf9dfe498ad0b7759a23f101ecc.tar.bz2
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.
Diffstat (limited to 'gcc/tree-ssa-phiopt.cc')
-rw-r--r--gcc/tree-ssa-phiopt.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/tree-ssa-phiopt.cc b/gcc/tree-ssa-phiopt.cc
index 2fb28b4..31a7c39 100644
--- a/gcc/tree-ssa-phiopt.cc
+++ b/gcc/tree-ssa-phiopt.cc
@@ -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.