rust/src/librustc_data_structures
bors 05a7f25cc4 Auto merge of #39456 - nagisa:mir-switchint-everywhere, r=nikomatsakis
[MIR] SwitchInt Everywhere

Something I've been meaning to do for a very long while. This PR essentially gets rid of 3 kinds of conditional branching and only keeps the most general one - `SwitchInt`. Primary benefits are such that dealing with MIR now does not involve dealing with 3 different ways to do conditional control flow. On the other hand, constructing a `SwitchInt` currently requires more code than what previously was necessary to build an equivalent `If` terminator. Something trivially "fixable" with some constructor methods somewhere (MIR needs stuff like that badly in general).

Some timings (tl;dr: slightly faster^1 (unexpected), but also uses slightly more memory at peak (expected)):

^1: Not sure if the speed benefits are because of LLVM liking the generated code better or the compiler itself getting compiled better. Either way, its a net benefit. The CORE and SYNTAX timings done for compilation without optimisation.

```
AFTER:
Building stage1 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 31.50 secs
    Finished release [optimized] target(s) in 31.42 secs
Building stage1 compiler artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 439.56 secs
    Finished release [optimized] target(s) in 435.15 secs

CORE: 99% (24.81 real, 0.13 kernel, 24.57 user); 358536k resident
CORE: 99% (24.56 real, 0.15 kernel, 24.36 user); 359168k resident
SYNTAX: 99% (49.98 real, 0.48 kernel, 49.42 user); 653416k resident
SYNTAX: 99% (50.07 real, 0.58 kernel, 49.43 user); 653604k resident

BEFORE:
Building stage1 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 31.84 secs
Building stage1 compiler artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Finished release [optimized] target(s) in 451.17 secs

CORE: 99% (24.66 real, 0.20 kernel, 24.38 user); 351096k resident
CORE: 99% (24.36 real, 0.17 kernel, 24.18 user); 352284k resident
SYNTAX: 99% (52.24 real, 0.56 kernel, 51.66 user); 645544k resident
SYNTAX: 99% (51.55 real, 0.48 kernel, 50.99 user); 646428k resident
```

cc @nikomatsakis @eddyb
2017-02-13 02:32:09 +00:00
..
control_flow_graph run rustfmt on control_flow_graph folder 2016-10-20 00:25:19 +05:30
graph Warn unused type aliases 2016-12-15 18:35:20 +09:00
obligation_forest Replace FnvHasher use with FxHasher. 2016-11-08 15:14:59 +11:00
snapshot_map Replace FnvHasher use with FxHasher. 2016-11-08 15:14:59 +11:00
unify Don't clone in UnificationTable::probe(). 2016-11-18 14:26:22 +11:00
veccell apply rustfmt to librustc_data_structures, correcting rust-lang-nursery/rustfmt#836 2016-03-05 08:40:33 -05:00
accumulate_vec.rs Remove dead recursive partial eq impl 2017-01-29 06:07:45 +01:00
array_vec.rs Remove dead recursive partial eq impl 2017-01-29 06:07:45 +01:00
base_n.rs Do not generate '@' character in symbol names. 2016-12-12 21:56:52 +03:00
bitslice.rs Move IdxSetBuf and BitSlice to rustc_data_structures 2016-10-10 20:26:26 -04:00
bitvec.rs SwitchInt over Switch 2017-02-10 19:42:41 +02:00
blake2b.rs Use little-endian encoding for Blake2 hashing on all architectures 2017-01-10 20:43:32 +02:00
Cargo.toml Bump version, upgrade bootstrap 2017-02-03 13:25:46 -08:00
flock.rs Allow rustc data structures compile to android 2017-02-10 16:34:10 -02:00
fmt_wrap.rs Replace all uses of SHA-256 with BLAKE2b. 2016-10-30 19:14:18 -04:00
fnv.rs Documentation of what does for each type 2016-09-11 17:00:09 +05:30
fx.rs Add FxHasher, a faster alternative to FnvHasher. 2016-11-08 15:14:00 +11:00
indexed_set.rs Move IdxSetBuf and BitSlice to rustc_data_structures 2016-10-10 20:26:26 -04:00
indexed_vec.rs A way to remove otherwise unused locals from MIR 2016-11-03 06:17:01 +02:00
ivar.rs apply rustfmt to librustc_data_structures, correcting rust-lang-nursery/rustfmt#836 2016-03-05 08:40:33 -05:00
lib.rs Bump version, upgrade bootstrap 2017-02-03 13:25:46 -08:00
small_vec.rs Use SmallVec for TypeWalker's stack. 2016-11-22 10:02:04 +11:00
snapshot_vec.rs Plumb inference obligations through selection 2016-05-11 17:29:23 -07:00
stable_hasher.rs Bump version, upgrade bootstrap 2017-02-03 13:25:46 -08:00
transitive_relation.rs generalize BitMatrix to be NxM and not just NxN 2016-08-09 08:26:06 -04:00
tuple_slice.rs Add additional test cases to test all arities of tuple; And remove type suffix - i32 on integers 2016-06-11 22:31:24 +05:30