]> gcc.gnu.org Git - gcc.git/commit
match: Add support for `a ^ CST` to bitwise_inverted_equal_p [PR115224]
authorAndrew Pinski <quic_apinski@quicinc.com>
Mon, 27 May 2024 00:38:37 +0000 (17:38 -0700)
committerAndrew Pinski <quic_apinski@quicinc.com>
Wed, 29 May 2024 15:54:09 +0000 (08:54 -0700)
commit547143df5aa0960fb149a26933dad7ca1c363afb
tree591367117f1beb8b9ff5ee5dbbadc4d4ea71f248
parent0a9154d154957b21eb2c9e4fbe9869e50fb9742f
match: Add support for `a ^ CST` to bitwise_inverted_equal_p [PR115224]

While looking into something else, I noticed that `a ^ CST` needed to be
special casing to bitwise_inverted_equal_p as it would simplify to `a ^ ~CST`
for the bitwise not.

Bootstrapped and tested on x86_64-linux-gnu with no regressions.

PR tree-optimization/115224

gcc/ChangeLog:

* generic-match-head.cc (bitwise_inverted_equal_p): Add `a ^ CST`
case.
* gimple-match-head.cc (gimple_bit_xor_cst): New declaration.
(gimple_bitwise_inverted_equal_p): Add `a ^ CST` case.
* match.pd (bit_xor_cst): New match.
(maybe_bit_not): Add bit_xor_cst case.

gcc/testsuite/ChangeLog:

* gcc.dg/tree-ssa/bitops-8.c: New test.

Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
gcc/generic-match-head.cc
gcc/gimple-match-head.cc
gcc/match.pd
gcc/testsuite/gcc.dg/tree-ssa/bitops-8.c [new file with mode: 0644]
This page took 0.072782 seconds and 6 git commands to generate.