LLVM  4.0.0
GCNSchedStrategy.h
Go to the documentation of this file.
1 //===-- GCNSchedStrategy.h - GCN Scheduler Strategy -*- C++ -*-------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 /// \file
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_LIB_TARGET_AMDGPU_GCNSCHEDSTRATEGY_H
15 #define LLVM_LIB_TARGET_AMDGPU_GCNSCHEDSTRATEGY_H
16 
18 
19 namespace llvm {
20 
21 class SIRegisterInfo;
22 
23 /// This is a minimal scheduler strategy. The main difference between this
24 /// and the GenericScheduler is that GCNSchedStrategy uses different
25 /// heuristics to determine excess/critical pressure sets. Its goal is to
26 /// maximize kernel occupancy (i.e. maximum number of waves per simd).
28 
29  SUnit *pickNodeBidirectional(bool &IsTopNode);
30 
31  void pickNodeFromQueue(SchedBoundary &Zone, const CandPolicy &ZonePolicy,
32  const RegPressureTracker &RPTracker,
33  SchedCandidate &Cand);
34 
35  void initCandidate(SchedCandidate &Cand, SUnit *SU,
36  bool AtTop, const RegPressureTracker &RPTracker,
37  const SIRegisterInfo *SRI,
38  int SGPRPressure, int VGPRPressure,
39  int SGPRExcessLimit, int VGPRExcessLimit,
40  int SGPRCriticalLimit, int VGPRCriticalLimit);
41 
42  void tryCandidate(SchedCandidate &Cand, SchedCandidate &TryCand,
43  SchedBoundary *Zone, const SIRegisterInfo *SRI,
44  unsigned SGPRPressure, unsigned VGPRPressure);
45 
46 public:
48 
49  SUnit *pickNode(bool &IsTopNode) override;
50 };
51 
52 } // End namespace llvm
53 
54 #endif // GCNSCHEDSTRATEGY_H
SUnit * pickNode(bool &IsTopNode) override
Pick the best node to balance the schedule. Implements MachineSchedStrategy.
Each Scheduling boundary is associated with ready queues.
This is a minimal scheduler strategy.
Store the state used by GenericScheduler heuristics, required for the lifetime of one invocation of p...
Track the current register pressure at some position in the instruction stream, and remember the high...
Policy for scheduling the next instruction in the candidate's zone.
GenericScheduler shrinks the unscheduled zone using heuristics to balance the schedule.
static GCRegistry::Add< ShadowStackGC > C("shadow-stack","Very portable GC for uncooperative code generators")
MachineSchedContext provides enough context from the MachineScheduler pass for the target to instanti...
GCNMaxOccupancySchedStrategy(const MachineSchedContext *C)
SUnit - Scheduling unit. This is a node in the scheduling DAG.
Definition: ScheduleDAG.h:244