https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123311
--- Comment #1 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Eikansh Gupta <[email protected]>: https://gcc.gnu.org/g:1743c12e3512bff3c9688dff7bba5b2ac43cd9d5 commit r17-2815-g1743c12e3512bff3c9688dff7bba5b2ac43cd9d5 Author: Eikansh Gupta <[email protected]> Date: Tue May 19 12:20:54 2026 +0530 MATCH: Simplify min of clz/ctz to clz/ctz of bitwise or [PR123311] 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]>
