summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/LazyValueInfo.cpp
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2017-01-11 13:24:24 +0000
committerHal Finkel <hfinkel@anl.gov>2017-01-11 13:24:24 +0000
commit8a9a783f2ceb7ba982a62e2fb3f2d089939f6cda (patch)
tree3aaa1237ae9c9ff314e2c564992db7099508a052 /llvm/lib/Analysis/LazyValueInfo.cpp
parent9d0e7c33d3fd35393d3f4de23fad6b33e7699c74 (diff)
downloadbcm5719-llvm-8a9a783f2ceb7ba982a62e2fb3f2d089939f6cda.tar.gz
bcm5719-llvm-8a9a783f2ceb7ba982a62e2fb3f2d089939f6cda.zip
Make processing @llvm.assume more efficient - Add affected values to the assumption cache
Here's my second try at making @llvm.assume processing more efficient. My previous attempt, which leveraged operand bundles, r289755, didn't end up working: it did make assume processing more efficient but eliminating the assumption cache made ephemeral value computation too expensive. This is a more-targeted change. We'll keep the assumption cache, but extend it to keep a map of affected values (i.e. values about which an assumption might provide some information) to the corresponding assumption intrinsics. This allows ValueTracking and LVI to find assumptions relevant to the value being queried without scanning all assumptions in the function. The fact that ValueTracking started doing O(number of assumptions in the function) work, for every known-bits query, has become prohibitively expensive in some cases. As discussed during the review, this is a pragmatic fix that, longer term, will likely be replaced by a more-principled solution (perhaps based on an extended SSA form). Differential Revision: https://reviews.llvm.org/D28459 llvm-svn: 291671
Diffstat (limited to 'llvm/lib/Analysis/LazyValueInfo.cpp')
-rw-r--r--llvm/lib/Analysis/LazyValueInfo.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/LazyValueInfo.cpp b/llvm/lib/Analysis/LazyValueInfo.cpp
index 4f635523687..d442310476c 100644
--- a/llvm/lib/Analysis/LazyValueInfo.cpp
+++ b/llvm/lib/Analysis/LazyValueInfo.cpp
@@ -925,7 +925,7 @@ void LazyValueInfoImpl::intersectAssumeOrGuardBlockValueConstantRange(
if (!BBI)
return;
- for (auto &AssumeVH : AC->assumptions()) {
+ for (auto &AssumeVH : AC->assumptionsFor(Val)) {
if (!AssumeVH)
continue;
auto *I = cast<CallInst>(AssumeVH);
OpenPOWER on IntegriCloud