LLVM  14.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
Collaboration diagram for llvm::VLIWResourceModel:
Collaboration graph

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
 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 ( )

Definition at line 86 of file VLIWMachineScheduler.cpp.

References ResourcesModel.

Member Function Documentation

◆ createPacketizer()

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

◆ getPacketInstCount()

size_t llvm::VLIWResourceModel::getPacketInstCount ( ) const

Definition at line 60 of file VLIWMachineScheduler.h.

References Packet.

◆ getTotalPackets()

unsigned llvm::VLIWResourceModel::getTotalPackets ( ) const

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 

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

Reimplemented in llvm::HexagonVLIWResourceModel.

Definition at line 89 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

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 

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 110 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 

◆ reset()

void VLIWResourceModel::reset ( )

Definition at line 81 of file VLIWMachineScheduler.cpp.

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

Referenced by reserveResources().

Member Data Documentation

◆ Packet

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

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

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

Definition at line 40 of file VLIWMachineScheduler.h.

Referenced by reserveResources(), and VLIWResourceModel().


const TargetInstrInfo* llvm::VLIWResourceModel::TII

◆ TotalPackets

unsigned llvm::VLIWResourceModel::TotalPackets = 0

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: