LLVM  4.0.0
Public Member Functions | Protected Member Functions | List of all members
llvm::MCSubtargetInfo Class Reference

MCSubtargetInfo - Generic base class for all target subtargets. More...

#include <MCSubtargetInfo.h>

Inheritance diagram for llvm::MCSubtargetInfo:
[legend]

Public Member Functions

 MCSubtargetInfo (const MCSubtargetInfo &)=default
 
 MCSubtargetInfo (const Triple &TT, StringRef CPU, StringRef FS, ArrayRef< SubtargetFeatureKV > PF, ArrayRef< SubtargetFeatureKV > PD, const SubtargetInfoKV *ProcSched, const MCWriteProcResEntry *WPR, const MCWriteLatencyEntry *WL, const MCReadAdvanceEntry *RA, const InstrStage *IS, const unsigned *OC, const unsigned *FP)
 
const TriplegetTargetTriple () const
 getTargetTriple - Return the target triple string. More...
 
StringRef getCPU () const
 getCPU - Return the CPU string. More...
 
const FeatureBitsetgetFeatureBits () const
 getFeatureBits - Return the feature bits. More...
 
void setFeatureBits (const FeatureBitset &FeatureBits_)
 setFeatureBits - Set the feature bits. More...
 
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)
 ToggleFeature - Toggle a feature and returns the re-computed feature bits. More...
 
FeatureBitset ToggleFeature (const FeatureBitset &FB)
 ToggleFeature - Toggle a feature and returns the re-computed feature bits. More...
 
FeatureBitset ToggleFeature (StringRef FS)
 ToggleFeature - Toggle a set of features and returns 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...
 
const MCSchedModelgetSchedModelForCPU (StringRef CPU) const
 getSchedModelForCPU - Get the machine model of a CPU. More...
 
const MCSchedModelgetSchedModel () const
 Get the machine model for this subtarget's CPU. More...
 
const MCWriteProcResEntrygetWriteProcResBegin (const MCSchedClassDesc *SC) const
 Return an iterator at the first process resource consumed by the given scheduling class. More...
 
const MCWriteProcResEntrygetWriteProcResEnd (const MCSchedClassDesc *SC) const
 
const MCWriteLatencyEntrygetWriteLatencyEntry (const MCSchedClassDesc *SC, unsigned DefIdx) const
 
int getReadAdvanceCycles (const MCSchedClassDesc *SC, unsigned UseIdx, unsigned WriteResID) const
 
InstrItineraryData getInstrItineraryForCPU (StringRef CPU) const
 getInstrItineraryForCPU - Get scheduling itinerary of a CPU. More...
 
void initInstrItins (InstrItineraryData &InstrItins) const
 Initialize an InstrItineraryData instance. More...
 
bool isCPUStringValid (StringRef CPU) const
 Check whether the CPU string is valid. More...
 

Protected Member Functions

void InitMCProcessorInfo (StringRef CPU, StringRef FS)
 Initialize the scheduling model and feature bits. More...
 

Detailed Description

MCSubtargetInfo - Generic base class for all target subtargets.

Definition at line 30 of file MCSubtargetInfo.h.

Constructor & Destructor Documentation

llvm::MCSubtargetInfo::MCSubtargetInfo ( const MCSubtargetInfo )
default
MCSubtargetInfo::MCSubtargetInfo ( const Triple TT,
StringRef  CPU,
StringRef  FS,
ArrayRef< SubtargetFeatureKV PF,
ArrayRef< SubtargetFeatureKV PD,
const SubtargetInfoKV ProcSched,
const MCWriteProcResEntry WPR,
const MCWriteLatencyEntry WL,
const MCReadAdvanceEntry RA,
const InstrStage IS,
const unsigned OC,
const unsigned FP 
)

Definition at line 39 of file MCSubtargetInfo.cpp.

References InitMCProcessorInfo().

Member Function Documentation

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 70 of file MCSubtargetInfo.cpp.

References llvm::SubtargetFeatures::ApplyFeatureFlag().

StringRef llvm::MCSubtargetInfo::getCPU ( ) const
inline

getCPU - Return the CPU string.

Definition at line 66 of file MCSubtargetInfo.h.

Referenced by llvm::HexagonShuffler::HexagonShuffler().

