aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-loop-versioning.cc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2022-04-11 12:18:48 +0200
committerRichard Biener <rguenther@suse.de>2022-04-29 12:13:48 +0200
commitc090743b2ae0095f792371c7cbeb3cf6e2978f5d (patch)
tree3526e923d4e83fd10ccb3f13dc23214b24203c86 /gcc/gimple-loop-versioning.cc
parent4aa61e08ade43fa1e94dc0e951f11739bbd2ae40 (diff)
downloadgcc-c090743b2ae0095f792371c7cbeb3cf6e2978f5d.zip
gcc-c090743b2ae0095f792371c7cbeb3cf6e2978f5d.tar.gz
gcc-c090743b2ae0095f792371c7cbeb3cf6e2978f5d.tar.bz2
Fix is_gimple_condexpr vs is_gimple_condexpr_for_cond
The following fixes wrongly used is_gimple_condexpr and makes canonicalize_cond_expr_cond honor either, delaying final checking to callers where all but two in ifcombine are doing the correct thing already. This fixes bugs but is now mainly in preparation for making COND_EXPRs in GIMPLE assignments no longer have a GENERIC expression as condition operand like we already transitioned VEC_COND_EXPR earlier. 2022-04-11 Richard Biener <rguenther@suse.de> * gimple-expr.cc (is_gimple_condexpr): Adjust comment. (canonicalize_cond_expr_cond): Move here from gimple.cc, allow both COND_EXPR and GIMPLE_COND forms. * gimple-expr.h (canonicalize_cond_expr_cond): Declare. * gimple.cc (canonicalize_cond_expr_cond): Remove here. * gimple.h (canonicalize_cond_expr_cond): Likewise. * gimple-loop-versioning.cc (loop_versioning::version_loop): Use is_gimple_condexpr_for_cond. * tree-parloops.cc (gen_parallel_loop): Likewise. * tree-ssa-ifcombine.cc (ifcombine_ifandif): Check for a proper cond expr after canonicalize_cond_expr_cond. Use is_gimple_condexpr_for_cond where appropriate. * tree-ssa-loop-manip.cc (determine_exit_conditions): Likewise. * tree-vect-loop-manip.cc (slpeel_add_loop_guard): Likewise.
Diffstat (limited to 'gcc/gimple-loop-versioning.cc')
-rw-r--r--gcc/gimple-loop-versioning.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/gimple-loop-versioning.cc b/gcc/gimple-loop-versioning.cc
index 3175a1e..5838ce7 100644
--- a/gcc/gimple-loop-versioning.cc
+++ b/gcc/gimple-loop-versioning.cc
@@ -1681,7 +1681,8 @@ loop_versioning::version_loop (class loop *loop)
/* Convert the condition into a suitable gcond. */
gimple_seq stmts = NULL;
- cond = force_gimple_operand_1 (cond, &stmts, is_gimple_condexpr, NULL_TREE);
+ cond = force_gimple_operand_1 (cond, &stmts, is_gimple_condexpr_for_cond,
+ NULL_TREE);
/* Version the loop. */
initialize_original_copy_tables ();