about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorBjörn Steinbrink <bsteinbr@gmail.com>2017-01-07 11:06:28 -0700
committerMark Simulacrum <mark.simulacrum@gmail.com>2017-01-13 16:47:22 -0700
commit43cf5b92310be5abb35a872f52615ace28bbed32 (patch)
tree79aed854a0e072cb79455a5bf4ebe85daabd2283 /src/rustllvm/RustWrapper.cpp
parente3930463801cfcc4c98974d627e8bbe8c9880fa0 (diff)
downloadrust-43cf5b92310be5abb35a872f52615ace28bbed32.tar.gz
rust-43cf5b92310be5abb35a872f52615ace28bbed32.zip
Avoid using load/stores on first class aggregates
LLVM usually prefers using memcpys over direct loads/store of first
class aggregates. The check in type_is_immediate to mark certain small
structs was originally part of the code to handle such immediates in
function arguments, and it had a counterpart in load_ty/store_ty to
actually convert small aggregates to integers.

But since then, the ABI handling has been refactored and takes care of
converting small aggregates to integers. During that refactoring, the
code to handle small aggregates in load_ty/store_ty has been removed,
and so we accidentally started using loads/stores on FCA values.

Since type_is_immediate() is no longer responsible for ABI-related
conversions, and using a memcpy even for small aggregates is usually
better than performing a FCA load/store, we can remove that code part
and only handle simple types as immediates there.

This integrates PR #38906 onto this branch.

Fixes #38906.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions