13#ifndef LLVM_MC_MCSUBTARGETINFO_H
14#define LLVM_MC_MCSUBTARGETINFO_H
51 const char *
key()
const {
52 return reinterpret_cast<const char *
>(
this) +
KeyStrOff;
56 return reinterpret_cast<const char *
>(
this) +
DescStrOff;
68template <
size_t NumFeatures,
size_t FeatureStrTabSize>
96 const char *
key()
const {
return Key; }
127 const unsigned *OperandCycles;
128 const unsigned *ForwardingPaths;
130 std::string FeatureString;
140 const unsigned *OC,
const unsigned *
FP);
152 FeatureBits = FeatureBits_;
158 return FeatureBits[Feature];
201 bool checkFeatureExpression(
StringRef FeatureExpr)
const;
221 unsigned DefIdx)
const {
222 assert(DefIdx < SC->NumWriteLatencyEntries &&
223 "MachineModel does not specify a WriteResource for DefIdx");
229 unsigned WriteResID)
const {
235 if (
I->UseIdx < UseIdx)
237 if (
I->UseIdx > UseIdx)
240 if (!
I->WriteResourceID ||
I->WriteResourceID == WriteResID) {
267 unsigned CPUID)
const {
274 return Found != ProcDesc.end() &&
StringRef(Found->key()) == CPU;
288 std::vector<const SubtargetFeatureKV *> getEnabledProcessorFeatures()
const;
321 virtual std::optional<unsigned> getCacheSize(
unsigned Level)
const;
327 virtual std::optional<unsigned> getCacheAssociativity(
unsigned Level)
const;
331 virtual std::optional<unsigned> getCacheLineSize(
unsigned Level)
const;
349 virtual unsigned getPrefetchDistance()
const;
354 virtual unsigned getMaxPrefetchIterationsAhead()
const;
358 virtual bool enableWritePrefetching()
const;
363 virtual unsigned getMinPrefetchStride(
unsigned NumMemAccesses,
364 unsigned NumStridedMemAccesses,
365 unsigned NumPrefetches,
369 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
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...
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 bool isCPUStringValid(StringRef CPU) const
Check whether the CPU string is valid.
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.
Triple - Helper class for working with autoconf configuration names.
This is an optimization pass for GlobalISel generic memory operations.
auto lower_bound(R &&Range, T &&Value)
Provide wrappers to std::lower_bound which take ranges instead of having to pass begin/end explicitly...
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.
uint16_t NumReadAdvanceEntries
uint16_t NumWriteProcResEntries
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
SubtargetSubTypeKV(const SubtargetSubTypeKV &)=delete
FeatureBitArray Implies
K-V bit mask.
FeatureBitArray TuneImplies
K-V bit mask.
const MCSchedModel * schedModel() const
bool operator<(const SubtargetSubTypeKV &Other) const
Compare routine for std::is_sorted.
SubtargetSubTypeKV & operator=(const SubtargetSubTypeKV &)=delete
constexpr SubtargetSubTypeKV(const char *Key, FeatureBitArray Implies, FeatureBitArray TuneImplies, const MCSchedModel *SchedModel)
bool operator<(StringRef S) const
Compare routine for std::lower_bound.