diff options
author | Kamlesh Kumar <kamleshbhalui@gmail.com> | 2019-09-03 20:13:22 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2019-09-03 14:13:22 -0600 |
commit | 52792faa0c8510b7bfc2c184c9f67d4a87f83215 (patch) | |
tree | 3c5f5a01416ec909271f3aa44d5c8d2a1c7a462e /gcc/match.pd | |
parent | 42bf58bb137992b876be37f8b2e683c49bc2abed (diff) | |
download | gcc-52792faa0c8510b7bfc2c184c9f67d4a87f83215.zip gcc-52792faa0c8510b7bfc2c184c9f67d4a87f83215.tar.gz gcc-52792faa0c8510b7bfc2c184c9f67d4a87f83215.tar.bz2 |
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.pd | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/match.pd b/gcc/match.pd index cd75dac..1d13543 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))) |