diff options
author | Matthias Braun <matze@braunis.de> | 2016-11-28 20:11:54 +0000 |
---|---|---|
committer | Matthias Braun <matze@braunis.de> | 2016-11-28 20:11:54 +0000 |
commit | 115efcd3d12e3617d0a2ee02499b379c67c2c5cb (patch) | |
tree | 930609a23320767934c1b6ecabb557c6ccb22984 /llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp | |
parent | a88e8358afb552aaadc3bf0aa4f76805a9d2b9ac (diff) | |
download | bcm5719-llvm-115efcd3d12e3617d0a2ee02499b379c67c2c5cb.tar.gz bcm5719-llvm-115efcd3d12e3617d0a2ee02499b379c67c2c5cb.zip |
MachineScheduler: Export function to construct "default" scheduler.
This makes the createGenericSchedLive() function that constructs the
default scheduler available for the public API. This should help when
you want to get a scheduler and the default list of DAG mutations.
This also shrinks the list of default DAG mutations:
{Load|Store}ClusterDAGMutation and MacroFusionDAGMutation are no longer
added by default. Targets can easily add them if they need them. It also
makes it easier for targets to add alternative/custom macrofusion or
clustering mutations while staying with the default
createGenericSchedLive(). It also saves the callback back and forth in
TargetInstrInfo::enableClusterLoads()/enableClusterStores().
Differential Revision: https://reviews.llvm.org/D26986
llvm-svn: 288057
Diffstat (limited to 'llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp')
-rw-r--r-- | llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp b/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp index baf4d192c57..7287b56aa6d 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp @@ -102,14 +102,8 @@ static ScheduleDAGInstrs * createGCNMaxOccupancyMachineScheduler(MachineSchedContext *C) { ScheduleDAGMILive *DAG = new ScheduleDAGMILive(C, make_unique<GCNMaxOccupancySchedStrategy>(C)); - - const SIInstrInfo *TII = static_cast<const SIInstrInfo *>(DAG->TII); - if (TII->enableClusterLoads()) - DAG->addMutation(createLoadClusterDAGMutation(TII, DAG->TRI)); - - if (TII->enableClusterStores()) - DAG->addMutation(createStoreClusterDAGMutation(TII, DAG->TRI)); - + DAG->addMutation(createLoadClusterDAGMutation(DAG->TII, DAG->TRI)); + DAG->addMutation(createStoreClusterDAGMutation(DAG->TII, DAG->TRI)); return DAG; } @@ -291,6 +285,14 @@ public: return getTM<AMDGPUTargetMachine>(); } + ScheduleDAGInstrs * + createMachineScheduler(MachineSchedContext *C) const override { + ScheduleDAGMILive *DAG = createGenericSchedLive(C); + DAG->addMutation(createLoadClusterDAGMutation(DAG->TII, DAG->TRI)); + DAG->addMutation(createStoreClusterDAGMutation(DAG->TII, DAG->TRI)); + return DAG; + } + void addEarlyCSEOrGVNPass(); void addStraightLineScalarOptimizationPasses(); void addIRPasses() override; |