LLVM
8.0.1
|
Class for calculating and caching the underlying values of phis in a function. More...
#include "llvm/Analysis/PhiValues.h"
Public Types | |
using | ValueSet = SmallPtrSet< Value *, 4 > |
Public Member Functions | |
PhiValues (const Function &F) | |
Construct an empty PhiValues. More... | |
const ValueSet & | getValuesForPhi (const PHINode *PN) |
Get the underlying values of a phi. More... | |
void | invalidateValue (const Value *V) |
Notify PhiValues that the cached information using V is no longer valid. More... | |
void | releaseMemory () |
Free the memory used by this class. More... | |
void | print (raw_ostream &OS) const |
Print out the values currently in the cache. More... | |
bool | invalidate (Function &, const PreservedAnalyses &, FunctionAnalysisManager::Invalidator &) |
Handle invalidation events in the new pass manager. More... | |
Class for calculating and caching the underlying values of phis in a function.
Initially the PhiValues is empty, and gets incrementally populated whenever it is queried.
Definition at line 43 of file PhiValues.h.
using llvm::PhiValues::ValueSet = SmallPtrSet<Value *, 4> |
Definition at line 45 of file PhiValues.h.
Construct an empty PhiValues.
Definition at line 48 of file PhiValues.h.
References F, getValuesForPhi(), invalidate(), invalidateValue(), print(), and releaseMemory().
Referenced by llvm::PhiValuesAnalysis::run().
const PhiValues::ValueSet & PhiValues::getValuesForPhi | ( | const PHINode * | PN | ) |
Get the underlying values of a phi.
This returns the cached value if PN has previously been processed, otherwise it processes it first.
Definition at line 114 of file PhiValues.cpp.
References assert(), and llvm::SmallVectorBase::empty().
Referenced by MergeAliasResults(), PhiValues(), and llvm::PhiValuesPrinterPass::run().
bool PhiValues::invalidate | ( | Function & | , |
const PreservedAnalyses & | PA, | ||
FunctionAnalysisManager::Invalidator & | |||
) |
Handle invalidation events in the new pass manager.
Definition at line 27 of file PhiValues.cpp.
References assert(), llvm::SmallVectorTemplateCommon< T >::back(), llvm::SmallVectorBase::empty(), llvm::PreservedAnalyses::getChecker(), llvm::PHINode::incoming_values(), llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::SmallVectorImpl< T >::pop_back_val(), and llvm::SmallVectorTemplateBase< T >::push_back().
Referenced by PhiValues().
Notify PhiValues that the cached information using V is no longer valid.
Whenever a phi has its operands modified the cached values for that phi (and the phis that use that phi) become invalid. A user of PhiValues has to notify it of this by calling invalidateValue on either the operand or the phi, which will then clear the relevant cached information.
Definition at line 124 of file PhiValues.cpp.
References N, and llvm::SmallVectorTemplateBase< T >::push_back().
Referenced by llvm::MemoryDependenceResults::invalidateCachedPointerInfo(), PhiValues(), and llvm::MemoryDependenceResults::removeInstruction().
void PhiValues::print | ( | raw_ostream & | OS | ) | const |
Print out the values currently in the cache.
Definition at line 150 of file PhiValues.cpp.
Referenced by PhiValues(), and llvm::PhiValuesPrinterPass::run().
void PhiValues::releaseMemory | ( | ) |
Free the memory used by this class.
Definition at line 144 of file PhiValues.cpp.
Referenced by llvm::PhiValuesWrapperPass::getResult(), and PhiValues().