|
LLVM 22.0.0git
|
Base class for MIR embedders. More...
#include "llvm/CodeGen/MIR2Vec.h"
Public Member Functions | |
| virtual | ~MIREmbedder ()=default |
| Embedding | getMInstVector (const MachineInstr &MI) const |
| Computes and returns the embedding for a given machine instruction MI in the machine function MF. | |
| Embedding | getMBBVector (const MachineBasicBlock &MBB) const |
| Computes and returns the embedding for a given machine basic block in the machine function MF. | |
| Embedding | getMFunctionVector () const |
| Computes and returns the embedding for the current machine function. | |
Static Public Member Functions | |
| static LLVM_ABI std::unique_ptr< MIREmbedder > | create (MIR2VecKind Mode, const MachineFunction &MF, const MIRVocabulary &Vocab) |
| Factory method to create an Embedder object of the specified kind Returns nullptr if the requested kind is not supported. | |
Protected Member Functions | |
| MIREmbedder (const MachineFunction &MF, const MIRVocabulary &Vocab) | |
| LLVM_ABI Embedding | computeEmbeddings () const |
| Function to compute embeddings. | |
| LLVM_ABI Embedding | computeEmbeddings (const MachineBasicBlock &MBB) const |
| Function to compute the embedding for a given machine basic block. | |
| virtual Embedding | computeEmbeddings (const MachineInstr &MI) const =0 |
| Function to compute the embedding for a given machine instruction. | |
Protected Attributes | |
| const MachineFunction & | MF |
| const MIRVocabulary & | Vocab |
| const unsigned | Dimension |
| Dimension of the embeddings; Captured from the vocabulary. | |
| const float | OpcWeight |
| Weight for opcode embeddings. | |
| const float | CommonOperandWeight |
| const float | RegOperandWeight |
|
inlineprotected |
Definition at line 302 of file MIR2Vec.h.
References CommonOperandWeight, Dimension, MF, OpcWeight, RegOperandWeight, and Vocab.
Referenced by llvm::mir2vec::SymbolicMIREmbedder::SymbolicMIREmbedder().
|
virtualdefault |
|
protected |
Function to compute embeddings.
Definition at line 549 of file MIR2Vec.cpp.
References computeEmbeddings(), llvm::depth_first(), Dimension, MBB, and MF.
Referenced by computeEmbeddings(), computeEmbeddings(), getMBBVector(), getMFunctionVector(), and getMInstVector().
|
protected |
Function to compute the embedding for a given machine basic block.
Definition at line 526 of file MIR2Vec.cpp.
References computeEmbeddings(), Dimension, MBB, MF, MI, and TII.
|
protectedpure virtual |
|
static |
Factory method to create an Embedder object of the specified kind Returns nullptr if the requested kind is not supported.
Definition at line 516 of file MIR2Vec.cpp.
References MF, llvm::Symbolic, and Vocab.
Referenced by llvm::MIR2VecPrinterLegacyPass::runOnMachineFunction().
|
inline |
Computes and returns the embedding for a given machine basic block in the machine function MF.
Definition at line 335 of file MIR2Vec.h.
References computeEmbeddings(), and MBB.
|
inline |
Computes and returns the embedding for the current machine function.
Definition at line 340 of file MIR2Vec.h.
References computeEmbeddings().
|
inline |
Computes and returns the embedding for a given machine instruction MI in the machine function MF.
Definition at line 329 of file MIR2Vec.h.
References computeEmbeddings(), and MI.
Definition at line 300 of file MIR2Vec.h.
Referenced by MIREmbedder().
Dimension of the embeddings; Captured from the vocabulary.
Definition at line 297 of file MIR2Vec.h.
Referenced by computeEmbeddings(), computeEmbeddings(), and MIREmbedder().
|
protected |
Definition at line 293 of file MIR2Vec.h.
Referenced by computeEmbeddings(), computeEmbeddings(), create(), llvm::mir2vec::SymbolicMIREmbedder::create(), MIREmbedder(), llvm::mir2vec::SymbolicMIREmbedder::SymbolicMIREmbedder(), and ~MIREmbedder().
Weight for opcode embeddings.
Definition at line 300 of file MIR2Vec.h.
Referenced by MIREmbedder().
Definition at line 300 of file MIR2Vec.h.
Referenced by MIREmbedder().
|
protected |
Definition at line 294 of file MIR2Vec.h.
Referenced by create(), llvm::mir2vec::SymbolicMIREmbedder::create(), MIREmbedder(), llvm::mir2vec::SymbolicMIREmbedder::SymbolicMIREmbedder(), and ~MIREmbedder().