Using Numba to compile a Python algorithm into target assembly

Hi @thk123,

I maintain a tool called RBC that does something along the lines of what you described. It also ships with a partial implementation of the Numba Runtime written in LLVM IR.

AOT will be replaced by PIXIE

What is the motivation for some of the Numba runtime being generated through LLVM IR, rather than simply including them in nrt.cpp (e.g. NRT_MemInfo_data_fast)?

I guess it is because LLVM can inline this function.

Is there a way to get the full LLVM IR for a function and everything it calls (currently using the command line --dump-llvm and then splitting the output into each module).

Programatically, yes!

from numba import njit

@njit('int32(int32)')
def incr(a):
    return a + 1

print(incr.inspect_llvm(incr.signatures[0]))