https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109176

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rsandifo at gcc dot gnu.org

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Before veclower2 we had/have
  _7 = ba_5(D) < a_6(D);
  _8 = svnand_b_z (_7, _7, _7);
  _9 = VEC_COND_EXPR <_7, _8, _7>;
where _7/_8/_9 are all __SVBool_t.
Before the r11-1445 changes, the VEC_COND_EXPR would be left untouched, because
expand_vec_cond_expr_p (__SVBool_t, __SVBool_t, SSA_NAME) is true on aarch64.
Now it doesn't, because _7 def_stmt is a comparison, and so
expand_vec_cond_expr_p (__SVBool_t, VNx16QI, LT_EXPR).
--- gcc/tree-vect-generic.cc.jj 2023-03-12 22:36:06.356178068 +0100
+++ gcc/tree-vect-generic.cc    2023-03-20 16:31:03.321831866 +0100
@@ -1063,6 +1063,12 @@ expand_vector_condition (gimple_stmt_ite
       return true;
     }

+  if (!TYPE_VECTOR_SUBPARTS (type).is_constant ()
+      && VECTOR_BOOLEAN_TYPE_P (type)
+      && VECTOR_BOOLEAN_TYPE_P (TREE_TYPE (a))
+      && expand_vec_cond_expr_p (type, TREE_TYPE (a), TREE_CODE (a)))
+    return true;
+
   /* Handle vector boolean types with bitmasks.  If there is a comparison
      and we can expand the comparison into the vector boolean bitmask,
      or otherwise if it is compatible with type, we can transform
basically restores the behaviour here for the SVE boolean types and makes it
compile.
Because otherwise, unless this would be solvable by the AVX512 "Handle vector
boolean types with bitmasks." code the non-constant vector elts cases will
always ICE in the following code,   int nunits = nunits_for_known_piecewise_op
(type);
requires constant TYPE_VECTOR_SUBPARTS and the code really isn't prepared to
handle anything non-constant.

Reply via email to