[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 23:02:10 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>>;
----------------
nishant-sachdeva wrote:
This is a good idea. I had missed this.
Accepting this.
https://github.com/llvm/llvm-project/pull/170078
More information about the llvm-commits
mailing list