Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Execute LLVM IR code generated from Python code

Tags:

llvm-ir

numba

Does anyone know if I can execute LLVM IR which is generated from Python code?

Using numba, llvm-lite we can have LLVM IR, but I am not sure if it is executable using clang or not?

like image 954
user3126804 Avatar asked Apr 08 '26 14:04

user3126804


1 Answers

You can compile it with clang, just make sure your IR have .bc or .ll extensions.

But the proper way is to use llc or LLVM API to compile down to native code, and then link it using system linker or LLD.

On linking stage you'd probably need to link some "runtime" libraries, numba ones in this case.

like image 135
arrowd Avatar answered Apr 12 '26 12:04

arrowd