[llvm] [LVI] Learn value ranges from ctpop/ctlz/cttz results (PR #121945)

Stephen Senran Zhang via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 8 18:59:36 PST 2025


zsrkmyn wrote:

> What is the rationale for supporting ctlz and cttz here? Comparisons involving these will already get canonicalized: https://llvm.godbolt.org/z/dfW4vK8jx

Oh, that's because if the RHS is not a constant, but a constant range, it won't get canonicalized.

But if I remove the `getValueFromSimpleICmpCondition`, ctlz & cttz won't be in such cases and can be removed.

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


More information about the llvm-commits mailing list