Skip to content
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

Enable -Zdrop-tracking-mir by default #107421

Merged
merged 11 commits into from Sep 23, 2023
Merged

Conversation

cjgillot
Copy link
Contributor

@cjgillot cjgillot commented Jan 28, 2023

This PR enables the drop-tracking-mir flag by default. This flag was initially implemented in #101692.

This flag computes auto-traits on generators based on their analysis MIR, instead of trying to compute on the HIR body. This removes the need for HIR-based drop-tracking, as we can now reuse the same code to compute generator witness types and to compute generator interior fields.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative labels Jan 28, 2023
@cjgillot
Copy link
Contributor Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 28, 2023
@bors
Copy link
Contributor

bors commented Jan 28, 2023

⌛ Trying commit 61c4d7edcd87bc38863fd1b164fccfc462431557 with merge 9ee0b0d5c433ffd332c5848d0dac8048d297b6ab...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Jan 28, 2023

💔 Test failed - checks-actions

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 28, 2023
@cjgillot
Copy link
Contributor Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Jan 28, 2023

⌛ Trying commit b4f64e4054cd1a31c28ac024f2473973ac94bfdf with merge 549dafd0516c8b08f912fb001d48e977d0a94c34...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Jan 29, 2023

☀️ Try build successful - checks-actions
Build commit: 549dafd0516c8b08f912fb001d48e977d0a94c34 (549dafd0516c8b08f912fb001d48e977d0a94c34)

1 similar comment
@bors
Copy link
Contributor

bors commented Jan 29, 2023

☀️ Try build successful - checks-actions
Build commit: 549dafd0516c8b08f912fb001d48e977d0a94c34 (549dafd0516c8b08f912fb001d48e977d0a94c34)

@rust-timer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (549dafd0516c8b08f912fb001d48e977d0a94c34): comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.8% [0.5%, 1.1%] 4
Improvements ✅
(primary)
-0.2% [-0.2%, -0.2%] 2
Improvements ✅
(secondary)
-2.6% [-5.4%, -1.1%] 11
All ❌✅ (primary) -0.2% [-0.2%, -0.2%] 2

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.2% [2.2%, 2.2%] 1
Improvements ✅
(primary)
-2.8% [-2.8%, -2.8%] 1
Improvements ✅
(secondary)
-2.7% [-2.8%, -2.6%] 2
All ❌✅ (primary) -2.8% [-2.8%, -2.8%] 1

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.5% [-5.6%, -2.3%] 7
All ❌✅ (primary) - - 0

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jan 29, 2023
@cjgillot
Copy link
Contributor Author

@craterbot check

@craterbot
Copy link
Collaborator

👌 Experiment pr-107421 created and queued.
🤖 Automatically detected try build 549dafd0516c8b08f912fb001d48e977d0a94c34
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 29, 2023
@craterbot
Copy link
Collaborator

🚧 Experiment pr-107421 is now running

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@bors bors merged commit 13e6f24 into rust-lang:master Sep 23, 2023
12 checks passed
@rustbot rustbot added this to the 1.74.0 milestone Sep 23, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (13e6f24): comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.4% [0.4%, 0.5%] 2
Regressions ❌
(secondary)
4.5% [0.3%, 6.5%] 9
Improvements ✅
(primary)
-0.4% [-0.4%, -0.4%] 1
Improvements ✅
(secondary)
-2.5% [-3.3%, -1.9%] 5
All ❌✅ (primary) 0.2% [-0.4%, 0.5%] 3

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.2% [1.0%, 5.4%] 16
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.7% [-4.6%, -1.5%] 7
All ❌✅ (primary) - - 0

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.9% [2.7%, 5.4%] 8
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.4% [-2.4%, -2.3%] 2
All ❌✅ (primary) - - 0

Binary size

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.9% [1.6%, 7.6%] 7
Improvements ✅
(primary)
-0.5% [-0.6%, -0.3%] 8
Improvements ✅
(secondary)
-8.8% [-23.8%, -0.0%] 8
All ❌✅ (primary) -0.5% [-0.6%, -0.3%] 8

