[LLVMdev] Re: questions about LLVM

Dinakar Dhurjati dhurjati at uiuc.edu
Wed Nov 17 14:14:37 PST 2004


Hi Shuo,

I am CCing your questions to the LLVM developers list so others can 
reply or correct me.

>I have a few questions about LLVM:
>(1) The LLVM tutorial says LLVM can be used in architecture research. If 
>I want to run my program on an instruction set defined by myself, is LLVM 
>a right tool to do that? 
>
I don't think so.

>In this aspect, is LLVM similar to SimpleScalar 
>simulator?
>
I am not familiar with a SimpleScalar simulators, may be others will reply.

>(2) Can I compile large applications, such as Apache server, into LLVM 
>virtual instructions, then use LLVM intepreter to execute it?
>
Sure. I believe the website  http://safecode.cs.uiuc.edu runs on just in 
time (JIT) execution of apache webserver compiled to llvm virtual 
instructions. 

>(3) If my program calls libc functions, e.g., malloc(), are the 
>instructions of malloc transformed to LLVM virtual instructions and 
>intepreted during its execution?
>
In general most library calls get translated to the LLVM's call 
instructions and they will be executed natively using the native libary 
call when you use the interpreter or the JIT.  But if you can compile 
the library call in to LLVM instructions and link it in to your 
application then there is no reason why you shouldn't be able to 
interpret instructions of that call .

Dinakar




More information about the llvm-dev mailing list