Commits

Andrew Trick committed 250bb973bbb
Add an array optimization pass that hoists make_mutable calls. This gives us a 10x speedup on -Ofast memset, which was the original goal. We're now within 2x of C, but the C code produces movdqu instead of movups for twice the throughput: <rdar://problem/17722727> Memset at -Ofast is 2x slower than C -O3 results: | benchmark | baserun0 | optrun0 | delta | speedup | | Memset | 39885.00 | 33978.00 | 5907.00 | 17.4% | | NBody | 459.00 | 440.00 | 19.00 | 4.3% | | QuickSort | 456.00 | 439.00 | 17.00 | 3.9% | | StringWalk | 625.00 | 647.00 | 22.00 | -3.4% | | SmallPT | 557.00 | 575.00 | 18.00 | -3.1% | | Phonebook | 1804.00 | 1862.00 | 58.00 | -3.1% | Memset, NBody, and Quicksort are the ones we expected to improve. We don't get much gain on O3 because retains/release and bounds checks are still there. <rdar://problem/17719220> QuickSort -O3 has retains/releases in the inner loop. Given the Ofast results, I think the small degradations at O3 are noise. -Ofast results: | benchmark | baserun0 | optrun0 | delta | speedup | | Memset | 5453.00 | 452.00 | 5001.00 | 1106.4% | | NBody | 772.00 | 437.00 | 335.00 | 76.7% | | Walsh | 1530.00 | 1096.00 | 434.00 | 39.6% | | QuickSort | 682.00 | 524.00 | 158.00 | 30.2% | | Phonebook | 1453.00 | 1561.00 | 108.00 | -6.9% | | Hash | 993.00 | 958.00 | 35.00 | 3.7% | | StringWalk | 458.00 | 446.00 | 12.00 | 2.7% | | StringBuilder | 1603.00 | 1568.00 | 35.00 | 2.2% | Swift SVN r20145