LLVM API Documentation

Public Types | Public Member Functions | Protected Attributes
llvm::ScheduleHazardRecognizer Class Reference

#include <ScheduleHazardRecognizer.h>

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

List of all members.

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 unsigned PreEmitNoops (SUnit *)
virtual bool ShouldPreferAnother (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

Definition at line 34 of file ScheduleHazardRecognizer.h.

Definition at line 642 of file ScheduleDAG.cpp.


Member Function Documentation

virtual void llvm::ScheduleHazardRecognizer::AdvanceCycle ( ) [inline, virtual]

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::PPCDispatchGroupSBHazardRecognizer, and llvm::ARMHazardRecognizer.

Definition at line 94 of file ScheduleHazardRecognizer.h.

Referenced by llvm::SchedBoundary::bumpCycle(), and EmitNoop().

virtual bool llvm::ScheduleHazardRecognizer::atIssueLimit ( ) const [inline, virtual]

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 ) [inline, virtual]

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

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

Definition at line 71 of file ScheduleHazardRecognizer.h.

Referenced by llvm::SchedBoundary::bumpNode().

virtual void llvm::ScheduleHazardRecognizer::EmitNoop ( ) [inline, virtual]

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

Reimplemented in llvm::PPCDispatchGroupSBHazardRecognizer.

Definition at line 103 of file ScheduleHazardRecognizer.h.

References AdvanceCycle().

virtual HazardType llvm::ScheduleHazardRecognizer::getHazardType ( SUnit m,
int  Stalls = 0 
) [inline, virtual]

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::PPCDispatchGroupSBHazardRecognizer.

Definition at line 60 of file ScheduleHazardRecognizer.h.

References NoHazard.

Referenced by llvm::SchedBoundary::checkHazard().

Definition at line 43 of file ScheduleHazardRecognizer.h.

References MaxLookAhead.

virtual unsigned llvm::ScheduleHazardRecognizer::PreEmitNoops ( SUnit ) [inline, virtual]

PreEmitNoops - This callback is invoked prior to emitting an instruction. It should return the number of noops to emit prior to the provided instruction. Note: This is only used during PostRA scheduling. EmitNoop is not called for these noops.

Reimplemented in llvm::PPCDispatchGroupSBHazardRecognizer.

Definition at line 78 of file ScheduleHazardRecognizer.h.

virtual void llvm::ScheduleHazardRecognizer::RecedeCycle ( ) [inline, virtual]

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, llvm::PPCDispatchGroupSBHazardRecognizer, and llvm::ARMHazardRecognizer.

Definition at line 99 of file ScheduleHazardRecognizer.h.

Referenced by llvm::SchedBoundary::bumpCycle().

virtual void llvm::ScheduleHazardRecognizer::Reset ( ) [inline, virtual]

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::PPCDispatchGroupSBHazardRecognizer, and llvm::ARMHazardRecognizer.

Definition at line 67 of file ScheduleHazardRecognizer.h.

Referenced by llvm::SchedBoundary::bumpNode().

ShouldPreferAnother - This callback may be invoked if getHazardType returns NoHazard. If, even though there is no hazard, it would be better to schedule another available instruction, this callback should return true.

Reimplemented in llvm::PPCDispatchGroupSBHazardRecognizer.

Definition at line 85 of file ScheduleHazardRecognizer.h.


Member Data Documentation

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: