]>
git.ipfire.org Git - thirdparty/gcc.git/commit
MATCH: [PR111432] Simplify `a & (x | CST)` to a when we know that (a & ~CST) == 0
This adds the simplification `a & (x | CST)` to a when we know that
`(a & ~CST) == 0`. In a similar fashion as `a & CST` is handle.
I looked into handling `a | (x & CST)` but that I don't see any decent
simplifications happening.
OK? Bootstrapped and tested on x86_linux-gnu with no regressions.
PR tree-optimization/111432
gcc/ChangeLog:
* match.pd (`a & (x | CST)`): New pattern.
gcc/testsuite/ChangeLog:
* gcc.dg/tree-ssa/bitops-7.c: New test.