Rollup merge of #115736 - Zoxc:time-cleanup, r=wesleywiser

Remove `verbose_generic_activity_with_arg`

This removes `verbose_generic_activity_with_arg` and changes users to `generic_activity_with_arg`. This keeps the output of `-Z time` readable while these repeated events are still available with the self profiling mechanism.
This commit is contained in:
Matthias Krüger 2023-09-13 18:37:41 +02:00 committed by GitHub
commit 5dc37c1966
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 63 additions and 29 deletions

View file

@ -94,6 +94,8 @@ fn run_passes_inner<'tcx>(
let overridden_passes = &tcx.sess.opts.unstable_opts.mir_enable_passes;
trace!(?overridden_passes);
let prof_arg = tcx.sess.prof.enabled().then(|| format!("{:?}", body.source.def_id()));
if !body.should_skip() {
for pass in passes {
let name = pass.name();
@ -121,7 +123,14 @@ fn run_passes_inner<'tcx>(
validate_body(tcx, body, format!("before pass {name}"));
}
tcx.sess.time(name, || pass.run_pass(tcx, body));
if let Some(prof_arg) = &prof_arg {
tcx.sess
.prof
.generic_activity_with_arg(pass.profiler_name(), &**prof_arg)
.run(|| pass.run_pass(tcx, body));
} else {
pass.run_pass(tcx, body);
}
if dump_enabled {
dump_mir_for_pass(tcx, body, &name, true);