Skip to content

Commit d9bb84d

Browse files
committed
[NewPM][CodeGen] add TargetPassConfig like API
1 parent 33d804c commit d9bb84d

File tree

3 files changed

+266
-91
lines changed

3 files changed

+266
-91
lines changed

llvm/include/llvm/CodeGen/MachinePassManager.h

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "llvm/ADT/SmallVector.h"
2828
#include "llvm/IR/PassManager.h"
2929
#include "llvm/Support/Error.h"
30+
#include "llvm/Target/CGPassBuilderOption.h"
3031

3132
#include <map>
3233

@@ -150,10 +151,7 @@ class MachineFunctionPassManager
150151
using Base = PassManager<MachineFunction, MachineFunctionAnalysisManager>;
151152

152153
public:
153-
MachineFunctionPassManager(bool RequireCodeGenSCCOrder = false,
154-
bool VerifyMachineFunction = false)
155-
: RequireCodeGenSCCOrder(RequireCodeGenSCCOrder),
156-
VerifyMachineFunction(VerifyMachineFunction) {}
154+
MachineFunctionPassManager() : Opt(getCGPassBuilderOption()) {}
157155
MachineFunctionPassManager(MachineFunctionPassManager &&) = default;
158156
MachineFunctionPassManager &
159157
operator=(MachineFunctionPassManager &&) = default;
@@ -261,10 +259,7 @@ class MachineFunctionPassManager
261259
using PassIndex = decltype(Passes)::size_type;
262260
std::map<PassIndex, llvm::unique_function<FuncTy>> MachineModulePasses;
263261

264-
// Run codegen in the SCC order.
265-
bool RequireCodeGenSCCOrder;
266-
267-
bool VerifyMachineFunction;
262+
CGPassBuilderOption Opt;
268263
};
269264

270265
} // end namespace llvm

0 commit comments

Comments
 (0)