Vectorization past dependent branches through speculation

Majedul Haque Sujon, R. Clint Whaley, Qing Yi · 2013

Abstract—Modern architectures increasingly rely on SIMD vectorization to improve performance for floating point intensive scientific applications. However, existing compiler optimization techniques for automatic vectorization are inhibited by the pres-ence of unknown control flow surrounding partially vectorizable computations. In this paper, we present a new approach, spec-ulative vectorization, which speculates past dependent branches to aggressively vectorize computational paths that are expected to be taken frequently at runtime, while simply restarting the calculation using scalar instructions when the speculation fails. We have integrated our technique in an iterative optimizing compiler and have employed empirical tuning to select the profitable paths for speculation. When applied to optimize 9 floating-point benchmarks, our optimizing compiler has achieved up to 6.8X speedup for single precision and 3.4X for double precision kernels using AVX, while vectorizing some operations considered not vectorizable by prior techniques. Index Terms—SIMD Vectorization, speculation, compiler op-timization, iterative compilation, ATLAS, iFKO. I.

Read the paper · More papers on PaperTik