LLVM: include/llvm/Analysis/IR2Vec.h File Reference (original) (raw)
This file defines the IR2Vec vocabulary analysis(IR2VecVocabAnalysis), the core ir2vec::Embedder interface for generating IR embeddings, and related utilities like the IR2VecPrinterPass. More...
#include "[llvm/ADT/DenseMap.h](DenseMap%5F8h%5Fsource.html)"#include "[llvm/IR/Instructions.h](Instructions%5F8h%5Fsource.html)"#include "[llvm/IR/PassManager.h](IR%5F2PassManager%5F8h%5Fsource.html)"#include "[llvm/IR/Type.h](IR%5F2Type%5F8h%5Fsource.html)"#include "[llvm/Support/CommandLine.h](CommandLine%5F8h%5Fsource.html)"#include "[llvm/Support/Compiler.h](Compiler%5F8h%5Fsource.html)"#include "[llvm/Support/ErrorOr.h](ErrorOr%5F8h%5Fsource.html)"#include "[llvm/Support/JSON.h](JSON%5F8h%5Fsource.html)"#include <array>#include <map>#include <optional>#include "llvm/IR/Instruction.def"
This file defines the IR2Vec vocabulary analysis(IR2VecVocabAnalysis), the core ir2vec::Embedder interface for generating IR embeddings, and related utilities like the IR2VecPrinterPass.
Program Embeddings are typically or derived-from a learned representation of the program. Such embeddings are used to represent the programs as input to machine learning algorithms. IR2Vec represents the LLVM IR as embeddings.
The IR2Vec algorithm is described in the following paper:
IR2Vec: LLVM IR Based Scalable Program Embeddings, S. VenkataKeerthy, Rohit Aggarwal, Shalini Jain, Maunendra Sankar Desarkar, Ramakrishna Upadrasta, and Y. N. Srikant, ACM Transactions on Architecture and Code Optimization (TACO), 2020. https://doi.org/10.1145/3418463. https://arxiv.org/abs/1909.06228
To obtain embeddings: First run IR2VecVocabAnalysis to populate the vocabulary. Then, use the Embedder interface to generate embeddings for the desired IR entities. See the documentation for more details - https://llvm.org/docs/MLGO.html#ir2vec-embeddings
Definition in file IR2Vec.h.