Bootstrap: 634.731s -> 631.479s (-0.51%)
Artifact size: 317.81 MiB -> 317.13 MiB (-0.21%)

@cjgillot cjgillot deleted the drop-tracking-mir branch September 24, 2023 07:32
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 24, 2023
…r=compiler-errors

Remove dead diagnostic code for generators

This code has become unreachable with rust-lang#107421.
@rylev
Copy link
Member

rylev commented Sep 26, 2023

@cjgillot @oli-obk it seems the regressions to await-call-tree are real. I'm having trouble running cachegrind right now. Do either of have any idea what might be causing this regression?

@oli-obk
Copy link
Contributor

oli-obk commented Sep 27, 2023

According to the graph, perf of await-call-tree went back to normal with the next perf run, or is the darker area on the graph just any perf run, instead of perf runs on master?

edit: oh this is the relative change, not the absolute value. oops

@Kobzol
Copy link
Contributor

Kobzol commented Sep 27, 2023

That's the second time in this week's triage that the "relativeness" of the graph tripped someone up. Would an absolute graph be more intuitive?

@oli-obk
Copy link
Contributor

oli-obk commented Sep 27, 2023

No ^^ I know that, and I read it correctly most of the time.

cachegrind:


--------------------------------------------------------------------------------
Ir        
--------------------------------------------------------------------------------
5,738,802  PROGRAM TOTALS

