The LLVM compiler infrastructure may be generating some speedier binaries by default for the -O3
optimization level by turning on the straight-line SLP vectorizer.
LLVM's Loop Vectorizer is used at various compiler optimization levels
but its newer SLP Vectorizer hasn't been turned on yet unless explicitly telling it to via a compiler flag (-fslp-vectorize
). This may change though with an Apple LLVM developer now proposing the SLP Vectorizer go on for the -O3
Back in May I ran benchmarks on the SLP Vectorizer
with its introduction in LLVM 3.3. The SLP Vectorizer is about vectorizing straight-line code over loops.
The discussion about enabling the SLP Vectorizer can be found on the mailing list
. It hasn't been decided for sure whether the SLP Vectorizer will be turned on, due to possible regressions in select workloads. However, ultimately I would anticipate the SLP Vectorizer to be turned on in due time for LLVM for delivering better performance. If it's turned on soon, it will be a feature of LLVM 3.4 that's due for release before year's end.