13#ifndef LLVM_MC_MCSUBTARGETINFO_H
14#define LLVM_MC_MCSUBTARGETINFO_H
53 const char *
key()
const {
return Key; }
54 const char *
desc()
const {
return Desc; }
87 const char *
key()
const {
return Key; }
118 const unsigned *OperandCycles;
119 const unsigned *ForwardingPaths;
121 std::string FeatureString;
131 const unsigned *OC,
const unsigned *
FP);
143 FeatureBits = FeatureBits_;
149 return FeatureBits[Feature];
192 bool checkFeatureExpression(
StringRef FeatureExpr)
const;
212 unsigned DefIdx)
const {
213 assert(DefIdx < SC->NumWriteLatencyEntries &&
214 "MachineModel does not specify a WriteResource for DefIdx");
220 unsigned WriteResID)
const {
226 if (
I->UseIdx < UseIdx)
228 if (
I->UseIdx > UseIdx)
231 if (!
I->WriteResourceID ||
I->WriteResourceID == WriteResID) {
258 unsigned CPUID)
const {
265 return Found != ProcDesc.end() &&
StringRef(Found->key()) == CPU;
279 std::vector<const SubtargetFeatureKV *> getEnabledProcessorFeatures()
const;
312 virtual std::optional<unsigned> getCacheSize(
unsigned Level)
const;
318 virtual std::optional<unsigned> getCacheAssociativity(
unsigned Level)
const;
322 virtual std::optional<unsigned> getCacheLineSize(
unsigned Level)
const;
340 virtual unsigned getPrefetchDistance()
const;
345 virtual unsigned getMaxPrefetchIterationsAhead()
const;
349 virtual bool enableWritePrefetching()
const;
354 virtual unsigned getMinPrefetchStride(
unsigned NumMemAccesses,
355 unsigned NumStridedMemAccesses,
356 unsigned NumPrefetches,
360 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(const SubtargetFeatureKV &)=delete
bool operator<(StringRef S) const
Compare routine for std::lower_bound.
constexpr SubtargetFeatureKV(const char *Key, const char *Desc, unsigned Value, FeatureBitArray Implies)
bool operator<(const SubtargetFeatureKV &Other) const
Compare routine for std::is_sorted.
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.