-
Notifications
You must be signed in to change notification settings - Fork 63
Open
Labels
DatasetsGraph and text datasetsGraph and text datasetsEnhancementNew feature or requestNew feature or request
Description
🚀 Feature
This feature request is to make it easy to construct ProGraML from subsets of LLVM-IRs by integrating with llvm-extract.
Motivation
For some use cases, we may want to construct a partial graph of a program. E.g. to construct the graph for a single function. This is easy to do using llvm-extract, but is not part of the ProGraML API. Lets say we have a program with two functions 'A' and 'B'. First compile the program down to LLVM-IR:
$ echo 'int A() { return 5; } int B() { return 10; }' | clang -xc - -emit-llvm -c -S -o ir.ll
Then use llvm-extract tool to pull out only the function you want. We can then use the normal ProGraML llvm2graph tool to generate the graph of just this function (and its transitive deps):
$ llvm-extract --func=A ir.ll -S | llvm2graph
Pitch
Add a set of arguments to the LLVM creation ops that automatically invoke llvm-extract to pull out the required program fragment. E.g.
G = programl.from_llvm_ir(my_program, function="A")Metadata
Metadata
Assignees
Labels
DatasetsGraph and text datasetsGraph and text datasetsEnhancementNew feature or requestNew feature or request