From: Marc Glisse Date: Fri, 31 May 2019 17:04:20 +0000 (+0200) Subject: apply unary op to both sides of (vec_cond x cst1 cst2) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=34a13a521e3fc6f46fcaf2f158d20e66874e99fd;p=gcc.git apply unary op to both sides of (vec_cond x cst1 cst2) 2019-05-31 Marc Glisse gcc/ * match.pd (~(vec?cst1:cst2)): New transformation. gcc/testsuite/ * g++.dg/tree-ssa/cprop-vcond.C: New file. From-SVN: r271817 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 67cfc44f19b..832ec727959 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2019-05-31 Marc Glisse + + * match.pd (~(vec?cst1:cst2)): New transformation. + 2019-05-31 Marc Glisse * match.pd (X/[ex]D + + * g++.dg/tree-ssa/cprop-vcond.C: New file. + 2019-05-31 Marc Glisse * gcc.dg/tree-ssa/cmpexactdiv-3.c: New file. diff --git a/gcc/testsuite/g++.dg/tree-ssa/cprop-vcond.C b/gcc/testsuite/g++.dg/tree-ssa/cprop-vcond.C new file mode 100644 index 00000000000..7d62cff1a17 --- /dev/null +++ b/gcc/testsuite/g++.dg/tree-ssa/cprop-vcond.C @@ -0,0 +1,12 @@ +/* { 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" } } */