[LVI] Support urem in implied conditions
authorNikita Popov <nikita.ppv@gmail.com>
Sat, 20 Nov 2021 18:03:45 +0000 (19:03 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Sat, 20 Nov 2021 20:01:26 +0000 (21:01 +0100)
commitcd84cab6b37f615d0babd0b1c7b9e3acef5586c2
tree3a1af895e7a4d6bf6d9e5a34cb6615cdc365d0ca
parent25a9ee52f139edc71043fbb218818aa735faa7b4
[LVI] Support urem in implied conditions

If (X urem M) >= C we know that X >= C. Make use of this fact
when computing the implied condition range.

In some cases we could also establish an upper bound, but that's
both tricker and not interesting in practice.

Alive: https://alive2.llvm.org/ce/z/R5ZGSW
llvm/lib/Analysis/LazyValueInfo.cpp
llvm/test/Transforms/CorrelatedValuePropagation/urem.ll