[llvm] [InstCombine] Fold (X / C) < X and (X >> C) < X into X > 0 (PR #85555)

via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 16 15:43:51 PDT 2024


goldsteinn wrote:

Just a note on the proofs.
You really only proved for the exact constant chosen i.e `lshr x, 1` in the case of the `lshr` proofs. That doesn't necessarily transfer to all other constants (in fact 0 is incorrect).
See some general proofs: https://alive2.llvm.org/ce/z/3YWXgD
I filled in the `sdiv` cases, can you please complete the `udiv`/`lshr`/`ashr` ones.


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


More information about the llvm-commits mailing list