rust/compiler/rustc_span/src
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
..
analyze_source_file remove redundant closures (clippy::redundant_closure) 2021-01-03 13:34:24 +01:00
lev_distance Rework SESSION_GLOBALS API to prevent overwriting it 2021-07-08 16:16:28 +02:00
source_map Split span_to_string into span_to_diagnostic/embeddable_string 2021-05-11 00:04:12 +01:00
symbol Rework SESSION_GLOBALS API to prevent overwriting it 2021-07-08 16:16:28 +02:00
analyze_source_file.rs Fix some clippy lints 2020-12-03 17:08:19 -05:00
caching_source_map_view.rs rustc_span: add span_data_to_lines_and_cols to caching source map view 2020-12-03 18:36:34 -08:00
def_id.rs Revert "Revert "Merge CrateDisambiguator into StableCrateId"" 2021-07-06 11:28:04 +02:00
edition.rs fix: wrong word 2021-03-10 09:09:37 +08:00
fatal_error.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
hygiene.rs Rework SESSION_GLOBALS API to prevent overwriting it 2021-07-08 16:16:28 +02:00
lev_distance.rs Edit rustc_span documentation 2020-12-25 14:02:52 -08:00
lib.rs Rework SESSION_GLOBALS API to prevent overwriting it 2021-07-08 16:16:28 +02:00
source_map.rs Avoid byte to char position conversions in is_multiline 2021-07-01 13:30:00 +02:00
span_encoding.rs Rework SESSION_GLOBALS API to prevent overwriting it 2021-07-08 16:16:28 +02:00
symbol.rs Auto merge of #85828 - scottmcm:raw-eq, r=oli-obk 2021-07-09 09:16:27 +00:00
tests.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00