OSDN Git Service

[LVI] Check for @llvm.assume dominating the edge branch
authorHal Finkel <hfinkel@anl.gov>
Tue, 14 Oct 2014 16:04:49 +0000 (16:04 +0000)
committerHal Finkel <hfinkel@anl.gov>
Tue, 14 Oct 2014 16:04:49 +0000 (16:04 +0000)
commit2993617e416c0a3b307441a243e161efc27538da
tree23ad475ee9a56a5333095833b77183343759258f
parent65e4aa465676c6ef278cff110f42400ecfb66197
[LVI] Check for @llvm.assume dominating the edge branch

When LazyValueInfo uses @llvm.assume intrinsics to provide edge-value
constraints, we should check for intrinsics that dominate the edge's branch,
not just any potential context instructions. An assumption that dominates the
edge's branch represents a truth on that edge. This is specifically useful, for
example, if multiple predecessors assume a pointer to be nonnull, allowing us
to simplify a later null comparison.

The test case, and an initial patch, were provided by Philip Reames. Thanks!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219688 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/LazyValueInfo.cpp
test/Transforms/JumpThreading/assume-edge-dom.ll [new file with mode: 0644]