[llvm] [InstCombine] Infer exact for lshr by cttz (PR #136696)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 27 04:13:17 PDT 2025


https://github.com/nikic commented:

For the proofs, please prefer linking to alive2.llvm.org instead of directly embedding the proof in the PR, e.g. like this: https://alive2.llvm.org/ce/z/CQR2PG

Note that this also shows that you do not need the second argument to be true. The reason false works is that if the input is zero, cttz will return the bit width and shifting by the bit width returns poison. Adding an extra exact flag doesn't affect this.

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


More information about the llvm-commits mailing list