]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
MATCH: Remove redundant pattern for `(x | y) & ~x`
authorAndrew Pinski <apinski@marvell.com>
Mon, 28 Aug 2023 00:04:04 +0000 (17:04 -0700)
committerAndrew Pinski <apinski@marvell.com>
Mon, 28 Aug 2023 13:46:07 +0000 (06:46 -0700)
After r14-2885-gb9237226fdc938, this pattern becomes
redundant as we match it using bitwise_inverted_equal_p.

There is already a testcase (gcc.dg/nand.c) for this pattern
and it still passes after the removal.

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

gcc/ChangeLog:

PR tree-optimization/111146
* match.pd (`(x | y) & ~x`, `(x & y) | ~x`): Remove
redundant pattern.

gcc/match.pd

index fa598d5ca2e470f9cc3b82469e77d743b12f107e..0076392c522b9c2d42e982d3b448c2ba59754e4d 100644 (file)
@@ -1556,14 +1556,6 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
  (bit_ior:c (bit_xor:s @0 @1) (bit_not:s (bit_ior:s @0 @1)))
  (bit_not (bit_and @0 @1)))
 
-/* (x | y) & ~x -> y & ~x */
-/* (x & y) | ~x -> y | ~x */
-(for bitop (bit_and bit_ior)
-     rbitop (bit_ior bit_and)
- (simplify
-  (bitop:c (rbitop:c @0 @1) (bit_not@2 @0))
-  (bitop @1 @2)))
-
 /* (x & y) ^ (x | y) -> x ^ y */
 (simplify
  (bit_xor:c (bit_and @0 @1) (bit_ior @0 @1))