The following disables the use of rotate patterns with reductions
since it breaks then single rotate SSA use-def chain constraints.
PR tree-optimization/122023
* tree-vect-patterns.cc (vect_recog_rotate_pattern): Disable
for rotates.
* gcc.dg/vect/pr122023.c: New testcase.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-require-effective-target int32plus } */
+
+unsigned int gvar1;
+int gvar2;
+void f ()
+{
+ unsigned int temp1;
+ while (gvar1--)
+ {
+ temp1 = gvar2;
+ gvar2 >>= 1;
+ gvar2 &= 2147483647;
+ temp1 <<= 31;
+ gvar2 |= temp1;
+ }
+}
goto use_rotate;
}
+ /* We may not use a reduction operand twice. */
+ if (vect_is_reduction (stmt_vinfo))
+ return NULL;
+
tree utype = unsigned_type_for (type);
tree uvectype = get_vectype_for_scalar_type (vinfo, utype);
if (!uvectype)