Zack Rusin wrote:
> On Tuesday 15 May 2007 06:29:43 am Keith Whitwell wrote:
>> Of particular interest to us is the runtime code generator and shader
>> compiler.  We have been developing something we're calling the "Tungsten
>> Graphics Shader Infrastructure", which is intended to be a retargetable
>> compiler for GLSL and similar high level shading languages, anchored
>> around shared intermediate representations and a common optimization
>> framework.   I should be able to thow some documents up on the web soon
>>   to throw a bit of light on this.
> 
> Hmm, I really hate to mention this for the first time like this but I think 
> it's better if people know and Roberto and I will just announce it properly 
> later. 

Slight thread hijack, Jack...

> I have been toying around with writing a proper shading infrastructure for 
> Mesa for a while now. Finally I managed to convince Roberto to help me with 
> it and we started. Both of us work on it in the spare-time-of-a-spare-time 
> and I wanted to wait with announcing it until we have proper benchmarks and 
> one of the drivers done but here's the bottom line: we're bringing LLVM in 
> Mesa.
> 
> http://llvm.org 
> 
> So first of all why. 
> - Because we won't be able to write a compiler infrastructure that is even 
> close to it and we just won't get to a point where we can perform the same 
> optimizations that LLVM does right now. 
> - Because even if we'll decide to start taking code from LLVM and porting it 
> to our new framework we won't have resources to maintain the kind of 
> optimization passes that are needed by modern systems. 
> - Because we're graphics people (well, I'm more a super-model myself and 
> Roberto is a compiler genius, so I guess what I'm saying is "you") and it 
> would be nice if we could do graphics and leave compilers to the compiler 
> people. 
> - Because LLVM has a great IR and everything we'll pretty much need already.
> - Because it would make Mesa code a lot cleaner (graphics code and no 
> compiler 
> infrastructure in a graphics project sounds pretty sensible to me).
> - Because it trivially allows us to bind many more languages than just GLSL.
> - Because LLVM is simply amazing.

I looked at LLVM a while ago, but didn't pick up that they'd looked at 
vector architectures.  And, it seems according to this that there is a 
GLSL frontend already in place:

http://llvm.org/pubs/2007-03-12-BossaLLVMIntro.pdf

Is this the same frontend as you've been working on, or a second one??

[...]

> Now having said I have a git repo at:
> http://gitweb.freedesktop.org/?p=users/zack/mesa.git;a=shortlog;h=llvm
> but I haven't push a few of my local changes and I haven't pulled from 
> Roberto 
> for a while as well. Roberto is working on finishing up the AST->LLVM code, 
> we need arb_fragment/vertex_program->LLVM code, I need to finish the lowering 
> pass and also so far I just didn't have motivation to figure out how i965 
> instruction set works like, especially that I don't even have one, but once 
> those are ready we will be basically done. So we're getting there and the 
> question becomes whether Mesa/LLVM shading framework is the best possible 
> choice for Mesa - Roberto and I certainly think so and I'm sure LLVM guys 
> would agree. 

Sounds interesting.  I'll take a look.

As I said, these things can progress in parallel, and I don't think the 
Cell driver is gated on a decision here.  I'm happy to see what you guys 
can put together on the 965, and once things are stable/validated there, 
looks at pulling that across.

It would be preferable to reuse LLVM, and it looks like it should be 
possible given the other projects that are based off it.  This puts it 
well in advance of other JIT/codegen approaches I've looked at over the 
last couple of years.

I'm interested to see how it copes with the less-than-usual aspects of 
an actual GPU target.  But even if there are problems, being able to 
pull in the optimization framework to iterate between two IR's would be 
a good win.

Keith

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to