LLVM 22.0.0git
|
Class for computing the Symbolic embeddings of IR2Vec. More...
#include "llvm/Analysis/IR2Vec.h"
Public Member Functions | |
SymbolicEmbedder (const Function &F, const Vocabulary &Vocab) | |
![]() | |
virtual | ~Embedder ()=default |
LLVM_ABI const InstEmbeddingsMap & | getInstVecMap () const |
Returns a map containing instructions and the corresponding embeddings for the function F if it has been computed. | |
LLVM_ABI const BBEmbeddingsMap & | getBBVecMap () const |
Returns a map containing basic block and the corresponding embeddings for the function F if it has been computed. | |
LLVM_ABI const Embedding & | getBBVector (const BasicBlock &BB) const |
Returns the embedding for a given basic block in the function F if it has been computed. | |
LLVM_ABI const Embedding & | getFunctionVector () const |
Computes and returns the embedding for the current function. | |
Additional Inherited Members | |
![]() | |
static LLVM_ABI std::unique_ptr< Embedder > | create (IR2VecKind Mode, const Function &F, const Vocabulary &Vocab) |
Factory method to create an Embedder object. | |
![]() | |
LLVM_ABI | Embedder (const Function &F, const Vocabulary &Vocab) |
void | computeEmbeddings () const |
Function to compute embeddings. | |
virtual void | computeEmbeddings (const BasicBlock &BB) const =0 |
Function to compute the embedding for a given basic block. | |
![]() | |
const Function & | F |
const Vocabulary & | Vocab |
const unsigned | Dimension |
Dimension of the vector representation; captured from the input vocabulary. | |
const float | OpcWeight |
Weights for different entities (like opcode, arguments, types) in the IR instructions to generate the vector representation. | |
const float | TypeWeight |
const float | ArgWeight |
Embedding | FuncVector |
BBEmbeddingsMap | BBVecMap |
InstEmbeddingsMap | InstVecMap |
Class for computing the Symbolic embeddings of IR2Vec.
Symbolic embeddings are constructed based on the entity-level representations obtained from the Vocabulary.
|
inline |