LLVM 20.0.0git
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
llvm::VLIWResourceModel Class Reference

#include "llvm/CodeGen/VLIWMachineScheduler.h"

Inheritance diagram for llvm::VLIWResourceModel:
Inheritance graph
[legend]

Public Member Functions

 VLIWResourceModel (const TargetSubtargetInfo &STI, const TargetSchedModel *SM)
 
VLIWResourceModeloperator= (const VLIWResourceModel &other)=delete
 
 VLIWResourceModel (const VLIWResourceModel &other)=delete
 
virtual ~VLIWResourceModel ()
 
virtual void reset ()
 
virtual bool hasDependence (const SUnit *SUd, const SUnit *SUu)
 Return true if there is a dependence between SUd and SUu.
 
virtual bool isResourceAvailable (SUnit *SU, bool IsTop)
 Check if scheduling of this SU is possible in the current packet.
 
virtual bool reserveResources (SUnit *SU, bool IsTop)
 Keep track of available resources.
 
unsigned getTotalPackets () const
 
size_t getPacketInstCount () const
 
bool isInPacket (SUnit *SU) const
 

Protected Member Functions

virtual DFAPacketizercreatePacketizer (const TargetSubtargetInfo &STI) const
 

Protected Attributes

const TargetInstrInfoTII
 
DFAPacketizerResourcesModel
 ResourcesModel - Represents VLIW state.
 
const TargetSchedModelSchedModel
 
SmallVector< SUnit * > Packet
 Local packet/bundle model.
 
unsigned TotalPackets = 0
 Total packets created.
 

Detailed Description

Definition at line 31 of file VLIWMachineScheduler.h.

Constructor & Destructor Documentation

◆ VLIWResourceModel() [1/2]

VLIWResourceModel::VLIWResourceModel ( const TargetSubtargetInfo STI,
const TargetSchedModel SM 
)

◆ VLIWResourceModel() [2/2]

llvm::VLIWResourceModel::VLIWResourceModel ( const VLIWResourceModel other)
delete

◆ ~VLIWResourceModel()

VLIWResourceModel::~VLIWResourceModel ( )
virtual

Definition at line 84 of file VLIWMachineScheduler.cpp.

References ResourcesModel.

Member Function Documentation

◆ createPacketizer()

DFAPacketizer * VLIWResourceModel::createPacketizer ( const TargetSubtargetInfo STI) const
protectedvirtual

◆ getPacketInstCount()

size_t llvm::VLIWResourceModel::getPacketInstCount ( ) const
inline

Definition at line 61 of file VLIWMachineScheduler.h.

References Packet.

◆ getTotalPackets()

unsigned llvm::VLIWResourceModel::getTotalPackets ( ) const
inline

Definition at line 60 of file VLIWMachineScheduler.h.

References TotalPackets.

Referenced by llvm::ConvergingVLIWScheduler::reportPackets().

◆ hasDependence()

bool VLIWResourceModel::hasDependence ( const SUnit SUd,
const SUnit SUu 
)
virtual

Return true if there is a dependence between SUd and SUu.

Reimplemented in llvm::HexagonVLIWResourceModel.

Definition at line 87 of file VLIWMachineScheduler.cpp.

References llvm::SUnit::Succs.

Referenced by llvm::HexagonVLIWResourceModel::hasDependence(), and isResourceAvailable().

◆ isInPacket()

bool llvm::VLIWResourceModel::isInPacket ( SUnit SU) const
inline

Definition at line 62 of file VLIWMachineScheduler.h.

References llvm::is_contained(), and Packet.

Referenced by llvm::ConvergingVLIWScheduler::SchedulingCost().

◆ isResourceAvailable()

bool VLIWResourceModel::isResourceAvailable ( SUnit SU,
bool  IsTop 
)
virtual

Check if scheduling of this SU is possible in the current packet.

It is not precise (statefull), it is more like another heuristic. Many corner cases are figured empirically.

Definition at line 108 of file VLIWMachineScheduler.cpp.

References llvm::DFAPacketizer::canReserveResources(), llvm::SUnit::getInstr(), llvm::MachineInstr::getOpcode(), hasDependence(), Packet, and ResourcesModel.

Referenced by reserveResources(), llvm::ConvergingVLIWScheduler::SchedulingCost(), and llvm::HexagonConvergingVLIWScheduler::SchedulingCost().

◆ operator=()

VLIWResourceModel & llvm::VLIWResourceModel::operator= ( const VLIWResourceModel other)
delete

◆ reserveResources()

bool VLIWResourceModel::reserveResources ( SUnit SU,
bool  IsTop 
)
virtual

◆ reset()

void VLIWResourceModel::reset ( )
virtual

Definition at line 79 of file VLIWMachineScheduler.cpp.

References llvm::DFAPacketizer::clearResources(), Packet, and ResourcesModel.

Referenced by reserveResources().

Member Data Documentation

◆ Packet

SmallVector<SUnit *> llvm::VLIWResourceModel::Packet
protected

Local packet/bundle model.

Purely internal to the MI scheduler at the time.

Definition at line 44 of file VLIWMachineScheduler.h.

Referenced by getPacketInstCount(), isInPacket(), isResourceAvailable(), reserveResources(), reset(), and VLIWResourceModel().

◆ ResourcesModel

DFAPacketizer* llvm::VLIWResourceModel::ResourcesModel
protected

ResourcesModel - Represents VLIW state.

Not limited to VLIW targets per se, but assumes definition of resource model by a target.

Definition at line 38 of file VLIWMachineScheduler.h.

Referenced by isResourceAvailable(), reserveResources(), reset(), VLIWResourceModel(), and ~VLIWResourceModel().

◆ SchedModel

const TargetSchedModel* llvm::VLIWResourceModel::SchedModel
protected

Definition at line 40 of file VLIWMachineScheduler.h.

Referenced by reserveResources(), and VLIWResourceModel().

◆ TII

const TargetInstrInfo* llvm::VLIWResourceModel::TII
protected

◆ TotalPackets

unsigned llvm::VLIWResourceModel::TotalPackets = 0
protected

Total packets created.

Definition at line 47 of file VLIWMachineScheduler.h.

Referenced by getTotalPackets(), and reserveResources().


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