On 11/20/26 7:12 AM, Richard Biener wrote:
On Fri, Nov 20, 2026 at 3:07 PM Daniel Petrovic <[email protected]> wrote:
Hi Richard,
thank you for your time and feedback!
A may be a constant or a range limited value, for example a bool,
a masked value or a value with a known range.
The fold is not done when A may touch the sign bit.
Does this supersede some of the existing (cmp (bitop ...)) simplifications?
I don't see that any of the existing simplifications is completely superseded,
although there is some partial overlap.
For X|0 and X^0 there are already simpler folds, and the new fold skips that
case.
There is one partial overlap for this one :
(for op (min bit_ior)
(for cmp (ge lt) ...)
which handles (a | b) >= 0 and < 0 for nonnegative b. That one is not
superseded, e.g. it also handles MIN.
That said, I may be missing something, so I'd be glad to be corrected.
Thanks for checking. As said, the patch is OK.
And pushed.
jeff