class DefaultResourceStrategy

Declaration

class DefaultResourceStrategy : public ResourceStrategy { /* full declaration omitted */ };

Description

Default resource allocation strategy used by processor resource groups and processor resources with multiple units.

Declared at: llvm/include/llvm/MCA/HardwareUnits/ResourceManager.h:67

Inherits from: ResourceStrategy

Member Variables

private const uint64_t ResourceUnitMask
There is one bit set for every available resource unit. It defaults to the value of field ResourceSizeMask in ResourceState.
private uint64_t NextInSequenceMask
When NextInSequenceMask becomes zero, it is automatically reset to the default value (i.e. ResourceUnitMask).
private uint64_t RemovedFromNextInSequence
Note: an LRU selector would have a better accuracy at the cost of being slightly more expensive (mostly in terms of runtime cost). Methods 'select' and 'used', are always in the hot execution path of llvm-mca. Therefore, a slow implementation of 'select' would have a negative impact on the overall performance of the tool.

Method Overview

Inherited from ResourceStrategy:

Methods

DefaultResourceStrategy(uint64_t UnitMask)

Declared at: llvm/include/llvm/MCA/HardwareUnits/ResourceManager.h:120

Parameters

uint64_t UnitMask

uint64_t select(uint64_t ReadyMask)

Description

Selects a processor resource unit from a ReadyMask.

Declared at: llvm/include/llvm/MCA/HardwareUnits/ResourceManager.h:125

Parameters

uint64_t ReadyMask

void used(uint64_t Mask)

Description

Called by the ResourceManager when a processor resource group, or a processor resource with multiple units has become unavailable. The default strategy uses this information to bias its selection logic.

Declared at: llvm/include/llvm/MCA/HardwareUnits/ResourceManager.h:126

Parameters

uint64_t Mask

virtual ~DefaultResourceStrategy()

Declared at: llvm/include/llvm/MCA/HardwareUnits/ResourceManager.h:123