|
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 |
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. | |
Friends | |
| class | llvm::MIR2VecVocabLegacyAnalysis |
Class for storing and accessing the MIR2Vec vocabulary.
The MIRVocabulary class manages seed embeddings for LLVM Machine IR
|
delete |
References LLVM_ABI, and LLVM_ABI_FOR_TEST.
Referenced by create().
|
inline |
|
static |
Factory method to create MIRVocabulary from vocabulary map.
Definition at line 93 of file MIR2Vec.cpp.
References llvm::createStringError(), llvm::ir2vec::VocabStorage::getDimension(), llvm::invalid_argument, llvm::ir2vec::VocabStorage::isValid(), and MIRVocabulary().
Referenced by createDummyVocabForTest(), and llvm::MIR2VecVocabProvider::getVocabulary().
|
static |
Create a dummy vocabulary for testing purposes.
Definition at line 377 of file MIR2Vec.cpp.
References assert(), create(), and extractBaseOpcodeName().
|
inline |
|
static |
Static method for extracting base opcode names (public for testing)
Definition at line 114 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 144 of file MIR2Vec.cpp.
References assert(), and llvm::StringRef::str().
Definition at line 159 of file MIR2Vec.cpp.
References assert().
| unsigned MIRVocabulary::getCanonicalIndexForRegisterClass | ( | StringRef | RegName, |
| bool | IsPhysical = true ) const |
Definition at line 169 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 240 of file MIR2Vec.h.
References llvm::MachineOperand::getReg(), llvm::MachineOperand::getType(), and llvm::MachineOperand::MO_Register.
| 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().
|
inline |
Definition at line 252 of file MIR2Vec.h.
References llvm::MachineOperand::getReg(), llvm::MachineOperand::getType(), and llvm::MachineOperand::MO_Register.
|
friend |
| size_t llvm::mir2vec::MIRVocabulary::CommonOperandBase = 0 |