about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-01-13 11:11:34 +0000
committerbors <bors@rust-lang.org>2021-01-13 11:11:34 +0000
commit116d1a7056830ccf649f74f823de4333ed329392 (patch)
treeaf2be022f429fafc9be420f0c1c10aba57d406c5 /compiler/rustc_codegen_llvm/src
parent9f3998b4aa9d0eea3249fdd48b8b719185673d16 (diff)
parent1f1a3b48572961e8ab1ec00dd57c2d1e94c75348 (diff)
downloadrust-116d1a7056830ccf649f74f823de4333ed329392.tar.gz
rust-116d1a7056830ccf649f74f823de4333ed329392.zip
Auto merge of #80824 - cuviper:heap-clones, r=kennytm
Try to avoid locals when cloning into Box/Rc/Arc

For generic `T: Clone`, we can allocate an uninitialized box beforehand,
which gives the optimizer a chance to create the clone directly in the
heap. For `T: Copy`, we can go further and do a simple memory copy,
regardless of optimization level.

The same applies to `Rc`/`Arc::make_mut` when they must clone the data.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions