about summary refs log tree commit diff
path: root/src/libsyntax/errors
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-01-18 18:35:48 +0000
committerbors <bors@rust-lang.org>2016-01-18 18:35:48 +0000
commit08886499cf0f7fea5de2cc555ea7bfe9ceb0b40f (patch)
treeb3bc6d9d23aaccc33df6bd43c9d212739025ff2d /src/libsyntax/errors
parenta09a604d361b00015ee0eaf30b3d332667711f11 (diff)
parent6a7bc47a8f1bf4441ca55e42aa50db6dda28181f (diff)
downloadrust-08886499cf0f7fea5de2cc555ea7bfe9ceb0b40f.tar.gz
rust-08886499cf0f7fea5de2cc555ea7bfe9ceb0b40f.zip
Auto merge of #31000 - bluss:efficient-clone-from-slice, r=dotdash
Restore indexed formulation of clone_from_slice

For good codegen here, we need a lock step iteration where the loop
bound is only checked once per iteration; .zip() unfortunately does not
optimize this way.

If we use a counted loop, and make sure that llvm sees that the bounds
check condition is the same as the loop bound condition, the bounds
checks are optimized out. For this reason we need to slice `from`
(apparently) redundantly.

This commit restores the old formulation of clone_from_slice. In this
shape, clone_from_slice will again optimize into calling memcpy where possible
(for example for &[u8] or &[i32]).
Diffstat (limited to 'src/libsyntax/errors')
0 files changed, 0 insertions, 0 deletions