diff options
author | Philip Reames <listmail@philipreames.com> | 2019-01-22 01:34:33 +0000 |
---|---|---|
committer | Philip Reames <listmail@philipreames.com> | 2019-01-22 01:34:33 +0000 |
commit | 390c0e2f728e4e5feb89301eb758a67ae296d350 (patch) | |
tree | 1178efbdcd7ae51c964537adc059822afa8e7d8e /llvm/lib/Analysis/LazyValueInfo.cpp | |
parent | 9846f5f79278bd3a0e2114838577e2df2cbf6a24 (diff) | |
download | bcm5719-llvm-390c0e2f728e4e5feb89301eb758a67ae296d350.tar.gz bcm5719-llvm-390c0e2f728e4e5feb89301eb758a67ae296d350.zip |
[CVP] Use LVI to constant fold deopt operands
Deopt operands are generally intended to record information about a site in code with minimal perturbation of the surrounding code. Idiomatically, they also tend to appear down rare paths. Putting these together, we have an obvious case for extending CVP w/deopt operand constant folding. Arguably, we should be doing this for all operands on all instructions, but that's definitely a much larger and risky change.
Differential Revision: https://reviews.llvm.org/D55678
llvm-svn: 351774
Diffstat (limited to 'llvm/lib/Analysis/LazyValueInfo.cpp')
-rw-r--r-- | llvm/lib/Analysis/LazyValueInfo.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/LazyValueInfo.cpp b/llvm/lib/Analysis/LazyValueInfo.cpp index 8943c31e290..03df953f24e 100644 --- a/llvm/lib/Analysis/LazyValueInfo.cpp +++ b/llvm/lib/Analysis/LazyValueInfo.cpp @@ -823,7 +823,9 @@ void LazyValueInfoImpl::intersectAssumeOrGuardBlockValueConstantRange( if (!GuardDecl || GuardDecl->use_empty()) return; - for (Instruction &I : make_range(BBI->getIterator().getReverse(), + if (BBI->getIterator() == BBI->getParent()->begin()) + return; + for (Instruction &I : make_range(std::next(BBI->getIterator().getReverse()), BBI->getParent()->rend())) { Value *Cond = nullptr; if (match(&I, m_Intrinsic<Intrinsic::experimental_guard>(m_Value(Cond)))) |