This is a quick example of using Terra and IACA to do micro-optimization.
- llc on the path should be the same version as Terra's builtin llvm (3.5.0 in my case)
- iaca should also be on the path
- run
terra test.t
to compile the function and invoke iaca on the output
The math for the test function is derived from http://fabiensanglard.net/doom3_documentation/37726-293748.pdf, and also incorporates the scale, translation, and transform origin vectors typical of traditional animation. Disclaimer: the code was translated from C++ and may be completely wrong due to translation errors.