diff options
author | Andrew Pinski <quic_apinski@quicinc.com> | 2024-05-25 23:29:48 -0700 |
---|---|---|
committer | Andrew Pinski <quic_apinski@quicinc.com> | 2024-05-29 08:54:09 -0700 |
commit | 0a9154d154957b21eb2c9e4fbe9869e50fb9742f (patch) | |
tree | 8c23d30c6374cbb0524a34be322855184b69b309 /libcpp | |
parent | 39263ed2d39ac1cebde59bc5e72ddcad5dc7a1ec (diff) | |
download | gcc-0a9154d154957b21eb2c9e4fbe9869e50fb9742f.zip gcc-0a9154d154957b21eb2c9e4fbe9869e50fb9742f.tar.gz gcc-0a9154d154957b21eb2c9e4fbe9869e50fb9742f.tar.bz2 |
Match: Add maybe_bit_not instead of plain matching
While working on adding matching of negative expressions of `a - b`,
I noticed that we started to have "duplicated" patterns due to not having
a way to match maybe negative expressions. So I went back to what I did for
bit_not and decided to improve the situtation there so for some patterns
where we had 2 operands of an expression where one could have been a bit_not,
add back maybe_bit_not.
This does not add maybe_bit_not in every place were bitwise_inverted_equal_p
is used, just the ones were 2 operands of an expression could be swapped.
Bootstrapped and tested on x86_64-linux-gnu with no regressions.
gcc/ChangeLog:
* match.pd (bit_not_with_nop): Unconditionalize.
(maybe_cmp): Likewise.
(maybe_bit_not): New match pattern.
(`~X & X`): Use maybe_bit_not and add `:c` back.
(`~x ^ x`/`~x | x`): Likewise.
Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
Diffstat (limited to 'libcpp')
0 files changed, 0 insertions, 0 deletions