imageworks/OpenShadingLanguage — pull request #295 by lgritz (2013-11-14 18:54:00+00:00)
Title: Major refactor of runtime optimization and code generation in oslexec.

Previously, the monstrous RuntimeOptimizer class handled all the runtime
optimization as well as LLVM IR generation and JIT. It was unmanageably
huge, and did not afford easy ways to test other "back ends" (for example,
JITing for alternate hardware platforms.

This patch splits up the class into modular pieces:

* RuntimeOptimizer is strictly about the runtime oso -> oso code
transformations. It doesn't know or care about LLVM.

* BackendLLVM takes oso and generates LLVM IR and JITs it.

* OSOProcessorBase provides an abstraction layer for the caller and
serves as a base class for the other two that factors out
commonalities that will be needed for any similar oso-walking
code-generating process. Alternate back ends (for example, PTX, GLSL,
etc.) will presumably just be additional subclasses.

In the process, lots of code has shuffled from file to file, methods
have moved from one class to another, and some things have been renamed.
This is going to make the diffs very hard to follow, it will look like a
complete rewrite of these classes. But actually, the code and
algorithms have not really changed.

This is just a first step toward making liboslexec support multiple back
ends. Much more coming, but this is preliminary work as I perform some
other experiments.