aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAndrew Pinski <quic_apinski@quicinc.com>2025-04-30 12:56:13 -0700
committerAndrew Pinski <quic_apinski@quicinc.com>2025-05-01 08:02:12 -0700
commitbbc96c9c09921ca7d59564851d0ed6dcd918c300 (patch)
tree5e4344675c3b138b43df1635eb633aa08a8a7217 /gcc
parent1fb5abc3919f376f3dedccad636eba4a4ad7e4a7 (diff)
downloadgcc-bbc96c9c09921ca7d59564851d0ed6dcd918c300.zip
gcc-bbc96c9c09921ca7d59564851d0ed6dcd918c300.tar.gz
gcc-bbc96c9c09921ca7d59564851d0ed6dcd918c300.tar.bz2
phiopt: Remove special case for a sequence after match and simplify for early phiopt
r16-189-g99aa410f5e0a72 fixed the case where match-and-simplify there was an extra assignment happening inside the sequence return. phiopt_early_allow had code to workaround that issue but now can be removed and simplify down to only allowing the sequence having only one MIN/MAX if the outer code is MIN/MAX also. Bootstrapped and tested on x86_64-linux-gnu. gcc/ChangeLog: * tree-ssa-phiopt.cc (phiopt_early_allow): Only allow a sequence with one statement for MIN/MAX and the op was MIN/MAX. Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
Diffstat (limited to 'gcc')
-rw-r--r--gcc/tree-ssa-phiopt.cc16
1 files changed, 2 insertions, 14 deletions
diff --git a/gcc/tree-ssa-phiopt.cc b/gcc/tree-ssa-phiopt.cc
index e27166c..54ecd93 100644
--- a/gcc/tree-ssa-phiopt.cc
+++ b/gcc/tree-ssa-phiopt.cc
@@ -549,8 +549,7 @@ phiopt_early_allow (gimple_seq &seq, gimple_match_op &op)
tree_code code = (tree_code)op.code;
/* For non-empty sequence, only allow one statement
- except for MIN/MAX, allow max 2 statements,
- each with MIN/MAX. */
+ a MIN/MAX and an original MIN/MAX. */
if (!gimple_seq_empty_p (seq))
{
if (code == MIN_EXPR || code == MAX_EXPR)
@@ -565,18 +564,7 @@ phiopt_early_allow (gimple_seq &seq, gimple_match_op &op)
code = gimple_assign_rhs_code (stmt);
return code == MIN_EXPR || code == MAX_EXPR;
}
- /* Check to make sure op was already a SSA_NAME. */
- if (code != SSA_NAME)
- return false;
- if (!gimple_seq_singleton_p (seq))
- return false;
- gimple *stmt = gimple_seq_first_stmt (seq);
- /* Only allow assignments. */
- if (!is_gimple_assign (stmt))
- return false;
- if (gimple_assign_lhs (stmt) != op.ops[0])
- return false;
- code = gimple_assign_rhs_code (stmt);
+ return false;
}
switch (code)