--------------------------------------------------------------------------------
Ir         file:function
--------------------------------------------------------------------------------
  328,796  ???:rustc_data_structures::graph::dominators::dominators::<rustc_middle::mir::basic_blocks::BasicBlocks>
 -294,357  ???:<rustc_middle::mir::basic_blocks::BasicBlocks>::dominators
  279,186  ???:<rustc_index::bit_set::BitSet<rustc_middle::mir::Local> as core::clone::Clone>::clone_from
  214,074  ???:<rustc_mir_dataflow::framework::GenKillSet<rustc_middle::mir::Local> as rustc_mir_dataflow::framework::GenKill<rustc_middle::mir::Local>>::kill
  198,319  /build/glibc-sMfBJT/glibc-2.31/string/../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:__memcpy_avx_unaligned_erms
  183,555  ???:<rustc_index::bit_set::BitSet<rustc_middle::mir::Local> as rustc_mir_dataflow::framework::lattice::JoinSemiLattice>::join
  179,652  ???:<rustc_infer::infer::combine::CombineFields>::instantiate
  179,298  ???:<rustc_infer::infer::equate::Equate as rustc_middle::ty::relate::TypeRelation>::regions
  163,674  ???:<alloc::vec::Vec<rustc_mir_dataflow::framework::GenKillSet<rustc_middle::mir::Local>>>::extend_with
 -161,957  ???:<rustc_infer::infer::region_constraints::RegionConstraintCollector>::make_eqregion
  142,882  ???:<rustc_mir_dataflow::impls::storage_liveness::MaybeRequiresStorage as rustc_mir_dataflow::framework::GenKillAnalysis>::terminator_effect
  139,495  ???:<smallvec::SmallVec<[u64; 2]> as core::iter::traits::collect::Extend<u64>>::extend::<core::iter::adapters::cloned::Cloned<core::slice::iter::Iter<u64>>>
  136,604  ???:<core::cell::once::OnceCell<alloc::vec::Vec<rustc_middle::mir::BasicBlock>>>::get_or_try_init::<<core::cell::once::OnceCell<alloc::vec::Vec<rustc_middle::mir::BasicBlock>>>::get_or_init<<rustc_middle::mir::basic_blocks::BasicBlocks>::reverse_postorder::{closure
  132,566  ???:<rustc_mir_transform::generator::StorageConflictVisitor>::apply_state
 -123,564  ???:<alloc::vec::Vec<rustc_middle::mir::BasicBlock> as alloc::vec::spec_from_iter::SpecFromIter<rustc_middle::mir::BasicBlock, core::iter::adapters::map::Map<rustc_middle::mir::traversal::Postorder, <rustc_middle::mir::basic_blocks::BasicBlocks>::reverse_postorder::{closure
  118,370  ???:<core::cell::once::OnceCell<rustc_index::vec::IndexVec<rustc_middle::mir::BasicBlock, smallvec::SmallVec<[rustc_middle::mir::BasicBlock; 4]>>>>::get_or_try_init::<<core::cell::once::OnceCell<rustc_index::vec::IndexVec<rustc_middle::mir::BasicBlock, smallvec::SmallVec<[rustc_middle::mir::BasicBlock; 4]>>>>::get_or_init<<rustc_middle::mir::basic_blocks::BasicBlocks>::predecessors::{closure
  114,764  ???:<rustc_mir_dataflow::framework::engine::Engine<rustc_mir_dataflow::impls::storage_liveness::MaybeRequiresStorage>>::iterate_to_fixpoint
  113,344  ???:<rustc_index::bit_set::BitSet<rustc_middle::mir::Local> as rustc_mir_dataflow::framework::BitSetExt<rustc_middle::mir::Local>>::subtract
 -111,672  ???:<rustc_infer::infer::sub::Sub as rustc_middle::ty::relate::TypeRelation>::tys
 -110,489  ???:<rustc_infer::infer::equate::Equate as rustc_middle::ty::relate::TypeRelation>::tys
  108,745  ???:rustc_middle::mir::traversal::reverse_postorder
  106,722  ???:<rustc_index::bit_set::BitMatrix<rustc_middle::mir::Local, rustc_middle::mir::Local>>::union_row_with
  102,612  ???:<rustc_mir_dataflow::impls::storage_liveness::MoveVisitor<rustc_index::bit_set::BitSet<rustc_middle::mir::Local>> as rustc_middle::mir::visit::Visitor>::visit_place
  101,417  ???:<&rustc_middle::ty::list::List<rustc_middle::ty::generic_args::GenericArg> as rustc_type_ir::fold::TypeFoldable<rustc_middle::ty::context::TyCtxt>>::try_fold_with::<rustc_infer::infer::freshen::TypeFreshener>

lots more small regressions that make up this 5 mil regression

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 29, 2023
Add non-regression test for ATPIT ICE rust-lang#114325

ATPIT issue rust-lang#114325 had been unknowingly fixed by rust-lang#107421, so this PR adds its [MCVE](rust-lang#114325 (comment)) as a non-regression test.

Closes rust-lang#114325.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 29, 2023
Add non-regression test for ATPIT ICE rust-lang#114325

ATPIT issue rust-lang#114325 had been unknowingly fixed by rust-lang#107421, so this PR adds its [MCVE](rust-lang#114325 (comment)) as a non-regression test.

Closes rust-lang#114325.
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Dec 30, 2023
Rollup merge of rust-lang#119406 - lqd:issue-114325, r=compiler-errors

Add non-regression test for ATPIT ICE rust-lang#114325

ATPIT issue rust-lang#114325 had been unknowingly fixed by rust-lang#107421, so this PR adds its [MCVE](rust-lang#114325 (comment)) as a non-regression test.

Closes rust-lang#114325.
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Jan 8, 2024
Pkgsrc changes:

 * Remove NetBSD-8 support (embedded LLVm requires newer C++
   than what is in -8; it's conceivable that this could still
   build with an external LLVM)
 * undo powerpc 9.0 file naming tweak, since we no longer support -8.
 * Remove patch to LLVM for powerpc now included by upstream.
 * Minor adjustments, checksum changes etc.


Upstream changes:

Version 1.74.1 (2023-12-07)
===========================

- [Resolved spurious STATUS_ACCESS_VIOLATIONs in LLVM]
  (rust-lang/rust#118464)
- [Clarify guarantees for std::mem::discriminant]
  (rust-lang/rust#118006)
- [Fix some subtyping-related regressions]
  (rust-lang/rust#116415)

Version 1.74.0 (2023-11-16)
==========================

Language
--------

- [Codify that `std::mem::Discriminant<T>` does not depend on any
  lifetimes in T]
  (rust-lang/rust#104299)
- [Replace `private_in_public` lint with `private_interfaces` and
  `private_bounds` per RFC 2145]
  (rust-lang/rust#113126)
  Read more in
  [RFC 2145](https://rust-lang.github.io/rfcs/2145-type-privacy.html).
- [Allow explicit `#[repr(Rust)]`]
  (rust-lang/rust#114201)
- [closure field capturing: don't depend on alignment of packed fields]
  (rust-lang/rust#115315)
- [Enable MIR-based drop-tracking for `async` blocks]
  (rust-lang/rust#107421)

Compiler
--------

- [stabilize combining +bundle and +whole-archive link modifiers]
  (rust-lang/rust#113301)
- [Stabilize `PATH` option for `--print KIND=PATH`]
  (rust-lang/rust#114183)
- [Enable ASAN/LSAN/TSAN for `*-apple-ios-macabi`]
  (rust-lang/rust#115644)
- [Promote loongarch64-unknown-none* to Tier 2]
  (rust-lang/rust#115368)
- [Add `i686-pc-windows-gnullvm` as a tier 3 target]
  (rust-lang/rust#115687)

Libraries
---------

- [Implement `From<OwnedFd/Handle>` for ChildStdin/out/err]
  (rust-lang/rust#98704)
- [Implement `From<{&,&mut} [T; N]>` for `Vec<T>` where `T: Clone`]
  (rust-lang/rust#111278)
- [impl Step for IP addresses]
  (rust-lang/rust#113748)
- [Implement `From<[T; N]>` for `Rc<[T]>` and `Arc<[T]>`]
  (rust-lang/rust#114041)
- [`impl TryFrom<char> for u16`]
  (rust-lang/rust#114065)
- [Stabilize `io_error_other` feature]
  (rust-lang/rust#115453)
- [Stabilize the `Saturating` type]
  (rust-lang/rust#115477)
- [Stabilize const_transmute_copy]
  (rust-lang/rust#115520)

Stabilized APIs
---------------

- [`core::num::Saturating`]
  (https://doc.rust-lang.org/stable/std/num/struct.Saturating.html)
- [`impl From<io::Stdout> for std::process::Stdio`]
  (https://doc.rust-lang.org/stable/std/process/struct.Stdio.html#impl-From%3CStdout%3E-for-Stdio)
- [`impl From<io::Stderr> for std::process::Stdio`]
  (https://doc.rust-lang.org/stable/std/process/struct.Stdio.html#impl-From%3CStderr%3E-for-Stdio)
- [`impl From<OwnedHandle> for std::process::Child{Stdin, Stdout, Stderr}`]
  (https://doc.rust-lang.org/stable/std/process/struct.Stdio.html#impl-From%3CStderr%3E-for-Stdio)
- [`impl From<OwnedFd> for std::process::Child{Stdin, Stdout, Stderr}`]
  (https://doc.rust-lang.org/stable/std/process/struct.Stdio.html#impl-From%3CStderr%3E-for-Stdio)
- [`std::ffi::OsString::from_encoded_bytes_unchecked`]
  (https://doc.rust-lang.org/stable/std/ffi/struct.OsString.html#method.from_encoded_bytes_unchecked)
- [`std::ffi::OsString::into_encoded_bytes`]
  (https://doc.rust-lang.org/stable/std/ffi/struct.OsString.html#method.into_encoded_bytes)
- [`std::ffi::OsStr::from_encoded_bytes_unchecked`]
  (https://doc.rust-lang.org/stable/std/ffi/struct.OsStr.html#method.from_encoded_bytes_unchecked)
- [`std::ffi::OsStr::as_encoded_bytes`]
  (https://doc.rust-lang.org/stable/std/ffi/struct.OsStr.html#method.as_encoded_bytes)
- [`std::io::Error::other`]
  (https://doc.rust-lang.org/stable/std/io/struct.Error.html#method.other)
- [`impl TryFrom<char> for u16`]
  (https://doc.rust-lang.org/stable/std/primitive.u16.html#impl-TryFrom%3Cchar%3E-for-u16)
- [`impl<T: Clone, const N: usize> From<&[T; N]> for Vec<T>`]
  (https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#impl-From%3C%26%5BT;+N%5D%3E-for-Vec%3CT,+Global%3E)
- [`impl<T: Clone, const N: usize> From<&mut [T; N]> for Vec<T>`]
  (https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#impl-From%3C%26mut+%5BT;+N%5D%3E-for-Vec%3CT,+Global%3E)
- [`impl<T, const N: usize> From<[T; N]> for Arc<[T]>`]
  (https://doc.rust-lang.org/stable/std/sync/struct.Arc.html#impl-From%3C%5BT;+N%5D%3E-for-Arc%3C%5BT%5D,+Global%3E)
- [`impl<T, const N: usize> From<[T; N]> for Rc<[T]>`]
  (https://doc.rust-lang.org/stable/std/rc/struct.Rc.html#impl-From%3C%5BT;+N%5D%3E-for-Rc%3C%5BT%5D,+Global%3E)

These APIs are now stable in const contexts:

- [`core::mem::transmute_copy`]
  (https://doc.rust-lang.org/beta/std/mem/fn.transmute_copy.html)
- [`str::is_ascii`]
  (https://doc.rust-lang.org/beta/std/primitive.str.html#method.is_ascii)
- [`[u8]::is_ascii`]
  (https://doc.rust-lang.org/beta/std/primitive.slice.html#method.is_ascii)

Cargo
-----

- [fix: Set MSRV for internal packages]
  (rust-lang/cargo#12381)
- [config: merge lists in precedence order]
  (rust-lang/cargo#12515)
- [fix(update): Clarify meaning of --aggressive as --recursive]
  (rust-lang/cargo#12544)
- [fix(update): Make `-p` more convenient by being positional]
  (rust-lang/cargo#12545)
- [feat(help): Add styling to help output ]
  (rust-lang/cargo#12578)
- [feat(pkgid): Allow incomplete versions when unambigious]
  (rust-lang/cargo#12614)
- [feat: stabilize credential-process and registry-auth]
  (rust-lang/cargo#12649)
- [feat(cli): Add '-n' to dry-run]
  (rust-lang/cargo#12660)
- [Add support for `target.'cfg(..)'.linker`]
  (rust-lang/cargo#12535)
- [Stabilize `--keep-going`]
  (rust-lang/cargo#12568)
- [feat: Stabilize lints]
  (rust-lang/cargo#12648)

Rustdoc
-------

- [Add warning block support in rustdoc]
  (rust-lang/rust#106561)
- [Accept additional user-defined syntax classes in fenced code blocks]
  (rust-lang/rust#110800)
- [rustdoc-search: add support for type parameters]
  (rust-lang/rust#112725)
- [rustdoc: show inner enum and struct in type definition for concrete type]
  (rust-lang/rust#114855)

Compatibility Notes
-------------------

- [Raise minimum supported Apple OS versions]
  (rust-lang/rust#104385)
- [make Cell::swap panic if the Cells partially overlap]
  (rust-lang/rust#114795)
- [Reject invalid crate names in `--extern`]
  (rust-lang/rust#116001)
- [Don't resolve generic impls that may be shadowed by dyn built-in impls]
  (rust-lang/rust#114941)

Internal Changes
----------------

These changes do not affect any public interfaces of Rust, but they represent
significant improvements to the performance or internals of rustc and related
tools.

None this cycle.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-coroutines Area: Coroutines disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. merged-by-bors This PR was explicitly merged by bors. needs-fcp This change is insta-stable, so needs a completed FCP to proceed. perf-regression Performance regression. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-types Relevant to the types team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet