+2019-06-03 Alejandro Martinez <alejandro.martinezvicente@arm.com>
+
+ PR tree-optimization/90681
+ * internal-fn.c (mask_load_direct): Mark as non-vectorizable again.
+ * tree-vect-slp.c (vect_build_slp_tree_1): Add masked loads as a
+ special case for SLP, but fail on non-groupped loads.
+
2019-06-03 Martin Liska <mliska@suse.cz>
* cfg.c (debug): Use TDF_DETAILS for debug and
/* Create static initializers for the information returned by
direct_internal_fn. */
#define not_direct { -2, -2, false }
-#define mask_load_direct { -1, 2, true }
+#define mask_load_direct { -1, 2, false }
#define load_lanes_direct { -1, -1, false }
#define mask_load_lanes_direct { -1, -1, false }
#define gather_load_direct { -1, -1, false }
machine_mode optab_op2_mode;
machine_mode vec_mode;
stmt_vec_info first_load = NULL, prev_first_load = NULL;
+ bool load_p = false;
/* For every stmt in NODE find its def stmt/s. */
stmt_vec_info stmt_info;
if (gcall *call_stmt = dyn_cast <gcall *> (stmt))
{
rhs_code = CALL_EXPR;
- if ((gimple_call_internal_p (call_stmt)
- && (!vectorizable_internal_fn_p
- (gimple_call_internal_fn (call_stmt))))
- || gimple_call_tail_p (call_stmt)
- || gimple_call_noreturn_p (call_stmt)
- || !gimple_call_nothrow_p (call_stmt)
- || gimple_call_chain (call_stmt))
+
+ if (gimple_call_internal_p (stmt, IFN_MASK_LOAD))
+ load_p = true;
+ else if ((gimple_call_internal_p (call_stmt)
+ && (!vectorizable_internal_fn_p
+ (gimple_call_internal_fn (call_stmt))))
+ || gimple_call_tail_p (call_stmt)
+ || gimple_call_noreturn_p (call_stmt)
+ || !gimple_call_nothrow_p (call_stmt)
+ || gimple_call_chain (call_stmt))
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
}
}
else
- rhs_code = gimple_assign_rhs_code (stmt);
+ {
+ rhs_code = gimple_assign_rhs_code (stmt);
+ load_p = TREE_CODE_CLASS (rhs_code) == tcc_reference;
+ }
/* Check the operation. */
if (i == 0)
} /* Grouped access. */
else
{
- if (TREE_CODE_CLASS (rhs_code) == tcc_reference)
+ if (load_p)
{
/* Not grouped load. */
if (dump_enabled_p ())