[LLVMdev] Newbie questions

Reid Spencer reid at x10sys.com
Wed Apr 26 08:04:54 PDT 2006


On Wed, 2006-04-26 at 09:01 -0500, Archie Cobbs wrote:

> Requoting myself:
> 
>  > 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?
> 
> -Archie

Archie,

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.

Reid.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20060426/79558b9c/attachment.sig>


More information about the llvm-dev mailing list