[llvm] r365110 - [NFC][PowerPC] Make the PowerPC scheduling strategy feature only control the strategy instead of the scheduler.
QingShan Zhang via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 4 00:43:51 PDT 2019
Author: qshanz
Date: Thu Jul 4 00:43:51 2019
New Revision: 365110
URL: http://llvm.org/viewvc/llvm-project?rev=365110&view=rev
Log:
[NFC][PowerPC] Make the PowerPC scheduling strategy feature only control the strategy instead of the scheduler.
Modified:
llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp
Modified: llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp?rev=365110&r1=365109&r2=365110&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp Thu Jul 4 00:43:51 2019
@@ -256,8 +256,11 @@ static CodeModel::Model getEffectivePPCC
static ScheduleDAGInstrs *createPPCMachineScheduler(MachineSchedContext *C) {
+ const PPCSubtarget &ST = C->MF->getSubtarget<PPCSubtarget>();
ScheduleDAGMILive *DAG =
- new ScheduleDAGMILive(C, llvm::make_unique<PPCPreRASchedStrategy>(C));
+ new ScheduleDAGMILive(C, ST.usePPCPreRASchedStrategy() ?
+ llvm::make_unique<PPCPreRASchedStrategy>(C) :
+ llvm::make_unique<GenericScheduler>(C));
// add DAG Mutations here.
DAG->addMutation(createCopyConstrainDAGMutation(DAG->TII, DAG->TRI));
return DAG;
@@ -265,8 +268,11 @@ static ScheduleDAGInstrs *createPPCMachi
static ScheduleDAGInstrs *createPPCPostMachineScheduler(
MachineSchedContext *C) {
+ const PPCSubtarget &ST = C->MF->getSubtarget<PPCSubtarget>();
ScheduleDAGMI *DAG =
- new ScheduleDAGMI(C, llvm::make_unique<PPCPostRASchedStrategy>(C), true);
+ new ScheduleDAGMI(C, ST.usePPCPostRASchedStrategy() ?
+ llvm::make_unique<PPCPostRASchedStrategy>(C) :
+ llvm::make_unique<PostGenericScheduler>(C), true);
// add DAG Mutations here.
return DAG;
}
@@ -366,17 +372,11 @@ public:
void addPreEmitPass() override;
ScheduleDAGInstrs *
createMachineScheduler(MachineSchedContext *C) const override {
- const PPCSubtarget &ST = C->MF->getSubtarget<PPCSubtarget>();
- if (ST.usePPCPreRASchedStrategy())
- return createPPCMachineScheduler(C);
- return nullptr;
+ return createPPCMachineScheduler(C);
}
ScheduleDAGInstrs *
createPostMachineScheduler(MachineSchedContext *C) const override {
- const PPCSubtarget &ST = C->MF->getSubtarget<PPCSubtarget>();
- if (ST.usePPCPostRASchedStrategy())
- return createPPCPostMachineScheduler(C);
- return nullptr;
+ return createPPCPostMachineScheduler(C);
}
};
More information about the llvm-commits
mailing list