public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-708] Remove is_gimple_condexpr
@ 2022-05-23 9:30 Richard Biener
0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2022-05-23 9:30 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:19dd439389be2c5eb6b986d164760e061ba01938
commit r13-708-g19dd439389be2c5eb6b986d164760e061ba01938
Author: Richard Biener <rguenther@suse.de>
Date: Thu May 12 15:26:22 2022 +0200
Remove is_gimple_condexpr
This removes is_gimple_condexpr, note the vectorizer via patterns
still creates COND_EXPRs with embedded GENERIC conditions and has
a reference to the function in comments. Otherwise is_gimple_condexpr
is now equal to is_gimple_val.
2022-05-16 Richard Biener <rguenther@suse.de>
* gimple-expr.cc (is_gimple_condexpr): Remove.
* gimple-expr.h (is_gimple_condexpr): Likewise.
* gimplify.cc (gimplify_expr): Remove is_gimple_condexpr usage.
* tree-if-conv.cc (set_bb_predicate): Likewie.
(add_to_predicate_list): Likewise.
(gen_phi_arg_condition): Likewise.
(predicate_scalar_phi): Likewise.
(predicate_statements): Likewise.
Diff:
---
gcc/gimple-expr.cc | 11 -----------
gcc/gimple-expr.h | 1 -
gcc/gimplify.cc | 1 -
gcc/tree-if-conv.cc | 33 ++++++++++++++-------------------
4 files changed, 14 insertions(+), 32 deletions(-)
diff --git a/gcc/gimple-expr.cc b/gcc/gimple-expr.cc
index 09eac80ae1c..c9c7285efbc 100644
--- a/gcc/gimple-expr.cc
+++ b/gcc/gimple-expr.cc
@@ -614,17 +614,6 @@ is_gimple_condexpr_1 (tree t, bool allow_traps, bool allow_cplx)
&& is_gimple_val (TREE_OPERAND (t, 1))));
}
-/* Return true if T is a condition operand in a GIMPLE assignment
- with a COND_EXPR RHS. */
-
-bool
-is_gimple_condexpr (tree t)
-{
- /* Always split out _Complex type compares since complex lowering
- doesn't handle this case. */
- return is_gimple_val (t);
-}
-
/* Like is_gimple_condexpr, but does not allow T to trap. */
bool
diff --git a/gcc/gimple-expr.h b/gcc/gimple-expr.h
index ba53b808437..0c3ac096ed7 100644
--- a/gcc/gimple-expr.h
+++ b/gcc/gimple-expr.h
@@ -40,7 +40,6 @@ extern void extract_ops_from_tree (tree, enum tree_code *, tree *, tree *,
extern void gimple_cond_get_ops_from_tree (tree, enum tree_code *, tree *,
tree *);
extern bool is_gimple_lvalue (tree);
-extern bool is_gimple_condexpr (tree);
extern bool is_gimple_condexpr_for_cond (tree);
extern bool is_gimple_address (const_tree);
extern bool is_gimple_invariant_address (const_tree);
diff --git a/gcc/gimplify.cc b/gcc/gimplify.cc
index 2b92b6394dc..98f554491e2 100644
--- a/gcc/gimplify.cc
+++ b/gcc/gimplify.cc
@@ -15023,7 +15023,6 @@ gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
gcc_assert (fallback & (fb_rvalue | fb_lvalue));
else if (gimple_test_f == is_gimple_val
|| gimple_test_f == is_gimple_call_addr
- || gimple_test_f == is_gimple_condexpr
|| gimple_test_f == is_gimple_condexpr_for_cond
|| gimple_test_f == is_gimple_mem_rhs
|| gimple_test_f == is_gimple_mem_rhs_or_call
diff --git a/gcc/tree-if-conv.cc b/gcc/tree-if-conv.cc
index 5b884aae3d6..2245b6bfd7c 100644
--- a/gcc/tree-if-conv.cc
+++ b/gcc/tree-if-conv.cc
@@ -244,8 +244,8 @@ static inline void
set_bb_predicate (basic_block bb, tree cond)
{
gcc_assert ((TREE_CODE (cond) == TRUTH_NOT_EXPR
- && is_gimple_condexpr (TREE_OPERAND (cond, 0)))
- || is_gimple_condexpr (cond));
+ && is_gimple_val (TREE_OPERAND (cond, 0)))
+ || is_gimple_val (cond));
((struct bb_predicate *) bb->aux)->predicate = cond;
}
@@ -544,10 +544,10 @@ add_to_predicate_list (class loop *loop, basic_block bb, tree nc)
tp = &TREE_OPERAND (bc, 0);
else
tp = &bc;
- if (!is_gimple_condexpr (*tp))
+ if (!is_gimple_val (*tp))
{
gimple_seq stmts;
- *tp = force_gimple_operand_1 (*tp, &stmts, is_gimple_condexpr, NULL_TREE);
+ *tp = force_gimple_operand (*tp, &stmts, true, NULL_TREE);
add_bb_predicate_gimplified_stmts (bb, stmts);
}
set_bb_predicate (bb, bc);
@@ -1884,16 +1884,14 @@ gen_phi_arg_condition (gphi *phi, vec<int> *occur,
cond = c;
break;
}
- c = force_gimple_operand_gsi_1 (gsi, unshare_expr (c),
- is_gimple_condexpr, NULL_TREE,
- true, GSI_SAME_STMT);
+ c = force_gimple_operand_gsi (gsi, unshare_expr (c),
+ true, NULL_TREE, true, GSI_SAME_STMT);
if (cond != NULL_TREE)
{
/* Must build OR expression. */
cond = fold_or_predicates (EXPR_LOCATION (c), c, cond);
- cond = force_gimple_operand_gsi_1 (gsi, unshare_expr (cond),
- is_gimple_condexpr, NULL_TREE,
- true, GSI_SAME_STMT);
+ cond = force_gimple_operand_gsi (gsi, unshare_expr (cond), true,
+ NULL_TREE, true, GSI_SAME_STMT);
}
else
cond = c;
@@ -1973,9 +1971,8 @@ predicate_scalar_phi (gphi *phi, gimple_stmt_iterator *gsi)
else
cond = bb_predicate (first_edge->src);
/* Gimplify the condition to a valid cond-expr conditonal operand. */
- cond = force_gimple_operand_gsi_1 (gsi, unshare_expr (cond),
- is_gimple_condexpr, NULL_TREE,
- true, GSI_SAME_STMT);
+ cond = force_gimple_operand_gsi (gsi, unshare_expr (cond), true,
+ NULL_TREE, true, GSI_SAME_STMT);
true_bb = first_edge->src;
if (EDGE_PRED (bb, 1)->src == true_bb)
{
@@ -2074,9 +2071,8 @@ predicate_scalar_phi (gphi *phi, gimple_stmt_iterator *gsi)
cond = TREE_OPERAND (cond, 0);
}
/* Gimplify the condition to a valid cond-expr conditonal operand. */
- cond = force_gimple_operand_gsi_1 (gsi, unshare_expr (cond),
- is_gimple_condexpr, NULL_TREE,
- true, GSI_SAME_STMT);
+ cond = force_gimple_operand_gsi (gsi, unshare_expr (cond), true,
+ NULL_TREE, true, GSI_SAME_STMT);
if (!(is_cond_scalar_reduction (phi, &reduc, arg0 , arg1,
&op0, &op1, true, &has_nop, &nop_reduc)))
rhs = fold_build_cond_expr (TREE_TYPE (res), unshare_expr (cond),
@@ -2612,9 +2608,8 @@ predicate_statements (loop_p loop)
rhs = ifc_temp_var (type, unshare_expr (rhs), &gsi);
if (swap)
std::swap (lhs, rhs);
- cond = force_gimple_operand_gsi_1 (&gsi, unshare_expr (cond),
- is_gimple_condexpr, NULL_TREE,
- true, GSI_SAME_STMT);
+ cond = force_gimple_operand_gsi (&gsi, unshare_expr (cond), true,
+ NULL_TREE, true, GSI_SAME_STMT);
rhs = fold_build_cond_expr (type, unshare_expr (cond), rhs, lhs);
gimple_assign_set_rhs1 (stmt, ifc_temp_var (type, rhs, &gsi));
update_stmt (stmt);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-05-23 9:30 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-23 9:30 [gcc r13-708] Remove is_gimple_condexpr Richard Biener
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).