diff options
author | Drew Ross <drross@redhat.com> | 2023-07-24 17:51:28 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2023-07-24 17:51:28 +0200 |
commit | 2a3556376c69a1fb588dcf25225950575e42784f (patch) | |
tree | ede842f5da8a3d42f6ef1e7624e1b07e55bbe4fc /gcc/cp | |
parent | d90e81af8052e96ae3262ed3ac42682537fc42c6 (diff) | |
download | gcc-2a3556376c69a1fb588dcf25225950575e42784f.zip gcc-2a3556376c69a1fb588dcf25225950575e42784f.tar.gz gcc-2a3556376c69a1fb588dcf25225950575e42784f.tar.bz2 |
match.pd: Implement missed optimization (~X | Y) ^ X -> ~(X & Y) [PR109986]
Adds a simplification for (~X | Y) ^ X to be folded into ~(X & Y).
Also adds the macro bitwise_equal_p for generic and gimple which
returns true iff EXPR1 and EXPR2 have the same value. This helps
to reduce the number of nop_converts necessary to match the pattern.
PR middle-end/109986
gcc/ChangeLog:
* generic-match-head.cc (bitwise_equal_p): New macro.
* gimple-match-head.cc (bitwise_equal_p): New macro.
(gimple_nop_convert): Declare.
(gimple_bitwise_equal_p): Helper for bitwise_equal_p.
* match.pd ((~X | Y) ^ X -> ~(X & Y)): New simplification.
gcc/testsuite/ChangeLog:
* gcc.c-torture/execute/pr109986.c: New test.
* gcc.dg/tree-ssa/pr109986.c: New test.
Co-authored-by: Jakub Jelinek <jakub@redhat.com>
Diffstat (limited to 'gcc/cp')
0 files changed, 0 insertions, 0 deletions