JuliaLang/julia — pull request #6928 by simonster (2014-05-23 00:27:50+00:00)
Title: Use atsign-simd for sum

Thanks to @ArchRobison's work in #6926, this version of `sum_seq` gets auto-vectorized and partially unrolled, but @lindahua's code beats LLVM on my system (a Core i7-3930K with AVX). With master, I see:

```julia
julia> a = randn(1000000000);

julia> @time sum(a)
elapsed time: 0.527515614 seconds (64 bytes allocated)
```

With this PR, I see:

```
julia> @time sum(a)
elapsed time: 0.660926643 seconds (64 bytes allocated)
```

I would expect `@simd` to be at least slightly faster, but instead, it is slightly slower. I tried adjusting `PAIRWISE_SUM_BLOCKSIZE` but it makes no difference in performance; @lindahua's code is faster even for naive summation. What gives?