|
LLVM
10.0.0
|
Generic base class for all target subtargets. More...
#include "llvm/MC/MCSubtargetInfo.h"
Public Member Functions | |
| MCSubtargetInfo (const MCSubtargetInfo &)=default | |
| MCSubtargetInfo (const Triple &TT, StringRef CPU, StringRef FS, ArrayRef< SubtargetFeatureKV > PF, ArrayRef< SubtargetSubTypeKV > PD, const MCWriteProcResEntry *WPR, const MCWriteLatencyEntry *WL, const MCReadAdvanceEntry *RA, const InstrStage *IS, const unsigned *OC, const unsigned *FP) | |
| MCSubtargetInfo ()=delete | |
| MCSubtargetInfo & | operator= (const MCSubtargetInfo &)=delete |
| MCSubtargetInfo & | operator= (MCSubtargetInfo &&)=delete |
| virtual | ~MCSubtargetInfo ()=default |
| const Triple & | getTargetTriple () const |
| StringRef | getCPU () const |
| const FeatureBitset & | getFeatureBits () const |
| void | setFeatureBits (const FeatureBitset &FeatureBits_) |
| bool | hasFeature (unsigned Feature) const |
| void | setDefaultFeatures (StringRef CPU, StringRef FS) |
| Set the features to the default for the given CPU with an appended feature string. More... | |
| FeatureBitset | ToggleFeature (uint64_t FB) |
| Toggle a feature and return the re-computed feature bits. More... | |
| FeatureBitset | ToggleFeature (const FeatureBitset &FB) |
| Toggle a feature and return the re-computed feature bits. More... | |
| FeatureBitset | ToggleFeature (StringRef FS) |
| Toggle a set of features and return the re-computed feature bits. More... | |
| FeatureBitset | ApplyFeatureFlag (StringRef FS) |
| Apply a feature flag and return the re-computed feature bits, including all feature bits implied by the flag. More... | |
| FeatureBitset | SetFeatureBitsTransitively (const FeatureBitset &FB) |
| Set/clear additional feature bits, including all other bits they imply. More... | |
| FeatureBitset | ClearFeatureBitsTransitively (const FeatureBitset &FB) |
| bool | checkFeatures (StringRef FS) const |
| Check whether the subtarget features are enabled/disabled as per the provided string, ignoring all other features. More... | |
| const MCSchedModel & | getSchedModelForCPU (StringRef CPU) const |
| Get the machine model of a CPU. More... | |
| const MCSchedModel & | getSchedModel () const |
| Get the machine model for this subtarget's CPU. More... | |
| const MCWriteProcResEntry * | getWriteProcResBegin (const MCSchedClassDesc *SC) const |
| Return an iterator at the first process resource consumed by the given scheduling class. More... | |
| const MCWriteProcResEntry * | getWriteProcResEnd (const MCSchedClassDesc *SC) const |
| const MCWriteLatencyEntry * | getWriteLatencyEntry (const MCSchedClassDesc *SC, unsigned DefIdx) const |
| int | getReadAdvanceCycles (const MCSchedClassDesc *SC, unsigned UseIdx, unsigned WriteResID) const |
| ArrayRef< MCReadAdvanceEntry > | getReadAdvanceEntries (const MCSchedClassDesc &SC) const |
| Return the set of ReadAdvance entries declared by the scheduling class descriptor in input. More... | |
| InstrItineraryData | getInstrItineraryForCPU (StringRef CPU) const |
| Get scheduling itinerary of a CPU. More... | |
| void | initInstrItins (InstrItineraryData &InstrItins) const |
| Initialize an InstrItineraryData instance. More... | |
| virtual unsigned | resolveVariantSchedClass (unsigned SchedClass, const MCInst *MI, unsigned CPUID) const |
| Resolve a variant scheduling class for the given MCInst and CPU. More... | |
| bool | isCPUStringValid (StringRef CPU) const |
| Check whether the CPU string is valid. More... | |
| virtual unsigned | getHwMode () const |
| virtual Optional< unsigned > | getCacheSize (unsigned Level) const |
| Return the cache size in bytes for the given level of cache. More... | |
| virtual Optional< unsigned > | getCacheAssociativity (unsigned Level) const |
| Return the cache associatvity for the given level of cache. More... | |
| virtual Optional< unsigned > | getCacheLineSize (unsigned Level) const |
| Return the target cache line size in bytes at a given level. More... | |
| virtual unsigned | getCacheLineSize () const |
| Return the target cache line size in bytes. More... | |
| virtual unsigned | getPrefetchDistance () const |
| Return the preferred prefetch distance in terms of instructions. More... | |
| virtual unsigned | getMaxPrefetchIterationsAhead () const |
| Return the maximum prefetch distance in terms of loop iterations. More... | |
| virtual unsigned | getMinPrefetchStride () const |
| Return the minimum stride necessary to trigger software prefetching. More... | |
Protected Member Functions | |
| void | InitMCProcessorInfo (StringRef CPU, StringRef FS) |
| Initialize the scheduling model and feature bits. More... | |
Generic base class for all target subtargets.
Definition at line 74 of file MCSubtargetInfo.h.
|
default |
| MCSubtargetInfo::MCSubtargetInfo | ( | const Triple & | TT, |
| StringRef | CPU, | ||
| StringRef | FS, | ||
| ArrayRef< SubtargetFeatureKV > | PF, | ||
| ArrayRef< SubtargetSubTypeKV > | PD, | ||
| const MCWriteProcResEntry * | WPR, | ||
| const MCWriteLatencyEntry * | WL, | ||
| const MCReadAdvanceEntry * | RA, | ||
| const InstrStage * | IS, | ||
| const unsigned * | OC, | ||
| const unsigned * | FP | ||
| ) |
Definition at line 209 of file MCSubtargetInfo.cpp.
References InitMCProcessorInfo().
|
delete |
|
virtualdefault |
| FeatureBitset MCSubtargetInfo::ApplyFeatureFlag | ( | StringRef | FS | ) |
Apply a feature flag and return the re-computed feature bits, including all feature bits implied by the flag.
Definition at line 273 of file MCSubtargetInfo.cpp.
Referenced by checkFeatures(), and llvm::IsCPSRDead< MCInst >().
Check whether the subtarget features are enabled/disabled as per the provided string, ignoring all other features.
Definition at line 278 of file MCSubtargetInfo.cpp.
References ApplyFeatureFlag(), F(), llvm::SubtargetFeatures::getFeatures(), and llvm::T.
| FeatureBitset MCSubtargetInfo::ClearFeatureBitsTransitively | ( | const FeatureBitset & | FB | ) |
Definition at line 237 of file MCSubtargetInfo.cpp.
References ClearImpliedBits(), E, I, llvm::FeatureBitset::reset(), and llvm::FeatureBitset::size().
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.
Definition at line 324 of file MCSubtargetInfo.cpp.
Referenced by llvm::BasicTTIImplBase< AMDGPUTTIImpl >::getCacheAssociativity().
Return the target cache line size in bytes at a given level.
Definition at line 328 of file MCSubtargetInfo.cpp.
Referenced by llvm::BasicTTIImplBase< AMDGPUTTIImpl >::getCacheLineSize().
|
inlinevirtual |
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.
Definition at line 249 of file MCSubtargetInfo.h.
References Size.
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.
Definition at line 319 of file MCSubtargetInfo.cpp.
Referenced by llvm::BasicTTIImplBase< AMDGPUTTIImpl >::getCacheSize().
|
inline |
Definition at line 105 of file MCSubtargetInfo.h.
Referenced by llvm::AMDGPUTargetELFStreamer::AMDGPUTargetELFStreamer(), llvm::createHexagonAsmBackend(), llvm::createMipsAsmBackend(), llvm::AMDGPUTargetAsmStreamer::EmitAmdhsaKernelDescriptor(), llvm::ARMTargetStreamer::emitTargetAttributes(), llvm::AMDGPU::IsaInfo::getAddressableNumSGPRs(), getArchForCPU(), llvm::AMDGPU::getDefaultAmdhsaKernelDescriptor(), llvm::Hexagon_MC::GetELFFlags(), llvm::AMDGPU::IsaInfo::getMaxNumSGPRs(), llvm::AMDGPU::IsaInfo::getMinNumSGPRs(), llvm::AMDGPU::IsaInfo::getNumExtraSGPRs(), llvm::AMDGPU::IsaInfo::getSGPRAllocGranule(), llvm::AMDGPU::IsaInfo::getTotalNumSGPRs(), llvm::HexagonShuffler::HexagonShuffler(), llvm::AMDGPU::initDefaultAMDKernelCodeT(), llvm::HexagonMCInstrInfo::isOrderedDuplexPair(), llvm::AMDGPUInstPrinter::printWaitFlag(), and llvm::AMDGPU::IsaInfo::streamIsaVersion().
|
inline |
Definition at line 107 of file MCSubtargetInfo.h.
Referenced by llvm::ARMAsmBackend::adjustFixupValue(), llvm::AMDGPUDisassembler::AMDGPUDisassembler(), llvm::AArch64TTIImpl::areInlineCompatible(), llvm::ARMTTIImpl::areInlineCompatible(), llvm::X86TTIImpl::areInlineCompatible(), llvm::AVRELFStreamer::AVRELFStreamer(), llvm::HexagonMCInstrInfo::canonicalizePacket(), checkFeature(), clearFeature(), llvm::AMDGPUDisassembler::convertMIMGInst(), llvm::AMDGPUDisassembler::convertSDWAInst(), llvm::Hexagon_MC::createHexagonMCSubtargetInfo(), llvm::createR600MCCodeEmitter(), llvm::createRISCVMCCodeEmitter(), llvm::AMDGPUDisassembler::decodeBoolReg(), DecodeHINTInstruction(), llvm::AMDGPUDisassembler::decodeSDWASrc(), llvm::AMDGPUDisassembler::decodeSDWAVopcDst(), DecodeSETPANInstruction(), DecodeSystemPStateInstruction(), llvm::HexagonMCCodeEmitter::encodeInstruction(), llvm::PPCMCCodeEmitter::encodeInstruction(), ExpandCryptoAEK(), llvm::MipsTargetELFStreamer::finish(), llvm::AMDGPU::IsaInfo::getAddressableNumSGPRs(), getARMLoadDeprecationInfo(), getARMStoreDeprecationInfo(), llvm::AMDGPU::getDefaultAmdhsaKernelDescriptor(), llvm::MCInstrDesc::getDeprecatedInfo(), getFixupKindSize(), llvm::AMDGPUDisassembler::getInstruction(), getITDeprecationInfo(), getLit16Encoding(), getLit32Encoding(), getLit64Encoding(), llvm::AMDGPU::IsaInfo::getLocalMemorySize(), llvm::AMDGPUMCAsmInfo::getMaxInstLength(), llvm::AMDGPU::IsaInfo::getMaxNumSGPRs(), getMCRDeprecationInfo(), llvm::AMDGPU::IsaInfo::getMinNumSGPRs(), llvm::AMDGPU::IsaInfo::getNumExtraSGPRs(), llvm::ARMAsmBackend::getRelaxedOpcode(), llvm::AMDGPU::IsaInfo::getTotalNumVGPRs(), llvm::AMDGPU::IsaInfo::getVGPRAllocGranule(), llvm::AMDGPU::IsaInfo::getWavefrontSize(), llvm::AMDGPU::IsaInfo::hasCodeObjectV3(), llvm::AMDGPU::hasMIMG_R128(), llvm::ARMAsmBackend::hasNOP(), llvm::AMDGPU::hasPackedD16(), llvm::AMDGPU::hasSRAMECC(), llvm::AMDGPU::hasXNACK(), incrementLoc(), llvm::AMDGPU::initDefaultAMDKernelCodeT(), llvm::AMDGPU::isCI(), llvm::IsCPSRDead< MCInst >(), llvm::AMDGPU::isGCN3Encoding(), llvm::AMDGPUDisassembler::isGFX10(), llvm::AMDGPU::isGFX10(), llvm::AMDGPUDisassembler::isGFX9(), llvm::AMDGPU::isGFX9(), isMicroMips(), isShiftedUIntAtAnyPosition(), llvm::AMDGPU::isSI(), isThumb(), llvm::SparcInstPrinter::isV9(), llvm::AMDGPUDisassembler::isVI(), llvm::AMDGPU::isVI(), LowerLargeShift(), matchAliasCondition(), MaxLongNopLength(), llvm::MipsTargetELFStreamer::MipsTargetELFStreamer(), llvm::RISCVInstPrinter::printCSRSystemRegister(), llvm::X86ATTInstPrinter::printInst(), llvm::X86IntelInstPrinter::printInst(), llvm::AArch64InstPrinter::printInst(), llvm::PPCInstPrinter::printInst(), llvm::ARMInstPrinter::printMemBOption(), llvm::AArch64InstPrinter::printMRSSystemRegister(), llvm::ARMInstPrinter::printMSRMaskOperand(), llvm::AArch64InstPrinter::printMSRSystemRegister(), llvm::AMDGPUInstPrinter::printRegOperand(), llvm::AArch64InstPrinter::printSysAlias(), llvm::AArch64InstPrinter::printSystemPStateField(), llvm::RISCVAsmBackend::RISCVAsmBackend(), llvm::RISCVTargetELFStreamer::RISCVTargetELFStreamer(), llvm::RISCVAsmBackend::shouldForceRelocation(), llvm::RISCVAsmBackend::shouldInsertExtraNopBytesForCodeAlign(), llvm::RISCVAsmBackend::shouldInsertFixupForCodeAlign(), SwapBits(), llvm::RISCVAsmBackend::willForceRelocations(), and llvm::RISCVAsmBackend::writeNopData().
|
inlinevirtual |
Definition at line 225 of file MCSubtargetInfo.h.
| InstrItineraryData MCSubtargetInfo::getInstrItineraryForCPU | ( | StringRef | CPU | ) | const |
Get scheduling itinerary of a CPU.
Definition at line 309 of file MCSubtargetInfo.cpp.
References getSchedModelForCPU().
Referenced by getItineraryLatency().
|
virtual |
Return the maximum prefetch distance in terms of loop iterations.
Definition at line 336 of file MCSubtargetInfo.cpp.
Referenced by llvm::BasicTTIImplBase< AMDGPUTTIImpl >::getMaxPrefetchIterationsAhead().
|
virtual |
Return the minimum stride necessary to trigger software prefetching.
Definition at line 340 of file MCSubtargetInfo.cpp.
Referenced by llvm::BasicTTIImplBase< AMDGPUTTIImpl >::getMinPrefetchStride().
|
virtual |
Return the preferred prefetch distance in terms of instructions.
Definition at line 332 of file MCSubtargetInfo.cpp.
Referenced by llvm::BasicTTIImplBase< AMDGPUTTIImpl >::getPrefetchDistance().
|
inline |
Definition at line 177 of file MCSubtargetInfo.h.
References E, I, llvm::MCSchedClassDesc::NumReadAdvanceEntries, and llvm::MCSchedClassDesc::ReadAdvanceIdx.
Referenced by llvm::mca::RegisterFile::addRegisterRead(), and llvm::TargetSchedModel::computeOperandLatency().
|
inline |
Return the set of ReadAdvance entries declared by the scheduling class descriptor in input.
Definition at line 199 of file MCSubtargetInfo.h.
References llvm::MCSchedClassDesc::NumReadAdvanceEntries, and llvm::MCSchedClassDesc::ReadAdvanceIdx.
|
inline |
Get the machine model for this subtarget's CPU.
Definition at line 156 of file MCSubtargetInfo.h.
Referenced by llvm::mca::RegisterFile::addRegisterRead(), adjCycles(), llvm::mca::Context::createDefaultPipeline(), llvm::mca::InstrBuilder::createInstruction(), llvm::mca::DispatchStage::DispatchStage(), llvm::TargetSubtargetInfo::enablePostRAScheduler(), llvm::BasicTTIImplBase< AMDGPUTTIImpl >::getInstructionLatency(), getLatency(), llvm::HexagonMCInstrInfo::getOtherReservedSlots(), llvm::MCSchedModel::getReciprocalThroughput(), getUnderlyingObjects(), llvm::HexagonMCInstrInfo::getUnits(), llvm::BasicTTIImplBase< AMDGPUTTIImpl >::getUnrollingPreferences(), llvm::TargetSchedModel::init(), llvm::ConvergingVLIWScheduler::initialize(), llvm::mca::initializeUsedResources(), initInstrItins(), llvm::mca::InstrBuilder::InstrBuilder(), and llvm::mca::verifyOperands().
| const MCSchedModel & MCSubtargetInfo::getSchedModelForCPU | ( | StringRef | CPU | ) | const |
Get the machine model of a CPU.
Definition at line 290 of file MCSubtargetInfo.cpp.
References assert(), llvm::errs(), Find(), llvm::MCSchedModel::GetDefaultSchedModel(), and llvm::SubtargetSubTypeKV::SchedModel.
Referenced by getInstrItineraryForCPU(), and InitMCProcessorInfo().
Definition at line 104 of file MCSubtargetInfo.h.
Referenced by llvm::ARMAsmBackend::adjustFixupValue(), canReuseBoundaryAlignFragment(), llvm::createAArch64beAsmBackend(), llvm::createAArch64leAsmBackend(), llvm::createAArch64ObjectTargetStreamer(), llvm::createAMDGPUAsmBackend(), createARMAsmBackend(), llvm::createARMObjectTargetStreamer(), createAsmBackend(), llvm::createAVRAsmBackend(), llvm::createHexagonAsmBackend(), llvm::createLanaiAsmBackend(), llvm::createMipsAsmBackend(), llvm::createMSP430ObjectTargetStreamer(), createObjectTargetStreamer(), llvm::createPPCAsmBackend(), llvm::createRISCVAsmBackend(), createRISCVObjectTargetStreamer(), llvm::createSparcAsmBackend(), llvm::createSystemZMCAsmBackend(), llvm::createX86_32AsmBackend(), llvm::createX86_64AsmBackend(), llvm::createX86ObjectTargetStreamer(), llvm::AMDGPUAsmPrinter::doFinalization(), llvm::AsmPrinter::emitXRayTable(), llvm::AMDGPUMCAsmInfo::getMaxInstLength(), llvm::AMDGPU::IsaInfo::getMaxWorkGroupsPerCU(), llvm::AMDGPU::getMCReg(), llvm::PPCMCCodeEmitter::getTLSRegEncoding(), llvm::AMDGPU::IsaInfo::hasCodeObjectV3(), lowerMSASplatZExt(), llvm::MipsTargetELFStreamer::MipsTargetELFStreamer(), llvm::RISCVAsmBackend::RISCVAsmBackend(), llvm::AMDGPU::IsaInfo::streamIsaVersion(), and truncateVecElts().
|
inline |
Definition at line 169 of file MCSubtargetInfo.h.
References assert(), and llvm::MCSchedClassDesc::WriteLatencyIdx.
Referenced by llvm::MCSchedModel::computeInstrLatency(), llvm::TargetSchedModel::computeOperandLatency(), getLatency(), and llvm::mca::verifyOperands().
|
inline |
Return an iterator at the first process resource consumed by the given scheduling class.
Definition at line 160 of file MCSubtargetInfo.h.
References llvm::MCSchedClassDesc::WriteProcResIdx.
Referenced by llvm::TargetSchedModel::computeOutputLatency(), llvm::MCSchedModel::getReciprocalThroughput(), getUnderlyingObjects(), llvm::TargetSchedModel::getWriteProcResBegin(), and llvm::mca::initializeUsedResources().
|
inline |
Definition at line 164 of file MCSubtargetInfo.h.
References llvm::MCSchedClassDesc::NumWriteProcResEntries.
Referenced by llvm::TargetSchedModel::computeOutputLatency(), llvm::MCSchedModel::getReciprocalThroughput(), getUnderlyingObjects(), and llvm::TargetSchedModel::getWriteProcResEnd().
Definition at line 112 of file MCSubtargetInfo.h.
References ApplyFeatureFlag().
Referenced by llvm::ARMTargetStreamer::emitTargetAttributes(), getArchForCPU(), hasVariantSymbol(), llvm::ARMElfTargetObjectFile::Initialize(), is16BitMemOperand(), isPCRel32Branch(), isV8M(), and llvm::AMDGPUInstPrinter::printInst().
| void MCSubtargetInfo::initInstrItins | ( | InstrItineraryData & | InstrItins | ) | const |
Initialize an InstrItineraryData instance.
Definition at line 314 of file MCSubtargetInfo.cpp.
References getSchedModel().
Referenced by llvm::TargetSchedModel::init().
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.
Definition at line 197 of file MCSubtargetInfo.cpp.
References llvm::StringRef::empty(), llvm::MCSchedModel::GetDefaultSchedModel(), getFeatures(), and getSchedModelForCPU().
Referenced by MCSubtargetInfo().
Check whether the CPU string is valid.
Definition at line 220 of file MCSubtargetInfo.h.
References llvm::ArrayRef< T >::begin(), llvm::ArrayRef< T >::end(), and llvm::lower_bound().
|
delete |
|
delete |
|
inlinevirtual |
Resolve a variant scheduling class for the given MCInst and CPU.
Definition at line 214 of file MCSubtargetInfo.h.
Referenced by llvm::MCSchedModel::computeInstrLatency(), llvm::MCSchedModel::getReciprocalThroughput(), and llvm::mca::verifyOperands().
Set the features to the default for the given CPU with an appended feature string.
Definition at line 205 of file MCSubtargetInfo.cpp.
References getFeatures().
Referenced by ExpandCryptoAEK(), incrementLoc(), and llvm::IsCPSRDead< MCInst >().
|
inline |
Definition at line 108 of file MCSubtargetInfo.h.
Referenced by llvm::Hexagon_MC::createHexagonMCSubtargetInfo(), and RefineErrorLoc().
| FeatureBitset MCSubtargetInfo::SetFeatureBitsTransitively | ( | const FeatureBitset & | FB | ) |
Set/clear additional feature bits, including all other bits they imply.
Definition at line 231 of file MCSubtargetInfo.cpp.
References SetImpliedBits().
| FeatureBitset MCSubtargetInfo::ToggleFeature | ( | uint64_t | FB | ) |
Toggle a feature and return the re-computed feature bits.
This version does not change the implied bits.
Definition at line 221 of file MCSubtargetInfo.cpp.
References llvm::FeatureBitset::flip().
Referenced by clearFeature(), ExpandCryptoAEK(), and incrementLoc().
| FeatureBitset MCSubtargetInfo::ToggleFeature | ( | const FeatureBitset & | FB | ) |
Toggle a feature and return the re-computed feature bits.
This version does not change the implied bits.
Definition at line 226 of file MCSubtargetInfo.cpp.
| FeatureBitset MCSubtargetInfo::ToggleFeature | ( | StringRef | FS | ) |
Toggle a set of features and return the re-computed feature bits.
This version will also change all implied bits.
Definition at line 248 of file MCSubtargetInfo.cpp.
References ClearImpliedBits(), llvm::errs(), Find(), llvm::FeatureBitArray::getAsBitset(), llvm::SubtargetFeatureKV::Implies, llvm::FeatureBitset::reset(), llvm::FeatureBitset::set(), SetImpliedBits(), llvm::SubtargetFeatures::StripFlag(), llvm::FeatureBitset::test(), and llvm::SubtargetFeatureKV::Value.
1.8.13