summaryrefslogtreecommitdiff
path: root/gcc/match.pd
diff options
context:
space:
mode:
authorKamlesh Kumar <kamleshbhalui@gmail.com>2019-09-03 20:13:22 +0000
committerJeff Law <law@gcc.gnu.org>2019-09-03 14:13:22 -0600
commit52792faa0c8510b7bfc2c184c9f67d4a87f83215 (patch)
tree3c5f5a01416ec909271f3aa44d5c8d2a1c7a462e /gcc/match.pd
parent42bf58bb137992b876be37f8b2e683c49bc2abed (diff)
re PR tree-optimization/91504 (Inlining misses some logical operation folding)
PR tree-optimization/91504 * match.pd: Add ((~a & b) ^a) --> (a | b). PR tree-optimization/91504 gcc.dg/tree-ssa/pr91504.c: New test. From-SVN: r275354
Diffstat (limited to 'gcc/match.pd')
-rw-r--r--gcc/match.pd5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/match.pd b/gcc/match.pd
index cd75dacd9cd..1d13543a615 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -831,6 +831,11 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
(bit_xor:c (bit_and:cs @0 (bit_not @1)) (bit_not @0))
(bit_not (bit_and @0 @1)))
+/* (~a & b) ^ a --> (a | b) */
+(simplify
+ (bit_xor:c (bit_and:cs (bit_not @0) @1) @0)
+ (bit_ior @0 @1))
+
/* (a | b) & ~(a ^ b) --> a & b */
(simplify
(bit_and:c (bit_ior @0 @1) (bit_not (bit_xor:c @0 @1)))