This may seem odd, but I want to really encourage the list to help Larry Gritz with this issue. I've been following the development of his project (OpenShadingLanguage) for months now and he has a *very* good use case for LLVM. It may be tempting to just "send him to the docs", but if anyone here can help take their use of LLVM to the next level, I can tell you that many, many people will benefit. Larry is a careful, committed and experienced coder and all of this work is being done out in the open at http://code.google.com/p/openshadinglanguage/. Success on this project will push LLVM into an industry (Hollywood visual effects and 3D animation) where it really should be used. Now is the time to help. :-)<br />
<br />
Unlike a lot of the advanced LLVM work being done today which is research-oriented (which is awesome, BTW), this is production software, meant to be used (now) on production projects. If people on the list can help more than usual, I think this is definitely a worthy project.<br />
<br />
Best, Erich<br />
<br />
On Wed, Aug 11, 2010 at 11:55 PM, Larry Gritz (lg@larrygritz.com) wrote:<br />
> <br />
> I have a whole slew of questions about optimization passes.  Answers to any or all would be extremely helpful:<br />
>   <br />
> How important are doInitialization/doFinalization?  I can't detect any difference if I use them or not.  Why does the function pass manager have doInitialization/doFinalization, but the global pass manager doesn't?  If I am applying the function passes to many functions, do I doInitialization/run/doFinalization for each function I apply the passes to, or do I initialize/finalize just once?<br />
>   <br />
> Where is it documented which passes should be part of the global versus which should be function passes?  Some *appear* to work with either, some have errors if you use it wrong.  I haven't found a way to tell without trying, and no indications that I'm not using it wrong but in a way that's too subtle to crash or catch it.<br />
>   <br />
> Is the best protocol to do function passes first, then global?  After that, should you do function passes again for good measure, or is that redundant?  Does inlining go best in function or global?  Does the strategy change if I really only need to directly call a few functions in the module, the others existing only in case they are needed by the dynamically-generated code that I'm JITing?<br />
>   <br />
> It seems that the combinatorics of which passes to apply, and in which order (including doing some multiple times), are pretty daunting.  Other than the Kaleidescope tutorial (too simple) and the StandardPasses.h (too complex?) I can't find any other examples, much less pro/con discussion or guidance.  Does anybody have any pointers to web pages or other docs where people have shared their experiences walking through the space of possible pass combinations? <br />
>   <br />
> The application of all of this for me is to JIT dynamically-generated code, so in contrast to a fully offline compiler, I'm fairly sensitive to achieving a good balance of optimization of the JITed code versus time spent doing the optimizations.  In case that changes any of your answers.<br />
>   <br />
> Thanks, any info would be very appreciated!<br />
>   <br />
> -- <br />
> Larry Gritz <br />
> lg@larrygritz.com<br />
>   <br />
> _______________________________________________ <br />
> LLVM Developers mailing list <br />
> LLVMdev@cs.uiuc.edu         http://llvm.cs.uiuc.edu <br />
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev <br />
>