]> granicus.if.org Git - llvm/commit
[LVI][CVP] Constrain values in with.overflow branches
authorNikita Popov <nikita.ppv@gmail.com>
Wed, 17 Apr 2019 16:57:42 +0000 (16:57 +0000)
committerNikita Popov <nikita.ppv@gmail.com>
Wed, 17 Apr 2019 16:57:42 +0000 (16:57 +0000)
commit9e6836a074ca8142a8a1674b25fe8e04b5c28b37
treecf6f2615ba2cd9e42840fcb3e72f910f81fef372
parent1678c747181d244b4a2c87fbc6204e0f1eaefb28
[LVI][CVP] Constrain values in with.overflow branches

If a branch is conditional on extractvalue(op.with.overflow(%x, C), 1)
then we can constrain the value of %x inside the branch based on
makeGuaranteedNoWrapRegion(). We do this by extending the edge-value
handling in LVI. This allows CVP to then fold comparisons against %x,
as illustrated in the tests.

Differential Revision: https://reviews.llvm.org/D60650

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358597 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/LazyValueInfo.cpp
test/Transforms/CorrelatedValuePropagation/overflow_predicate.ll