]> granicus.if.org Git - llvm/commit
Make processing @llvm.assume more efficient - Add affected values to the assumption...
authorHal Finkel <hfinkel@anl.gov>
Wed, 11 Jan 2017 13:24:24 +0000 (13:24 +0000)
committerHal Finkel <hfinkel@anl.gov>
Wed, 11 Jan 2017 13:24:24 +0000 (13:24 +0000)
commita6e44bd6350ff4aaa40b104abff1e28a9918ef87
tree592e266fd3013ab12f4eadfae2fe8956bca23afd
parent7449a168da31cc36cdb520925551758c0d10c8ab
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291671 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/AssumptionCache.h
lib/Analysis/AssumptionCache.cpp
lib/Analysis/LazyValueInfo.cpp
lib/Analysis/ValueTracking.cpp
lib/Transforms/InstCombine/InstCombineCalls.cpp