llvm.org GIT mirror llvm / release_40 lib / Target / AMDGPU / GCNSchedStrategy.h

Tree @release_40 (Download .tar.gz)

GCNSchedStrategy.h @release_40

//===-- GCNSchedStrategy.h - GCN Scheduler Strategy -*- C++ -*-------------===//
//                     The LLVM Compiler Infrastructure
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
/// \file


#include "llvm/CodeGen/MachineScheduler.h"

namespace llvm {

class SIRegisterInfo;

/// This is a minimal scheduler strategy.  The main difference between this
/// and the GenericScheduler is that GCNSchedStrategy uses different
/// 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 {

  SUnit *pickNodeBidirectional(bool &IsTopNode);

  void pickNodeFromQueue(SchedBoundary &Zone, const CandPolicy &ZonePolicy,
                         const RegPressureTracker &RPTracker,
                         SchedCandidate &Cand);

  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);

  void tryCandidate(SchedCandidate &Cand, SchedCandidate &TryCand,
                    SchedBoundary *Zone, const SIRegisterInfo *SRI,
                    unsigned SGPRPressure, unsigned VGPRPressure);

  GCNMaxOccupancySchedStrategy(const MachineSchedContext *C);

  SUnit *pickNode(bool &IsTopNode) override;

} // End namespace llvm