aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2024-02-23 16:16:38 +0100
committerRichard Biener <rguenther@suse.de>2024-06-06 08:55:56 +0200
commit28edeb1409a7b839407ec06031899b933390bff3 (patch)
tree983b327dcdee47eda60c58fdbd46279df261a184 /gcc
parent6a6bab4ba36c5d190b3151055e683e7067be92c1 (diff)
downloadgcc-28edeb1409a7b839407ec06031899b933390bff3.zip
gcc-28edeb1409a7b839407ec06031899b933390bff3.tar.gz
gcc-28edeb1409a7b839407ec06031899b933390bff3.tar.bz2
Relax COND_EXPR reduction vectorization SLP restriction
Allow one-lane SLP but for the case where we need to swap the arms. * tree-vect-stmts.cc (vectorizable_condition): Allow single-lane SLP, but not when we need to swap then and else clause.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/tree-vect-stmts.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc
index b26cc74..c82381e 100644
--- a/gcc/tree-vect-stmts.cc
+++ b/gcc/tree-vect-stmts.cc
@@ -12116,7 +12116,7 @@ vectorizable_condition (vec_info *vinfo,
= STMT_VINFO_REDUC_DEF (vect_orig_stmt (stmt_info)) != NULL;
if (for_reduction)
{
- if (slp_node)
+ if (slp_node && SLP_TREE_LANES (slp_node) > 1)
return false;
reduc_info = info_for_reduction (vinfo, stmt_info);
reduction_type = STMT_VINFO_REDUC_TYPE (reduc_info);
@@ -12205,6 +12205,10 @@ vectorizable_condition (vec_info *vinfo,
cond_expr = NULL_TREE;
}
}
+ /* ??? The vectorized operand query below doesn't allow swapping
+ this way for SLP. */
+ if (slp_node)
+ return false;
std::swap (then_clause, else_clause);
}