[llvm] Match range check pattern with SExt (PR #118910)

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 9 10:49:31 PST 2024


MatzeB wrote:

> Looks like it also holds for zext: https://alive2.llvm.org/ce/z/vpYSiD

uh oh, the tests should have been `and %n, 9223372036854775807`. While this holds for `and i64 %n, 2147483647` where all upper 32bits are zero, the C++ code checks for non-negative number (which is what we actually want) and then zext won't hold any longer.

Let me change the tests to use `llvm.assume` instead to make things clearer.

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


More information about the llvm-commits mailing list