[llvm-dev] A "Cross-Platform Runtime Library API" in LLVM IR

David Chisnall via llvm-dev llvm-dev at lists.llvm.org
Mon May 23 01:11:13 PDT 2016


On 22 May 2016, at 20:32, Lorenzo Laneve via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> I know, that's the problem.
> We can assume all of the system calls as runtime functions: such as I/O, allocations etc. and create a set of function implemented for all the architectures.
> For example, let's think about the mem allocation again: we can provide a primitive function with the same name for all archs (e.g. __alloc() ) and then people can include this function __alloc() in their libraries, inlining it or even renaming it just to fit the frontend needs. And this can be useful: every backend should implement this set of functions ( __alloc(), __free(), __write()… just for example) so the frontends can build a library with these functions as they want.
> I don't know if you get me.

I think you will need to explain a bit more.  We already have such a function, it’s called malloc() and a few LLVM passes assume specific behaviour about it.  What problem are you trying to solve?

David



More information about the llvm-dev mailing list