| Age | Commit message (Collapse) | Author | Lines | |
|---|---|---|---|---|
| 2020-11-15 | Don't re-export std::ops::ControlFlow in the compiler. | Leonora Tindall | -3/+1 | |
| 2020-11-15 | change the order of type arguments on ControlFlow | Leonora Tindall | -2/+1 | |
| This allows ControlFlow<BreakType> which is much more ergonomic for common iterator combinator use cases. | ||||
| 2020-09-30 | Stable hashing: add comments and tests concerning platform-independence | Tyson Nottingham | -18/+142 | |
| SipHasher128 implements short_write in an endian-independent way, yet its write_xxx Hasher trait methods undo this endian-independence by byte swapping the integer inputs on big-endian hardware. StableHasher then adds endian-independence back by also byte-swapping on big-endian hardware prior to invoking SipHasher128. This double swap may have the appearance of being a no-op, but is in fact by design. In particular, we really do want SipHasher128 to be platform-dependent, in order to be consistent with the libstd SipHasher. Try to clarify this intent. Also, add and update a couple of unit tests. | ||||
| 2020-09-26 | Remove unused #[allow(...)] statements from compiler/ | est31 | -1/+0 | |
| 2020-09-25 | Rollup merge of #77121 - duckymirror:html-root-url, r=jyn514 | Jonas Schievink | -1/+1 | |
| Updated html_root_url for compiler crates Closes #77103 r? @jyn514 | ||||
| 2020-09-23 | /nightly/nightly-rustc | Erik Hofmayer | -1/+1 | |
| 2020-09-23 | Updated html_root_url for compiler crates | Erik Hofmayer | -1/+1 | |
| 2020-09-23 | Move MiniSet to data_structures | Andreas Jonson | -0/+42 | |
| remove the need for T to be copy from MiniSet as was done for MiniMap | ||||
| 2020-09-22 | Auto merge of #76928 - lcnr:opaque-types-cache, r=tmandry | bors | -5/+69 | |
| cache types during normalization partially fixes #75992 reduces the following test from 14 to 3 seconds locally. cc `@Mark-Simulacrum` would it make sense to add that test to `perf`? ```rust #![recursion_limit="2048"] #![type_length_limit="112457564"] pub async fn h0(v: &String, x: &u64) { println!("{} {}", v, x) } pub async fn h1(v: &String, x: &u64) { h0(v, x).await } pub async fn h2(v: &String, x: &u64) { h1(v, x).await } pub async fn h3(v: &String, x: &u64) { h2(v, x).await } pub async fn h4(v: &String, x: &u64) { h3(v, x).await } pub async fn h5(v: &String, x: &u64) { h4(v, x).await } pub async fn h6(v: &String, x: &u64) { h5(v, x).await } pub async fn h7(v: &String, x: &u64) { h6(v, x).await } pub async fn h8(v: &String, x: &u64) { h7(v, x).await } pub async fn h9(v: &String, x: &u64) { h8(v, x).await } pub async fn h10(v: &String, x: &u64) { h9(v, x).await } pub async fn h11(v: &String, x: &u64) { h10(v, x).await } pub async fn h12(v: &String, x: &u64) { h11(v, x).await } pub async fn h13(v: &String, x: &u64) { h12(v, x).await } pub async fn h14(v: &String, x: &u64) { h13(v, x).await } pub async fn h15(v: &String, x: &u64) { h14(v, x).await } pub async fn h16(v: &String, x: &u64) { h15(v, x).await } pub async fn h17(v: &String, x: &u64) { h16(v, x).await } pub async fn h18(v: &String, x: &u64) { h17(v, x).await } pub async fn h19(v: &String, x: &u64) { h18(v, x).await } macro_rules! async_recursive { (29, $inner:expr) => { async { async_recursive!(28, $inner) }.await }; (28, $inner:expr) => { async { async_recursive!(27, $inner) }.await }; (27, $inner:expr) => { async { async_recursive!(26, $inner) }.await }; (26, $inner:expr) => { async { async_recursive!(25, $inner) }.await }; (25, $inner:expr) => { async { async_recursive!(24, $inner) }.await }; (24, $inner:expr) => { async { async_recursive!(23, $inner) }.await }; (23, $inner:expr) => { async { async_recursive!(22, $inner) }.await }; (22, $inner:expr) => { async { async_recursive!(21, $inner) }.await }; (21, $inner:expr) => { async { async_recursive!(20, $inner) }.await }; (20, $inner:expr) => { async { async_recursive!(19, $inner) }.await }; (19, $inner:expr) => { async { async_recursive!(18, $inner) }.await }; (18, $inner:expr) => { async { async_recursive!(17, $inner) }.await }; (17, $inner:expr) => { async { async_recursive!(16, $inner) }.await }; (16, $inner:expr) => { async { async_recursive!(15, $inner) }.await }; (15, $inner:expr) => { async { async_recursive!(14, $inner) }.await }; (14, $inner:expr) => { async { async_recursive!(13, $inner) }.await }; (13, $inner:expr) => { async { async_recursive!(12, $inner) }.await }; (12, $inner:expr) => { async { async_recursive!(11, $inner) }.await }; (11, $inner:expr) => { async { async_recursive!(10, $inner) }.await }; (10, $inner:expr) => { async { async_recursive!(9, $inner) }.await }; (9, $inner:expr) => { async { async_recursive!(8, $inner) }.await }; (8, $inner:expr) => { async { async_recursive!(7, $inner) }.await }; (7, $inner:expr) => { async { async_recursive!(6, $inner) }.await }; (6, $inner:expr) => { async { async_recursive!(5, $inner) }.await }; (5, $inner:expr) => { async { async_recursive!(4, $inner) }.await }; (4, $inner:expr) => { async { async_recursive!(3, $inner) }.await }; (3, $inner:expr) => { async { async_recursive!(2, $inner) }.await }; (2, $inner:expr) => { async { async_recursive!(1, $inner) }.await }; (1, $inner:expr) => { async { async_recursive!(0, $inner) }.await }; (0, $inner:expr) => { async { h19(&String::from("owo"), &0).await; $inner }.await }; } async fn f() { async_recursive!(14, println!("hello")); } fn main() { let _ = f(); } ``` r? `@eddyb` requires a perf run. | ||||
| 2020-09-21 | Auto merge of #76680 - ↵ | bors | -1/+1 | |
| Julian-Wollersberger:nongeneric_ensure_sufficient_stack, r=jyn514 Make `ensure_sufficient_stack()` non-generic, using cargo-llvm-lines Inspired by [this blog post](https://blog.mozilla.org/nnethercote/2020/08/05/how-to-speed-up-the-rust-compiler-some-more-in-2020/) from `@nnethercote,` I used [cargo-llvm-lines](https://github.com/dtolnay/cargo-llvm-lines/) on the rust compiler itself, to improve it's compile time. This PR contains only one low-hanging fruit, but I also want to share some measurements. The function `ensure_sufficient_stack()` was monomorphized 1500 times, and with it the `stacker` and `psm` crates, for a total of 1.5% of all llvm IR lines. With some trickery I convert the generic closure into a dynamic one, and thus all that code is only monomorphized once. # Measurements Getting these numbers took some fiddling with CLI flags and I [modified](https://github.com/Julian-Wollersberger/cargo-llvm-lines/blob/master/src/main.rs#L115) cargo-llvm-lines to read from a folder instead of invoking cargo. Commands I used: ``` ./x.py clean RUSTFLAGS="--emit=llvm-ir -C link-args=-fuse-ld=lld -Z self-profile=profile" CARGOFLAGS_BOOTSTRAP="-Ztimings" RUSTC_BOOTSTRAP=1 ./x.py build -i --stage 1 library/std # Then manually copy all .ll files into a folder I hardcoded in cargo-llvm-lines in main.rs#L115 cd ../cargo-llvm-lines cargo run llvm-lines ``` The result is this list (see [first 500 lines](https://github.com/Julian-Wollersberger/cargo-llvm-lines/blob/master/llvm-lines-rustc-before.txt) ), before the change: ``` Lines Copies Function name ----- ------ ------------- 16894211 (100%) 58417 (100%) (TOTAL) 2223855 (13.2%) 502 (0.9%) rustc_query_system::query::plumbing::get_query_impl::{{closure}} 1331918 (7.9%) 1287 (2.2%) hashbrown::raw::RawTable<T>::reserve_rehash 774434 (4.6%) 12043 (20.6%) core::ptr::drop_in_place 294170 (1.7%) 499 (0.9%) rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl 245410 (1.5%) 1552 (2.7%) psm::on_stack::with_on_stack 210311 (1.2%) 1 (0.0%) rustc_target::spec::load_specific 200962 (1.2%) 513 (0.9%) rustc_query_system::query::plumbing::get_query_impl 190704 (1.1%) 1 (0.0%) rustc_middle::ty::query::<impl rustc_middle::ty::context::TyCtxt>::alloc_self_profile_query_strings 180272 (1.1%) 468 (0.8%) rustc_query_system::query::plumbing::load_from_disk_and_cache_in_memory 177396 (1.1%) 114 (0.2%) rustc_query_system::query::plumbing::force_query_impl 161134 (1.0%) 445 (0.8%) rustc_query_system::dep_graph::graph::DepGraph<K>::with_anon_task 141551 (0.8%) 186 (0.3%) rustc_query_system::query::plumbing::incremental_verify_ich 110191 (0.7%) 7 (0.0%) rustc_middle::ty::context::_DERIVE_rustc_serialize_Decodable_D_FOR_TypeckResults::<impl rustc_serialize::serialize::Decodable<__D> for rustc_middle::ty::context::TypeckResults>::decode::{{closure}} 108590 (0.6%) 420 (0.7%) core::ops::function::FnOnce::call_once 88488 (0.5%) 21 (0.0%) rustc_query_system::dep_graph::graph::DepGraph<K>::try_mark_previous_green 86368 (0.5%) 1 (0.0%) rustc_middle::ty::query::stats::query_stats 85654 (0.5%) 3973 (6.8%) <&T as core::fmt::Debug>::fmt 84475 (0.5%) 1 (0.0%) rustc_middle::ty::query::Queries::try_collect_active_jobs 81220 (0.5%) 862 (1.5%) <hashbrown::raw::RawIterHash<T> as core::iter::traits::iterator::Iterator>::next 77636 (0.5%) 54 (0.1%) core::slice::sort::recurse 66484 (0.4%) 461 (0.8%) <hashbrown::raw::RawIter<T> as core::iter::traits::iterator::Iterator>::next ``` All `.ll` files together had 4.4GB. After my change they had 4.2GB. So a few percent less code LLVM has to process. Hurray! Sadly, I couldn't measure an actual wall-time improvement. Watching YouTube while compiling added to much noise... Here is the top of the list after the change: ``` 16460866 (100%) 58341 (100%) (TOTAL) 1903085 (11.6%) 504 (0.9%) rustc_query_system::query::plumbing::get_query_impl::{{closure}} 1331918 (8.1%) 1287 (2.2%) hashbrown::raw::RawTable<T>::reserve_rehash 777796 (4.7%) 12031 (20.6%) core::ptr::drop_in_place 551462 (3.4%) 1519 (2.6%) rustc_data_structures::stack::ensure_sufficient_stack::{{closure}} ``` Note that the total was reduced by 430 000 lines and `psm::on_stack::with_on_stack` has disappeared. Instead `rustc_data_structures::stack::ensure_sufficient_stack::{{closure}}` appeared. I'm confused about that one, but it seems to consist of inlined calls to `rustc_query_system::*` stuff. Further note the other two big culprits in this list: `rustc_query_system` and `hashbrown`. These two are monomorphized many times, the query system summing to more than 20% of all lines, not even counting code that's probably inlined elsewhere. Assuming compile times scale linearly with llvm-lines, that means a possible 20% compile time reduction. Reducing eg. `get_query_impl` would probably need a major refactoring of the qery system though. _Everything_ in there is generic over multiple types, has associated types and passes generic Self arguments by value. Which means you can't simply make things `dyn`. --------------------------------------- This PR is a small step to make rustc compile faster and thus make contributing to rustc less painful. Nonetheless I love Rust and I find the work around rustc fascinating :) | ||||
| 2020-09-21 | Rollup merge of #76963 - est31:remove_static_assert, r=oli-obk | Ralf Jung | -12/+0 | |
| Remove unused static_assert macro | ||||
| 2020-09-21 | Rollup merge of #76958 - est31:ns, r=oli-obk | Ralf Jung | -4/+1 | |
| Replace manual as_nanos and as_secs_f64 reimplementations | ||||
| 2020-09-20 | To avoid monomorphizing `psm::on_stack::with_on_stack` 1500 times, I made a ↵ | Julian Wollersberger | -1/+1 | |
| change in `stacker` to wrap the callback in `dyn`. | ||||
| 2020-09-20 | Rollup merge of #76825 - lcnr:array-windows-apply, r=varkor | Ralf Jung | -2/+3 | |
| use `array_windows` instead of `windows` in the compiler I do think these changes are beautiful, but do have to admit that using type inference for the window length can easily be confusing. This seems like a general issue with const generics, where inferring constants adds an additional complexity which users have to learn and keep in mind. | ||||
| 2020-09-20 | Rollup merge of #76821 - est31:remove_redundant_nightly_features, ↵ | Ralf Jung | -2/+1 | |
| r=oli-obk,Mark-Simulacrum Remove redundant nightly features Removes a bunch of redundant/outdated nightly features. The first commit removes a `core_intrinsics` use for which a stable wrapper has been provided since. The second commit replaces the `const_generics` feature with `min_const_generics` which might get stabilized this year. The third commit is the result of a trial/error run of removing every single feature and then adding it back if compile failed. A bunch of unused features are the result that the third commit removes. | ||||
| 2020-09-20 | Remove unused static_assert macro | est31 | -12/+0 | |
| 2020-09-20 | Use as_secs_f64 in profiling.rs | est31 | -4/+1 | |
| 2020-09-20 | use `array_windows` instead of `windows` in the compiler | Bastian Kauschke | -2/+3 | |
| 2020-09-19 | cache types during normalization | Bastian Kauschke | -5/+69 | |
| 2020-09-19 | Use `T::BITS` instead of `size_of::<T> * 8`. | Mara Bos | -1/+2 | |
| 2020-09-17 | Remove redundant #![feature(...)] 's from compiler/ | est31 | -1/+0 | |
| 2020-09-17 | Replace const_generics feature gate with min_const_generics | est31 | -1/+1 | |
| The latter is on the path to stabilization. | ||||
| 2020-09-12 | update the version of itertools and parking_lot | Andreas Jonson | -1/+1 | |
| this is to avoid compiling multiple version of the crates in rustc | ||||
| 2020-09-08 | Capitalize safety comments | Flying-Toast | -1/+1 | |
| 2020-09-04 | Add `BREAK` too, and improve the comments | Scott McMurray | -1/+1 | |
| 2020-09-04 | Use ops::ControlFlow in graph::iterate | Scott McMurray | -8/+6 | |
| 2020-09-02 | Auto merge of #76233 - cuviper:unhasher, r=Mark-Simulacrum | bors | -1/+59 | |
| Avoid rehashing Fingerprint as a map key This introduces a no-op `Unhasher` for map keys that are already hash- like, for example `Fingerprint` and its wrapper `DefPathHash`. For these we can directly produce the `u64` hash for maps. The first use of this is `def_path_hash_to_def_id: Option<UnhashMap<DefPathHash, DefId>>`. cc #56308 r? @eddyb | ||||
| 2020-09-01 | Avoid rehashing Fingerprint as a map key | Josh Stone | -1/+59 | |
| This introduces a no-op `Unhasher` for map keys that are already hash- like, for example `Fingerprint` and its wrapper `DefPathHash`. For these we can directly produce the `u64` hash for maps. The first use of this is `def_path_hash_to_def_id: Option<UnhashMap<DefPathHash, DefId>>`. | ||||
| 2020-09-01 | datastructures: replace `lazy_static` by `SyncLazy` from std | marmeladema | -28/+25 | |
| 2020-08-30 | datastructures: replace `once_cell` crate with an impl from std | marmeladema | -3/+3 | |
| 2020-08-30 | mv compiler to compiler/ | mark | -0/+12150 | |
