[llvm] 0f63496 - Revert "[MemorySSA] Add pass to print results of MemorySSA walker"
Arthur Eubanks via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 1 18:45:35 PDT 2021
Author: Arthur Eubanks
Date: 2021-09-01T18:45:19-07:00
New Revision: 0f63496ea46892fcadc03487109dabb9392604cb
URL: https://github.com/llvm/llvm-project/commit/0f63496ea46892fcadc03487109dabb9392604cb
DIFF: https://github.com/llvm/llvm-project/commit/0f63496ea46892fcadc03487109dabb9392604cb.diff
LOG: Revert "[MemorySSA] Add pass to print results of MemorySSA walker"
This reverts commit 8f98477c2d2bcbf5b6aa36278b59bf2a861426a1.
Breaks bots
Added:
Modified:
llvm/include/llvm/Analysis/MemorySSA.h
llvm/lib/Analysis/MemorySSA.cpp
llvm/lib/Passes/PassRegistry.def
Removed:
llvm/test/Analysis/MemorySSA/print-walker.ll
################################################################################
diff --git a/llvm/include/llvm/Analysis/MemorySSA.h b/llvm/include/llvm/Analysis/MemorySSA.h
index d39beacb35ae..024d2c4b003c 100644
--- a/llvm/include/llvm/Analysis/MemorySSA.h
+++ b/llvm/include/llvm/Analysis/MemorySSA.h
@@ -953,17 +953,6 @@ class MemorySSAPrinterPass : public PassInfoMixin<MemorySSAPrinterPass> {
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
};
-/// Printer pass for \c MemorySSA via the walker.
-class MemorySSAWalkerPrinterPass
- : public PassInfoMixin<MemorySSAWalkerPrinterPass> {
- raw_ostream &OS;
-
-public:
- explicit MemorySSAWalkerPrinterPass(raw_ostream &OS) : OS(OS) {}
-
- PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
-};
-
/// Verifier pass for \c MemorySSA.
struct MemorySSAVerifierPass : PassInfoMixin<MemorySSAVerifierPass> {
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
diff --git a/llvm/lib/Analysis/MemorySSA.cpp b/llvm/lib/Analysis/MemorySSA.cpp
index 06976c444336..dc830ca7a812 100644
--- a/llvm/lib/Analysis/MemorySSA.cpp
+++ b/llvm/lib/Analysis/MemorySSA.cpp
@@ -95,11 +95,13 @@ static cl::opt<bool, true>
VerifyMemorySSAX("verify-memoryssa", cl::location(VerifyMemorySSA),
cl::Hidden, cl::desc("Enable verification of MemorySSA."));
-namespace {
+namespace llvm {
/// An assembly annotator class to print Memory SSA information in
/// comments.
class MemorySSAAnnotatedWriter : public AssemblyAnnotationWriter {
+ friend class MemorySSA;
+
const MemorySSA *MSSA;
public:
@@ -118,29 +120,7 @@ class MemorySSAAnnotatedWriter : public AssemblyAnnotationWriter {
}
};
-/// An assembly annotator class to print Memory SSA information in
-/// comments.
-class MemorySSAWalkerAnnotatedWriter : public AssemblyAnnotationWriter {
- MemorySSA *MSSA;
- MemorySSAWalker *Walker;
-
-public:
- MemorySSAWalkerAnnotatedWriter(MemorySSA *M)
- : MSSA(M), Walker(M->getWalker()) {}
-
- void emitInstructionAnnot(const Instruction *I,
- formatted_raw_ostream &OS) override {
- if (MemoryAccess *MA = MSSA->getMemoryAccess(I)) {
- MemoryAccess *Clobber = Walker->getClobberingMemoryAccess(MA);
- OS << "; " << *MA;
- if (Clobber)
- OS << " - clobbered by " << *Clobber;
- OS << "\n";
- }
- }
-};
-
-} // namespace
+} // end namespace llvm
namespace {
@@ -2371,16 +2351,6 @@ PreservedAnalyses MemorySSAPrinterPass::run(Function &F,
return PreservedAnalyses::all();
}
-PreservedAnalyses MemorySSAWalkerPrinterPass::run(Function &F,
- FunctionAnalysisManager &AM) {
- auto &MSSA = AM.getResult<MemorySSAAnalysis>(F).getMSSA();
- OS << "MemorySSA (walker) for function: " << F.getName() << "\n";
- MemorySSAWalkerAnnotatedWriter Writer(&MSSA);
- F.print(OS, &Writer);
-
- return PreservedAnalyses::all();
-}
-
PreservedAnalyses MemorySSAVerifierPass::run(Function &F,
FunctionAnalysisManager &AM) {
AM.getResult<MemorySSAAnalysis>(F).getMSSA().verifyMemorySSA();
diff --git a/llvm/lib/Passes/PassRegistry.def b/llvm/lib/Passes/PassRegistry.def
index 29ab4bbcbdbb..fef3aba69e25 100644
--- a/llvm/lib/Passes/PassRegistry.def
+++ b/llvm/lib/Passes/PassRegistry.def
@@ -297,7 +297,6 @@ FUNCTION_PASS("print<inliner-size-estimator>",
InlineSizeEstimatorAnalysisPrinterPass(dbgs()))
FUNCTION_PASS("print<loops>", LoopPrinterPass(dbgs()))
FUNCTION_PASS("print<memoryssa>", MemorySSAPrinterPass(dbgs()))
-FUNCTION_PASS("print<memoryssa-walker>", MemorySSAWalkerPrinterPass(dbgs()))
FUNCTION_PASS("print<phi-values>", PhiValuesPrinterPass(dbgs()))
FUNCTION_PASS("print<regions>", RegionInfoPrinterPass(dbgs()))
FUNCTION_PASS("print<scalar-evolution>", ScalarEvolutionPrinterPass(dbgs()))
diff --git a/llvm/test/Analysis/MemorySSA/print-walker.ll b/llvm/test/Analysis/MemorySSA/print-walker.ll
deleted file mode 100644
index 5c44b5b2c758..000000000000
--- a/llvm/test/Analysis/MemorySSA/print-walker.ll
+++ /dev/null
@@ -1,35 +0,0 @@
-; RUN: opt -passes='print<memoryssa-walker>' -disable-output < %s 2>&1 | FileCheck %s
-
-; CHECK: define void @test
-; CHECK: 1 = MemoryDef(liveOnEntry)->liveOnEntry - clobbered by 0 = MemoryDef(liveOnEntry)
-; CHECK: store i8 42, i8* %a1
-; CHECK: 2 = MemoryDef(1)->liveOnEntry - clobbered by 0 = MemoryDef(liveOnEntry)
-; CHECK: store i8 42, i8* %a2
-; CHECK: MemoryUse(1) MustAlias - clobbered by 1 = MemoryDef(liveOnEntry)->liveOnEntry
-; CHECK: %l1 = load i8, i8* %a1
-; CHECK: MemoryUse(2) MustAlias - clobbered by 2 = MemoryDef(1)->liveOnEntry
-; CHECK: %l2 = load i8, i8* %a2
-; CHECK: 3 = MemoryDef(2)->liveOnEntry - clobbered by 0 = MemoryDef(liveOnEntry)
-; CHECK: store i8 42, i8* %p
-; CHECK: 4 = MemoryDef(3)->3 MustAlias - clobbered by 3 = MemoryDef(2)->liveOnEntry
-; CHECK: store i8 42, i8* %p
-; CHECK: MemoryUse(4) MustAlias - clobbered by 4 = MemoryDef(3)->3 MustAlias
-; CHECK: %p1 = load i8, i8* %p
-; CHECK: MemoryUse(4) MustAlias - clobbered by 4 = MemoryDef(3)->3 MustAlias
-; CHECK: %p2 = load i8, i8* %p
-
-define void @test(i8* %p) {
- %a1 = alloca i8
- %a2 = alloca i8
- store i8 42, i8* %a1
- store i8 42, i8* %a2
- %l1 = load i8, i8* %a1
- %l2 = load i8, i8* %a2
-
- store i8 42, i8* %p
- store i8 42, i8* %p
- %p1 = load i8, i8* %p
- %p2 = load i8, i8* %p
-
- ret void
-}
More information about the llvm-commits
mailing list