Skip to content

Commit eb3d21b

Browse files
committed
[Passes] Remove some legacy printer passes
MemDepPrinter doesn't have a new PM equivalent, but MemDep is soft deprecated anyway and adding one should be easy if somebody wants to.
1 parent 1ebad21 commit eb3d21b

File tree

12 files changed

+0
-462
lines changed

12 files changed

+0
-462
lines changed

llvm/include/llvm/Analysis/MemorySSA.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,6 @@ class MemorySSA {
798798

799799
protected:
800800
// Used by Memory SSA dumpers and wrapper pass
801-
friend class MemorySSAPrinterLegacyPass;
802801
friend class MemorySSAUpdater;
803802

804803
void verifyOrderingDominationAndDefUses(
@@ -919,18 +918,6 @@ class MemorySSAUtil {
919918
AliasAnalysis &AA);
920919
};
921920

922-
// This pass does eager building and then printing of MemorySSA. It is used by
923-
// the tests to be able to build, dump, and verify Memory SSA.
924-
class MemorySSAPrinterLegacyPass : public FunctionPass {
925-
public:
926-
MemorySSAPrinterLegacyPass();
927-
928-
bool runOnFunction(Function &) override;
929-
void getAnalysisUsage(AnalysisUsage &AU) const override;
930-
931-
static char ID;
932-
};
933-
934921
/// An analysis that produces \c MemorySSA for a function.
935922
///
936923
class MemorySSAAnalysis : public AnalysisInfoMixin<MemorySSAAnalysis> {

llvm/include/llvm/Analysis/Passes.h

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -58,39 +58,6 @@ namespace llvm {
5858
// in a function and builds the region hierarchy.
5959
//
6060
FunctionPass *createRegionInfoPass();
61-
62-
// Print module-level debug info metadata in human-readable form.
63-
ModulePass *createModuleDebugInfoPrinterPass();
64-
65-
//===--------------------------------------------------------------------===//
66-
//
67-
// createMemDepPrinter - This pass exhaustively collects all memdep
68-
// information and prints it with -analyze.
69-
//
70-
FunctionPass *createMemDepPrinter();
71-
72-
//===--------------------------------------------------------------------===//
73-
//
74-
// createMemDerefPrinter - This pass collects memory dereferenceability
75-
// information and prints it with -analyze.
76-
//
77-
FunctionPass *createMemDerefPrinter();
78-
79-
//===--------------------------------------------------------------------===//
80-
//
81-
// createMustExecutePrinter - This pass collects information about which
82-
// instructions within a loop are guaranteed to execute if the loop header is
83-
// entered and prints it with -analyze.
84-
//
85-
FunctionPass *createMustExecutePrinter();
86-
87-
//===--------------------------------------------------------------------===//
88-
//
89-
// createMustBeExecutedContextPrinter - This pass prints information about which
90-
// instructions are guaranteed to execute together (run with -analyze).
91-
//
92-
ModulePass *createMustBeExecutedContextPrinter();
93-
9461
}
9562

9663
#endif

llvm/include/llvm/InitializePasses.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -237,18 +237,12 @@ void initializeMachineTraceMetricsPass(PassRegistry&);
237237
void initializeMachineUniformityInfoPrinterPassPass(PassRegistry &);
238238
void initializeMachineUniformityAnalysisPassPass(PassRegistry &);
239239
void initializeMachineVerifierPassPass(PassRegistry&);
240-
void initializeMemDepPrinterPass(PassRegistry&);
241-
void initializeMemDerefPrinterPass(PassRegistry&);
242240
void initializeMemoryDependenceWrapperPassPass(PassRegistry&);
243-
void initializeMemorySSAPrinterLegacyPassPass(PassRegistry&);
244241
void initializeMemorySSAWrapperPassPass(PassRegistry&);
245242
void initializeMergeICmpsLegacyPassPass(PassRegistry &);
246243
void initializeMergedLoadStoreMotionLegacyPassPass(PassRegistry&);
247-
void initializeModuleDebugInfoLegacyPrinterPass(PassRegistry &);
248244
void initializeModuleSummaryIndexWrapperPassPass(PassRegistry&);
249245
void initializeModuloScheduleTestPass(PassRegistry&);
250-
void initializeMustExecutePrinterPass(PassRegistry&);
251-
void initializeMustBeExecutedContextPrinterPass(PassRegistry&);
252246
void initializeNaryReassociateLegacyPassPass(PassRegistry&);
253247
void initializeObjCARCContractLegacyPassPass(PassRegistry &);
254248
void initializeOptimizationRemarkEmitterWrapperPassPass(PassRegistry&);

llvm/include/llvm/LinkAllPasses.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,8 @@ namespace {
146146
llvm::raw_string_ostream os(buf);
147147
(void) llvm::createPrintModulePass(os);
148148
(void) llvm::createPrintFunctionPass(os);
149-
(void) llvm::createModuleDebugInfoPrinterPass();
150149
(void) llvm::createSinkingPass();
151150
(void) llvm::createLowerAtomicPass();
152-
(void) llvm::createMemDepPrinter();
153151
(void) llvm::createLoadStoreVectorizerPass();
154152
(void) llvm::createPartiallyInlineLibCallsPass();
155153
(void) llvm::createScalarizerPass();
@@ -158,9 +156,6 @@ namespace {
158156
(void) llvm::createSpeculativeExecutionIfHasBranchDivergencePass();
159157
(void) llvm::createRewriteSymbolsPass();
160158
(void) llvm::createStraightLineStrengthReducePass();
161-
(void) llvm::createMemDerefPrinter();
162-
(void) llvm::createMustExecutePrinter();
163-
(void) llvm::createMustBeExecutedContextPrinter();
164159
(void)llvm::createScalarizeMaskedMemIntrinLegacyPass();
165160
(void) llvm::createHardwareLoopsLegacyPass();
166161
(void) llvm::createUnifyLoopExitsPass();

llvm/lib/Analysis/Analysis.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,8 @@ void llvm::initializeAnalysis(PassRegistry &Registry) {
5454
initializeLazyValueInfoWrapperPassPass(Registry);
5555
initializeLazyValueInfoPrinterPass(Registry);
5656
initializeLoopInfoWrapperPassPass(Registry);
57-
initializeMemDepPrinterPass(Registry);
58-
initializeMemDerefPrinterPass(Registry);
5957
initializeMemoryDependenceWrapperPassPass(Registry);
60-
initializeModuleDebugInfoLegacyPrinterPass(Registry);
6158
initializeModuleSummaryIndexWrapperPassPass(Registry);
62-
initializeMustExecutePrinterPass(Registry);
63-
initializeMustBeExecutedContextPrinterPass(Registry);
6459
initializeOptimizationRemarkEmitterWrapperPassPass(Registry);
6560
initializePhiValuesWrapperPassPass(Registry);
6661
initializePostDominatorTreeWrapperPassPass(Registry);
@@ -78,7 +73,6 @@ void llvm::initializeAnalysis(PassRegistry &Registry) {
7873
initializeScopedNoAliasAAWrapperPassPass(Registry);
7974
initializeLCSSAVerificationPassPass(Registry);
8075
initializeMemorySSAWrapperPassPass(Registry);
81-
initializeMemorySSAPrinterLegacyPassPass(Registry);
8276
}
8377

8478
LLVMBool LLVMVerifyModule(LLVMModuleRef M, LLVMVerifierFailureAction Action,

llvm/lib/Analysis/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ add_llvm_component_library(LLVMAnalysis
9292
LoopInfo.cpp
9393
LoopPass.cpp
9494
MLInlineAdvisor.cpp
95-
MemDepPrinter.cpp
9695
MemDerefPrinter.cpp
9796
MemoryBuiltins.cpp
9897
MemoryDependenceAnalysis.cpp

llvm/lib/Analysis/MemDepPrinter.cpp

Lines changed: 0 additions & 164 deletions
This file was deleted.

llvm/lib/Analysis/MemDerefPrinter.cpp

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -18,65 +18,6 @@
1818

1919
using namespace llvm;
2020

21-
namespace {
22-
struct MemDerefPrinter : public FunctionPass {
23-
SmallVector<Value *, 4> Deref;
24-
SmallPtrSet<Value *, 4> DerefAndAligned;
25-
26-
static char ID; // Pass identification, replacement for typeid
27-
MemDerefPrinter() : FunctionPass(ID) {
28-
initializeMemDerefPrinterPass(*PassRegistry::getPassRegistry());
29-
}
30-
void getAnalysisUsage(AnalysisUsage &AU) const override {
31-
AU.setPreservesAll();
32-
}
33-
bool runOnFunction(Function &F) override;
34-
void print(raw_ostream &OS, const Module * = nullptr) const override;
35-
void releaseMemory() override {
36-
Deref.clear();
37-
DerefAndAligned.clear();
38-
}
39-
};
40-
}
41-
42-
char MemDerefPrinter::ID = 0;
43-
INITIALIZE_PASS_BEGIN(MemDerefPrinter, "print-memderefs",
44-
"Memory Dereferenciblity of pointers in function", false, true)
45-
INITIALIZE_PASS_END(MemDerefPrinter, "print-memderefs",
46-
"Memory Dereferenciblity of pointers in function", false, true)
47-
48-
FunctionPass *llvm::createMemDerefPrinter() {
49-
return new MemDerefPrinter();
50-
}
51-
52-
bool MemDerefPrinter::runOnFunction(Function &F) {
53-
const DataLayout &DL = F.getParent()->getDataLayout();
54-
for (auto &I: instructions(F)) {
55-
if (LoadInst *LI = dyn_cast<LoadInst>(&I)) {
56-
Value *PO = LI->getPointerOperand();
57-
if (isDereferenceablePointer(PO, LI->getType(), DL))
58-
Deref.push_back(PO);
59-
if (isDereferenceableAndAlignedPointer(PO, LI->getType(), LI->getAlign(),
60-
DL))
61-
DerefAndAligned.insert(PO);
62-
}
63-
}
64-
return false;
65-
}
66-
67-
void MemDerefPrinter::print(raw_ostream &OS, const Module *M) const {
68-
OS << "The following are dereferenceable:\n";
69-
for (Value *V: Deref) {
70-
OS << " ";
71-
V->print(OS);
72-
if (DerefAndAligned.count(V))
73-
OS << "\t(aligned)";
74-
else
75-
OS << "\t(unaligned)";
76-
OS << "\n";
77-
}
78-
}
79-
8021
PreservedAnalyses MemDerefPrinterPass::run(Function &F,
8122
FunctionAnalysisManager &AM) {
8223
OS << "Memory Dereferencibility of pointers in function '" << F.getName()

0 commit comments

Comments
 (0)