diff options
author | Andrew Pinski <pinskia@gmail.com> | 2023-10-10 12:45:56 -0700 |
---|---|---|
committer | Andrew Pinski <pinskia@gmail.com> | 2023-10-11 09:45:51 -0700 |
commit | e8d418df3dc609f27487deece796d4aa69004b8c (patch) | |
tree | 80b4a620828e3e420688d03e3e6fea9ff4acf1e7 /libgcc | |
parent | acfca27eaf4960069f7a49039f1407b956669ec1 (diff) | |
download | gcc-e8d418df3dc609f27487deece796d4aa69004b8c.zip gcc-e8d418df3dc609f27487deece796d4aa69004b8c.tar.gz gcc-e8d418df3dc609f27487deece796d4aa69004b8c.tar.bz2 |
MATCH: [PR111282] Simplify `a & (b ^ ~a)` to `a & b`
While `a & (b ^ ~a)` is optimized to `a & b` on the rtl level,
it is always good to optimize this at the gimple level and allows
us to match a few extra things including where a is a comparison.
Note I had to update/change the testcase and-1.c to avoid matching
this case as we can match -2 and 1 as bitwise inversions.
PR tree-optimization/111282
gcc/ChangeLog:
* match.pd (`a & ~(a ^ b)`, `a & (a == b)`,
`a & ((~a) ^ b)`): New patterns.
gcc/testsuite/ChangeLog:
* gcc.dg/tree-ssa/and-1.c: Update testcase to avoid
matching `~1 & (a ^ 1)` simplification.
* gcc.dg/tree-ssa/bitops-6.c: New test.
Diffstat (limited to 'libgcc')
0 files changed, 0 insertions, 0 deletions