LLVM 22.0.0git
Classes | Typedefs | Functions | Variables
llvm::ir2vec Namespace Reference

Classes

class  Embedder
 Embedder provides the interface to generate embeddings (vector representations) for instructions, basic blocks, and functions. More...
 
struct  Embedding
 Embedding is a datatype that wraps std::vector<double>. More...
 
class  FlowAwareEmbedder
 Class for computing the Flow-aware embeddings of IR2Vec. More...
 
class  SymbolicEmbedder
 Class for computing the Symbolic embeddings of IR2Vec. More...
 
class  Vocabulary
 Class for storing and accessing the IR2Vec vocabulary. More...
 

Typedefs

using InstEmbeddingsMap = DenseMap< const Instruction *, Embedding >
 
using BBEmbeddingsMap = DenseMap< const BasicBlock *, Embedding >
 

Functions

cl::OptionCategory IR2VecCategory ("IR2Vec Options")
 
cl::opt< float > OpcWeight ("ir2vec-opc-weight", cl::Optional, cl::init(1.0), cl::desc("Weight for opcode embeddings"), cl::cat(IR2VecCategory))
 
cl::opt< float > TypeWeight ("ir2vec-type-weight", cl::Optional, cl::init(0.5), cl::desc("Weight for type embeddings"), cl::cat(IR2VecCategory))
 
cl::opt< float > ArgWeight ("ir2vec-arg-weight", cl::Optional, cl::init(0.2), cl::desc("Weight for argument embeddings"), cl::cat(IR2VecCategory))
 
cl::opt< IR2VecKindIR2VecEmbeddingKind ("ir2vec-kind", cl::Optional, cl::values(clEnumValN(IR2VecKind::Symbolic, "symbolic", "Generate symbolic embeddings"), clEnumValN(IR2VecKind::FlowAware, "flow-aware", "Generate flow-aware embeddings")), cl::init(IR2VecKind::Symbolic), cl::desc("IR2Vec embedding kind"), cl::cat(IR2VecCategory))
 

Variables

llvm::cl::OptionCategory IR2VecCategory
 
LLVM_ABI cl::opt< float > OpcWeight
 
LLVM_ABI cl::opt< float > TypeWeight
 
LLVM_ABI cl::opt< float > ArgWeight
 
LLVM_ABI cl::opt< IR2VecKindIR2VecEmbeddingKind
 
static cl::opt< std::string > VocabFile ("ir2vec-vocab-path", cl::Optional, cl::desc("Path to the vocabulary file for IR2Vec"), cl::init(""), cl::cat(IR2VecCategory))
 

Typedef Documentation

◆ BBEmbeddingsMap

Definition at line 138 of file IR2Vec.h.

◆ InstEmbeddingsMap

Definition at line 137 of file IR2Vec.h.

Function Documentation

◆ ArgWeight()

cl::opt< float > llvm::ir2vec::ArgWeight ( "ir2vec-arg-weight"  ,
cl::Optional  ,
cl::init(0.2)  ,
cl::desc("Weight for argument embeddings")  ,
cl::cat(IR2VecCategory  
)

◆ IR2VecCategory()

cl::OptionCategory llvm::ir2vec::IR2VecCategory ( "IR2Vec Options"  )

◆ IR2VecEmbeddingKind()

cl::opt< IR2VecKind > llvm::ir2vec::IR2VecEmbeddingKind ( "ir2vec-kind"  ,
cl::Optional  ,
cl::values(clEnumValN(IR2VecKind::Symbolic, "symbolic", "Generate symbolic embeddings"), clEnumValN(IR2VecKind::FlowAware, "flow-aware", "Generate flow-aware embeddings"))  ,
cl::init(IR2VecKind::Symbolic ,
cl::desc("IR2Vec embedding kind")  ,
cl::cat(IR2VecCategory  
)

◆ OpcWeight()

cl::opt< float > llvm::ir2vec::OpcWeight ( "ir2vec-opc-weight"  ,
cl::Optional  ,
cl::init(1.0)  ,
cl::desc("Weight for opcode embeddings")  ,
cl::cat(IR2VecCategory  
)

◆ TypeWeight()

cl::opt< float > llvm::ir2vec::TypeWeight ( "ir2vec-type-weight"  ,
cl::Optional  ,
cl::init(0.5)  ,
cl::desc("Weight for type embeddings")  ,
cl::cat(IR2VecCategory  
)

Variable Documentation

◆ ArgWeight

cl::opt< float > llvm::ir2vec::ArgWeight("ir2vec-arg-weight", cl::Optional, cl::init(0.2), cl::desc("Weight for argument embeddings"), cl::cat(IR2VecCategory))

◆ IR2VecCategory

cl::OptionCategory llvm::ir2vec::IR2VecCategory("IR2Vec Options")

◆ IR2VecEmbeddingKind

cl::opt< IR2VecKind > llvm::ir2vec::IR2VecEmbeddingKind("ir2vec-kind", cl::Optional, cl::values(clEnumValN(IR2VecKind::Symbolic, "symbolic", "Generate symbolic embeddings"), clEnumValN(IR2VecKind::FlowAware, "flow-aware", "Generate flow-aware embeddings")), cl::init(IR2VecKind::Symbolic), cl::desc("IR2Vec embedding kind"), cl::cat(IR2VecCategory))

◆ OpcWeight

cl::opt< float > llvm::ir2vec::OpcWeight("ir2vec-opc-weight", cl::Optional, cl::init(1.0), cl::desc("Weight for opcode embeddings"), cl::cat(IR2VecCategory))

◆ TypeWeight

cl::opt< float > llvm::ir2vec::TypeWeight("ir2vec-type-weight", cl::Optional, cl::init(0.5), cl::desc("Weight for type embeddings"), cl::cat(IR2VecCategory))

◆ VocabFile

cl::opt< std::string > llvm::ir2vec::VocabFile("ir2vec-vocab-path", cl::Optional, cl::desc("Path to the vocabulary file for IR2Vec"), cl::init(""), cl::cat(IR2VecCategory)) ( "ir2vec-vocab-path"  ,
cl::Optional  ,
cl::desc("Path to the vocabulary file for IR2Vec")  ,
cl::init("")  ,
cl::cat(IR2VecCategory  
)
static