diff options
| author | bors <bors@rust-lang.org> | 2017-08-06 08:09:59 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-08-06 08:09:59 +0000 |
| commit | a9c24fd579cfa08852dca94214caae4b7e6b91c1 (patch) | |
| tree | 32126d8fc5afedad4033af072b1df6d5f0e3ae3b /src/libsyntax/parse | |
| parent | dd1df35f87beca7b1768b3e8fc3569dd8f9009e5 (diff) | |
| parent | 11d6312abd614fca3970902f137225e0437d0a09 (diff) | |
| download | rust-a9c24fd579cfa08852dca94214caae4b7e6b91c1.tar.gz rust-a9c24fd579cfa08852dca94214caae4b7e6b91c1.zip | |
Auto merge of #43488 - Florob:repeat-opt, r=arielb1
Optimize initialization of arrays using repeat expressions This PR was inspired by [this thread](https://www.reddit.com/r/rust/comments/6o8ok9/understanding_rust_performances_a_newbie_question/) on Reddit. It tries to bring array initialization in the same ballpark as `Vec::from_elem()` for unoptimized builds. For optimized builds this should relieve LLVM of having to figure out the construct we generate is in fact a `memset()`. To that end this emits `llvm.memset()` when: * the array is of integer type and all elements are zero (`Vec::from_elem()` also explicitly optimizes for this case) * the array elements are byte sized If the array is zero-sized initialization is omitted entirely.
Diffstat (limited to 'src/libsyntax/parse')
0 files changed, 0 insertions, 0 deletions
