[LLVMdev] LLVM IR is a compiler IR

David A. Greene greened at obbligato.org
Wed Oct 5 15:10:36 PDT 2011


Joachim Durchholz <jo at durchholz.org> writes:

> Now that the dust begins to settle... I'm wondering whether LLVM is for me.
>
> I'm working on something that can be used to create software for 
> different environments: C/C++, JVM, CLR, Parrot, etc.
> I.e. one language for different environments, but not write once, run 
> anywhere.
>
> Now what would be the role of LLVM in such an infrastructure?
> Just backend for C/C++ linkage, and I should go and look elsewhere for 
> JVM/CLR/whateverVM?
> Should I look into LLVM subprojects? Which ones?

It depends on what you want to do with the IR.  If you want to create
object files, LLVM is great.  You just need to map the semantics of the
various HLLs onto the LLVM IR language, as with any translator.  For any
kind of code-generator-ish thing, it's hard to beat LLVM IR, IMHO.

If you want to JIT, then some of LLVM IR's limitations will impact the
speed of code generation, as Dan outlined.

If you want to do fancy transformations that use or analyze high-level
language semantics, LLVM IR may not be right for you, as most of that
information is lost by the time the code has been converted to LLVM IR.

                                  -Dave



More information about the llvm-dev mailing list