Skip to content

Commit d623b2f

Browse files
committedMar 13, 2023
[PassManagerBuilder] Remove PassManagerBuilder
PassManagerBuilder is dead, long live PassBuilder! bugpoint's -O# are now useless (and probably have been for a while given the number of passes we've removed from PassManagerBuilder). Perhaps they'll be revived if bugpoint ever works with the new PM. Reviewed By: nikic, MaskRay Differential Revision: https://reviews.llvm.org/D145835
1 parent af5f468 commit d623b2f

File tree

7 files changed

+0
-519
lines changed

7 files changed

+0
-519
lines changed
 

‎llvm/docs/WritingAnLLVMPass.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ As a whole, the ``.cpp`` file looks like:
194194
#include "llvm/Support/raw_ostream.h"
195195

196196
#include "llvm/IR/LegacyPassManager.h"
197-
#include "llvm/Transforms/IPO/PassManagerBuilder.h"
198197

199198
using namespace llvm;
200199

‎llvm/include/llvm/Transforms/IPO/PassManagerBuilder.h

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

‎llvm/lib/Transforms/IPO/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ add_llvm_component_library(LLVMipo
3131
ModuleInliner.cpp
3232
OpenMPOpt.cpp
3333
PartialInlining.cpp
34-
PassManagerBuilder.cpp
3534
SampleContextTracker.cpp
3635
SampleProfile.cpp
3736
SampleProfileProbe.cpp

‎llvm/lib/Transforms/IPO/PassManagerBuilder.cpp

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

‎llvm/tools/bugpoint/bugpoint.cpp

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
#include "llvm/Support/TargetSelect.h"
3131
#include "llvm/Support/Valgrind.h"
3232
#include "llvm/Transforms/IPO/AlwaysInliner.h"
33-
#include "llvm/Transforms/IPO/PassManagerBuilder.h"
3433

3534
// Enable this macro to debug bugpoint itself.
3635
//#define DEBUG_BUGPOINT 1
@@ -66,24 +65,6 @@ static cl::opt<bool>
6665
static cl::list<const PassInfo *, bool, PassNameParser>
6766
PassList(cl::desc("Passes available:"));
6867

69-
static cl::opt<bool>
70-
OptLevelO1("O1", cl::desc("Optimization level 1. Identical to 'opt -O1'"));
71-
72-
static cl::opt<bool>
73-
OptLevelO2("O2", cl::desc("Optimization level 2. Identical to 'opt -O2'"));
74-
75-
static cl::opt<bool> OptLevelOs(
76-
"Os",
77-
cl::desc(
78-
"Like -O2 with extra optimizations for size. Similar to clang -Os"));
79-
80-
static cl::opt<bool>
81-
OptLevelOz("Oz",
82-
cl::desc("Like -Os but reduces code size further. Similar to clang -Oz"));
83-
84-
static cl::opt<bool>
85-
OptLevelO3("O3", cl::desc("Optimization level 3. Identical to 'opt -O3'"));
86-
8768
static cl::opt<std::string>
8869
OverrideTriple("mtriple", cl::desc("Override target triple for module"));
8970

@@ -110,23 +91,6 @@ class AddToDriver : public legacy::FunctionPassManager {
11091
};
11192
}
11293

113-
// This routine adds optimization passes based on selected optimization level,
114-
// OptLevel.
115-
//
116-
// OptLevel - Optimization Level
117-
static void AddOptimizationPasses(legacy::FunctionPassManager &FPM,
118-
unsigned OptLevel,
119-
unsigned SizeLevel) {
120-
PassManagerBuilder Builder;
121-
Builder.OptLevel = OptLevel;
122-
Builder.SizeLevel = SizeLevel;
123-
124-
Builder.Inliner = createAlwaysInlinerLegacyPass();
125-
126-
Builder.populateFunctionPassManager(FPM);
127-
Builder.populateModulePassManager(FPM);
128-
}
129-
13094
#define HANDLE_EXTENSION(Ext) \
13195
llvm::PassPluginLibraryInfo get##Ext##PluginInfo();
13296
#include "llvm/Support/Extension.def"
@@ -192,17 +156,6 @@ int main(int argc, char **argv) {
192156

193157
AddToDriver PM(D);
194158

195-
if (OptLevelO1)
196-
AddOptimizationPasses(PM, 1, 0);
197-
else if (OptLevelO2)
198-
AddOptimizationPasses(PM, 2, 0);
199-
else if (OptLevelO3)
200-
AddOptimizationPasses(PM, 3, 0);
201-
else if (OptLevelOs)
202-
AddOptimizationPasses(PM, 2, 1);
203-
else if (OptLevelOz)
204-
AddOptimizationPasses(PM, 2, 2);
205-
206159
for (const PassInfo *PI : PassList)
207160
D.addPass(std::string(PI->getPassArgument()));
208161

‎llvm/utils/gn/secondary/llvm/lib/Transforms/IPO/BUILD.gn

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ static_library("IPO") {
5252
"ModuleInliner.cpp",
5353
"OpenMPOpt.cpp",
5454
"PartialInlining.cpp",
55-
"PassManagerBuilder.cpp",
5655
"SCCP.cpp",
5756
"SampleContextTracker.cpp",
5857
"SampleProfile.cpp",

‎polly/lib/Support/RegisterPasses.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
#include "llvm/Support/CommandLine.h"
4949
#include "llvm/Support/TargetSelect.h"
5050
#include "llvm/Transforms/IPO.h"
51-
#include "llvm/Transforms/IPO/PassManagerBuilder.h"
5251

5352
namespace cl = llvm::cl;
5453

0 commit comments

Comments
 (0)
Please sign in to comment.