LLVM  8.0.1
Public Member Functions | Public Attributes | List of all members
llvm::SystemZHazardRecognizer Class Reference

SystemZHazardRecognizer maintains the state for one MBB during scheduling. More...

#include "Target/SystemZ/SystemZHazardRecognizer.h"

Inheritance diagram for llvm::SystemZHazardRecognizer:
Inheritance graph
[legend]
Collaboration diagram for llvm::SystemZHazardRecognizer:
Collaboration graph
[legend]

Public Member Functions

 SystemZHazardRecognizer (const SystemZInstrInfo *tii, const TargetSchedModel *SM)
 
HazardType getHazardType (SUnit *m, int Stalls=0) override
 getHazardType - Return the hazard type of emitting this node. More...
 
void Reset () override
 Reset - This callback is invoked when a new block of instructions is about to be schedule. More...
 
void EmitInstruction (SUnit *SU) override
 EmitInstruction - This callback is invoked when an instruction is emitted, to advance the hazard state. More...
 
const MCSchedClassDescgetSchedClass (SUnit *SU) const
 Resolves and cache a resolved scheduling class for an SUnit. More...
 
void emitInstruction (MachineInstr *MI, bool TakenBranch=false)
 Wrap a non-scheduled instruction in an SU and emit it. More...
 
int groupingCost (SUnit *SU) const
 Return the cost of decoder grouping for SU. More...
 
int resourcesCost (SUnit *SU)
 Return the cost of SU in regards to processor resources usage. More...
 
void dumpSU (SUnit *SU, raw_ostream &OS) const
 
void dumpCurrGroup (std::string Msg="") const
 
void dumpProcResourceCounters () const
 
void dumpState () const
 
MachineBasicBlock::iterator getLastEmittedMI ()
 
void copyState (SystemZHazardRecognizer *Incoming)
 Copy counters from end of single predecessor. More...
 
- Public Member Functions inherited from llvm::ScheduleHazardRecognizer
 ScheduleHazardRecognizer ()=default
 
virtual ~ScheduleHazardRecognizer ()
 
unsigned getMaxLookAhead () const
 
bool isEnabled () const
 
virtual bool atIssueLimit () const
 atIssueLimit - Return true if no more instructions may be issued in this cycle. More...
 
virtual void EmitInstruction (MachineInstr *)
 This overload will be used when the hazard recognizer is being used by a non-scheduling pass, which does not use SUnits. More...
 
virtual unsigned PreEmitNoops (SUnit *)
 PreEmitNoops - This callback is invoked prior to emitting an instruction. More...
 
virtual unsigned PreEmitNoops (MachineInstr *)
 This overload will be used when the hazard recognizer is being used by a non-scheduling pass, which does not use SUnits. More...
 
virtual bool ShouldPreferAnother (SUnit *)
 ShouldPreferAnother - This callback may be invoked if getHazardType returns NoHazard. More...
 
virtual void AdvanceCycle ()
 AdvanceCycle - This callback is invoked whenever the next top-down instruction to be scheduled cannot issue in the current cycle, either because of latency or resource conflicts. More...
 
virtual void RecedeCycle ()
 RecedeCycle - This callback is invoked whenever the next bottom-up instruction to be scheduled cannot issue in the current cycle, either because of latency or resource conflicts. More...
 
virtual void EmitNoop ()
 EmitNoop - This callback is invoked when a noop was added to the instruction stream. More...
 

Public Attributes

std::string CurGroupDbg
 

Additional Inherited Members

- Public Types inherited from llvm::ScheduleHazardRecognizer
enum  HazardType { NoHazard, Hazard, NoopHazard }
 
- Protected Attributes inherited from llvm::ScheduleHazardRecognizer
unsigned MaxLookAhead = 0
 MaxLookAhead - Indicate the number of cycles in the scoreboard state. More...
 

Detailed Description

SystemZHazardRecognizer maintains the state for one MBB during scheduling.

Definition at line 46 of file SystemZHazardRecognizer.h.

Constructor & Destructor Documentation

◆ SystemZHazardRecognizer()

llvm::SystemZHazardRecognizer::SystemZHazardRecognizer ( const SystemZInstrInfo tii,
const TargetSchedModel SM 
)
inline

Definition at line 111 of file SystemZHazardRecognizer.h.

References EmitInstruction(), getHazardType(), and Reset().

Member Function Documentation

◆ copyState()

