--- /dev/null
+// { dg-do compile }
+// { dg-require-effective-target vect_int }
+
+struct A
+{
+ unsigned int a, b, c, d;
+
+ A& operator+= (A const& that)
+ {
+ a += that.a;
+ b += that.b;
+ c += that.c;
+ d += that.d;
+ return *this;
+ }
+
+ A& operator-= (A const& that)
+ {
+ a -= that.a;
+ b -= that.b;
+ c -= that.c;
+ d -= that.d;
+ return *this;
+ }
+};
+
+void test(A& x, A const& y1, A const& y2)
+{
+ x += y1;
+ x -= y2;
+}
+
+// We want to SLP vectorize a single connected SLP subgraph with two instances
+// { dg-final { scan-tree-dump-not "removing SLP instance" "slp2" } }
+// { dg-final { scan-tree-dump-times "SLPing BB part" 1 "slp2" } }
+// { dg-final { scan-tree-dump-times "Vectorizing SLP" 2 "slp2" } }
stmt we have to resort to the alias oracle. */
stmt_vec_info stmt_info = vinfo->lookup_stmt (stmt);
data_reference *dr_b = STMT_VINFO_DATA_REF (stmt_info);
- if (!dr_b)
+
+ /* We are hoisting a load - this means we can use
+ TBAA for disambiguation. */
+ if (!ref_initialized_p)
+ ao_ref_init (&ref, DR_REF (dr_a));
+ if (stmt_may_clobber_ref_p_1 (stmt, &ref, true))
{
- /* We are hoisting a load - this means we can use
- TBAA for disambiguation. */
- if (!ref_initialized_p)
- ao_ref_init (&ref, DR_REF (dr_a));
- if (stmt_may_clobber_ref_p_1 (stmt, &ref, true))
+ if (!dr_b)
return false;
- continue;
+ /* Resort to dependence checking below. */
}
+ else
+ /* No dependence. */
+ continue;
bool dependent = false;
/* If we run into a store of this same instance (we've just