[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)
commit203958100289f8273bf4bce1a7239cba9e707264
tree2c5f8bd87ce2f2468394f6be19ff7876778894a7
parent394d0a163714ee544266f31536e7bdd81fdb2fc0
[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

llvm-svn: 358597
llvm/lib/Analysis/LazyValueInfo.cpp
llvm/test/Transforms/CorrelatedValuePropagation/overflow_predicate.ll