void SystemZHazardRecognizer::copyState ( SystemZHazardRecognizer Incoming)

Copy counters from end of single predecessor.

Definition at line 452 of file SystemZHazardRecognizer.cpp.

References CurGroupDbg, and LLVM_DEBUG.

Referenced by emitInstruction(), llvm::SystemZPostRASchedStrategy::enterMBB(), and getLastEmittedMI().

◆ dumpCurrGroup()

void SystemZHazardRecognizer::dumpCurrGroup ( std::string  Msg = "") const

Definition at line 209 of file SystemZHazardRecognizer.cpp.

References CurGroupDbg, and llvm::dbgs().

Referenced by dumpState(), EmitInstruction(), and Reset().

◆ dumpProcResourceCounters()

void SystemZHazardRecognizer::dumpProcResourceCounters ( ) const

◆ dumpState()

void SystemZHazardRecognizer::dumpState ( ) const

◆ dumpSU()

void SystemZHazardRecognizer::dumpSU ( SUnit SU,
raw_ostream OS 
) const

◆ EmitInstruction()

void SystemZHazardRecognizer::EmitInstruction ( SUnit )
overridevirtual

◆ emitInstruction()

void SystemZHazardRecognizer::emitInstruction ( MachineInstr MI,
bool  TakenBranch = false 
)

◆ getHazardType()

ScheduleHazardRecognizer::HazardType SystemZHazardRecognizer::getHazardType ( SUnit m,
int  Stalls = 0 
)
overridevirtual

getHazardType - Return the hazard type of emitting this node.

There are three possible results. Either:

  • NoHazard: it is legal to issue this instruction on this cycle.
  • Hazard: issuing this instruction would stall the machine. If some other instruction is available, issue it first.
  • NoopHazard: issuing this instruction would break the program. If some other instruction can be issued, do so, otherwise issue a noop.

Reimplemented from llvm::ScheduleHazardRecognizer.

Definition at line 78 of file SystemZHazardRecognizer.cpp.

References llvm::ScheduleHazardRecognizer::Hazard, and llvm::ScheduleHazardRecognizer::NoHazard.

Referenced by SystemZHazardRecognizer().

◆ getLastEmittedMI()

MachineBasicBlock::iterator llvm::SystemZHazardRecognizer::getLastEmittedMI ( )
inline

Definition at line 154 of file SystemZHazardRecognizer.h.

References copyState().

Referenced by getSingleSchedPred().

◆ getSchedClass()

const MCSchedClassDesc* llvm::SystemZHazardRecognizer::getSchedClass ( SUnit SU) const
inline

◆ groupingCost()

int SystemZHazardRecognizer::groupingCost ( SUnit SU) const

Return the cost of decoder grouping for SU.

If SU must start a new decoder group, this is negative if this fits the schedule or positive if it would mean ending a group prematurely. For normal instructions this returns 0.

Definition at line 341 of file SystemZHazardRecognizer.cpp.

References assert(), llvm::MCSchedClassDesc::BeginGroup, llvm::MCSchedClassDesc::EndGroup, llvm::SUnit::getInstr(), getSchedClass(), llvm::SUnit::isUnbuffered, llvm::MCSchedClassDesc::isValid(), and resourcesCost().

Referenced by getSchedClass(), and llvm::SystemZPostRASchedStrategy::pickNode().

◆ Reset()

void SystemZHazardRecognizer::Reset ( )
overridevirtual

◆ resourcesCost()

int SystemZHazardRecognizer::resourcesCost ( SUnit SU)

Return the cost of SU in regards to processor resources usage.

A positive value means it would be better to wait with SU, while a negative value means it would be good to schedule SU next.

Definition at line 388 of file SystemZHazardRecognizer.cpp.

References getSchedClass(), llvm::TargetSchedModel::getWriteProcResBegin(), llvm::TargetSchedModel::getWriteProcResEnd(), llvm::SUnit::isUnbuffered, and llvm::MCSchedClassDesc::isValid().

Referenced by getSchedClass(), groupingCost(), and llvm::SystemZPostRASchedStrategy::pickNode().

Member Data Documentation

◆ CurGroupDbg

std::string llvm::SystemZHazardRecognizer::CurGroupDbg

Definition at line 147 of file SystemZHazardRecognizer.h.

Referenced by copyState(), dumpCurrGroup(), EmitInstruction(), and Reset().


The documentation for this class was generated from the following files: