match.pd: Fold (~X | C) ^ D into (X | C) ^ (~D ^ C) if (~D ^ C) can be simplified...
authorJakub Jelinek <jakub@redhat.com>
Wed, 13 Jan 2021 18:54:49 +0000 (19:54 +0100)
committerJakub Jelinek <jakub@redhat.com>
Wed, 13 Jan 2021 18:54:49 +0000 (19:54 +0100)
commit8fc183ccd0628465205b8a88c29ab69bfe74a08a
tree4f8b6bc9bb581e48d217a2c0baacbfcb5f13e102
parent7d7ef413ef1b696dec2710ae0acc058bdc832686
match.pd: Fold (~X | C) ^ D into (X | C) ^ (~D ^ C) if (~D ^ C) can be simplified [PR96691]

These simplifications are only simplifications if the (~D ^ C) or (D ^ C)
expressions fold into gimple vals, but in that case they decrease number of
operations by 1.

2021-01-13  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/96691
* match.pd ((~X | C) ^ D -> (X | C) ^ (~D ^ C),
(~X & C) ^ D -> (X & C) ^ (D ^ C)): New simplifications if
(~D ^ C) or (D ^ C) can be simplified.

* gcc.dg/tree-ssa/pr96691.c: New test.
gcc/match.pd
gcc/testsuite/gcc.dg/tree-ssa/pr96691.c [new file with mode: 0644]