[llvm] Refactoring llvm-ir2vec.cpp for better separation of concerns in the Tooling classes (PR #170078)
S. VenkataKeerthy via llvm-commits
llvm-commits at lists.llvm.org
Sun Dec 7 22:15:38 PST 2025
================
@@ -151,7 +152,30 @@ static cl::opt<EmbeddingLevel>
cl::init(FunctionLevel), cl::sub(EmbeddingsSubCmd),
cl::cat(CommonCategory));
+struct Triplet {
+ unsigned Head;
+ unsigned Tail;
+ unsigned Relation;
+};
+
+struct TripletResult {
+ unsigned MaxRelation;
+ std::vector<Triplet> Triplets;
+};
+
namespace ir2vec {
+/// Entity mappings: [entity_name]
+using EntityList = std::vector<std::string>;
+
+/// Basic block embeddings: [{bb_ptr, Embedding}]
+using BBVecList = std::vector<std::pair<const BasicBlock *, ir2vec::Embedding>>;
+
+/// Instruction embeddings: [{instruction_ptr, Embedding}]
+using InstVecList =
+ std::vector<std::pair<const Instruction *, ir2vec::Embedding>>;
+
+/// Function embeddings: [Embedding]
+using FuncVecList = std::vector<ir2vec::Embedding>;
----------------
svkeerthy wrote:
Is this used?
https://github.com/llvm/llvm-project/pull/170078
More information about the llvm-commits
mailing list