LLVM 19.0.0git
Public Member Functions | List of all members
llvm::mca::Pipeline Class Reference

A pipeline for a specific subtarget. More...

#include "llvm/MCA/Pipeline.h"

Public Member Functions

 Pipeline ()=default
 
void appendStage (std::unique_ptr< Stage > S)
 
Expected< unsignedrun ()
 Returns the total number of simulated cycles.
 
void addEventListener (HWEventListener *Listener)
 
bool isPaused () const
 Returns whether the pipeline is currently paused.
 

Detailed Description

A pipeline for a specific subtarget.

It emulates an out-of-order execution of instructions. Instructions are fetched from a MCInst sequence managed by an initial 'Fetch' stage. Instructions are firstly fetched, then dispatched to the schedulers, and then executed.

This class tracks the lifetime of an instruction from the moment where it gets dispatched to the schedulers, to the moment where it finishes executing and register writes are architecturally committed. In particular, it monitors changes in the state of every instruction in flight.

Instructions are executed in a loop of iterations. The number of iterations is defined by the SourceMgr object, which is managed by the initial stage of the instruction pipeline.

The Pipeline entry point is method 'run()' which executes cycles in a loop until there are new instructions to dispatch, and not every instruction has been retired.

Internally, the Pipeline collects statistical information in the form of histograms. For example, it tracks how the dispatch group size changes over time.

Definition at line 50 of file Pipeline.h.

Constructor & Destructor Documentation

◆ Pipeline()

llvm::mca::Pipeline::Pipeline ( )
default

Member Function Documentation

◆ addEventListener()

void llvm::mca::Pipeline::addEventListener ( HWEventListener Listener)

Definition at line 24 of file Pipeline.cpp.

◆ appendStage()

void llvm::mca::Pipeline::appendStage ( std::unique_ptr< Stage S)

Definition at line 86 of file Pipeline.cpp.

References assert(), and llvm::Last.

◆ isPaused()

bool llvm::mca::Pipeline::isPaused ( ) const
inline

Returns whether the pipeline is currently paused.

Definition at line 81 of file Pipeline.h.

Referenced by run().

◆ run()

Expected< unsigned > llvm::mca::Pipeline::run ( )

Returns the total number of simulated cycles.

Definition at line 37 of file Pipeline.cpp.

References assert(), and isPaused().


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