+2019-05-31 Marc Glisse <marc.glisse@inria.fr>
+
+ * match.pd (~(vec?cst1:cst2)): New transformation.
+
2019-05-31 Marc Glisse <marc.glisse@inria.fr>
* match.pd (X/[ex]D<Y/[ex]D): Handle negative denominator.
(if (integer_zerop (@0))
@2)))
+/* Sink unary operations to constant branches, but only if we do fold it to
+ constants. */
+(for op (negate bit_not abs absu)
+ (simplify
+ (op (vec_cond @0 VECTOR_CST@1 VECTOR_CST@2))
+ (with
+ {
+ tree cst1, cst2;
+ cst1 = const_unop (op, type, @1);
+ if (cst1)
+ cst2 = const_unop (op, type, @2);
+ }
+ (if (cst1 && cst2)
+ (vec_cond @0 { cst1; } { cst2; })))))
+
/* Simplification moved from fold_cond_expr_with_comparison. It may also
be extended. */
/* This pattern implements two kinds simplification:
+2019-05-31 Marc Glisse <marc.glisse@inria.fr>
+
+ * g++.dg/tree-ssa/cprop-vcond.C: New file.
+
2019-05-31 Marc Glisse <marc.glisse@inria.fr>
* gcc.dg/tree-ssa/cmpexactdiv-3.c: New file.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-forwprop1-raw" } */
+
+typedef long vec __attribute__((vector_size(2*sizeof(long))));
+void f(vec*v){
+ vec t = { 5, 16 };
+ vec f = { 27, -11 };
+ vec r = *v ? t : f;
+ *v = -r;
+}
+
+/* { dg-final { scan-tree-dump-not "negate_expr" "forwprop1" } } */