LLVM 22.0.0git
|
Class for storing and accessing the MIR2Vec vocabulary. More...
#include "llvm/CodeGen/MIR2Vec.h"
Public Types | |
using | const_iterator = ir2vec::VocabStorage::const_iterator |
Public Member Functions | |
unsigned | getCanonicalIndexForBaseName (StringRef BaseName) const |
Get canonical index for base name (public for testing) | |
std::string | getStringKey (unsigned Pos) const |
Get the string key for a vocabulary entry at the given position. | |
unsigned | getDimension () const |
const Embedding & | operator[] (unsigned Opcode) const |
const_iterator | begin () const |
const_iterator | end () const |
size_t | getCanonicalSize () const |
Total number of entries in the vocabulary. | |
MIRVocabulary ()=delete |
Static Public Member Functions | |
static std::string | extractBaseOpcodeName (StringRef InstrName) |
Static method for extracting base opcode names (public for testing) | |
static Expected< MIRVocabulary > | create (VocabMap &&Entries, const TargetInstrInfo &TII) |
Factory method to create MIRVocabulary from vocabulary map. |
Friends | |
class | llvm::MIR2VecVocabLegacyAnalysis |
Class for storing and accessing the MIR2Vec vocabulary.
The MIRVocabulary class manages seed embeddings for LLVM Machine IR
|
delete |
Referenced by create().
|
inline |
|
static |
Factory method to create MIRVocabulary from vocabulary map.
Definition at line 64 of file MIR2Vec.cpp.
References llvm::createStringError(), llvm::invalid_argument, and MIRVocabulary().
Referenced by llvm::MIR2VecVocabLegacyAnalysis::getMIR2VecVocabulary().
|
inline |
|
static |
Static method for extracting base opcode names (public for testing)
Definition at line 73 of file MIR2Vec.cpp.
References assert(), llvm::StringRef::back(), llvm::StringRef::drop_back(), llvm::StringRef::empty(), llvm::Regex::match(), llvm::SmallVectorTemplateCommon< T, typename >::size(), and llvm::StringRef::str().
Get canonical index for base name (public for testing)
Definition at line 103 of file MIR2Vec.cpp.
References assert(), and llvm::StringRef::str().
|
inline |
|
inline |
std::string MIRVocabulary::getStringKey | ( | unsigned | Pos | ) | const |
Get the string key for a vocabulary entry at the given position.
Definition at line 117 of file MIR2Vec.cpp.
References assert(), and llvm_unreachable.
|
friend |