[llvm] Adding IR2Vec as an analysis pass (PR #134004)
S. VenkataKeerthy via llvm-commits
llvm-commits at lists.llvm.org
Wed May 14 23:51:18 PDT 2025
================
@@ -0,0 +1,128 @@
+//===- IR2VecAnalysis.h - IR2Vec Analysis Implementation -------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
+// Exceptions. See the LICENSE file for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// This file contains the declaration of IR2VecAnalysis that computes
+/// IR2Vec Embeddings of the program.
+///
+/// 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
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_ANALYSIS_IR2VECANALYSIS_H
+#define LLVM_ANALYSIS_IR2VECANALYSIS_H
+
+#include "llvm/ADT/MapVector.h"
+#include "llvm/IR/PassManager.h"
+#include <map>
+
+namespace llvm {
+
+class Module;
+class BasicBlock;
+class Instruction;
+class Function;
+
+namespace ir2vec {
+using Embedding = std::vector<double>;
----------------
svkeerthy wrote:
Thanks for this catch. Changed `Embeddings` to `Embedder`; `Embedder` generates `Embeddings`.
https://github.com/llvm/llvm-project/pull/134004
More information about the llvm-commits
mailing list