GCC 12 Enables Auto-Vectorization For -O2 Optimization Level
A month ago was talk of GCC developers enabling the vectorizer at the common "-O2" optimization level and now that change has landed into the GCC 12 development code-base.
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.
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.
19 Comments