[PATCH] D61043: [MemorySSA] Invalidate MemorySSA if AA or DT are invalidated.
Alina Sbirlea via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 23 15:21:42 PDT 2019
asbirlea created this revision.
asbirlea added reviewers: george.burgess.iv, chandlerc.
Herald added subscribers: Prazek, jlebar.
Herald added a project: LLVM.
MemorySSA keeps internal pointers of AA and DT.
If these get invalidated, so should MemorySSA.
Repository:
rL LLVM
https://reviews.llvm.org/D61043
Files:
include/llvm/Analysis/MemorySSA.h
lib/Analysis/MemorySSA.cpp
Index: lib/Analysis/MemorySSA.cpp
===================================================================
--- lib/Analysis/MemorySSA.cpp
+++ lib/Analysis/MemorySSA.cpp
@@ -2213,6 +2213,15 @@
return MemorySSAAnalysis::Result(llvm::make_unique<MemorySSA>(F, &AA, &DT));
}
+bool MemorySSAAnalysis::invalidate(
+ Function &F, const PreservedAnalyses &PA,
+ FunctionAnalysisManager::Invalidator &Inv) {
+ auto PAC = PA.getChecker<MemorySSAAnalysis>();
+ return !(PAC.preserved() || PAC.preservedSet<AllAnalysesOn<Function>>()) ||
+ Inv.invalidate<AAManager>(F, PA) ||
+ Inv.invalidate<DominatorTreeAnalysis>(F, PA);
+}
+
PreservedAnalyses MemorySSAPrinterPass::run(Function &F,
FunctionAnalysisManager &AM) {
OS << "MemorySSA for function: " << F.getName() << "\n";
Index: include/llvm/Analysis/MemorySSA.h
===================================================================
--- include/llvm/Analysis/MemorySSA.h
+++ include/llvm/Analysis/MemorySSA.h
@@ -939,6 +939,9 @@
};
Result run(Function &F, FunctionAnalysisManager &AM);
+
+ bool invalidate(Function &F, const PreservedAnalyses &PA,
+ FunctionAnalysisManager::Invalidator &Inv);
};
/// Printer pass for \c MemorySSA.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61043.196344.patch
Type: text/x-patch
Size: 1274 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190423/e7d22387/attachment.bin>
More information about the llvm-commits
mailing list