On 2/18/2026 6:29 AM, Daniel Barboza wrote:
> Add two patterns to eliminate mispredicts in the following bit ops
> scenarios:
>
> - checking if a single bit is not set, and in this case set it: always
>    set the bit;
> - checking if a bitmask is set (even partially), and in this case clear
>    it: always clear the bitmask.
>
> Bootstrapped and tested with x86_64-pc-linux-gnu.
>
>       PR tree-optimization/64567
>
> gcc/ChangeLog:
>
>       * match.pd (`cond (bit_and A IMM) (bit_or A IMM) A`): New
>       pattern.
>       (`cond (bit_and A IMM) (bit_and A ~IMM) A`): New pattern.
>
> gcc/testsuite/ChangeLog:
>
>       * gcc.dg/tree-ssa/pr64567-2.c: New test.
>       * gcc.dg/tree-ssa/pr64567.c: New test.
OK once gcc-17 opens for development.

jeff

Reply via email to