[llvm] [InstCombine] Added optimisation for trunc (Pow2 >> x) to i1 (PR #157030)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 10 08:19:23 PDT 2025


https://github.com/dtcxzyw approved this pull request.

LGTM. Thanks.

As a follow-up, are you interested in folding `trunc (shr C=0b11111...0000, %x) to i1 -> icmp ugt %x, cttz(C) - 1` as well? Not sure if it is profitable in real-world programs.


https://github.com/llvm/llvm-project/pull/157030


More information about the llvm-commits mailing list