Review: LLVM optimization pass diddling (issue1696060)


larry...@...
 

Reviewers: ,

Description:
This rearrangement of LLVM optimization passes approximately doubles the
performance of the resulting code. Yes, I know it looks like all the
pieces of the engine are splayed across the floor of the garage. That's
because I'm still tinkering furiously, but I wanted to get such a big
speedup out there (and checkpoint what I have).

And no, I do not expect anybody to understand exactly why these
optimizations are good, or what the next step is. It's all trial and
error.

This comes along with some other minor changes: I track the number of
times each group is run and change 'optimized' from a bool to an int, in
anticipation of doing less optimization at first, then more when it's
clear that the shaders of a group are being used heavily. I also
suppress the voluminous output of LLVM IR unless the use_llvm > 1 (and
so promoted it to int).



Please review this at http://codereview.appspot.com/1696060/show

Affected files:
src/liboslexec/context.cpp
src/liboslexec/instance.cpp
src/liboslexec/llvm_instance.cpp
src/liboslexec/oslexec_pvt.h
src/liboslexec/runtimeoptimize.h
src/liboslexec/shadingsys.cpp