class MCSubtargetInfo
Declaration
class MCSubtargetInfo { /* full declaration omitted */ };
Description
Generic base class for all target subtargets.
Declared at: llvm/include/llvm/MC/MCSubtargetInfo.h:76
Member Variables
- private llvm::Triple TargetTriple
- private std::string CPU
- private std::string TuneCPU
- private ArrayRef<llvm::SubtargetFeatureKV> ProcFeatures
- private ArrayRef<llvm::SubtargetSubTypeKV> ProcDesc
- private const llvm::MCWriteProcResEntry* WriteProcResTable
- private const llvm::MCWriteLatencyEntry* WriteLatencyTable
- private const llvm::MCReadAdvanceEntry* ReadAdvanceTable
- private const llvm::MCSchedModel* CPUSchedModel
- private const llvm::InstrStage* Stages
- private const unsigned int* OperandCycles
- private const unsigned int* ForwardingPaths
- private llvm::FeatureBitset FeatureBits
- private std::string FeatureString
Method Overview
- public llvm::FeatureBitset ApplyFeatureFlag(llvm::StringRef FS)
- public llvm::FeatureBitset ClearFeatureBitsTransitively(const llvm::FeatureBitset & FB)
- protected void InitMCProcessorInfo(llvm::StringRef CPU, llvm::StringRef TuneCPU, llvm::StringRef FS)
- public MCSubtargetInfo(const llvm::Triple & TT, llvm::StringRef CPU, llvm::StringRef TuneCPU, llvm::StringRef FS, ArrayRef<llvm::SubtargetFeatureKV> PF, ArrayRef<llvm::SubtargetSubTypeKV> PD, const llvm::MCWriteProcResEntry * WPR, const llvm::MCWriteLatencyEntry * WL, const llvm::MCReadAdvanceEntry * RA, const llvm::InstrStage * IS, const unsigned int * OC, const unsigned int * FP)
- public MCSubtargetInfo()
- public MCSubtargetInfo(const llvm::MCSubtargetInfo &)
- public llvm::FeatureBitset SetFeatureBitsTransitively(const llvm::FeatureBitset & FB)
- public llvm::FeatureBitset ToggleFeature(llvm::StringRef FS)
- public llvm::FeatureBitset ToggleFeature(const llvm::FeatureBitset & FB)
- public llvm::FeatureBitset ToggleFeature(uint64_t FB)
- public bool checkFeatures(llvm::StringRef FS) const
- public virtual bool enableWritePrefetching() const
- public llvm::StringRef getCPU() const
- public virtual Optional<unsigned int> getCacheAssociativity(unsigned int Level) const
- public virtual Optional<unsigned int> getCacheLineSize(unsigned int Level) const
- public virtual unsigned int getCacheLineSize() const
- public virtual Optional<unsigned int> getCacheSize(unsigned int Level) const
- public const llvm::FeatureBitset & getFeatureBits() const
- public llvm::StringRef getFeatureString() const
- public virtual unsigned int getHwMode() const
- public llvm::InstrItineraryData getInstrItineraryForCPU(llvm::StringRef CPU) const
- public virtual unsigned int getMaxPrefetchIterationsAhead() const
- public virtual unsigned int getMinPrefetchStride(unsigned int NumMemAccesses, unsigned int NumStridedMemAccesses, unsigned int NumPrefetches, bool HasCall) const
- public virtual unsigned int getPrefetchDistance() const
- public int getReadAdvanceCycles(const llvm::MCSchedClassDesc * SC, unsigned int UseIdx, unsigned int WriteResID) const
- public ArrayRef<llvm::MCReadAdvanceEntry> getReadAdvanceEntries(const llvm::MCSchedClassDesc & SC) const
- public const llvm::MCSchedModel & getSchedModel() const
- public const llvm::MCSchedModel & getSchedModelForCPU(llvm::StringRef CPU) const
- public const llvm::Triple & getTargetTriple() const
- public llvm::StringRef getTuneCPU() const
- public const llvm::MCWriteLatencyEntry * getWriteLatencyEntry(const llvm::MCSchedClassDesc * SC, unsigned int DefIdx) const
- public const llvm::MCWriteProcResEntry * getWriteProcResBegin(const llvm::MCSchedClassDesc * SC) const
- public const llvm::MCWriteProcResEntry * getWriteProcResEnd(const llvm::MCSchedClassDesc * SC) const
- public bool hasFeature(unsigned int Feature) const
- public void initInstrItins(llvm::InstrItineraryData & InstrItins) const
- public bool isCPUStringValid(llvm::StringRef CPU) const
- public virtual unsigned int resolveVariantSchedClass(unsigned int SchedClass, const llvm::MCInst * MI, const llvm::MCInstrInfo * MCII, unsigned int CPUID) const
- public void setDefaultFeatures(llvm::StringRef CPU, llvm::StringRef TuneCPU, llvm::StringRef FS)
- public void setFeatureBits(const llvm::FeatureBitset & FeatureBits_)
- public virtual ~MCSubtargetInfo()
Methods
¶llvm::FeatureBitset ApplyFeatureFlag(
llvm::StringRef FS)
llvm::FeatureBitset ApplyFeatureFlag(
llvm::StringRef FS)
Description
Apply a feature flag and return the re-computed feature bits, including all feature bits implied by the flag.
Declared at: llvm/include/llvm/MC/MCSubtargetInfo.h:149
Parameters
¶llvm::FeatureBitset ClearFeatureBitsTransitively(
const llvm::FeatureBitset& FB)
llvm::FeatureBitset ClearFeatureBitsTransitively(
const llvm::FeatureBitset& FB)
Declared at: llvm/include/llvm/MC/MCSubtargetInfo.h:153
Parameters
- const llvm::FeatureBitset& FB
¶void InitMCProcessorInfo(llvm::StringRef CPU,
llvm::StringRef TuneCPU,
llvm::StringRef FS)
void InitMCProcessorInfo(llvm::StringRef CPU,
llvm::StringRef TuneCPU,
llvm::StringRef FS)
Description
Initialize the scheduling model and feature bits. FIXME: Find a way to stick this in the constructor, since it should only be called during initialization.
Declared at: llvm/include/llvm/MC/MCSubtargetInfo.h:128
Parameters
- llvm::StringRef CPU
- llvm::StringRef TuneCPU
- llvm::StringRef FS
¶MCSubtargetInfo(
const llvm::Triple& TT,
llvm::StringRef CPU,
llvm::StringRef TuneCPU,
llvm::StringRef FS,
ArrayRef<llvm::SubtargetFeatureKV> PF,
ArrayRef<llvm::SubtargetSubTypeKV> PD,
const llvm::MCWriteProcResEntry* WPR,
const llvm::MCWriteLatencyEntry* WL,
const llvm::MCReadAdvanceEntry* RA,
const llvm::InstrStage* IS,
const unsigned int* OC,
const unsigned int* FP)
MCSubtargetInfo(
const llvm::Triple& TT,
llvm::StringRef CPU,
llvm::StringRef TuneCPU,
llvm::StringRef FS,
ArrayRef<llvm::SubtargetFeatureKV> PF,
ArrayRef<llvm::SubtargetSubTypeKV> PD,
const llvm::MCWriteProcResEntry* WPR,
const llvm::MCWriteLatencyEntry* WL,
const llvm::MCReadAdvanceEntry* RA,
const llvm::InstrStage* IS,
const unsigned int* OC,
const unsigned int* FP)
Declared at: llvm/include/llvm/MC/MCSubtargetInfo.h:97
Parameters
- const llvm::Triple& TT
- llvm::StringRef CPU
- llvm::StringRef TuneCPU
- llvm::StringRef FS
- ArrayRef<llvm::SubtargetFeatureKV> PF
- ArrayRef<llvm::SubtargetSubTypeKV> PD
- const llvm::MCWriteProcResEntry* WPR
- const llvm::MCWriteLatencyEntry* WL
- const llvm::MCReadAdvanceEntry* RA
- const llvm::InstrStage* IS
- const unsigned int* OC
- const unsigned int* FP
¶MCSubtargetInfo()
MCSubtargetInfo()
Declared at: llvm/include/llvm/MC/MCSubtargetInfo.h:103
¶MCSubtargetInfo(const llvm::MCSubtargetInfo&)
MCSubtargetInfo(const llvm::MCSubtargetInfo&)
Declared at: llvm/include/llvm/MC/MCSubtargetInfo.h:96
Parameters
- const llvm::MCSubtargetInfo&
¶llvm::FeatureBitset SetFeatureBitsTransitively(
const llvm::FeatureBitset& FB)
llvm::FeatureBitset SetFeatureBitsTransitively(
const llvm::FeatureBitset& FB)
Description
Set/clear additional feature bits, including all other bits they imply.
Declared at: llvm/include/llvm/MC/MCSubtargetInfo.h:152
Parameters
- const llvm::FeatureBitset& FB
¶llvm::FeatureBitset ToggleFeature(
llvm::StringRef FS)
llvm::FeatureBitset ToggleFeature(
llvm::StringRef FS)
Description
Toggle a set of features and return the re-computed feature bits. This version will also change all implied bits.
Declared at: llvm/include/llvm/MC/MCSubtargetInfo.h:145
Parameters
¶llvm::FeatureBitset ToggleFeature(
const llvm::FeatureBitset& FB)
llvm::FeatureBitset ToggleFeature(
const llvm::FeatureBitset& FB)
Description
Toggle a feature and return the re-computed feature bits. This version does not change the implied bits.
Declared at: llvm/include/llvm/MC/MCSubtargetInfo.h:141
Parameters
- const llvm::FeatureBitset& FB
¶llvm::FeatureBitset ToggleFeature(uint64_t FB)
llvm::FeatureBitset ToggleFeature(uint64_t FB)
Description
Toggle a feature and return the re-computed feature bits. This version does not change the implied bits.
Declared at: llvm/include/llvm/MC/MCSubtargetInfo.h:137
Parameters
- uint64_t FB
¶bool checkFeatures(llvm::StringRef FS) const
bool checkFeatures(llvm::StringRef FS) const
Description
Check whether the subtarget features are enabled/disabled as per the provided string, ignoring all other features.
Declared at: llvm/include/llvm/MC/MCSubtargetInfo.h:157
Parameters
¶virtual bool enableWritePrefetching() const
virtual bool enableWritePrefetching() const
Declared at: llvm/include/llvm/MC/MCSubtargetInfo.h:276
Returns
True if prefetching should also be done for writes.
¶llvm::StringRef getCPU() const
llvm::StringRef getCPU() const
Declared at: llvm/include/llvm/MC/MCSubtargetInfo.h:109
¶virtual Optional<unsigned int>
getCacheAssociativity(unsigned int Level) const
virtual Optional<unsigned int>
getCacheAssociativity(unsigned int Level) const
Description
Return the cache associatvity for the given level of cache. Level is zero-based, so a value of zero means the first level of cache.
Declared at: llvm/include/llvm/MC/MCSubtargetInfo.h:245
Parameters
- unsigned int Level
¶virtual Optional<unsigned int> getCacheLineSize(
unsigned int Level) const
virtual Optional<unsigned int> getCacheLineSize(
unsigned int Level) const
Description
Return the target cache line size in bytes at a given level.
Declared at: llvm/include/llvm/MC/MCSubtargetInfo.h:249
Parameters
- unsigned int Level
¶virtual unsigned int getCacheLineSize() const
virtual unsigned int getCacheLineSize() const
Description
Return the target cache line size in bytes. By default, return the line size for the bottom-most level of cache. This provides a more convenient interface for the common case where all cache levels have the same line size. Return zero if there is no cache model.
Declared at: llvm/include/llvm/MC/MCSubtargetInfo.h:257
¶virtual Optional<unsigned int> getCacheSize(
unsigned int Level) const
virtual Optional<unsigned int> getCacheSize(
unsigned int Level) const
Description
Return the cache size in bytes for the given level of cache. Level is zero-based, so a value of zero means the first level of cache.
Declared at: llvm/include/llvm/MC/MCSubtargetInfo.h:239
Parameters
- unsigned int Level
¶const llvm::FeatureBitset& getFeatureBits() const
const llvm::FeatureBitset& getFeatureBits() const
Declared at: llvm/include/llvm/MC/MCSubtargetInfo.h:112
¶llvm::StringRef getFeatureString() const
llvm::StringRef getFeatureString() const
Declared at: llvm/include/llvm/MC/MCSubtargetInfo.h:117
¶virtual unsigned int getHwMode() const
virtual unsigned int getHwMode() const
Declared at: llvm/include/llvm/MC/MCSubtargetInfo.h:233
¶llvm::InstrItineraryData getInstrItineraryForCPU(
llvm::StringRef CPU) const
llvm::InstrItineraryData getInstrItineraryForCPU(
llvm::StringRef CPU) const
Description
Get scheduling itinerary of a CPU.
Declared at: llvm/include/llvm/MC/MCSubtargetInfo.h:214
Parameters
- llvm::StringRef CPU
¶virtual unsigned int
getMaxPrefetchIterationsAhead() const
virtual unsigned int
getMaxPrefetchIterationsAhead() const
Description
Return the maximum prefetch distance in terms of loop iterations.
Declared at: llvm/include/llvm/MC/MCSubtargetInfo.h:272
¶virtual unsigned int getMinPrefetchStride(
unsigned int NumMemAccesses,
unsigned int NumStridedMemAccesses,
unsigned int NumPrefetches,
bool HasCall) const
virtual unsigned int getMinPrefetchStride(
unsigned int NumMemAccesses,
unsigned int NumStridedMemAccesses,
unsigned int NumPrefetches,
bool HasCall) const
Description
Return the minimum stride necessary to trigger software prefetching.
Declared at: llvm/include/llvm/MC/MCSubtargetInfo.h:281
Parameters
- unsigned int NumMemAccesses
- unsigned int NumStridedMemAccesses
- unsigned int NumPrefetches
- bool HasCall
¶virtual unsigned int getPrefetchDistance() const
virtual unsigned int getPrefetchDistance() const
Description
Return the preferred prefetch distance in terms of instructions.
Declared at: llvm/include/llvm/MC/MCSubtargetInfo.h:267
¶int getReadAdvanceCycles(
const llvm::MCSchedClassDesc* SC,
unsigned int UseIdx,
unsigned int WriteResID) const
int getReadAdvanceCycles(
const llvm::MCSchedClassDesc* SC,
unsigned int UseIdx,
unsigned int WriteResID) const
Declared at: llvm/include/llvm/MC/MCSubtargetInfo.h:184
Parameters
- const llvm::MCSchedClassDesc* SC
- unsigned int UseIdx
- unsigned int WriteResID
¶ArrayRef<llvm::MCReadAdvanceEntry>
getReadAdvanceEntries(
const llvm::MCSchedClassDesc& SC) const
ArrayRef<llvm::MCReadAdvanceEntry>
getReadAdvanceEntries(
const llvm::MCSchedClassDesc& SC) const
Description
Return the set of ReadAdvance entries declared by the scheduling class descriptor in input.
Declared at: llvm/include/llvm/MC/MCSubtargetInfo.h:206
Parameters
- const llvm::MCSchedClassDesc& SC
¶const llvm::MCSchedModel& getSchedModel() const
const llvm::MCSchedModel& getSchedModel() const
Description
Get the machine model for this subtarget's CPU.
Declared at: llvm/include/llvm/MC/MCSubtargetInfo.h:163
¶const llvm::MCSchedModel& getSchedModelForCPU(
llvm::StringRef CPU) const
const llvm::MCSchedModel& getSchedModelForCPU(
llvm::StringRef CPU) const
Description
Get the machine model of a CPU.
Declared at: llvm/include/llvm/MC/MCSubtargetInfo.h:160
Parameters
- llvm::StringRef CPU
¶const llvm::Triple& getTargetTriple() const
const llvm::Triple& getTargetTriple() const
Declared at: llvm/include/llvm/MC/MCSubtargetInfo.h:108
¶llvm::StringRef getTuneCPU() const
llvm::StringRef getTuneCPU() const
Declared at: llvm/include/llvm/MC/MCSubtargetInfo.h:110
¶const llvm::MCWriteLatencyEntry*
getWriteLatencyEntry(
const llvm::MCSchedClassDesc* SC,
unsigned int DefIdx) const
const llvm::MCWriteLatencyEntry*
getWriteLatencyEntry(
const llvm::MCSchedClassDesc* SC,
unsigned int DefIdx) const
Declared at: llvm/include/llvm/MC/MCSubtargetInfo.h:176
Parameters
- const llvm::MCSchedClassDesc* SC
- unsigned int DefIdx
¶const llvm::MCWriteProcResEntry*
getWriteProcResBegin(
const llvm::MCSchedClassDesc* SC) const
const llvm::MCWriteProcResEntry*
getWriteProcResBegin(
const llvm::MCSchedClassDesc* SC) const
Description
Return an iterator at the first process resource consumed by the given scheduling class.
Declared at: llvm/include/llvm/MC/MCSubtargetInfo.h:167
Parameters
- const llvm::MCSchedClassDesc* SC
¶const llvm::MCWriteProcResEntry*
getWriteProcResEnd(
const llvm::MCSchedClassDesc* SC) const
const llvm::MCWriteProcResEntry*
getWriteProcResEnd(
const llvm::MCSchedClassDesc* SC) const
Declared at: llvm/include/llvm/MC/MCSubtargetInfo.h:171
Parameters
- const llvm::MCSchedClassDesc* SC
¶bool hasFeature(unsigned int Feature) const
bool hasFeature(unsigned int Feature) const
Declared at: llvm/include/llvm/MC/MCSubtargetInfo.h:119
Parameters
- unsigned int Feature
¶void initInstrItins(
llvm::InstrItineraryData& InstrItins) const
void initInstrItins(
llvm::InstrItineraryData& InstrItins) const
Description
Initialize an InstrItineraryData instance.
Declared at: llvm/include/llvm/MC/MCSubtargetInfo.h:217
Parameters
- llvm::InstrItineraryData& InstrItins
¶bool isCPUStringValid(llvm::StringRef CPU) const
bool isCPUStringValid(llvm::StringRef CPU) const
Description
Check whether the CPU string is valid.
Declared at: llvm/include/llvm/MC/MCSubtargetInfo.h:228
Parameters
- llvm::StringRef CPU
¶virtual unsigned int resolveVariantSchedClass(
unsigned int SchedClass,
const llvm::MCInst* MI,
const llvm::MCInstrInfo* MCII,
unsigned int CPUID) const
virtual unsigned int resolveVariantSchedClass(
unsigned int SchedClass,
const llvm::MCInst* MI,
const llvm::MCInstrInfo* MCII,
unsigned int CPUID) const
Description
Resolve a variant scheduling class for the given MCInst and CPU.
Declared at: llvm/include/llvm/MC/MCSubtargetInfo.h:220
Parameters
- unsigned int SchedClass
- const llvm::MCInst* MI
- const llvm::MCInstrInfo* MCII
- unsigned int CPUID
¶void setDefaultFeatures(llvm::StringRef CPU,
llvm::StringRef TuneCPU,
llvm::StringRef FS)
void setDefaultFeatures(llvm::StringRef CPU,
llvm::StringRef TuneCPU,
llvm::StringRef FS)
Description
Set the features to the default for the given CPU and TuneCPU, with ano appended feature string.
Declared at: llvm/include/llvm/MC/MCSubtargetInfo.h:133
Parameters
- llvm::StringRef CPU
- llvm::StringRef TuneCPU
- llvm::StringRef FS
¶void setFeatureBits(
const llvm::FeatureBitset& FeatureBits_)
void setFeatureBits(
const llvm::FeatureBitset& FeatureBits_)
Declared at: llvm/include/llvm/MC/MCSubtargetInfo.h:113
Parameters
- const llvm::FeatureBitset& FeatureBits_
¶virtual ~MCSubtargetInfo()
virtual ~MCSubtargetInfo()
Declared at: llvm/include/llvm/MC/MCSubtargetInfo.h:106