+2020-01-06 Richard Sandiford <richard.sandiford@arm.com>
+
+ * tree-vect-stmts.c (vect_check_load_store_mask): Rename to...
+ (vect_check_scalar_mask): ...this.
+ (vectorizable_store, vectorizable_load): Update call accordingly.
+ (vectorizable_call): Use vect_check_scalar_mask to check the mask
+ argument in calls to conditional internal functions.
+
2020-01-06 Andrew Stubbs <ams@codesourcery.com>
* config/gcn/gcn-valu.md (subv64di3): Use separate alternatives for
}
/* Return true if boolean argument MASK is suitable for vectorizing
- conditional load or store STMT_INFO. When returning true, store the type
+ conditional operation STMT_INFO. When returning true, store the type
of the definition in *MASK_DT_OUT and the type of the vectorized mask
in *MASK_VECTYPE_OUT. */
static bool
-vect_check_load_store_mask (stmt_vec_info stmt_info, tree mask,
- vect_def_type *mask_dt_out,
- tree *mask_vectype_out)
+vect_check_scalar_mask (stmt_vec_info stmt_info, tree mask,
+ vect_def_type *mask_dt_out,
+ tree *mask_vectype_out)
{
vec_info *vinfo = stmt_info->vinfo;
if (!VECT_SCALAR_BOOLEAN_TYPE_P (TREE_TYPE (mask)))
for (i = 0; i < nargs; i++)
{
op = gimple_call_arg (stmt, i);
+
+ if ((int) i == mask_opno)
+ {
+ if (!vect_check_scalar_mask (stmt_info, op, &dt[i], &vectypes[i]))
+ return false;
+ continue;
+ }
+
if (!vect_is_simple_use (op, vinfo, &dt[i], &vectypes[i]))
{
if (dump_enabled_p ())
return false;
}
- /* Skip the mask argument to an internal function. This operand
- has been converted via a pattern if necessary. */
- if ((int) i == mask_opno)
- continue;
-
/* We can only handle calls with arguments of the same type. */
if (rhs_type
&& !types_compatible_p (rhs_type, TREE_TYPE (op)))
continue;
}
- if (mask_opno >= 0 && !vectypes[mask_opno])
- {
- gcc_assert (modifier != WIDEN);
- vectypes[mask_opno] = truth_type_for (vectype_in);
- }
-
for (i = 0; i < nargs; i++)
{
op = gimple_call_arg (stmt, i);
if (mask_index >= 0)
{
mask = gimple_call_arg (call, mask_index);
- if (!vect_check_load_store_mask (stmt_info, mask, &mask_dt,
- &mask_vectype))
+ if (!vect_check_scalar_mask (stmt_info, mask, &mask_dt,
+ &mask_vectype))
return false;
}
}
if (mask_index >= 0)
{
mask = gimple_call_arg (call, mask_index);
- if (!vect_check_load_store_mask (stmt_info, mask, &mask_dt,
- &mask_vectype))
+ if (!vect_check_scalar_mask (stmt_info, mask, &mask_dt,
+ &mask_vectype))
return false;
}
}