Harnessing partial vectorization in Open64 compiler
Ramshankar Ramanarayanan, Meghana Gupta, Soham Sundar Chakraborty, Dibyendu Kumar Das, Michael Lai · 2014
Two methods for partial vectorization are implemented in the state-of-the-art optimizing open-source Open64 compiler. The first method vectorizes isomorphic expression trees in a basic block using tree matching. Given that finding isomorphic trees in a basic block is fast, the compile time overhead for this approach is negligible. The second method computes the dependency DAG of the instructions in the basic block and deploys a variant of the dynamic programming approach to partial vectorization. Due to the cost in dynamic programming, this method is slower than the first. But results show that the second approach is effective in harnessing partial vectorization for complex DAGs. To improve benefits from partial vectorization, our experience demonstrates the need for careful tuning in the absence of accurate alias data. Unrolling loops also make partial vectorization more effective. Performance improvements range from 12% to 22% for the proposed approaches when generating SSE2/AVX code. Also this is the first reported instances of effective partial vectorization techniques implemented in a full-fledged open-source and robust commercial compiler.