[llvm] r271432 - [MemorySSA] Port to new pass manager
Geoff Berry via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 1 14:30:41 PDT 2016
Author: gberry
Date: Wed Jun 1 16:30:40 2016
New Revision: 271432
URL: http://llvm.org/viewvc/llvm-project?rev=271432&view=rev
Log:
[MemorySSA] Port to new pass manager
Add support for the new pass manager to MemorySSA pass.
Change MemorySSA to be computed eagerly upon construction.
Change MemorySSAWalker to be owned by the MemorySSA object that creates
it.
Reviewers: dberlin, george.burgess.iv
Subscribers: mcrosier, llvm-commits
Differential Revision: http://reviews.llvm.org/D19664
Modified:
llvm/trunk/include/llvm/InitializePasses.h
llvm/trunk/include/llvm/Transforms/Utils/MemorySSA.h
llvm/trunk/lib/Passes/PassBuilder.cpp
llvm/trunk/lib/Passes/PassRegistry.def
llvm/trunk/lib/Transforms/Utils/MemorySSA.cpp
llvm/trunk/lib/Transforms/Utils/Utils.cpp
llvm/trunk/test/Transforms/Util/MemorySSA/assume.ll
llvm/trunk/test/Transforms/Util/MemorySSA/atomic-clobber.ll
llvm/trunk/test/Transforms/Util/MemorySSA/cyclicphi.ll
llvm/trunk/test/Transforms/Util/MemorySSA/function-clobber.ll
llvm/trunk/test/Transforms/Util/MemorySSA/function-mem-attrs.ll
llvm/trunk/test/Transforms/Util/MemorySSA/livein.ll
llvm/trunk/test/Transforms/Util/MemorySSA/load-invariant.ll
llvm/trunk/test/Transforms/Util/MemorySSA/many-dom-backedge.ll
llvm/trunk/test/Transforms/Util/MemorySSA/many-doms.ll
llvm/trunk/test/Transforms/Util/MemorySSA/multi-edges.ll
llvm/trunk/test/Transforms/Util/MemorySSA/multiple-backedges-hal.ll
llvm/trunk/test/Transforms/Util/MemorySSA/multiple-locations.ll
llvm/trunk/test/Transforms/Util/MemorySSA/no-disconnected.ll
llvm/trunk/test/Transforms/Util/MemorySSA/optimize-use.ll
llvm/trunk/test/Transforms/Util/MemorySSA/phi-translation.ll
llvm/trunk/test/Transforms/Util/MemorySSA/volatile-clobber.ll
llvm/trunk/unittests/Transforms/Utils/MemorySSA.cpp
Modified: llvm/trunk/include/llvm/InitializePasses.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/InitializePasses.h?rev=271432&r1=271431&r2=271432&view=diff
==============================================================================
--- llvm/trunk/include/llvm/InitializePasses.h (original)
+++ llvm/trunk/include/llvm/InitializePasses.h Wed Jun 1 16:30:40 2016
@@ -221,8 +221,7 @@ void initializeMemCpyOptPass(PassRegistr
void initializeMemDepPrinterPass(PassRegistry&);
void initializeMemDerefPrinterPass(PassRegistry&);
void initializeMemoryDependenceWrapperPassPass(PassRegistry&);
-void initializeMemorySSALazyPass(PassRegistry&);
-void initializeMemorySSAPrinterPassPass(PassRegistry&);
+void initializeMemorySSAWrapperPassPass(PassRegistry&);
void initializeMergedLoadStoreMotionPass(PassRegistry &);
void initializeMetaRenamerPass(PassRegistry&);
void initializeMergeFunctionsPass(PassRegistry&);
Modified: llvm/trunk/include/llvm/Transforms/Utils/MemorySSA.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/MemorySSA.h?rev=271432&r1=271431&r2=271432&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Transforms/Utils/MemorySSA.h (original)
+++ llvm/trunk/include/llvm/Transforms/Utils/MemorySSA.h Wed Jun 1 16:30:40 2016
@@ -495,15 +495,11 @@ class MemorySSAWalker;
/// accesses.
class MemorySSA {
public:
- MemorySSA(Function &);
+ MemorySSA(Function &, AliasAnalysis *, DominatorTree *);
+ MemorySSA(MemorySSA &&);
~MemorySSA();
- /// \brief Build Memory SSA, and return the walker we used during building,
- /// for later reuse. If MemorySSA is already built, just return the walker.
- MemorySSAWalker *buildMemorySSA(AliasAnalysis *, DominatorTree *);
-
- /// \brief Returns false if you need to call buildMemorySSA.
- bool isFinishedBuilding() const { return Walker; }
+ MemorySSAWalker *getWalker();
/// \brief Given a memory Mod/Ref'ing instruction, get the MemorySSA
/// access associated with it. If passed a basic block gets the memory phi
@@ -561,7 +557,7 @@ public:
protected:
// Used by Memory SSA annotater, dumpers, and wrapper pass
friend class MemorySSAAnnotatedWriter;
- friend class MemorySSAPrinterPass;
+ friend class MemorySSAPrinterLegacyPass;
void verifyDefUses(Function &F) const;
void verifyDomination(Function &F) const;
@@ -593,49 +589,51 @@ private:
std::unique_ptr<MemoryAccess> LiveOnEntryDef;
// Memory SSA building info
- MemorySSAWalker *Walker;
+ std::unique_ptr<MemorySSAWalker> Walker;
unsigned NextID;
};
-// This pass does eager building and then printing of MemorySSA. It is used by
-// the tests to be able to build, dump, and verify Memory SSA.
-class MemorySSAPrinterPass : public FunctionPass {
+/// An analysis that produces \c MemorySSA for a function.
+///
+class MemorySSAAnalysis : public AnalysisInfoMixin<MemorySSAAnalysis> {
+ friend AnalysisInfoMixin<MemorySSAAnalysis>;
+ static char PassID;
+
public:
- MemorySSAPrinterPass();
+ typedef MemorySSA Result;
- static char ID;
- bool doInitialization(Module &M) override;
- bool runOnFunction(Function &) override;
- void releaseMemory() override;
- void getAnalysisUsage(AnalysisUsage &AU) const override;
- void print(raw_ostream &OS, const Module *M) const override;
- static void registerOptions();
- MemorySSA &getMSSA() { return *MSSA; }
+ MemorySSA run(Function &F, AnalysisManager<Function> &AM);
+};
-private:
- bool VerifyMemorySSA;
+/// \brief Printer pass for \c MemorySSA.
+class MemorySSAPrinterPass : public PassInfoMixin<MemorySSAPrinterPass> {
+ raw_ostream &OS;
- std::unique_ptr<MemorySSA> MSSA;
- // FIXME(gbiv): It seems that MemorySSA doesn't own the walker it returns?
- std::unique_ptr<MemorySSAWalker> Walker;
- Function *F;
+public:
+ explicit MemorySSAPrinterPass(raw_ostream &OS) : OS(OS) {}
+ PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM);
+};
+
+/// \brief Verifier pass for \c MemorySSA.
+struct MemorySSAVerifierPass : PassInfoMixin<MemorySSAVerifierPass> {
+ PreservedAnalyses run(Function &F, AnalysisManager<Function> &AM);
};
-class MemorySSALazy : public FunctionPass {
+/// \brief Legacy analysis pass which computes \c MemorySSA.
+class MemorySSAWrapperPass : public FunctionPass {
public:
- MemorySSALazy();
+ MemorySSAWrapperPass();
static char ID;
bool runOnFunction(Function &) override;
void releaseMemory() override;
- MemorySSA &getMSSA() {
- assert(MSSA);
- return *MSSA;
- }
+ MemorySSA &getMSSA() { return *MSSA; }
+ const MemorySSA &getMSSA() const { return *MSSA; }
- void getAnalysisUsage(AnalysisUsage &AU) const override {
- AU.setPreservesAll();
- }
+ void getAnalysisUsage(AnalysisUsage &AU) const override;
+
+ void verifyAnalysis() const override;
+ void print(raw_ostream &OS, const Module *M = nullptr) const override;
private:
std::unique_ptr<MemorySSA> MSSA;
@@ -705,6 +703,8 @@ public:
virtual void invalidateInfo(MemoryAccess *) {}
protected:
+ friend class MemorySSA; // For updating MSSA pointer in MemorySSA move
+ // constructor.
MemorySSA *MSSA;
};
Modified: llvm/trunk/lib/Passes/PassBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Passes/PassBuilder.cpp?rev=271432&r1=271431&r2=271432&view=diff
==============================================================================
--- llvm/trunk/lib/Passes/PassBuilder.cpp (original)
+++ llvm/trunk/lib/Passes/PassBuilder.cpp Wed Jun 1 16:30:40 2016
@@ -80,6 +80,7 @@
#include "llvm/Transforms/Scalar/SROA.h"
#include "llvm/Transforms/Scalar/SimplifyCFG.h"
#include "llvm/Transforms/Scalar/Sink.h"
+#include "llvm/Transforms/Utils/MemorySSA.h"
#include <type_traits>
using namespace llvm;
Modified: llvm/trunk/lib/Passes/PassRegistry.def
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Passes/PassRegistry.def?rev=271432&r1=271431&r2=271432&view=diff
==============================================================================
--- llvm/trunk/lib/Passes/PassRegistry.def (original)
+++ llvm/trunk/lib/Passes/PassRegistry.def Wed Jun 1 16:30:40 2016
@@ -86,6 +86,7 @@ FUNCTION_ANALYSIS("domfrontier", Dominan
FUNCTION_ANALYSIS("loops", LoopAnalysis())
FUNCTION_ANALYSIS("da", DependenceAnalysis())
FUNCTION_ANALYSIS("memdep", MemoryDependenceAnalysis())
+FUNCTION_ANALYSIS("memoryssa", MemorySSAAnalysis())
FUNCTION_ANALYSIS("regions", RegionInfoAnalysis())
FUNCTION_ANALYSIS("no-op-function", NoOpFunctionAnalysis())
FUNCTION_ANALYSIS("scalar-evolution", ScalarEvolutionAnalysis())
@@ -132,6 +133,7 @@ FUNCTION_PASS("print<postdomtree>", Post
FUNCTION_PASS("print<demanded-bits>", DemandedBitsPrinterPass(dbgs()))
FUNCTION_PASS("print<domfrontier>", DominanceFrontierPrinterPass(dbgs()))
FUNCTION_PASS("print<loops>", LoopPrinterPass(dbgs()))
+FUNCTION_PASS("print<memoryssa>", MemorySSAPrinterPass(dbgs()))
FUNCTION_PASS("print<regions>", RegionInfoPrinterPass(dbgs()))
FUNCTION_PASS("print<scalar-evolution>", ScalarEvolutionPrinterPass(dbgs()))
FUNCTION_PASS("reassociate", ReassociatePass())
@@ -141,6 +143,7 @@ FUNCTION_PASS("sink", SinkingPass())
FUNCTION_PASS("sroa", SROA())
FUNCTION_PASS("verify", VerifierPass())
FUNCTION_PASS("verify<domtree>", DominatorTreeVerifierPass())
+FUNCTION_PASS("verify<memoryssa>", MemorySSAVerifierPass())
FUNCTION_PASS("verify<regions>", RegionInfoVerifierPass())
#undef FUNCTION_PASS
Modified: llvm/trunk/lib/Transforms/Utils/MemorySSA.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/MemorySSA.cpp?rev=271432&r1=271431&r2=271432&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/MemorySSA.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/MemorySSA.cpp Wed Jun 1 16:30:40 2016
@@ -46,14 +46,12 @@ using namespace llvm;
STATISTIC(NumClobberCacheLookups, "Number of Memory SSA version cache lookups");
STATISTIC(NumClobberCacheHits, "Number of Memory SSA version cache hits");
STATISTIC(NumClobberCacheInserts, "Number of MemorySSA version cache inserts");
-INITIALIZE_PASS_WITH_OPTIONS_BEGIN(MemorySSAPrinterPass, "print-memoryssa",
- "Memory SSA", true, true)
+
+INITIALIZE_PASS_BEGIN(MemorySSAWrapperPass, "memoryssa", "Memory SSA", true,
+ true)
INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
INITIALIZE_PASS_DEPENDENCY(AAResultsWrapperPass)
-INITIALIZE_PASS_DEPENDENCY(GlobalsAAWrapperPass)
-INITIALIZE_PASS_END(MemorySSAPrinterPass, "print-memoryssa", "Memory SSA", true,
- true)
-INITIALIZE_PASS(MemorySSALazy, "memoryssalazy", "Memory SSA", true, true)
+INITIALIZE_PASS_END(MemorySSAWrapperPass, "memoryssa", "Memory SSA", true, true)
namespace llvm {
@@ -203,9 +201,22 @@ void MemorySSA::markUnreachableAsLiveOnE
}
}
-MemorySSA::MemorySSA(Function &Func)
- : AA(nullptr), DT(nullptr), F(Func), LiveOnEntryDef(nullptr),
- Walker(nullptr), NextID(0) {}
+MemorySSA::MemorySSA(Function &Func, AliasAnalysis *AA, DominatorTree *DT)
+ : AA(AA), DT(DT), F(Func), LiveOnEntryDef(nullptr), Walker(nullptr),
+ NextID(0) {
+ getWalker(); // Ensure MemorySSA has been built.
+}
+
+MemorySSA::MemorySSA(MemorySSA &&MSSA)
+ : AA(MSSA.AA), DT(MSSA.DT), F(MSSA.F),
+ ValueToMemoryAccess(std::move(MSSA.ValueToMemoryAccess)),
+ PerBlockAccesses(std::move(MSSA.PerBlockAccesses)),
+ LiveOnEntryDef(std::move(MSSA.LiveOnEntryDef)),
+ Walker(std::move(MSSA.Walker)), NextID(MSSA.NextID) {
+ // Update the Walker MSSA pointer so it doesn't point to the moved-from MSSA
+ // object any more.
+ Walker->MSSA = this;
+}
MemorySSA::~MemorySSA() {
// Drop all our references
@@ -222,17 +233,11 @@ MemorySSA::AccessListType *MemorySSA::ge
return Res.first->second.get();
}
-MemorySSAWalker *MemorySSA::buildMemorySSA(AliasAnalysis *AA,
- DominatorTree *DT) {
+MemorySSAWalker *MemorySSA::getWalker() {
if (Walker)
- return Walker;
-
- assert(!this->AA && !this->DT &&
- "MemorySSA without a walker already has AA or DT?");
+ return Walker.get();
- Walker = new CachingMemorySSAWalker(this, AA, DT);
- this->AA = AA;
- this->DT = DT;
+ Walker = make_unique<CachingMemorySSAWalker>(this, AA, DT);
// We create an access to represent "live on entry", for things like
// arguments or users of globals, where the memory they use is defined before
@@ -349,7 +354,7 @@ MemorySSAWalker *MemorySSA::buildMemoryS
if (!Visited.count(&BB))
markUnreachableAsLiveOnEntry(&BB);
- return Walker;
+ return Walker.get();
}
/// \brief Helper function to create new memory accesses
@@ -684,69 +689,54 @@ void MemoryAccess::dump() const {
dbgs() << "\n";
}
-char MemorySSAPrinterPass::ID = 0;
+char MemorySSAAnalysis::PassID;
-MemorySSAPrinterPass::MemorySSAPrinterPass() : FunctionPass(ID) {
- initializeMemorySSAPrinterPassPass(*PassRegistry::getPassRegistry());
+MemorySSA MemorySSAAnalysis::run(Function &F, AnalysisManager<Function> &AM) {
+ auto &DT = AM.getResult<DominatorTreeAnalysis>(F);
+ auto &AA = AM.getResult<AAManager>(F);
+ return MemorySSA(F, &AA, &DT);
}
-void MemorySSAPrinterPass::releaseMemory() {
- // Subtlety: Be sure to delete the walker before MSSA, because the walker's
- // dtor may try to access MemorySSA.
- Walker.reset();
- MSSA.reset();
-}
+PreservedAnalyses MemorySSAPrinterPass::run(Function &F,
+ FunctionAnalysisManager &AM) {
+ OS << "MemorySSA for function: " << F.getName() << "\n";
+ AM.getResult<MemorySSAAnalysis>(F).print(OS);
-void MemorySSAPrinterPass::getAnalysisUsage(AnalysisUsage &AU) const {
- AU.setPreservesAll();
- AU.addRequired<AAResultsWrapperPass>();
- AU.addRequired<DominatorTreeWrapperPass>();
- AU.addPreserved<DominatorTreeWrapperPass>();
- AU.addPreserved<GlobalsAAWrapperPass>();
+ return PreservedAnalyses::all();
}
-bool MemorySSAPrinterPass::doInitialization(Module &M) {
- VerifyMemorySSA = M.getContext()
- .getOption<bool, MemorySSAPrinterPass,
- &MemorySSAPrinterPass::VerifyMemorySSA>();
- return false;
-}
+PreservedAnalyses MemorySSAVerifierPass::run(Function &F,
+ FunctionAnalysisManager &AM) {
+ AM.getResult<MemorySSAAnalysis>(F).verifyMemorySSA();
-void MemorySSAPrinterPass::registerOptions() {
- OptionRegistry::registerOption<bool, MemorySSAPrinterPass,
- &MemorySSAPrinterPass::VerifyMemorySSA>(
- "verify-memoryssa", "Run the Memory SSA verifier", false);
+ return PreservedAnalyses::all();
}
-void MemorySSAPrinterPass::print(raw_ostream &OS, const Module *M) const {
- MSSA->print(OS);
-}
+char MemorySSAWrapperPass::ID = 0;
-bool MemorySSAPrinterPass::runOnFunction(Function &F) {
- this->F = &F;
- MSSA.reset(new MemorySSA(F));
- AliasAnalysis *AA = &getAnalysis<AAResultsWrapperPass>().getAAResults();
- DominatorTree *DT = &getAnalysis<DominatorTreeWrapperPass>().getDomTree();
- Walker.reset(MSSA->buildMemorySSA(AA, DT));
+MemorySSAWrapperPass::MemorySSAWrapperPass() : FunctionPass(ID) {
+ initializeMemorySSAWrapperPassPass(*PassRegistry::getPassRegistry());
+}
- if (VerifyMemorySSA) {
- MSSA->verifyMemorySSA();
- }
+void MemorySSAWrapperPass::releaseMemory() { MSSA.reset(); }
- return false;
+void MemorySSAWrapperPass::getAnalysisUsage(AnalysisUsage &AU) const {
+ AU.setPreservesAll();
+ AU.addRequiredTransitive<DominatorTreeWrapperPass>();
+ AU.addRequiredTransitive<AAResultsWrapperPass>();
}
-char MemorySSALazy::ID = 0;
-
-MemorySSALazy::MemorySSALazy() : FunctionPass(ID) {
- initializeMemorySSALazyPass(*PassRegistry::getPassRegistry());
+bool MemorySSAWrapperPass::runOnFunction(Function &F) {
+ auto &DT = getAnalysis<DominatorTreeWrapperPass>().getDomTree();
+ auto &AA = getAnalysis<AAResultsWrapperPass>().getAAResults();
+ MSSA.reset(new MemorySSA(F, &AA, &DT));
+ return false;
}
-void MemorySSALazy::releaseMemory() { MSSA.reset(); }
+void MemorySSAWrapperPass::verifyAnalysis() const { MSSA->verifyMemorySSA(); }
-bool MemorySSALazy::runOnFunction(Function &F) {
- MSSA.reset(new MemorySSA(F));
- return false;
+void MemorySSAWrapperPass::print(raw_ostream &OS, const Module *M) const {
+ MSSA->print(OS);
}
MemorySSAWalker::MemorySSAWalker(MemorySSA *M) : MSSA(M) {}
Modified: llvm/trunk/lib/Transforms/Utils/Utils.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/Utils.cpp?rev=271432&r1=271431&r2=271432&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/Utils.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/Utils.cpp Wed Jun 1 16:30:40 2016
@@ -33,8 +33,7 @@ void llvm::initializeTransformUtils(Pass
initializeUnifyFunctionExitNodesPass(Registry);
initializeInstSimplifierPass(Registry);
initializeMetaRenamerPass(Registry);
- initializeMemorySSALazyPass(Registry);
- initializeMemorySSAPrinterPassPass(Registry);
+ initializeMemorySSAWrapperPassPass(Registry);
}
/// LLVMInitializeTransformUtils - C binding for initializeTransformUtilsPasses.
Modified: llvm/trunk/test/Transforms/Util/MemorySSA/assume.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Util/MemorySSA/assume.ll?rev=271432&r1=271431&r2=271432&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/Util/MemorySSA/assume.ll (original)
+++ llvm/trunk/test/Transforms/Util/MemorySSA/assume.ll Wed Jun 1 16:30:40 2016
@@ -1,4 +1,5 @@
-; RUN: opt -basicaa -print-memoryssa -verify-memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -basicaa -memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>,verify<memoryssa>' -disable-output < %s 2>&1 | FileCheck %s
;
; Ensures that assumes are treated as not reading or writing memory.
Modified: llvm/trunk/test/Transforms/Util/MemorySSA/atomic-clobber.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Util/MemorySSA/atomic-clobber.ll?rev=271432&r1=271431&r2=271432&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/Util/MemorySSA/atomic-clobber.ll (original)
+++ llvm/trunk/test/Transforms/Util/MemorySSA/atomic-clobber.ll Wed Jun 1 16:30:40 2016
@@ -1,4 +1,5 @@
-; RUN: opt -basicaa -print-memoryssa -verify-memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -basicaa -memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>,verify<memoryssa>' -disable-output < %s 2>&1 | FileCheck %s
;
; Ensures that atomic loads count as MemoryDefs
Modified: llvm/trunk/test/Transforms/Util/MemorySSA/cyclicphi.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Util/MemorySSA/cyclicphi.ll?rev=271432&r1=271431&r2=271432&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/Util/MemorySSA/cyclicphi.ll (original)
+++ llvm/trunk/test/Transforms/Util/MemorySSA/cyclicphi.ll Wed Jun 1 16:30:40 2016
@@ -1,4 +1,5 @@
-; RUN: opt -basicaa -print-memoryssa -verify-memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -basicaa -memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>,verify<memoryssa>' -disable-output < %s 2>&1 | FileCheck %s
%struct.hoge = type { i32, %struct.widget }
%struct.widget = type { i64 }
Modified: llvm/trunk/test/Transforms/Util/MemorySSA/function-clobber.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Util/MemorySSA/function-clobber.ll?rev=271432&r1=271431&r2=271432&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/Util/MemorySSA/function-clobber.ll (original)
+++ llvm/trunk/test/Transforms/Util/MemorySSA/function-clobber.ll Wed Jun 1 16:30:40 2016
@@ -1,4 +1,5 @@
-; RUN: opt -basicaa -print-memoryssa -verify-memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -basicaa -memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>,verify<memoryssa>' -disable-output < %s 2>&1 | FileCheck %s
;
; Ensuring that external functions without attributes are MemoryDefs
Modified: llvm/trunk/test/Transforms/Util/MemorySSA/function-mem-attrs.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Util/MemorySSA/function-mem-attrs.ll?rev=271432&r1=271431&r2=271432&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/Util/MemorySSA/function-mem-attrs.ll (original)
+++ llvm/trunk/test/Transforms/Util/MemorySSA/function-mem-attrs.ll Wed Jun 1 16:30:40 2016
@@ -1,4 +1,5 @@
-; RUN: opt -basicaa -print-memoryssa -verify-memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -basicaa -memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>,verify<memoryssa>' -disable-output < %s 2>&1 | FileCheck %s
;
; Test that various function attributes give us sane results.
Modified: llvm/trunk/test/Transforms/Util/MemorySSA/livein.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Util/MemorySSA/livein.ll?rev=271432&r1=271431&r2=271432&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/Util/MemorySSA/livein.ll (original)
+++ llvm/trunk/test/Transforms/Util/MemorySSA/livein.ll Wed Jun 1 16:30:40 2016
@@ -1,4 +1,5 @@
-; RUN: opt -basicaa -print-memoryssa -verify-memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -basicaa -memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>,verify<memoryssa>' -disable-output < %s 2>&1 | FileCheck %s
define void @F(i8*) {
br i1 true, label %left, label %right
left:
Modified: llvm/trunk/test/Transforms/Util/MemorySSA/load-invariant.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Util/MemorySSA/load-invariant.ll?rev=271432&r1=271431&r2=271432&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/Util/MemorySSA/load-invariant.ll (original)
+++ llvm/trunk/test/Transforms/Util/MemorySSA/load-invariant.ll Wed Jun 1 16:30:40 2016
@@ -1,5 +1,6 @@
; XFAIL: *
-; RUN: opt -basicaa -print-memoryssa -verify-memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -basicaa -memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>' -verify-memoryssa -disable-output < %s 2>&1 | FileCheck %s
;
; Invariant loads should be considered live on entry, because, once the
; location is known to be dereferenceable, the value can never change.
Modified: llvm/trunk/test/Transforms/Util/MemorySSA/many-dom-backedge.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Util/MemorySSA/many-dom-backedge.ll?rev=271432&r1=271431&r2=271432&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/Util/MemorySSA/many-dom-backedge.ll (original)
+++ llvm/trunk/test/Transforms/Util/MemorySSA/many-dom-backedge.ll Wed Jun 1 16:30:40 2016
@@ -1,4 +1,5 @@
-; RUN: opt -basicaa -print-memoryssa -verify-memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -basicaa -memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>,verify<memoryssa>' -disable-output < %s 2>&1 | FileCheck %s
;
; many-dom.ll, with an added back-edge back into the switch.
; Because people love their gotos.
Modified: llvm/trunk/test/Transforms/Util/MemorySSA/many-doms.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Util/MemorySSA/many-doms.ll?rev=271432&r1=271431&r2=271432&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/Util/MemorySSA/many-doms.ll (original)
+++ llvm/trunk/test/Transforms/Util/MemorySSA/many-doms.ll Wed Jun 1 16:30:40 2016
@@ -1,4 +1,5 @@
-; RUN: opt -basicaa -print-memoryssa -verify-memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -basicaa -memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>,verify<memoryssa>' -disable-output < %s 2>&1 | FileCheck %s
;
; Testing many dominators, specifically from a switch statement in C.
Modified: llvm/trunk/test/Transforms/Util/MemorySSA/multi-edges.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Util/MemorySSA/multi-edges.ll?rev=271432&r1=271431&r2=271432&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/Util/MemorySSA/multi-edges.ll (original)
+++ llvm/trunk/test/Transforms/Util/MemorySSA/multi-edges.ll Wed Jun 1 16:30:40 2016
@@ -1,4 +1,5 @@
-; RUN: opt -basicaa -print-memoryssa -verify-memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -basicaa -memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>,verify<memoryssa>' -disable-output < %s 2>&1 | FileCheck %s
;
; Makes sure we have a sane model if both successors of some block is the same
; block.
Modified: llvm/trunk/test/Transforms/Util/MemorySSA/multiple-backedges-hal.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Util/MemorySSA/multiple-backedges-hal.ll?rev=271432&r1=271431&r2=271432&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/Util/MemorySSA/multiple-backedges-hal.ll (original)
+++ llvm/trunk/test/Transforms/Util/MemorySSA/multiple-backedges-hal.ll Wed Jun 1 16:30:40 2016
@@ -1,4 +1,5 @@
-; RUN: opt -basicaa -print-memoryssa -verify-memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -basicaa -memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>,verify<memoryssa>' -disable-output < %s 2>&1 | FileCheck %s
; hfinkel's case
; [entry]
Modified: llvm/trunk/test/Transforms/Util/MemorySSA/multiple-locations.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Util/MemorySSA/multiple-locations.ll?rev=271432&r1=271431&r2=271432&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/Util/MemorySSA/multiple-locations.ll (original)
+++ llvm/trunk/test/Transforms/Util/MemorySSA/multiple-locations.ll Wed Jun 1 16:30:40 2016
@@ -1,4 +1,5 @@
-; RUN: opt -basicaa -print-memoryssa -verify-memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -basicaa -memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>,verify<memoryssa>' -disable-output < %s 2>&1 | FileCheck %s
;
; Checks that basicAA is doing some amount of disambiguation for us
Modified: llvm/trunk/test/Transforms/Util/MemorySSA/no-disconnected.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Util/MemorySSA/no-disconnected.ll?rev=271432&r1=271431&r2=271432&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/Util/MemorySSA/no-disconnected.ll (original)
+++ llvm/trunk/test/Transforms/Util/MemorySSA/no-disconnected.ll Wed Jun 1 16:30:40 2016
@@ -1,4 +1,5 @@
-; RUN: opt -basicaa -print-memoryssa -analyze -verify-memoryssa < %s 2>&1 | FileCheck %s
+; RUN: opt -basicaa -memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>,verify<memoryssa>' -disable-output < %s 2>&1 | FileCheck %s
;
; This test ensures we don't end up with multiple reaching defs for a single
; use/phi edge If we were to optimize defs, we would end up with 2=
Modified: llvm/trunk/test/Transforms/Util/MemorySSA/optimize-use.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Util/MemorySSA/optimize-use.ll?rev=271432&r1=271431&r2=271432&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/Util/MemorySSA/optimize-use.ll (original)
+++ llvm/trunk/test/Transforms/Util/MemorySSA/optimize-use.ll Wed Jun 1 16:30:40 2016
@@ -1,4 +1,5 @@
-; RUN: opt -basicaa -print-memoryssa -analyze -verify-memoryssa < %s 2>&1 | FileCheck %s
+; RUN: opt -basicaa -memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>,verify<memoryssa>' -disable-output < %s 2>&1 | FileCheck %s
; Function Attrs: ssp uwtable
define i32 @main() {
Modified: llvm/trunk/test/Transforms/Util/MemorySSA/phi-translation.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Util/MemorySSA/phi-translation.ll?rev=271432&r1=271431&r2=271432&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/Util/MemorySSA/phi-translation.ll (original)
+++ llvm/trunk/test/Transforms/Util/MemorySSA/phi-translation.ll Wed Jun 1 16:30:40 2016
@@ -1,4 +1,5 @@
-; RUN: opt -basicaa -print-memoryssa -verify-memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -basicaa -memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>,verify<memoryssa>' -disable-output < %s 2>&1 | FileCheck %s
; %ptr can't alias %local, so we should be able to optimize the use of %local to
; point to the store to %local.
Modified: llvm/trunk/test/Transforms/Util/MemorySSA/volatile-clobber.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Util/MemorySSA/volatile-clobber.ll?rev=271432&r1=271431&r2=271432&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/Util/MemorySSA/volatile-clobber.ll (original)
+++ llvm/trunk/test/Transforms/Util/MemorySSA/volatile-clobber.ll Wed Jun 1 16:30:40 2016
@@ -1,4 +1,5 @@
-; RUN: opt -basicaa -print-memoryssa -verify-memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -basicaa -memoryssa -analyze < %s 2>&1 | FileCheck %s
+; RUN: opt -aa-pipeline=basic-aa -passes='print<memoryssa>,verify<memoryssa>' -disable-output < %s 2>&1 | FileCheck %s
;
; Ensures that volatile stores/loads count as MemoryDefs
Modified: llvm/trunk/unittests/Transforms/Utils/MemorySSA.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Transforms/Utils/MemorySSA.cpp?rev=271432&r1=271431&r2=271432&view=diff
==============================================================================
--- llvm/trunk/unittests/Transforms/Utils/MemorySSA.cpp (original)
+++ llvm/trunk/unittests/Transforms/Utils/MemorySSA.cpp Wed Jun 1 16:30:40 2016
@@ -43,13 +43,13 @@ protected:
AAResults AA;
BasicAAResult BAA;
MemorySSA MSSA;
- std::unique_ptr<MemorySSAWalker> Walker;
+ MemorySSAWalker *Walker;
TestAnalyses(MemorySSATest &Test)
: DT(*Test.F), AC(*Test.F), AA(Test.TLI),
- BAA(Test.DL, Test.TLI, AC, &DT), MSSA(*Test.F) {
+ BAA(Test.DL, Test.TLI, AC, &DT), MSSA(*Test.F, &AA, &DT) {
AA.addAAResult(BAA);
- Walker.reset(MSSA.buildMemorySSA(&AA, &DT));
+ Walker = MSSA.getWalker();
}
};
More information about the llvm-commits
mailing list