diff options
author | Philip Reames <listmail@philipreames.com> | 2021-04-06 11:11:44 -0700 |
---|---|---|
committer | Philip Reames <listmail@philipreames.com> | 2021-04-06 11:16:22 -0700 |
commit | a6d2a8d6f59a974752666305c4baaabebee41b95 (patch) | |
tree | fd78a01447da0dc40916251620efc2214465be3e /llvm/lib/Analysis/AssumptionCache.cpp | |
parent | 3b1b1d7530e6cf2c3aac25fc9d079f083e929137 (diff) | |
download | llvm-a6d2a8d6f59a974752666305c4baaabebee41b95.zip llvm-a6d2a8d6f59a974752666305c4baaabebee41b95.tar.gz llvm-a6d2a8d6f59a974752666305c4baaabebee41b95.tar.bz2 |
Add a subclass of IntrinsicInst for llvm.assume [nfc]
Add the subclass, update a few places which check for the intrinsic to use idiomatic dyn_cast, and update the public interface of AssumptionCache to use the new class. A follow up change will do the same for the newer assumption query/bundle mechanisms.
Diffstat (limited to 'llvm/lib/Analysis/AssumptionCache.cpp')
-rw-r--r-- | llvm/lib/Analysis/AssumptionCache.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/llvm/lib/Analysis/AssumptionCache.cpp b/llvm/lib/Analysis/AssumptionCache.cpp index 70053fd..753ea5f 100644 --- a/llvm/lib/Analysis/AssumptionCache.cpp +++ b/llvm/lib/Analysis/AssumptionCache.cpp @@ -56,7 +56,7 @@ AssumptionCache::getOrInsertAffectedValues(Value *V) { } static void -findAffectedValues(CallInst *CI, +findAffectedValues(CallBase *CI, SmallVectorImpl<AssumptionCache::ResultElem> &Affected) { // Note: This code must be kept in-sync with the code in // computeKnownBitsFromAssume in ValueTracking. @@ -126,7 +126,7 @@ findAffectedValues(CallInst *CI, } } -void AssumptionCache::updateAffectedValues(CallInst *CI) { +void AssumptionCache::updateAffectedValues(AssumeInst *CI) { SmallVector<AssumptionCache::ResultElem, 16> Affected; findAffectedValues(CI, Affected); @@ -139,7 +139,7 @@ void AssumptionCache::updateAffectedValues(CallInst *CI) { } } -void AssumptionCache::unregisterAssumption(CallInst *CI) { +void AssumptionCache::unregisterAssumption(AssumeInst *CI) { SmallVector<AssumptionCache::ResultElem, 16> Affected; findAffectedValues(CI, Affected); @@ -211,13 +211,10 @@ void AssumptionCache::scanFunction() { // Update affected values. for (auto &A : AssumeHandles) - updateAffectedValues(cast<CallInst>(A)); + updateAffectedValues(cast<AssumeInst>(A)); } -void AssumptionCache::registerAssumption(CallInst *CI) { - assert(match(CI, m_Intrinsic<Intrinsic::assume>()) && - "Registered call does not call @llvm.assume"); - +void AssumptionCache::registerAssumption(AssumeInst *CI) { // If we haven't scanned the function yet, just drop this assumption. It will // be found when we scan later. if (!Scanned) |