rust/src/librustc_trans
Björn Steinbrink 43cf5b9231 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.
2017-01-13 16:47:22 -07:00
..
back rustc: use -Xlinker when specifying an rpath with ',' in it 2017-01-03 11:40:48 -08:00
debuginfo rustc: store ty::Tables separately for each body (except closures'). 2017-01-06 22:23:29 +02:00
mir Simplify code since CEnum is always immediate now. 2017-01-10 19:42:37 -07:00
abi.rs Fix style nit 2017-01-04 11:38:10 -07:00
adt.rs Inline trans_switch to simplify code 2017-01-04 11:38:10 -07:00
asm.rs Add Builder::sess and Builder::tcx methods 2017-01-04 11:34:26 -07:00
assert_module_sources.rs Use Symbol instead of InternedString in the AST, HIR, and various other places. 2016-11-21 09:00:55 +00:00
attributes.rs Add new #[target_feature = "..."] attribute. 2016-11-29 20:32:14 -05:00
base.rs Inline and remove Builder::entry_block 2017-01-04 11:38:10 -07:00
builder.rs Inline and remove Builder::entry_block 2017-01-04 11:38:10 -07:00
cabi_aarch64.rs Move ty_align and ty_size out of most C ABI code 2016-09-24 18:27:39 -06:00
cabi_arm.rs Remove needless allows 2016-12-20 20:02:52 -07:00
cabi_asmjs.rs Use llvm::Attribute API instead of "raw value" APIs, which will be removed in LLVM 4.0. 2016-11-17 21:12:26 +01:00
cabi_mips64.rs Move ty_align and ty_size out of most C ABI code 2016-09-24 18:27:39 -06:00
cabi_mips.rs Move ty_align and ty_size out of most C ABI code 2016-09-24 18:27:39 -06:00
cabi_msp430.rs add cabi_msp430 2016-11-13 11:03:44 -05:00
cabi_nvptx64.rs PTX support 2016-12-26 21:06:23 -05:00
cabi_nvptx.rs PTX support 2016-12-26 21:06:23 -05:00
cabi_powerpc64.rs Move ty_align and ty_size out of most C ABI code 2016-09-24 18:27:39 -06:00
cabi_powerpc.rs Move ty_align and ty_size out of most C ABI code 2016-09-24 18:27:39 -06:00
cabi_s390x.rs Move ty_align and ty_size out of most C ABI code 2016-09-24 18:27:39 -06:00
cabi_sparc64.rs Add cabi_sparc64 2016-12-29 21:30:01 -05:00
cabi_sparc.rs implement cabi for 32-bit sparc 2016-12-19 12:23:37 -05:00
cabi_x86_64.rs Use llvm::Attribute API instead of "raw value" APIs, which will be removed in LLVM 4.0. 2016-11-17 21:12:26 +01:00
cabi_x86_win64.rs Windows x64 ABI requires i128 params to be passed as reference 2016-12-30 15:17:29 +01:00
cabi_x86.rs Cleaned up the code and added tests. 2016-12-22 14:54:42 +03:00
callee.rs Auto merge of #38822 - michaelwoerister:collect-fn-once-adapter, r=eddyb 2017-01-08 04:18:32 +00:00
Cargo.toml Such large. Very 128. Much bits. 2016-12-30 15:15:44 +01:00
cleanup.rs Builder.build_new_block -> Builder.build_sibling_block 2017-01-04 11:38:10 -07:00
collector.rs Auto merge of #38837 - eddyb:issue-38074, r=nikomatsakis 2017-01-08 15:51:49 +00:00
common.rs Avoid using load/stores on first class aggregates 2017-01-13 16:47:22 -07:00
consts.rs rustc: store ty::Tables separately for each body (except closures'). 2017-01-06 22:23:29 +02:00
context.rs rustc: keep track of tables everywhere as if they were per-body. 2017-01-06 22:23:29 +02:00
declare.rs Refactor ty::FnSig to privatize all fields 2016-12-05 22:22:49 -07:00
diagnostics.rs Small error code explanations improvements 2016-08-26 17:28:47 +02:00
disr.rs Such large. Very 128. Much bits. 2016-12-30 15:15:44 +01:00
glue.rs rustc: keep track of tables everywhere as if they were per-body. 2017-01-06 22:23:29 +02:00
intrinsic.rs Fix errors introduced during rebase 2017-01-04 11:47:43 -07:00
lib.rs Auto merge of #38679 - alexcrichton:always-deny-warnings, r=nrc 2017-01-08 08:22:06 +00:00
machine.rs Completely kill represent_type and the adt::Repr type that goes with it. 2016-09-24 18:21:10 -04:00
macros.rs rustc_trans: move the contents of the trans module to top-level. 2016-03-27 01:23:28 +02:00
meth.rs Inline and remove Builder::entry_block 2017-01-04 11:38:10 -07:00
monomorphize.rs rustc: simplify constant cross-crate loading and rustc_passes::consts. 2016-12-28 11:29:19 +02:00
partitioning.rs incr.comp.: Take symbol visibility into account for CGU hashes. 2016-12-09 17:47:56 -05:00
README.md Rename README.txt to README.md 2016-12-22 12:52:22 -06:00
symbol_map.rs Replace FnvHasher use with FxHasher. 2016-11-08 15:14:59 +11:00
symbol_names_test.rs revamp Visitor with a single method for controlling nested visits 2016-11-29 13:04:27 +01:00
trans_item.rs Such large. Very 128. Much bits. 2016-12-30 15:15:44 +01:00
tvec.rs Builder.build_new_block -> Builder.build_sibling_block 2017-01-04 11:38:10 -07:00
type_.rs Fix rebase fallout 2016-12-30 15:17:27 +01:00
type_of.rs Move param_env onto SharedCrateContext, and move functions which need the ParamEnv onto it. 2016-12-20 20:03:32 -07:00
value.rs Inline last remaining use of Callee::call and delete unused code 2016-12-20 20:03:31 -07:00