[LLVMdev] Newbie questions

Archie Cobbs archie at dellroad.org
Wed Apr 26 13:11:16 PDT 2006

Reid Spencer wrote:
>>  > I.e., my question is the more general one:
>>  > how do optimizations that are specific to the front-end language get
>>  > done? How does the front-end "secret knowledge" get passed through
>>  > somehow so it can be used for optimization purposes?
> The quick answer is that it doesn't. The front end is responsible for
> having its own AST (higher level representation) and running its own
> optimizations on that. From there you generate the LLVM intermediate
> representation (IR) and run on that whatever LLVM optimization passes
> are appropriate for your language and the level of optimization you want
> to get to. The "secret knowledge" is retained by the language's front
> end. However, your front end is in control of two things: what LLVM IR
> gets generated, and what passes get run on it. You can create your own
> LLVM passes to "clean up" things that you generate (assuming there's a
> pattern). 
> We have tossed around a few ideas about how to retain front-end
> information in the bytecode. The current Annotation/Annotable construct
> in 1.7 is scheduled for removal in 1.8. There are numerous problems with
> it. One option is to just leave it up to the front end. Another option
> is to allow a "blob" to be attached to the end of a bytecode file. 
> On another front, you might be interested in http://hlvm.org/ where a
> few interested LLVM developers are thinking about just these kinds of
> things and ways to bring high level support to the excellent low level
> framework that LLVM provides. Note: this effort has just begun, so don't
> expect to find much there for another few weeks.

Thanks for the answer.. I'm glad some folks are looking into this.
I'll check it out.


Archie Cobbs      *        CTO, Awarix        *      http://www.awarix.com

More information about the llvm-dev mailing list