On 7/23/2026 3:01 AM, Eikansh Gupta wrote:
This adds match.pd simplifications for min(clz(x), clz(y)) and
min(ctz(x), ctz(y)) to clz(x | y) and ctz(x | y).

Bootstrapped and tested on aarch64-linux-gnu and x86_64-linux-gnu.

        PR tree-optimization/123311

gcc/ChangeLog:

        * match.pd (min(clz(x), clz(y)) -> clz(x | y)): New pattern.
        (min(ctz(x), ctz(y)) -> ctz(x | y)): Likewise.

gcc/testsuite/ChangeLog:

        * gcc.dg/tree-ssa/pr123311-1.c: New test.
        * gcc.dg/tree-ssa/pr123311-2.c: New test.

Signed-off-by: Eikansh Gupta <[email protected]>
OK.  Thanks.

jeff

Reply via email to