rust/compiler
bors ee86f96ba1 Auto merge of #85828 - scottmcm:raw-eq, r=oli-obk
Stop generating `alloca`s & `memcmp` for simple short array equality

Example:
```rust
pub fn demo(x: [u16; 6], y: [u16; 6]) -> bool { x == y }
```

Before:
```llvm
define zeroext i1 `@_ZN10playground4demo17h48537f7eac23948fE(i96` %0, i96 %1) unnamed_addr #0 {
start:
  %y = alloca [6 x i16], align 8
  %x = alloca [6 x i16], align 8
  %.0..sroa_cast = bitcast [6 x i16]* %x to i96*
  store i96 %0, i96* %.0..sroa_cast, align 8
  %.0..sroa_cast3 = bitcast [6 x i16]* %y to i96*
  store i96 %1, i96* %.0..sroa_cast3, align 8
  %_11.i.i.i = bitcast [6 x i16]* %x to i8*
  %_14.i.i.i = bitcast [6 x i16]* %y to i8*
  %bcmp.i.i.i = call i32 `@bcmp(i8*` nonnull dereferenceable(12) %_11.i.i.i, i8* nonnull dereferenceable(12) %_14.i.i.i, i64 12) #2, !alias.scope !2
  %2 = icmp eq i32 %bcmp.i.i.i, 0
  ret i1 %2
}
```
```x86
playground::demo: # `@playground::demo`
	sub	rsp, 32
	mov	qword ptr [rsp], rdi
	mov	dword ptr [rsp + 8], esi
	mov	qword ptr [rsp + 16], rdx
	mov	dword ptr [rsp + 24], ecx
	xor	rdi, rdx
	xor	esi, ecx
	or	rsi, rdi
	sete	al
	add	rsp, 32
	ret
```

After:
```llvm
define zeroext i1 `@_ZN4mini4demo17h7a8994aaa314c981E(i96` %0, i96 %1) unnamed_addr #0 {
start:
  %2 = icmp eq i96 %0, %1
  ret i1 %2
}
```
```x86
_ZN4mini4demo17h7a8994aaa314c981E:
	xor	rcx, r8
	xor	edx, r9d
	or	rdx, rcx
	sete	al
	ret
```
2021-07-09 09:16:27 +00:00
..
rustc
rustc_apfloat
rustc_arena
rustc_ast Rework SESSION_GLOBALS API to prevent overwriting it 2021-07-08 16:16:28 +02:00
rustc_ast_lowering
rustc_ast_passes
rustc_ast_pretty Rework SESSION_GLOBALS API to prevent overwriting it 2021-07-08 16:16:28 +02:00
rustc_attr
rustc_builtin_macros
rustc_codegen_cranelift Use cranelift's Type::int instead of doing the match myself 2021-07-08 14:55:58 -07:00
rustc_codegen_llvm Adjust the threshold to look at the ABI, not just the size 2021-07-08 14:55:59 -07:00
rustc_codegen_ssa Auto merge of #86105 - bjorn3:link_info_refactor, r=petrochenkov 2021-07-07 18:28:53 +00:00
rustc_data_structures
rustc_driver
rustc_error_codes Rollup merge of #86838 - lambinoo:I-69630-rust_const_unstable_check_const, r=oli-obk 2021-07-08 18:30:34 +02:00
rustc_errors Rework SESSION_GLOBALS API to prevent overwriting it 2021-07-08 16:16:28 +02:00
rustc_expand Rework SESSION_GLOBALS API to prevent overwriting it 2021-07-08 16:16:28 +02:00
rustc_feature
rustc_fs_util
rustc_graphviz
rustc_hir Rollup merge of #86726 - sexxi-goose:use-diagnostic-item-for-rfc2229-migration, r=nikomatsakis 2021-07-08 18:30:33 +02:00
rustc_hir_pretty
rustc_incremental Revert "Revert "Merge CrateDisambiguator into StableCrateId"" 2021-07-06 11:28:04 +02:00
rustc_index
rustc_infer
rustc_interface Rework SESSION_GLOBALS API to prevent overwriting it 2021-07-08 16:16:28 +02:00
rustc_lexer
rustc_lint Update to last upstream version 2021-07-08 17:14:28 +02:00
rustc_lint_defs rename rust_2021_token_prefixes to rust_2021_prefixes_incompatible_syntax 2021-07-06 20:13:36 +02:00
rustc_llvm
rustc_macros
rustc_metadata Revert "Revert "Merge CrateDisambiguator into StableCrateId"" 2021-07-06 11:28:04 +02:00
rustc_middle Auto merge of #86105 - bjorn3:link_info_refactor, r=petrochenkov 2021-07-07 18:28:53 +00:00
rustc_mir PR feedback 2021-07-08 14:55:57 -07:00
rustc_mir_build
rustc_parse Rollup merge of #86932 - rylev:fix-ice-86895, r=estebank 2021-07-08 10:44:34 +09:00
rustc_parse_format Rework SESSION_GLOBALS API to prevent overwriting it 2021-07-08 16:16:28 +02:00
rustc_passes Rollup merge of #86838 - lambinoo:I-69630-rust_const_unstable_check_const, r=oli-obk 2021-07-08 18:30:34 +02:00
rustc_plugin_impl
rustc_privacy
rustc_query_impl
rustc_query_system
rustc_resolve Auto merge of #86143 - bjorn3:revert_revert_merge_crate_disambiguator, r=michaelwoerister 2021-07-06 11:31:59 +00:00
rustc_save_analysis Revert "Revert "Merge CrateDisambiguator into StableCrateId"" 2021-07-06 11:28:04 +02:00
rustc_serialize
rustc_session Auto merge of #86572 - rylev:force-warnings-always, r=nikomatsakis 2021-07-06 16:50:33 +00:00
rustc_span Auto merge of #85828 - scottmcm:raw-eq, r=oli-obk 2021-07-09 09:16:27 +00:00
rustc_symbol_mangling Revert "Revert "Merge CrateDisambiguator into StableCrateId"" 2021-07-06 11:28:04 +02:00
rustc_target Replace per-target ABI denylist with an allowlist 2021-07-06 13:12:15 +03:00
rustc_trait_selection Rollup merge of #86726 - sexxi-goose:use-diagnostic-item-for-rfc2229-migration, r=nikomatsakis 2021-07-08 18:30:33 +02:00
rustc_traits
rustc_ty_utils Revert "Revert "Merge CrateDisambiguator into StableCrateId"" 2021-07-06 11:28:04 +02:00
rustc_type_ir
rustc_typeck Auto merge of #85828 - scottmcm:raw-eq, r=oli-obk 2021-07-09 09:16:27 +00:00