13#ifndef LLVM_MC_MCSUBTARGETINFO_H
14#define LLVM_MC_MCSUBTARGETINFO_H
53 const char *
key()
const {
54 return reinterpret_cast<const char *
>(
this) +
KeyStrOff;
58 return reinterpret_cast<const char *
>(
this) +
DescStrOff;
70template <
size_t NumFeatures,
size_t FeatureStrTabSize>
95 const char *
key()
const {
96 return reinterpret_cast<const char *
>(
this) +
KeyStrOff;
124 return reinterpret_cast<const char *
>(
this) +
KeyStrOff;
130template <
size_t NumSubTypes,
size_t NumAliases,
size_t SubTypeStrTabSize>
133 std::array<SubtargetSubTypeAliasKV, NumAliases>
Aliases;
158 const unsigned *OperandCycles;
159 const unsigned *ForwardingPaths;
161 std::string FeatureString;
171 const unsigned *OC,
const unsigned *
FP);
183 FeatureBits = FeatureBits_;
189 return FeatureBits[Feature];
232 bool checkFeatureExpression(
StringRef FeatureExpr)
const;
252 unsigned DefIdx)
const {
253 assert(DefIdx < SC->NumWriteLatencyEntries &&
254 "MachineModel does not specify a WriteResource for DefIdx");
260 unsigned WriteResID)
const {
266 if (
I->UseIdx < UseIdx)
268 if (
I->UseIdx > UseIdx)
271 if (!
I->WriteResourceID ||
I->WriteResourceID == WriteResID) {
298 unsigned CPUID)
const {
320 std::vector<const SubtargetFeatureKV *> getEnabledProcessorFeatures()
const;
353 virtual std::optional<unsigned> getCacheSize(
unsigned Level)
const;
359 virtual std::optional<unsigned> getCacheAssociativity(
unsigned Level)
const;
363 virtual std::optional<unsigned> getCacheLineSize(
unsigned Level)
const;
381 virtual unsigned getPrefetchDistance()
const;
386 virtual unsigned getMaxPrefetchIterationsAhead()
const;
390 virtual bool enableWritePrefetching()
const;
395 virtual unsigned getMinPrefetchStride(
unsigned NumMemAccesses,
396 unsigned NumStridedMemAccesses,
397 unsigned NumPrefetches,
401 virtual bool shouldPrefetchAddressSpace(
unsigned AS)
const;
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
static void ApplyFeatureFlag(FeatureBitset &Bits, StringRef Feature, ArrayRef< SubtargetFeatureKV > FeatureTable)
SI optimize exec mask operations pre RA
Represent a constant reference to an array (0 or more elements consecutively in memory),...
Class used to store the subtarget bits in the tables created by tablegen.
Container class for subtarget features.
Itinerary data supplied by a subtarget to be used by a target.
Instances of this class represent a single low-level machine instruction.
Interface to description of machine instruction set.
virtual unsigned getCacheLineSize() const
Return the target cache line size in bytes.
const MCWriteProcResEntry * getWriteProcResEnd(const MCSchedClassDesc *SC) const
bool hasFeature(unsigned Feature) const
int getReadAdvanceCycles(const MCSchedClassDesc *SC, unsigned UseIdx, unsigned WriteResID) const
StringRef getFeatureString() const
void setFeatureBits(const FeatureBitset &FeatureBits_)
virtual unsigned resolveVariantSchedClass(unsigned SchedClass, const MCInst *MI, const MCInstrInfo *MCII, unsigned CPUID) const
Resolve a variant scheduling class for the given MCInst and CPU.
const Triple & getTargetTriple() const
bool isCPUStringValid(StringRef CPU) const
Check whether the CPU string is valid.
ArrayRef< SubtargetSubTypeKV > getAllProcessorDescriptions() const
Return processor descriptions.
ArrayRef< MCReadAdvanceEntry > getReadAdvanceEntries(const MCSchedClassDesc &SC) const
Return the set of ReadAdvance entries declared by the scheduling class descriptor in input.
const MCWriteLatencyEntry * getWriteLatencyEntry(const MCSchedClassDesc *SC, unsigned DefIdx) const
MCSubtargetInfo & operator=(const MCSubtargetInfo &)=delete
MCSubtargetInfo & operator=(MCSubtargetInfo &&)=delete
const FeatureBitset & getFeatureBits() const
HwModeType
HwMode IDs are stored and accessed in a bit set format, enabling users to efficiently retrieve specif...
const SubtargetSubTypeKV * resolveCPU(StringRef CPU) const
Look up the processor entry for a CPU name, resolving aliases.
ArrayRef< SubtargetFeatureKV > getAllProcessorFeatures() const
Return processor features.
virtual ~MCSubtargetInfo()=default
StringRef getTuneCPU() const
virtual std::optional< unsigned > getCacheLineSize(unsigned Level) const
Return the target cache line size in bytes at a given level.
MCSubtargetInfo(const MCSubtargetInfo &)=default
virtual unsigned getHwModeSet() const
Return a bit set containing all HwMode IDs of the current subtarget.
const MCWriteProcResEntry * getWriteProcResBegin(const MCSchedClassDesc *SC) const
Return an iterator at the first process resource consumed by the given scheduling class.
virtual unsigned getHwMode(enum HwModeType type=HwMode_Default) const
HwMode ID corresponding to the 'type' parameter is retrieved from the HwMode bit set of the current s...
const MCSchedModel & getSchedModel() const
Get the machine model for this subtarget's CPU.
Represent a constant reference to a string, i.e.
A table of densely packed, null-terminated strings indexed by offset.
Triple - Helper class for working with autoconf configuration names.
This is an optimization pass for GlobalISel generic memory operations.
These values represent a non-pipelined step in the execution of an instruction.
Specify the number of cycles allowed after instruction issue before a particular use operand reads it...
Summarize the scheduling resources required for an instruction of a particular scheduling class.
uint8_t NumWriteProcResEntries
uint16_t NumReadAdvanceEntries
Machine model for scheduling, bundling, and heuristics.
Specify the latency in cpu cycles for a particular scheduling class and def index.
Identify one of the processor resource kinds consumed by a particular scheduling class for the specif...
SubtargetFeatureKV Features[NumFeatures]
char Strings[FeatureStrTabSize]
Used to provide key value pairs for feature and CPU bit flags.
SubtargetFeatureKV(const SubtargetFeatureKV &)=delete
bool operator<(StringRef S) const
Compare routine for std::lower_bound.
bool operator<(const SubtargetFeatureKV &Other) const
Compare routine for std::is_sorted.
constexpr SubtargetFeatureKV(uint16_t KeyStrOff, uint16_t DescStrOff, unsigned Value, FeatureBitArray Implies)
const char * desc() const
unsigned Value
K-V integer value.
FeatureBitArray Implies
K-V bit mask.
SubtargetFeatureKV & operator=(const SubtargetFeatureKV &)=delete
constexpr SubtargetSubTypeAliasKV()
bool operator<(StringRef S) const
SubtargetSubTypeAliasKV & operator=(const SubtargetSubTypeAliasKV &)=delete
uint16_t KeyStrOff
Relative offset to the alias name.
SubtargetSubTypeAliasKV(const SubtargetSubTypeAliasKV &)=delete
constexpr SubtargetSubTypeAliasKV(uint16_t KeyStrOff, uint16_t SubTypeIdx)
uint16_t SubTypeIdx
Index into the SubtargetSubTypeKV array.
std::array< SubtargetSubTypeAliasKV, NumAliases > Aliases
char Strings[SubTypeStrTabSize]
SubtargetSubTypeKV SubTypes[NumSubTypes]
Used to provide key value pairs for feature and CPU bit flags.
SubtargetSubTypeKV(const SubtargetSubTypeKV &)=delete
FeatureBitArray Implies
K-V bit mask.
FeatureBitArray TuneImplies
K-V bit mask.
bool operator<(const SubtargetSubTypeKV &Other) const
Compare routine for std::is_sorted.
SubtargetSubTypeKV & operator=(const SubtargetSubTypeKV &)=delete
constexpr SubtargetSubTypeKV(uint16_t KeyStrOff, FeatureBitArray Implies, FeatureBitArray TuneImplies, unsigned SchedModelIdx)
bool operator<(StringRef S) const
Compare routine for std::lower_bound.