LLVM  15.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]
Collaboration diagram for llvm::VLIWResourceModel:
Collaboration graph
[legend]

Public Member Functions

 VLIWResourceModel (const TargetSubtargetInfo &STI, const TargetSchedModel *SM)
 
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. More...
 
virtual bool isResourceAvailable (SUnit *SU, bool IsTop)
 Check if scheduling of this SU is possible in the current packet. More...
 
virtual bool reserveResources (SUnit *SU, bool IsTop)
 Keep track of available resources. More...
 
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. More...
 
const TargetSchedModelSchedModel
 
SmallVector< SUnit * > Packet
 Local packet/bundle model. More...
 
unsigned TotalPackets = 0
 Total packets created. More...
 

Detailed Description

Definition at line 31 of file VLIWMachineScheduler.h.

Constructor & Destructor Documentation

◆ VLIWResourceModel()

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

◆ ~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 60 of file VLIWMachineScheduler.h.

References Packet.

◆ getTotalPackets()

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

Definition at line 59 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 S, and llvm::SUnit::Succs.

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

◆ isInPacket()

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

Definition at line 61 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::numbers::e, llvm::SUnit::getInstr(), llvm::MachineInstr::getOpcode(), hasDependence(), i, llvm::ISD::INLINEASM, llvm::ISD::INLINEASM_BR, Packet, and ResourcesModel.

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

◆ 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: