28 lines
847 B
Diff
28 lines
847 B
Diff
2022-01-28 Navid Rahimi <navidrahimi@microsoft.com>
|
|
|
|
gcc/
|
|
PR tree-optimization/103514
|
|
* match.pd (a & b) ^ (a == b) -> !(a | b): New optimization.
|
|
(a & b) == (a ^ b) -> !(a | b): New optimization.
|
|
|
|
gcc/testsuite
|
|
* gcc.dg/tree-ssa/pr103514.c: Testcase for this optimization.
|
|
|
|
--- gcc/match.pd
|
|
+++ gcc/match.pd
|
|
@@ -1784,14 +1784,6 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
|
|
(negate (nop_convert? (bit_not @0)))
|
|
(plus (view_convert @0) { build_each_one_cst (type); }))
|
|
|
|
-/* (a & b) ^ (a == b) -> !(a | b) */
|
|
-/* (a & b) == (a ^ b) -> !(a | b) */
|
|
-(for first_op (bit_xor eq)
|
|
- second_op (eq bit_xor)
|
|
- (simplify
|
|
- (first_op:c (bit_and:c truth_valued_p@0 truth_valued_p@1) (second_op:c @0 @1))
|
|
- (bit_not (bit_ior @0 @1))))
|
|
-
|
|
/* Convert ~ (A - 1) or ~ (A + -1) to -A. */
|
|
(simplify
|
|
(bit_not (convert? (minus @0 integer_each_onep)))
|