-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rollup of 7 pull requests #39663
Rollup of 7 pull requests #39663
Conversation
frewsxcv
commented
Feb 9, 2017
- Successful merges: Document RFC 1623: static lifetime elision. #37928, [MIR] SwitchInt Everywhere #39456, rustbuild: support setting verbosity in config.toml #39587, rustdoc: Improve impl disambiguation #39589, Remove some leftover makefiles. #39641, Add missing urls on join_paths #39649, Fixes #39661 #39662
- Failed merges: emit "align 1" metadata on loads/stores of packed structs #39586, Make reprs use a structured representation instead of a slice #39595
Previously AdtDef variants contained ConstInt for each discriminant, which did not really reflect the actual type of the discriminants. Moving the type into AdtDef allows to easily put the type into metadata and also saves bytes from ConstVal overhead for each discriminant. Also arguably the code is cleaner now :)
This removes another special case of Switch by replacing it with the more general SwitchInt. While this is more clunky currently, there’s no reason we can’t make it nice (and efficient) to use.
Also use a Cow to avoid full Vec for all SwitchInts
First example of optimisation that applies to many more cases than originally.
Previously it used to build a switch in a way that didn’t preserve the invariat of SwitchInt. Now it builds it in an optimal way too, where otherwise branch becomes all the branches which did not have partial variant drops.
This ends up not really mattering because we generate a plain conditional branch in LLVM either way.
Constructs a TerminatorKind::SwitchInt for an equivalent conditional true-false branch.
Signed-off-by: Marc-Antoine Perennou <[email protected]>
* Don't disambiguate if there are multiple impls for the same type. * Disambiguate for impls of &Foo and &mut Foo. * Don't try to disambiguate generic types.
Signed-off-by: Marc-Antoine Perennou <[email protected]>
Clarified potential ambiguity.
…eveklabnik Document RFC 1623: static lifetime elision. This should be the last item required for stabilizing RFC 1623 (rust-lang#35897).
…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¹ (unexpected), but also uses slightly more memory at peak (expected)): ¹: 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
rustbuild: support setting verbosity in config.toml Most if not all the configuration is settable trhough config.toml but the verbosity isn't yet. This avoids having to pass -v to x.py on each command if you want verbosity to be always on.
…, r=alexcrichton rustdoc: Improve impl disambiguation * Don't disambiguate if there are multiple impls for the same type. * Disambiguate for impls of &Foo and &mut Foo. * Don't try to disambiguate generic types. [before](https://doc.rust-lang.org/nightly/std/ops/trait.Rem.html#implementors) [after](https://ollie27.github.io/rust_doc_test/std/ops/trait.Rem.html#implementors)
Remove some leftover makefiles.
…ewsxcv Add missing urls on join_paths r? @frewsxcv
Fixes rust-lang#39661 Clarifies the potential ambiguity.
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @eddyb (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
@bors r+ p=10 |
📌 Commit 14d894f has been approved by |
⌛ Testing commit 14d894f with merge 606e273... |
💔 Test failed - status-appveyor |
@bors retry |
⌛ Testing commit 14d894f with merge 9d0267a... |
💔 Test failed - status-appveyor |