LLVM 22.0.0git
Namespaces | Macros | Functions | Variables
IR2Vec.cpp File Reference

This file implements the IR2Vec algorithm. More...

#include "llvm/Analysis/IR2Vec.h"
#include "llvm/ADT/DepthFirstIterator.h"
#include "llvm/ADT/Sequence.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/IR/CFG.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/PassManager.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/IR/Instruction.def"

Go to the source code of this file.

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
 
namespace  llvm::ir2vec
 
namespace  llvm::json
 

Macros

#define DEBUG_TYPE   "ir2vec"
 
#define HANDLE_INST(NUM, OPCODE, CLASS)
 

Functions

 STATISTIC (VocabMissCounter, "Number of lookups to entities not present in the vocabulary")
 
cl::OptionCategory llvm::ir2vec::IR2VecCategory ("IR2Vec Options")
 
cl::opt< float > llvm::ir2vec::OpcWeight ("ir2vec-opc-weight", cl::Optional, cl::init(1.0), cl::desc("Weight for opcode embeddings"), cl::cat(IR2VecCategory))
 
cl::opt< float > llvm::ir2vec::TypeWeight ("ir2vec-type-weight", cl::Optional, cl::init(0.5), cl::desc("Weight for type embeddings"), cl::cat(IR2VecCategory))
 
cl::opt< float > llvm::ir2vec::ArgWeight ("ir2vec-arg-weight", cl::Optional, cl::init(0.2), cl::desc("Weight for argument embeddings"), cl::cat(IR2VecCategory))
 
cl::opt< IR2VecKindllvm::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))
 
bool llvm::json::fromJSON (const llvm::json::Value &E, Embedding &Out, llvm::json::Path P)
 

Variables

static 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))
 

Detailed Description

This file implements the IR2Vec algorithm.

Definition in file IR2Vec.cpp.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "ir2vec"

Definition at line 32 of file IR2Vec.cpp.

◆ HANDLE_INST

#define HANDLE_INST (   NUM,
  OPCODE,
  CLASS 
)
Value:
if (Opcode == NUM) { \
return #OPCODE; \
}
#define OPCODE(NAME)

Function Documentation

◆ STATISTIC()

STATISTIC ( VocabMissCounter  ,
"Number of lookups to entities not present in the vocabulary"   
)