LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Attributes | List of all members
llvm::ScheduleHazardRecognizer Class Reference

#include <ScheduleHazardRecognizer.h>

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

Public Types

enum  HazardType { NoHazard, Hazard, NoopHazard }
 

Public Member Functions

 ScheduleHazardRecognizer ()
 
virtual ~ScheduleHazardRecognizer ()
 
unsigned getMaxLookAhead () const
 
bool isEnabled () const
 
virtual bool atIssueLimit () const
 
virtual HazardType getHazardType (SUnit *m, int Stalls=0)
 
virtual void Reset ()
 
virtual void EmitInstruction (SUnit *)
 
virtual void AdvanceCycle ()
 
virtual void RecedeCycle ()
 
virtual void EmitNoop ()
 

Protected Attributes

unsigned MaxLookAhead
 

Detailed Description

HazardRecognizer - This determines whether or not an instruction can be issued this cycle, and whether or not a noop needs to be inserted to handle the hazard.

Definition at line 25 of file ScheduleHazardRecognizer.h.

Member Enumeration Documentation

Enumerator
NoHazard 
Hazard 
NoopHazard 

Definition at line 37 of file ScheduleHazardRecognizer.h.

Constructor & Destructor Documentation

llvm::ScheduleHazardRecognizer::ScheduleHazardRecognizer ( )
inline

Definition at line 34 of file ScheduleHazardRecognizer.h.

ScheduleHazardRecognizer::~ScheduleHazardRecognizer ( )
virtual

Definition at line 642 of file ScheduleDAG.cpp.

Member Function Documentation

virtual void llvm::ScheduleHazardRecognizer::AdvanceCycle ( )
inlinevirtual

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. This should increment the internal state of the hazard recognizer so that previously "Hazard" instructions will now not be hazards.

Reimplemented in llvm::ScoreboardHazardRecognizer, llvm::PPCHazardRecognizer970, llvm::ARMHazardRecognizer, and llvm::PPCScoreboardHazardRecognizer.

Definition at line 78 of file ScheduleHazardRecognizer.h.

Referenced by EmitNoop().

virtual bool llvm::ScheduleHazardRecognizer::atIssueLimit ( ) const
inlinevirtual

atIssueLimit - Return true if no more instructions may be issued in this cycle.

FIXME: remove this once MachineScheduler is the only client.

Reimplemented in llvm::ScoreboardHazardRecognizer.

Definition at line 51 of file ScheduleHazardRecognizer.h.

virtual void llvm::ScheduleHazardRecognizer::EmitInstruction ( SUnit )
inlinevirtual

EmitInstruction - This callback is invoked when an instruction is emitted, to advance the hazard state.

Reimplemented in llvm::ScoreboardHazardRecognizer, llvm::PPCHazardRecognizer970, llvm::ARMHazardRecognizer, and llvm::PPCScoreboardHazardRecognizer.

Definition at line 71 of file ScheduleHazardRecognizer.h.

virtual void llvm::ScheduleHazardRecognizer::EmitNoop ( )
inlinevirtual

EmitNoop - This callback is invoked when a noop was added to the instruction stream.

Definition at line 87 of file ScheduleHazardRecognizer.h.

References AdvanceCycle().

virtual HazardType llvm::ScheduleHazardRecognizer::getHazardType ( SUnit m,
int  Stalls = 0 
)
inlinevirtual

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 in llvm::ScoreboardHazardRecognizer, llvm::PPCHazardRecognizer970, llvm::ARMHazardRecognizer, and llvm::PPCScoreboardHazardRecognizer.

Definition at line 60 of file ScheduleHazardRecognizer.h.

References NoHazard.

unsigned llvm::ScheduleHazardRecognizer::getMaxLookAhead ( ) const
inline

Definition at line 43 of file ScheduleHazardRecognizer.h.

References MaxLookAhead.

bool llvm::ScheduleHazardRecognizer::isEnabled ( ) const
inline
virtual void llvm::ScheduleHazardRecognizer::RecedeCycle ( )
inlinevirtual

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.

Reimplemented in llvm::ScoreboardHazardRecognizer, and llvm::ARMHazardRecognizer.

Definition at line 83 of file ScheduleHazardRecognizer.h.

virtual void llvm::ScheduleHazardRecognizer::Reset ( )
inlinevirtual

Reset - This callback is invoked when a new block of instructions is about to be schedule. The hazard state should be set to an initialized state.

Reimplemented in llvm::ScoreboardHazardRecognizer, llvm::PPCHazardRecognizer970, llvm::ARMHazardRecognizer, and llvm::PPCScoreboardHazardRecognizer.

Definition at line 67 of file ScheduleHazardRecognizer.h.

Member Data Documentation

unsigned llvm::ScheduleHazardRecognizer::MaxLookAhead
protected

MaxLookAhead - Indicate the number of cycles in the scoreboard state. Important to restore the state after backtracking. Additionally, MaxLookAhead=0 identifies a fake recognizer, allowing the client to bypass virtual calls. Currently the PostRA scheduler ignores it.

Definition at line 31 of file ScheduleHazardRecognizer.h.

Referenced by getMaxLookAhead(), isEnabled(), and llvm::ScoreboardHazardRecognizer::ScoreboardHazardRecognizer().


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