aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2025-10-02 14:41:01 +0200
committerRichard Biener <rguenth@gcc.gnu.org>2025-10-02 15:58:14 +0200
commite5ae5b5ba6f2af408717034d82c40839642667b0 (patch)
treec35f40f7da83f22c8ae74ecf4c5551f09ca8ddeb /gcc
parent328dc7f2dd1ab1e60633647f9a1fb2ec717a9afc (diff)
downloadgcc-e5ae5b5ba6f2af408717034d82c40839642667b0.zip
gcc-e5ae5b5ba6f2af408717034d82c40839642667b0.tar.gz
gcc-e5ae5b5ba6f2af408717034d82c40839642667b0.tar.bz2
Disallow mask reduction vectorization
When you trick bool pattern recognition to use a mask type for a reduction PHI you'll figure we're not ready to handle this because epilogue creation isn't expecting this yet. The following reverts part of the last change and makes this explicit. * tree-vect-loop.cc (vectorizable_reduction): Do not allow mask reductions.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/tree-vect-loop.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc
index 1d549e4..df45adb 100644
--- a/gcc/tree-vect-loop.cc
+++ b/gcc/tree-vect-loop.cc
@@ -7177,6 +7177,15 @@ vectorizable_reduction (loop_vec_info loop_vinfo,
tree vectype_out = SLP_TREE_VECTYPE (slp_for_stmt_info);
VECT_REDUC_INFO_VECTYPE (reduc_info) = vectype_out;
+ /* We do not handle mask reductions correctly in the epilogue. */
+ if (VECTOR_BOOLEAN_TYPE_P (vectype_out))
+ {
+ if (dump_enabled_p ())
+ dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
+ "mask reduction not supported.\n");
+ return false;
+ }
+
gimple_match_op op;
if (!gimple_extract_op (stmt_info->stmt, &op))
gcc_unreachable ();
@@ -7187,8 +7196,7 @@ vectorizable_reduction (loop_vec_info loop_vinfo,
return false;
/* Do not try to vectorize bit-precision reductions. */
- if (!VECTOR_BOOLEAN_TYPE_P (vectype_out)
- && !type_has_mode_precision_p (op.type)
+ if (!type_has_mode_precision_p (op.type)
&& op.code != BIT_AND_EXPR
&& op.code != BIT_IOR_EXPR
&& op.code != BIT_XOR_EXPR)