LLVM: llvm::mir2vec::MIRVocabulary Class Reference (original) (raw)

Class for storing and accessing the MIR2Vec vocabulary. More...

#include "[llvm/CodeGen/MIR2Vec.h](MIR2Vec%5F8h%5Fsource.html)"

Public Member Functions
LLVM_ABI_FOR_TEST unsigned getCanonicalIndexForBaseName (StringRef BaseName) const
Get indices from opcode or operand names.
LLVM_ABI_FOR_TEST unsigned getCanonicalIndexForOperandName (StringRef OperandName) const
LLVM_ABI_FOR_TEST unsigned getCanonicalIndexForRegisterClass (StringRef RegName, bool IsPhysical=true) const
LLVM_ABI std::string getStringKey (unsigned Pos) const
Get the string key for a vocabulary entry at the given position.
unsigned getDimension () const
unsigned getEntityIDForOpcode (unsigned Opcode) const
Get entity ID (flat index) for an opcode This is used for triplet generation.
unsigned getEntityIDForMachineOperand (const MachineOperand &MO) const
Get entity ID (flat index) for a machine operand This is used for triplet generation.
const Embedding & operator[] (unsigned Opcode) const
const Embedding & operator[] (MachineOperand Operand) const
const_iterator begin () const
const_iterator end () const
MIRVocabulary ()=delete
size_t getCanonicalSize () const
Total number of entries in the vocabulary.
Static Public Member Functions
static LLVM_ABI_FOR_TEST std::string extractBaseOpcodeName (StringRef InstrName)
Static method for extracting base opcode names (public for testing)
static LLVM_ABI_FOR_TEST Expected< MIRVocabulary > create (VocabMap &&OpcMap, VocabMap &&CommonOperandsMap, VocabMap &&PhyRegMap, VocabMap &&VirtRegMap, const TargetInstrInfo &TII, const TargetRegisterInfo &TRI, const MachineRegisterInfo &MRI)
Factory method to create MIRVocabulary from vocabulary map.
static LLVM_ABI Expected< MIRVocabulary > createDummyVocabForTest (const TargetInstrInfo &TII, const TargetRegisterInfo &TRI, const MachineRegisterInfo &MRI, unsigned Dim=1)
Create a dummy vocabulary for testing purposes.

Class for storing and accessing the MIR2Vec vocabulary.

The MIRVocabulary class manages seed embeddings for LLVM Machine IR

Definition at line 86 of file MIR2Vec.h.

const_iterator

llvm::mir2vec::MIRVocabulary::MIRVocabulary ( ) delete

begin()

const_iterator llvm::mir2vec::MIRVocabulary::begin ( ) const inline

create()

createDummyVocabForTest()

end()

const_iterator llvm::mir2vec::MIRVocabulary::end ( ) const inline

extractBaseOpcodeName()

std::string MIRVocabulary::extractBaseOpcodeName ( StringRef InstrName) static

getCanonicalIndexForBaseName()

Get indices from opcode or operand names.

These are public for testing. String based lookups are inefficient and should be avoided in general.

Definition at line 144 of file MIR2Vec.cpp.

References assert(), and llvm::StringRef::str().

getCanonicalIndexForOperandName()

unsigned MIRVocabulary::getCanonicalIndexForOperandName ( StringRef OperandName ) const

getCanonicalIndexForRegisterClass()

unsigned MIRVocabulary::getCanonicalIndexForRegisterClass ( StringRef RegName,
bool IsPhysical = true ) const

getCanonicalSize()

size_t llvm::mir2vec::MIRVocabulary::getCanonicalSize ( ) const inline

Total number of entries in the vocabulary.

Definition at line 281 of file MIR2Vec.h.

getDimension()

unsigned llvm::mir2vec::MIRVocabulary::getDimension ( ) const inline

getEntityIDForMachineOperand()

getEntityIDForOpcode()

unsigned llvm::mir2vec::MIRVocabulary::getEntityIDForOpcode ( unsigned Opcode) const inline

Get entity ID (flat index) for an opcode This is used for triplet generation.

Definition at line 234 of file MIR2Vec.h.

getStringKey()

std::string MIRVocabulary::getStringKey ( unsigned Pos ) const

Get the string key for a vocabulary entry at the given position.

Definition at line 179 of file MIR2Vec.cpp.

References assert().

operator[]() [1/2]

operator[]() [2/2]

llvm::MIR2VecVocabLegacyAnalysis

CommonOperandBase

size_t llvm::mir2vec::MIRVocabulary::CommonOperandBase = 0

OpcodeBase

size_t llvm::mir2vec::MIRVocabulary::OpcodeBase = 0

PhyRegBase

size_t llvm::mir2vec::MIRVocabulary::PhyRegBase = 0

TotalEntries

size_t llvm::mir2vec::MIRVocabulary::TotalEntries = 0

VirtRegBase

size_t llvm::mir2vec::MIRVocabulary::VirtRegBase = 0


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