+/* Function vect_is_simple_use_1.
+
+ Same as vect_is_simple_use_1 but also determines the vector operand
+ type of OPERAND and stores it to *VECTYPE. If the definition of
+ OPERAND is vect_uninitialized_def, vect_constant_def or
+ vect_external_def *VECTYPE will be set to NULL_TREE and the caller
+ is responsible to compute the best suited vector type for the
+ scalar operand. */
+
+bool
+vect_is_simple_use_1 (tree operand, loop_vec_info loop_vinfo,
+ bb_vec_info bb_vinfo, gimple *def_stmt,
+ tree *def, enum vect_def_type *dt, tree *vectype)
+{
+ if (!vect_is_simple_use (operand, loop_vinfo, bb_vinfo, def_stmt, def, dt))
+ return false;
+
+ /* Now get a vector type if the def is internal, otherwise supply
+ NULL_TREE and leave it up to the caller to figure out a proper
+ type for the use stmt. */
+ if (*dt == vect_internal_def
+ || *dt == vect_induction_def
+ || *dt == vect_reduction_def
+ || *dt == vect_double_reduction_def
+ || *dt == vect_nested_cycle)
+ {
+ stmt_vec_info stmt_info = vinfo_for_stmt (*def_stmt);
+ if (STMT_VINFO_IN_PATTERN_P (stmt_info))
+ stmt_info = vinfo_for_stmt (STMT_VINFO_RELATED_STMT (stmt_info));
+ *vectype = STMT_VINFO_VECTYPE (stmt_info);
+ gcc_assert (*vectype != NULL_TREE);
+ }
+ else if (*dt == vect_uninitialized_def
+ || *dt == vect_constant_def
+ || *dt == vect_external_def)
+ *vectype = NULL_TREE;
+ else
+ gcc_unreachable ();
+
+ return true;
+}
+