[PATCH] D60832: [MemorySSA] LCSSA preserves MemorySSA.
Alina Sbirlea via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 18 15:03:44 PDT 2019
asbirlea updated this revision to Diff 195819.
asbirlea marked an inline comment as done.
asbirlea added a comment.
Simplify patch to only rpeserve and not require.
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D60832/new/
https://reviews.llvm.org/D60832
Files:
include/llvm/Analysis/LoopAnalysisManager.h
include/llvm/Analysis/MemorySSA.h
lib/Analysis/MemorySSA.cpp
lib/Transforms/Utils/LCSSA.cpp
Index: lib/Transforms/Utils/LCSSA.cpp
===================================================================
--- lib/Transforms/Utils/LCSSA.cpp
+++ lib/Transforms/Utils/LCSSA.cpp
@@ -33,9 +33,9 @@
#include "llvm/Analysis/BasicAliasAnalysis.h"
#include "llvm/Analysis/GlobalsModRef.h"
#include "llvm/Analysis/LoopPass.h"
+#include "llvm/Analysis/MemorySSA.h"
#include "llvm/Analysis/ScalarEvolution.h"
#include "llvm/Analysis/ScalarEvolutionAliasAnalysis.h"
-#include "llvm/Transforms/Utils/Local.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/Function.h"
@@ -44,6 +44,7 @@
#include "llvm/IR/PredIteratorCache.h"
#include "llvm/Pass.h"
#include "llvm/Transforms/Utils.h"
+#include "llvm/Transforms/Utils/Local.h"
#include "llvm/Transforms/Utils/LoopUtils.h"
#include "llvm/Transforms/Utils/SSAUpdater.h"
using namespace llvm;
@@ -442,6 +443,7 @@
AU.addPreserved<GlobalsAAWrapperPass>();
AU.addPreserved<ScalarEvolutionWrapperPass>();
AU.addPreserved<SCEVAAWrapperPass>();
+ AU.addPreserved<MemorySSAWrapperPass>();
// This is needed to perform LCSSA verification inside LPPassManager
AU.addRequired<LCSSAVerificationPass>();
@@ -485,5 +487,9 @@
PA.preserve<GlobalsAA>();
PA.preserve<SCEVAA>();
PA.preserve<ScalarEvolutionAnalysis>();
+ // In the new pass manager, LCSSA must mark the AAManager as preserved too, in
+ // order to correctly preserve MemorySSA.
+ PA.preserve<MemorySSAAnalysis>();
+ PA.preserve<AAManager>();
return PA;
}
Index: lib/Analysis/MemorySSA.cpp
===================================================================
--- lib/Analysis/MemorySSA.cpp
+++ lib/Analysis/MemorySSA.cpp
@@ -914,6 +914,7 @@
: MSSA(MSSA), AA(AA), DT(DT) {}
AliasAnalysisType *getAA() { return &AA; }
+
/// Finds the nearest clobber for the given query, optimizing phis if
/// possible.
MemoryAccess *findClobber(MemoryAccess *Start, UpwardsMemoryQuery &Q,
Index: include/llvm/Analysis/MemorySSA.h
===================================================================
--- include/llvm/Analysis/MemorySSA.h
+++ include/llvm/Analysis/MemorySSA.h
@@ -104,6 +104,9 @@
namespace llvm {
+/// Enables memory ssa as a dependency for loop passes.
+extern cl::opt<bool> EnableMSSALoopDependency;
+
class Function;
class Instruction;
class MemoryAccess;
Index: include/llvm/Analysis/LoopAnalysisManager.h
===================================================================
--- include/llvm/Analysis/LoopAnalysisManager.h
+++ include/llvm/Analysis/LoopAnalysisManager.h
@@ -61,9 +61,6 @@
MemorySSA *MSSA;
};
-/// Enables memory ssa as a dependency for loop passes.
-extern cl::opt<bool> EnableMSSALoopDependency;
-
/// Extern template declaration for the analysis set for this IR unit.
extern template class AllAnalysesOn<Loop>;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60832.195819.patch
Type: text/x-patch
Size: 2842 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190418/f4678989/attachment.bin>
More information about the llvm-commits
mailing list