On Tue, 30 Jan 2024 at 20:13, Richard Ball <richard.b...@arm.com> wrote:
>
> Adds a check to ensure that the input vector arguments
> to a function are not variable length. Previously, only the
> output vector of a function was checked.
Hi,
Quoting from patch:
@@ -8989,6 +8989,14 @@ vectorizable_slp_permutation_1 (vec_info
*vinfo, gimple_stmt_iterator *gsi,
       instead of relying on the pattern described above.  */
       if (!nunits.is_constant (&npatterns))
      return -1;
+  FOR_EACH_VEC_ELT (children, i, child)
+     if (SLP_TREE_VECTYPE (child))
+       {
+         tree child_vectype = SLP_TREE_VECTYPE (child);
+         poly_uint64 child_nunits = TYPE_VECTOR_SUBPARTS (child_vectype);
+         if (!child_nunits.is_constant ())
+           return -1;
+       }

Just wondering if that'd be equivalent to checking:
if (!TYPE_VECTOR_SUBPARTS (op_vectype).is_constant ())
  return -1;
Instead of (again) iterating over children since we bail out in the
function above,
if SLP_TREE_VECTYPE (child) and op_vectype are not compatible types ?

Also, could you please include the offending test-case in the patch ?

Thanks,
Prathamesh

>
> gcc/ChangeLog:
>
>         * tree-vect-slp.cc (vectorizable_slp_permutation_1):
>         Add variable-length check for vector input arguments
>         to a function.

Reply via email to