[llvm] [InstCombine] Add additional known bits info for self multiply (PR #151202)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 30 21:48:22 PDT 2025
ZERICO2005 wrote:
Case B from the issue states that bit 3 will be cleared if bit 0 is cleared. If bit 0 is cleared, then we can alternatively compute ((x >> 1) * (x >> 1)) << 2. Which shows that case B is a special case of the fact that (x * x) will always have bit 1 cleared.
A more general version of case B would be that bit `2 * count_known_trailing_zeros(x) + 1` will be cleared
https://github.com/llvm/llvm-project/pull/151202
More information about the llvm-commits
mailing list