[llvm] [InstCombine] Fold `(trunc X)` into `X & Mask` inside `decomposeBitTestICmp` (PR #171195)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 10 10:22:03 PST 2026


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

LGTM. However, as I commented in https://github.com/llvm/llvm-project/pull/171195#discussion_r2614799633, the current implementation converts `(trunc X) ==/!= C` to `(and X, mask) ==/!= 0` unconditionally and causes some irrevertible regressions. As a follow-up, we can try to preserve previous behavior by checking if the mask is `getLowBitsSet(bit width of original operands)`. Then we can check the net effect.



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


More information about the llvm-commits mailing list