mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-06 12:26:45 +00:00
Move pass configuration out of pass constructors: PostRAScheduler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150096 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
61f1e3db43
commit
c7d081b594
@ -271,7 +271,7 @@ namespace llvm {
|
||||
|
||||
/// createPostRAScheduler - This pass performs post register allocation
|
||||
/// scheduling.
|
||||
FunctionPass *createPostRAScheduler(CodeGenOpt::Level OptLevel);
|
||||
FunctionPass *createPostRAScheduler();
|
||||
|
||||
/// BranchFolding Pass - This pass performs machine code CFG based
|
||||
/// optimizations to delete branches to branches, eliminate branches to
|
||||
|
@ -285,7 +285,7 @@ void TargetPassConfig::addMachinePasses() {
|
||||
|
||||
// Second pass scheduler.
|
||||
if (getOptLevel() != CodeGenOpt::None && !DisablePostRA) {
|
||||
PM.add(createPostRAScheduler(getOptLevel()));
|
||||
PM.add(createPostRAScheduler());
|
||||
printNoVerify("After PostRAScheduler");
|
||||
}
|
||||
|
||||
|
@ -82,16 +82,15 @@ namespace {
|
||||
AliasAnalysis *AA;
|
||||
const TargetInstrInfo *TII;
|
||||
RegisterClassInfo RegClassInfo;
|
||||
CodeGenOpt::Level OptLevel;
|
||||
|
||||
public:
|
||||
static char ID;
|
||||
PostRAScheduler(CodeGenOpt::Level ol) :
|
||||
MachineFunctionPass(ID), OptLevel(ol) {}
|
||||
PostRAScheduler() : MachineFunctionPass(ID) {}
|
||||
|
||||
void getAnalysisUsage(AnalysisUsage &AU) const {
|
||||
AU.setPreservesCFG();
|
||||
AU.addRequired<AliasAnalysis>();
|
||||
AU.addRequired<TargetPassConfig>();
|
||||
AU.addRequired<MachineDominatorTree>();
|
||||
AU.addPreserved<MachineDominatorTree>();
|
||||
AU.addRequired<MachineLoopInfo>();
|
||||
@ -209,6 +208,8 @@ bool PostRAScheduler::runOnMachineFunction(MachineFunction &Fn) {
|
||||
MachineLoopInfo &MLI = getAnalysis<MachineLoopInfo>();
|
||||
MachineDominatorTree &MDT = getAnalysis<MachineDominatorTree>();
|
||||
AliasAnalysis *AA = &getAnalysis<AliasAnalysis>();
|
||||
TargetPassConfig *PassConfig = &getAnalysis<TargetPassConfig>();
|
||||
|
||||
RegClassInfo.runOnMachineFunction(Fn);
|
||||
|
||||
// Check for explicit enable/disable of post-ra scheduling.
|
||||
@ -222,7 +223,8 @@ bool PostRAScheduler::runOnMachineFunction(MachineFunction &Fn) {
|
||||
// Check that post-RA scheduling is enabled for this target.
|
||||
// This may upgrade the AntiDepMode.
|
||||
const TargetSubtargetInfo &ST = Fn.getTarget().getSubtarget<TargetSubtargetInfo>();
|
||||
if (!ST.enablePostRAScheduler(OptLevel, AntiDepMode, CriticalPathRCs))
|
||||
if (!ST.enablePostRAScheduler(PassConfig->getOptLevel(), AntiDepMode,
|
||||
CriticalPathRCs))
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -710,6 +712,6 @@ void SchedulePostRATDList::ListScheduleTopDown() {
|
||||
// Public Constructor Functions
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
FunctionPass *llvm::createPostRAScheduler(CodeGenOpt::Level OptLevel) {
|
||||
return new PostRAScheduler(OptLevel);
|
||||
FunctionPass *llvm::createPostRAScheduler() {
|
||||
return new PostRAScheduler();
|
||||
}
|
||||
|
@ -353,7 +353,7 @@ bool PTXPassConfig::addCodeGenPasses(MCContext *&OutContext) {
|
||||
|
||||
// Second pass scheduler.
|
||||
if (getOptLevel() != CodeGenOpt::None) {
|
||||
PM.add(createPostRAScheduler(getOptLevel()));
|
||||
PM.add(createPostRAScheduler());
|
||||
printAndVerify("After PostRAScheduler");
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user