Source to Source Optimization

In April Olaf Krzikalla Gave a talk titled “Performing Source-to-Source Transformations with Clang” (Videos available here)

In that talk he showed an auto vectorizer that doesn’t perform the optimization in the assembly, but which instead spits out new source code that performs the optimized operations. Here is a picture from his talk:

A picture showing a source-to-source transformation. There is the source code for a simple loop operating on an array of floats on the left hand side, and the same loop using SIMD instructions on the right hand side.

And I want to explain why all compiler optimizations should do this.

Read the rest of this entry »