GCC 9 Compiler Tuning Benchmarks At Various Optimization Levels, Vectorize Options
The vectorize options obviously don't help out universally, but we haven't seen any major regressions caused by adding them to -O2.
Obviously, the more optimizations the compiler has to deal with, the longer the build times. Fortunately, "-ftree-vectorize -ftree-slp-vectorize" don't slow down GCC a whole lot at the O2 optimization level.
Those wanting to dig through more benchmark results can find all of these tests and more via this OpenBenchmarking.org result file.
If looking at the geometric mean of all the compiler benchmarks carried out, adding -ftree-vectorize -ftree-slp-vectorize to -O2 increased the performance by just under 2%. Not bad for what will hopefully be a default change to benefit the common -O2 optimization level albeit may have to wait until next year's GCC 10 release. Also, we didn't encounter any tests where those vectorize options really hurt the performance.
If you enjoyed this article consider joining Phoronix Premium to view this site ad-free, multi-page articles on a single page, and other benefits. PayPal or Stripe tips are also graciously accepted. Thanks for your support.