Skip to content

Enable -Zdrop-tracking-mir by default#107421

Merged
bors merged 11 commits intorust-lang:masterfrom
cjgillot:drop-tracking-mir
Sep 23, 2023
Merged

Enable -Zdrop-tracking-mir by default#107421
bors merged 11 commits intorust-lang:masterfrom
cjgillot:drop-tracking-mir

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 (-Znext-solver) 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
Collaborator

bors commented Jan 28, 2023

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

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

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
Collaborator

bors commented Jan 28, 2023

⌛ Trying commit b4f64e4054cd1a31c28ac024f2473973ac94bfdf with merge 549dafd0516c8b08f912fb001d48e977d0a94c34...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Jan 29, 2023

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

1 similar comment
@bors
Copy link
Collaborator

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

@cjgillot
Copy link
Contributor Author

@bors r=oli-obk

@bors
Copy link
Collaborator

bors commented Sep 23, 2023

📌 Commit bffb346 has been approved by oli-obk

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Sep 23, 2023

⌛ Testing commit bffb346 with merge 13e6f24...

@bors
Copy link
Collaborator

bors commented Sep 23, 2023

☀️ Test successful - checks-actions
Approved by: oli-obk
Pushing 13e6f24 to master...

@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%)

@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
Member

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

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, or significant enough to need a team 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 (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.