numba / llvmlite

A lightweight LLVM python binding for writing JIT compilers
https://llvmlite.pydata.org/
BSD 2-Clause "Simplified" License
1.94k stars 322 forks source link

Split the code dealing with IR and not touching native llvm into a separate package not depending on native llvm. #718

Open KOLANICH opened 3 years ago

KOLANICH commented 3 years ago

The llvmlite.ir module contains classes and utilities to build the LLVM intermediate representation (IR) of native functions.

The provided APIs may sometimes look like LLVM’s C++ APIs, but they never call into LLVM, unless otherwise noted. Instead, they construct a pure Python representation of the IR.

Sounds like it can be possible.

gmarkall commented 3 years ago

@KOLANICH Can you outline the use case / motivation for this request? It's certainly possible, but why should it be done?

KOLANICH commented 3 years ago

I guess to allow the 2 parts be updated and used separately. I wonder if the pure python part can be used as a library for manipulating LLVM IR and then dumping them to disk, to be consumed by other tools that can work with the IR.