[llvm] Refactoring llvm-ir2vec.cpp for better separation of concerns in the Tooling classes (PR #170078)

Nishant Sachdeva via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 8 03:21:46 PST 2025


================
@@ -355,6 +431,19 @@ Error processModule(Module &M, raw_ostream &OS) {
 } // namespace ir2vec
 
 namespace mir2vec {
+/// Entity mappings: [entity_name]
+using EntityList = std::vector<std::string>;
+
+/// Machine basic block embeddings: [{mbb_ptr, Embedding}]
+using MBBVecList =
+    std::vector<std::pair<const MachineBasicBlock *, ir2vec::Embedding>>;
+
+/// Machine instruction embeddings: [{minstr_ptr, Embedding}]
+using MInstVecList =
+    std::vector<std::pair<const MachineInstr *, ir2vec::Embedding>>;
+
+/// Function embeddings: [Embedding]
+using FuncVecList = std::vector<ir2vec::Embedding>;
----------------
nishant-sachdeva wrote:

Accepted this. 

This is going to be useful with the upcoming Python bindings. Removing this for now

https://github.com/llvm/llvm-project/pull/170078


More information about the llvm-commits mailing list