imageworks/OpenShadingLanguage — pull request #250 by lgritz (2013-05-09 22:23:05+00:00)
Title: Runtime optimizations

* Add constant folding for normalize, sin, cos, asin, acos

* Augment constant folding for min/max to handle 'int' (it already did float and triple)

* I realized that constant arrays were generating LLVM IR that would allocate local storage and copy the values. Instead, avoid all of that and just reference the pointer to where we already had that constant data living.

For a particular strange shader we've been working on, this (plus the last checkin, with the constant array stuff) speeds things up by about a factor of 1000.