Show Your Support: This site is primarily supported by advertisements. Ads are what have allowed this site to be maintained on a daily basis for the past 18+ years. We do our best to ensure only clean, relevant ads are shown, when any nasty ads are detected, we work to remove them ASAP. If you would like to view the site without ads while still supporting our work, please consider our ad-free Phoronix Premium.
GCC 12 Enables Auto-Vectorization For -O2 Optimization Level
The change merged today is enabling the auto-vectorizer at the -O2 optimization level rather than only at -O3 and above. The auto-vectorizer is enabled by default with -O2 and using its "very cheap" cost model. The very cheap model enables vectorization if the scalar iteration count is a multiple of four, it is the "cheapest" of these cost models. Meanwhile the default cost model for vectorization at -O3 is "dynamic" for having more checks to try to determine if a vectorized code path will be faster.
This commit from Intel changes that default behavior for -O2 as of today's GNU Compiler Collection 12 development code. GCC 12 in turn will debut as stable around early Q2'22. This change should help with the performance at the common -O2 optimization level for some code-bases, GCC 11 vs. GCC 12 compiler benchmarks will begin in due course. GCC 12 will be moving to its stage three phase of development in November as feature work winds down.