Commits

Andrew Trick committed 720fc094029
ArrayOpts: handle local variable arrays, not just inout args. This improves RC4 at -Ofast by ~2.7x. It also makes microbenchmarks more robust. Without this, we were seeing dramatic performance artifacts due to inlining differences. For example, if you remove the @inline attribute from Quicksort, this will give us a 10x speedup. Here are the >5% differences: | benchmark | base -O3 | opt -O3 | delta | speedup | | RC4 | 746.00 | 686.00 | 60.00 | 8.7% | | Histogram | 1147.00 | 1086.00 | 61.00 | 5.6% | | StringWalk | 1334.00 | 1265.00 | 69.00 | 5.5% | | SmallPT | 1124.00 | 1069.00 | 55.00 | 5.1% | (I think the non-RC4 results might be bogus) | benchmark |base-Ofast|opt -Ofast| delta | speedup | | RC4 | 1094.00 | 405.00 | 689.00 | 170.1% | | EditDistance | 1727.00 | 1396.00 | 331.00 | 23.7% | | StringWalk | 1043.00 | 937.00 | 106.00 | 11.3% | | Dictionary | 930.00 | 1009.00 | 79.00 | -7.8% | | Phonebook | 2270.00 | 2131.00 | 139.00 | 6.5% | | StringBuilder | 1842.00 | 1723.00 | 119.00 | 6.9% | RC4 is definitely real. It's always between 2.5-3x faster. The others are very flaky. Swift SVN r20445