From 361034ba781105c630b58660cfd70148747b9f61 Mon Sep 17 00:00:00 2001 From: Dmitry Makogon Date: Tue, 15 Mar 2022 17:10:41 +0700 Subject: [PATCH] [NFC] Add LazyValueInfo::clear method This method just calls LazyValueInfoImpl::clear --- llvm/include/llvm/Analysis/LazyValueInfo.h | 3 +++ llvm/lib/Analysis/LazyValueInfo.cpp | 5 +++++ 2 files changed, 8 insertions(+) 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) {