LLVM: llvm::AssumptionCache Class Reference (original) (raw)
A cache of @llvm.assume calls within a function. More...
#include "[llvm/Analysis/AssumptionCache.h](AssumptionCache%5F8h%5Fsource.html)"
| Public Types | |
|---|---|
| enum | : unsigned { ExprResultIdx = std::numeric_limits::max() } |
| Value of ResultElem::Index indicating that the argument to the call of the llvm.assume. More... |
| Public Member Functions | |
|---|---|
| AssumptionCache (Function &F, TargetTransformInfo *TTI=nullptr) | |
| Construct an AssumptionCache from a function by scanning all of its instructions. | |
| bool | invalidate (Function &, const PreservedAnalyses &, FunctionAnalysisManager::Invalidator &) |
| This cache is designed to be self-updating and so it should never be invalidated. | |
| LLVM_ABI void | registerAssumption (AssumeInst *CI) |
| Add an @llvm.assume intrinsic to this function's cache. | |
| LLVM_ABI void | unregisterAssumption (AssumeInst *CI) |
| Remove an @llvm.assume intrinsic from this function's cache if it has been added to the cache earlier. | |
| LLVM_ABI void | updateAffectedValues (AssumeInst *CI) |
| Update the cache of values being affected by this assumption (i.e. | |
| void | clear () |
| Clear the cache of @llvm.assume intrinsics for a function. | |
| MutableArrayRef< WeakVH > | assumptions () |
| Access the list of assumption handles currently tracked for this function. | |
| MutableArrayRef< ResultElem > | assumptionsFor (const Value *V) |
| Access the list of assumptions which affect this value. |
A cache of @llvm.assume calls within a function.
This cache provides fast lookup of assumptions within a function by caching them and amortizing the cost of scanning for them across all queries. Passes that create new assumptions are required to call registerAssumption() to register any new @llvm.assume calls that they create. Deletions of @llvm.assume calls do not require special handling.
Definition at line 44 of file AssumptionCache.h.
◆ anonymous enum
◆ assumptions()
◆ assumptionsFor()
◆ clear()
| void llvm::AssumptionCache::clear ( ) | inline |
|---|
Clear the cache of @llvm.assume intrinsics for a function.
It will be re-scanned the next time it is requested.
Definition at line 138 of file AssumptionCache.h.
◆ findValuesAffectedByOperandBundle()
◆ invalidate()
This cache is designed to be self-updating and so it should never be invalidated.
Definition at line 116 of file AssumptionCache.h.
◆ registerAssumption()
| void AssumptionCache::registerAssumption | ( | AssumeInst * | CI | ) |
|---|
Add an @llvm.assume intrinsic to this function's cache.
The call passed in must be an instruction within this function and must not already be in the cache.
Definition at line 193 of file AssumptionCache.cpp.
References assert(), llvm::cast(), getParent(), llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent(), llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::PatternMatch::m_Intrinsic(), llvm::PatternMatch::match(), and updateAffectedValues().
Referenced by AddAlignmentAssumptions(), addAssumeNonNull(), buildClonedLoopBlocks(), combineInstructionsOverFunction(), ConnectEpilog(), foldCondBranchOnValueKnownInPredecessorImpl(), removeUndefIntroducingPredecessor(), llvm::DropUnnecessaryAssumesPass::run(), llvm::salvageKnowledge(), llvm::UnrollAndJamLoop(), and llvm::UnrollLoop().
◆ unregisterAssumption()
| void AssumptionCache::unregisterAssumption | ( | AssumeInst * | CI | ) |
|---|
◆ updateAffectedValues()
| void AssumptionCache::updateAffectedValues | ( | AssumeInst * | CI | ) |
|---|
The documentation for this class was generated from the following files:
- include/llvm/Analysis/AssumptionCache.h
- lib/Analysis/AssumptionCache.cpp