const FeatureBitset& llvm::MCSubtargetInfo::getFeatureBits ( ) const
inline
InstrItineraryData MCSubtargetInfo::getInstrItineraryForCPU ( StringRef  CPU) const

getInstrItineraryForCPU - Get scheduling itinerary of a CPU.

Definition at line 101 of file MCSubtargetInfo.cpp.

References getSchedModelForCPU().

Referenced by getItineraryLatency().

int llvm::MCSubtargetInfo::getReadAdvanceCycles ( const MCSchedClassDesc SC,
unsigned  UseIdx,
unsigned  WriteResID 
) const
inline
const MCSchedModel& llvm::MCSubtargetInfo::getSchedModel ( ) const
inline
const MCSchedModel & MCSubtargetInfo::getSchedModelForCPU ( StringRef  CPU) const

getSchedModelForCPU - Get the machine model of a CPU.

Definition at line 75 of file MCSubtargetInfo.cpp.

References assert(), llvm::errs(), llvm::MCSchedModel::GetDefaultSchedModel(), llvm::SubtargetInfoKV::Key, and fuzzer::strcmp.

Referenced by getInstrItineraryForCPU(), and InitMCProcessorInfo().

const Triple& llvm::MCSubtargetInfo::getTargetTriple ( ) const
inline
const MCWriteLatencyEntry* llvm::MCSubtargetInfo::getWriteLatencyEntry ( const MCSchedClassDesc SC,
unsigned  DefIdx 
) const
inline
const MCWriteProcResEntry* llvm::MCSubtargetInfo::getWriteProcResBegin ( const MCSchedClassDesc SC) const
inline

Return an iterator at the first process resource consumed by the given scheduling class.

Definition at line 119 of file MCSubtargetInfo.h.

References llvm::MCSchedClassDesc::WriteProcResIdx.

Referenced by llvm::TargetSchedModel::computeOutputLatency(), llvm::TargetSchedModel::getWriteProcResBegin(), and getWriteProcResEnd().

const MCWriteProcResEntry* llvm::MCSubtargetInfo::getWriteProcResEnd ( const MCSchedClassDesc SC) const
inline
void MCSubtargetInfo::initInstrItins ( InstrItineraryData InstrItins) const

Initialize an InstrItineraryData instance.

Definition at line 107 of file MCSubtargetInfo.cpp.

References getSchedModel().

Referenced by llvm::TargetSchedModel::init().

void MCSubtargetInfo::InitMCProcessorInfo ( StringRef  CPU,
StringRef  FS 
)
protected

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 27 of file MCSubtargetInfo.cpp.

References llvm::StringRef::empty(), llvm::MCSchedModel::GetDefaultSchedModel(), getFeatures(), and getSchedModelForCPU().

Referenced by MCSubtargetInfo().

bool llvm::MCSubtargetInfo::isCPUStringValid ( StringRef  CPU) const
inline

Check whether the CPU string is valid.

Definition at line 163 of file MCSubtargetInfo.h.

void MCSubtargetInfo::setDefaultFeatures ( StringRef  CPU,
StringRef  FS 
)

Set the features to the default for the given CPU with an appended feature string.

Definition at line 35 of file MCSubtargetInfo.cpp.

References getFeatures().

void llvm::MCSubtargetInfo::setFeatureBits ( const FeatureBitset FeatureBits_)
inline

setFeatureBits - Set the feature bits.

Definition at line 78 of file MCSubtargetInfo.h.

FeatureBitset MCSubtargetInfo::ToggleFeature ( uint64_t  FB)

ToggleFeature - Toggle a feature and returns the re-computed feature bits.

This version does not change the implied bits.

Definition at line 53 of file MCSubtargetInfo.cpp.

FeatureBitset MCSubtargetInfo::ToggleFeature ( const FeatureBitset FB)

ToggleFeature - Toggle a feature and returns the re-computed feature bits.

This version does not change the implied bits.

Definition at line 58 of file MCSubtargetInfo.cpp.

FeatureBitset MCSubtargetInfo::ToggleFeature ( StringRef  FS)

ToggleFeature - Toggle a set of features and returns the re-computed feature bits.

ToggleFeature - Toggle a feature and returns the re-computed feature bits.

This version will also change all implied bits.

Definition at line 65 of file MCSubtargetInfo.cpp.

References llvm::SubtargetFeatures::ToggleFeature().


The documentation for this class was generated from the following files: