#include "llvm/MC/MCSubtargetInfo.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/MC/MCInstrItineraries.h"
#include "llvm/MC/MCSchedule.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/TargetParser/SubtargetFeature.h"
#include <algorithm>
#include <cassert>
#include <cstring>
#include <optional>
usingnamespacellvm;
template <typename T>
static const T *Find(StringRef S, ArrayRef<T> A) { … }
static
void SetImpliedBits(FeatureBitset &Bits, const FeatureBitset &Implies,
ArrayRef<SubtargetFeatureKV> FeatureTable) { … }
static
void ClearImpliedBits(FeatureBitset &Bits, unsigned Value,
ArrayRef<SubtargetFeatureKV> FeatureTable) { … }
static void ApplyFeatureFlag(FeatureBitset &Bits, StringRef Feature,
ArrayRef<SubtargetFeatureKV> FeatureTable) { … }
template <typename T>
static size_t getLongestEntryLength(ArrayRef<T> Table) { … }
static void Help(ArrayRef<SubtargetSubTypeKV> CPUTable,
ArrayRef<SubtargetFeatureKV> FeatTable) { … }
static void cpuHelp(ArrayRef<SubtargetSubTypeKV> CPUTable) { … }
static FeatureBitset getFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS,
ArrayRef<SubtargetSubTypeKV> ProcDesc,
ArrayRef<SubtargetFeatureKV> ProcFeatures) { … }
void MCSubtargetInfo::InitMCProcessorInfo(StringRef CPU, StringRef TuneCPU,
StringRef FS) { … }
void MCSubtargetInfo::setDefaultFeatures(StringRef CPU, StringRef TuneCPU,
StringRef FS) { … }
MCSubtargetInfo::MCSubtargetInfo(const Triple &TT, StringRef C, StringRef TC,
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)
: … { … }
FeatureBitset MCSubtargetInfo::ToggleFeature(uint64_t FB) { … }
FeatureBitset MCSubtargetInfo::ToggleFeature(const FeatureBitset &FB) { … }
FeatureBitset MCSubtargetInfo::SetFeatureBitsTransitively(
const FeatureBitset &FB) { … }
FeatureBitset MCSubtargetInfo::ClearFeatureBitsTransitively(
const FeatureBitset &FB) { … }
FeatureBitset MCSubtargetInfo::ToggleFeature(StringRef Feature) { … }
FeatureBitset MCSubtargetInfo::ApplyFeatureFlag(StringRef FS) { … }
bool MCSubtargetInfo::checkFeatures(StringRef FS) const { … }
const MCSchedModel &MCSubtargetInfo::getSchedModelForCPU(StringRef CPU) const { … }
InstrItineraryData
MCSubtargetInfo::getInstrItineraryForCPU(StringRef CPU) const { … }
void MCSubtargetInfo::initInstrItins(InstrItineraryData &InstrItins) const { … }
std::vector<SubtargetFeatureKV>
MCSubtargetInfo::getEnabledProcessorFeatures() const { … }
std::optional<unsigned> MCSubtargetInfo::getCacheSize(unsigned Level) const { … }
std::optional<unsigned>
MCSubtargetInfo::getCacheAssociativity(unsigned Level) const { … }
std::optional<unsigned>
MCSubtargetInfo::getCacheLineSize(unsigned Level) const { … }
unsigned MCSubtargetInfo::getPrefetchDistance() const { … }
unsigned MCSubtargetInfo::getMaxPrefetchIterationsAhead() const { … }
bool MCSubtargetInfo::enableWritePrefetching() const { … }
unsigned MCSubtargetInfo::getMinPrefetchStride(unsigned NumMemAccesses,
unsigned NumStridedMemAccesses,
unsigned NumPrefetches,
bool HasCall) const { … }
bool MCSubtargetInfo::shouldPrefetchAddressSpace(unsigned AS) const { … }