diff --git a/llvm/include/llvm/Analysis/LazyValueInfo.h b/llvm/include/llvm/Analysis/LazyValueInfo.h index 754391e10630282..24c2bfcc74b9cd3 100644 --- a/llvm/include/llvm/Analysis/LazyValueInfo.h +++ b/llvm/include/llvm/Analysis/LazyValueInfo.h @@ -114,6 +114,9 @@ class LazyValueInfo { /// Inform the analysis cache that we have erased a block. void eraseBlock(BasicBlock *BB); + /// Complete flush all previously computed values + void clear(const Module *M); + /// Print the \LazyValueInfo Analysis. /// We pass in the DTree that is required for identifying which basic blocks /// we can solve/print for, in the LVIPrinter. diff --git a/llvm/lib/Analysis/LazyValueInfo.cpp b/llvm/lib/Analysis/LazyValueInfo.cpp index 0d0f186ddbfe42b..d1593333763a99c 100644 --- a/llvm/lib/Analysis/LazyValueInfo.cpp +++ b/llvm/lib/Analysis/LazyValueInfo.cpp @@ -1885,6 +1885,11 @@ void LazyValueInfo::eraseBlock(BasicBlock *BB) { } } +void LazyValueInfo::clear(const Module *M) { + if (PImpl) { + getImpl(PImpl, AC, M).clear(); + } +} void LazyValueInfo::printLVI(Function &F, DominatorTree &DTree, raw_ostream &OS) { if (PImpl) {