diff options
author | Andrew Pinski <apinski@marvell.com> | 2023-07-28 20:27:03 -0700 |
---|---|---|
committer | Andrew Pinski <apinski@marvell.com> | 2023-07-31 10:12:06 -0700 |
commit | b9237226fdc9387bccf584a811b30c5d3689ffd2 (patch) | |
tree | a7d1b2ff27dae83884c33d2aff966d2eceac0e88 /gcc/c | |
parent | c6523ae786e36dccd64589682140e9221628bb5b (diff) | |
download | gcc-b9237226fdc9387bccf584a811b30c5d3689ffd2.zip gcc-b9237226fdc9387bccf584a811b30c5d3689ffd2.tar.gz gcc-b9237226fdc9387bccf584a811b30c5d3689ffd2.tar.bz2 |
tree-optimization: [PR100864] `(a&!b) | b` is not opimized to `a | b` for comparisons
This is a new version of the patch.
Instead of doing the matching of inversion comparison directly inside
match, creating a new function (bitwise_inverted_equal_p) to do it.
It is very similar to bitwise_equal_p that was added in r14-2751-g2a3556376c69a1fb
but instead it says `expr1 == ~expr2`. A follow on patch, will
use this function in other patterns where we try to match `@0` and `(bit_not @0)`.
Changed the name bitwise_not_equal_p to bitwise_inverted_equal_p.
Committed as approved after a Bootstrapped and test on x86_64-linux-gnu with no regressions.
PR tree-optimization/100864
gcc/ChangeLog:
* generic-match-head.cc (bitwise_inverted_equal_p): New function.
* gimple-match-head.cc (bitwise_inverted_equal_p): New macro.
(gimple_bitwise_inverted_equal_p): New function.
* match.pd ((~x | y) & x): Use bitwise_inverted_equal_p
instead of direct matching bit_not.
gcc/testsuite/ChangeLog:
* gcc.dg/tree-ssa/bitops-3.c: New test.
Diffstat (limited to 'gcc/c')
0 files changed, 0 insertions, 0 deletions