|
LLVM 24.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 |
Static Public Member Functions | |
| static LLVM_ABI std::string | extractBaseOpcodeName (StringRef InstrName) |
| Static method for extracting base opcode names (public for testing) | |
| static LLVM_ABI Expected< MIRVocabulary > | create (VocabMap &&OpcMap, VocabMap &&CommonOperandsMap, VocabMap &&PhyRegMap, VocabMap &&VirtRegMap, const TargetInstrInfo &TII, const TargetRegisterInfo &TRI) |
| Factory method to create MIRVocabulary from vocabulary map. | |
| static LLVM_ABI Expected< MIRVocabulary > | createDummyVocabForTest (const TargetInstrInfo &TII, const TargetRegisterInfo &TRI, unsigned Dim=1) |
| Create a dummy vocabulary for testing purposes. | |
Friends | |
| class | llvm::MIR2VecVocabLegacyAnalysis |
Class for storing and accessing the MIR2Vec vocabulary.
The MIRVocabulary class manages seed embeddings for LLVM Machine IR
|
inline |
|
static |
Factory method to create MIRVocabulary from vocabulary map.
Definition at line 101 of file MIR2Vec.cpp.
References llvm::createStringError(), llvm::ir2vec::VocabStorage::getDimension(), llvm::invalid_argument, llvm::ir2vec::VocabStorage::isValid(), and MIRVocabulary().
Referenced by buildVocabulary(), and createDummyVocabForTest().
|
static |
Create a dummy vocabulary for testing purposes.
Definition at line 418 of file MIR2Vec.cpp.
References assert(), create(), and extractBaseOpcodeName().
|
inline |
|
static |
Static method for extracting base opcode names (public for testing)
Definition at line 123 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().
Referenced by createDummyVocabForTest().
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 153 of file MIR2Vec.cpp.
References assert(), and llvm::StringRef::str().
Definition at line 168 of file MIR2Vec.cpp.
References assert(), and llvm::find_if().
| unsigned MIRVocabulary::getCanonicalIndexForRegisterClass | ( | StringRef | RegName, |
| bool | IsPhysical = true ) const |
Definition at line 179 of file MIR2Vec.cpp.
|
inline |
|
inline |
|
inline |
Get entity ID (flat index) for a machine operand This is used for triplet generation.
Definition at line 271 of file MIR2Vec.h.
References llvm::MachineOperand::getReg(), llvm::MachineOperand::getType(), llvm::MachineOperand::MO_Register, and MRI.
|
inline |
Definition at line 284 of file MIR2Vec.h.
References llvm::MachineOperand::getReg(), llvm::MachineOperand::getType(), llvm::MachineOperand::MO_Register, and MRI.
| std::string MIRVocabulary::getStringKey | ( | unsigned | Pos | ) | const |
Get the string key for a vocabulary entry at the given position.
Definition at line 189 of file MIR2Vec.cpp.
|
friend |
| size_t llvm::mir2vec::MIRVocabulary::CommonOperandBase = 0 |