]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Relax vect_check_scalar_mask check
authorRichard Biener <rguenther@suse.de>
Wed, 23 Oct 2024 09:55:31 +0000 (11:55 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 25 Oct 2024 09:14:42 +0000 (11:14 +0200)
When the mask is not a constant or external def there's no need to
check the scalar type, in particular with SLP and the mask being
a VEC_PERM_EXPR there isn't a scalar operand ready to check
(not one vect_is_simple_use will get you).  We later check the
vector type and reject non-mask types there.

* tree-vect-stmts.cc (vect_check_scalar_mask): Only check
the scalar type for constant or extern defs.

gcc/tree-vect-stmts.cc

index ce5289ec60ee795f01a52b4a6fb9c9d68b977876..9f1449dfc259dd760fff3c3c0b38383dfcabfab2 100644 (file)
@@ -2520,7 +2520,8 @@ vect_check_scalar_mask (vec_info *vinfo, stmt_vec_info stmt_info,
       return false;
     }
 
-  if (!VECT_SCALAR_BOOLEAN_TYPE_P (TREE_TYPE (*mask)))
+  if ((mask_dt == vect_constant_def || mask_dt == vect_external_def)
+      && !VECT_SCALAR_BOOLEAN_TYPE_P (TREE_TYPE (*mask)))
     {
       if (dump_enabled_p ())
        dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,