summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AMDGPU/GCNSchedStrategy.h
diff options
context:
space:
mode:
authorStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>2017-02-15 17:19:50 +0000
committerStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>2017-02-15 17:19:50 +0000
commit582a5237f95a3852cead5208f28a84b4cab0efb2 (patch)
treedf76fef746ef0d85b80901079d46f88b680b5486 /llvm/lib/Target/AMDGPU/GCNSchedStrategy.h
parent0a6913bc2f6213d109c4497de8c4a302f62222a8 (diff)
downloadbcm5719-llvm-582a5237f95a3852cead5208f28a84b4cab0efb2.tar.gz
bcm5719-llvm-582a5237f95a3852cead5208f28a84b4cab0efb2.zip
[AMDGPU] Revert failed scheduling
This patch reverts region's scheduling to the original untouched state in case if we have have decreased occupancy. In addition it switches to use TargetRegisterInfo occupancy callback for pressure limits instead of gradually increasing limits which were just passed by. We are going to stay with the best schedule so we do not need to tolerate worsened scheduling anymore. Differential Revision: https://reviews.llvm.org/D29971 llvm-svn: 295206
Diffstat (limited to 'llvm/lib/Target/AMDGPU/GCNSchedStrategy.h')
-rw-r--r--llvm/lib/Target/AMDGPU/GCNSchedStrategy.h23
1 files changed, 17 insertions, 6 deletions
diff --git a/llvm/lib/Target/AMDGPU/GCNSchedStrategy.h b/llvm/lib/Target/AMDGPU/GCNSchedStrategy.h
index 4cfc0cea81f..a0068f55d2d 100644
--- a/llvm/lib/Target/AMDGPU/GCNSchedStrategy.h
+++ b/llvm/lib/Target/AMDGPU/GCNSchedStrategy.h
@@ -25,6 +25,7 @@ class SIRegisterInfo;
/// heuristics to determine excess/critical pressure sets. Its goal is to
/// maximize kernel occupancy (i.e. maximum number of waves per simd).
class GCNMaxOccupancySchedStrategy : public GenericScheduler {
+ friend class GCNScheduleDAGMILive;
SUnit *pickNodeBidirectional(bool &IsTopNode);
@@ -35,18 +36,28 @@ class GCNMaxOccupancySchedStrategy : public GenericScheduler {
void initCandidate(SchedCandidate &Cand, SUnit *SU,
bool AtTop, const RegPressureTracker &RPTracker,
const SIRegisterInfo *SRI,
- int SGPRPressure, int VGPRPressure,
- int SGPRExcessLimit, int VGPRExcessLimit,
- int SGPRCriticalLimit, int VGPRCriticalLimit);
+ unsigned SGPRPressure, unsigned VGPRPressure);
- void tryCandidate(SchedCandidate &Cand, SchedCandidate &TryCand,
- SchedBoundary *Zone, const SIRegisterInfo *SRI,
- unsigned SGPRPressure, unsigned VGPRPressure);
+ unsigned SGPRExcessLimit;
+ unsigned VGPRExcessLimit;
+ unsigned SGPRCriticalLimit;
+ unsigned VGPRCriticalLimit;
public:
GCNMaxOccupancySchedStrategy(const MachineSchedContext *C);
SUnit *pickNode(bool &IsTopNode) override;
+
+ void initialize(ScheduleDAGMI *DAG) override;
+};
+
+class GCNScheduleDAGMILive : public ScheduleDAGMILive {
+public:
+ GCNScheduleDAGMILive(MachineSchedContext *C,
+ std::unique_ptr<MachineSchedStrategy> S) :
+ ScheduleDAGMILive(C, std::move(S)) {}
+
+ void schedule() override;
};
} // End namespace llvm
OpenPOWER on IntegriCloud