summaryrefslogtreecommitdiff
path: root/include/llvm/Transforms/Scalar/LoopPassManager.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Transforms/Scalar/LoopPassManager.h')
-rw-r--r--include/llvm/Transforms/Scalar/LoopPassManager.h30
1 files changed, 25 insertions, 5 deletions
diff --git a/include/llvm/Transforms/Scalar/LoopPassManager.h b/include/llvm/Transforms/Scalar/LoopPassManager.h
index 715b11d3d974..473b97dc7e8d 100644
--- a/include/llvm/Transforms/Scalar/LoopPassManager.h
+++ b/include/llvm/Transforms/Scalar/LoopPassManager.h
@@ -164,10 +164,11 @@ public:
/// If this is called for the current loop, in addition to clearing any
/// state, this routine will mark that the current loop should be skipped by
/// the rest of the pass management infrastructure.
- void markLoopAsDeleted(Loop &L) {
- LAM.clear(L);
- assert(CurrentL->contains(&L) && "Cannot delete a loop outside of the "
- "subloop tree currently being processed.");
+ void markLoopAsDeleted(Loop &L, llvm::StringRef Name) {
+ LAM.clear(L, Name);
+ assert((&L == CurrentL || CurrentL->contains(&L)) &&
+ "Cannot delete a loop outside of the "
+ "subloop tree currently being processed.");
if (&L == CurrentL)
SkipCurrentLoop = true;
}
@@ -216,6 +217,19 @@ public:
// shouldn't impact anything.
}
+ /// Restart the current loop.
+ ///
+ /// Loop passes should call this method to indicate the current loop has been
+ /// sufficiently changed that it should be re-visited from the begining of
+ /// the loop pass pipeline rather than continuing.
+ void revisitCurrentLoop() {
+ // Tell the currently in-flight pipeline to stop running.
+ SkipCurrentLoop = true;
+
+ // And insert ourselves back into the worklist.
+ Worklist.insert(CurrentL);
+ }
+
private:
template <typename LoopPassT> friend class llvm::FunctionToLoopPassAdaptor;
@@ -271,13 +285,17 @@ public:
return PA;
// Get the analysis results needed by loop passes.
+ MemorySSA *MSSA = EnableMSSALoopDependency
+ ? (&AM.getResult<MemorySSAAnalysis>(F).getMSSA())
+ : nullptr;
LoopStandardAnalysisResults LAR = {AM.getResult<AAManager>(F),
AM.getResult<AssumptionAnalysis>(F),
AM.getResult<DominatorTreeAnalysis>(F),
AM.getResult<LoopAnalysis>(F),
AM.getResult<ScalarEvolutionAnalysis>(F),
AM.getResult<TargetLibraryAnalysis>(F),
- AM.getResult<TargetIRAnalysis>(F)};
+ AM.getResult<TargetIRAnalysis>(F),
+ MSSA};
// Setup the loop analysis manager from its proxy. It is important that
// this is only done when there are loops to process and we have built the
@@ -345,6 +363,8 @@ public:
PA.preserve<DominatorTreeAnalysis>();
PA.preserve<LoopAnalysis>();
PA.preserve<ScalarEvolutionAnalysis>();
+ // FIXME: Uncomment this when all loop passes preserve MemorySSA
+ // PA.preserve<MemorySSAAnalysis>();
// FIXME: What we really want to do here is preserve an AA category, but
// that concept doesn't exist yet.
PA.preserve<AAManager>();