--- /dev/null
+/* { dg-do compile } */
+/* { dg-add-options vect_early_break } */
+/* { dg-require-effective-target vect_early_break } */
+/* { dg-require-effective-target vect_int } */
+
+struct ColorSpace {
+ int componentCt;
+};
+
+struct Psnr {
+ double psnr[3];
+};
+
+int f(struct Psnr psnr, struct ColorSpace colorSpace) {
+ int i, hitsTarget = 1;
+
+ for (i = 1; i < colorSpace.componentCt && hitsTarget; ++i)
+ hitsTarget = !(psnr.psnr[i] < 1);
+
+ return hitsTarget;
+}
if (VECTOR_TYPE_P (scalar_type))
return NULL;
- if (code == NE_EXPR
- && zerop (rhs)
- && VECT_SCALAR_BOOLEAN_TYPE_P (scalar_type))
- return NULL;
+ /* If the input is a boolean then try to figure out the precision that the
+ vector type should use. We cannot use the scalar precision as this would
+ later mismatch. This is similar to what recog_bool does. */
+ if (VECT_SCALAR_BOOLEAN_TYPE_P (scalar_type))
+ {
+ if (tree stype = integer_type_for_mask (lhs, vinfo))
+ scalar_type = stype;
+ }
- tree vecitype = get_vectype_for_scalar_type (vinfo, scalar_type);
- if (vecitype == NULL_TREE)
+ tree vectype = get_mask_type_for_scalar_type (vinfo, scalar_type);
+ if (vectype == NULL_TREE)
return NULL;
- tree vectype = truth_type_for (vecitype);
-
tree new_lhs = vect_recog_temp_ssa_var (boolean_type_node, NULL);
gimple *new_stmt = gimple_build_assign (new_lhs, code, lhs, rhs);
append_pattern_def_seq (vinfo, stmt_vinfo, new_stmt, vectype, scalar_type);
return NULL;
}
-
/* A helper for vect_recog_mask_conversion_pattern. Build
conversion of MASK to a type suitable for masking VECTYPE.
Built statement gets required vectype and is appended to
from them. It's highly likely that the resulting SLP tree here if both
arguments have a def will be incompatible, but we rely on it being split
later on. */
- if (auto varg = loop_vinfo->lookup_def (args0))
- {
- vec<stmt_vec_info> stmts;
- vec<tree> remain = vNULL;
- stmts.create (1);
- stmts.quick_push (vect_stmt_to_vectorize (varg));
+ auto varg = loop_vinfo->lookup_def (args0);
+ vec<stmt_vec_info> stmts;
+ vec<tree> remain = vNULL;
+ stmts.create (1);
+ stmts.quick_push (vect_stmt_to_vectorize (varg));
- vect_build_slp_instance (vinfo, slp_inst_kind_gcond,
- stmts, roots, remain,
- max_tree_size, &limit,
- bst_map, NULL, force_single_lane);
- }
- else
- {
- /* Create a new SLP instance. */
- slp_instance new_instance = XNEW (class _slp_instance);
- vec<tree> ops;
- ops.create (1);
- ops.quick_push (args0);
- slp_tree invnode = vect_create_new_slp_node (ops);
- SLP_TREE_DEF_TYPE (invnode) = vect_external_def;
- SLP_INSTANCE_TREE (new_instance) = invnode;
- SLP_INSTANCE_LOADS (new_instance) = vNULL;
- SLP_INSTANCE_ROOT_STMTS (new_instance) = roots;
- SLP_INSTANCE_REMAIN_DEFS (new_instance) = vNULL;
- SLP_INSTANCE_KIND (new_instance) = slp_inst_kind_gcond;
- new_instance->reduc_phis = NULL;
- new_instance->cost_vec = vNULL;
- new_instance->subgraph_entries = vNULL;
- vinfo->slp_instances.safe_push (new_instance);
- }
+ vect_build_slp_instance (vinfo, slp_inst_kind_gcond,
+ stmts, roots, remain,
+ max_tree_size, &limit,
+ bst_map, NULL, force_single_lane);
}
/* Find and create slp instances for inductions that have been forced