Introduction to Auto Vectorization
For the Intel® Compiler, vectorization is the unrolling of a loop combined with the generation of packed SIMD instructions. Because the packed instructions operate on more than one data element at a time, the loop can execute more efficiently. It is sometimes referred to as auto-vectorization to emphasize that the compiler automatically identifies and optimizes suitable loops on its own.
Intel® Advisor can assist with vectorization and show optimization report messages with your source code. See https://software.intel.com/content/www/us/en/develop/tools/advisor.html for details.
Vectorization may call library routines that can result in additional performance gain on Intel microprocessors than on non-Intel microprocessors. The vectorization can also be affected by certain options, such as m or x.
Vectorization is enabled with the compiler at optimization levels of O2 (default level) and higher for both Intel® Microprocessors and non-Intel® Microprocessors. Many loops are vectorized automatically, but in cases where this doesn't happen, you may be able to vectorize loops by making simple code modifications. In this tutorial, you will:
Establish a performance baseline
Generate a vectorization report
Improve performance by aligning data
Improve performance using Interprocedural Optimization
This tutorial is available in Linux*, macOS*, and Windows* versions.
Did you find the information on this page useful?
Characters remaining: