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 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) | |
Embedding | computeEmbeddings () const |
Function to compute embeddings. | |
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. |
|
inlineprotected |
|
protected |
Function to compute embeddings.
Definition at line 330 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 307 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 297 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 180 of file MIR2Vec.h.
References computeEmbeddings(), and MBB.
|
inline |
Computes and returns the embedding for the current machine function.
Definition at line 185 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 174 of file MIR2Vec.h.
References computeEmbeddings(), and MI.
Dimension of the embeddings; Captured from the vocabulary.
Definition at line 144 of file MIR2Vec.h.
Referenced by computeEmbeddings(), computeEmbeddings(), and MIREmbedder().
|
protected |
Definition at line 140 of file MIR2Vec.h.
Referenced by computeEmbeddings(), computeEmbeddings(), create(), llvm::mir2vec::SymbolicMIREmbedder::create(), MIREmbedder(), llvm::mir2vec::SymbolicMIREmbedder::SymbolicMIREmbedder(), and ~MIREmbedder().
|
protected |
Weight for opcode embeddings.
Definition at line 147 of file MIR2Vec.h.
Referenced by MIREmbedder().
|
protected |
Definition at line 141 of file MIR2Vec.h.
Referenced by create(), llvm::mir2vec::SymbolicMIREmbedder::create(), MIREmbedder(), llvm::mir2vec::SymbolicMIREmbedder::SymbolicMIREmbedder(), and ~MIREmbedder().