1
Fork 0

Auto merge of #117773 - nnethercote:rm-Zperf-stats, r=wesleywiser

Remove `-Zperf-stats`.

The included measurements have varied over the years. At one point there were quite a few more, but #49558 deleted a lot that were no longer used. Today there's just four, and it's a motley collection that doesn't seem particularly valuable.

I think it has been well and truly subsumed by self-profiling, which collects way more data.

r? `@wesleywiser`
This commit is contained in:
bors 2023-11-14 02:24:05 +00:00
commit d5375d0587
8 changed files with 29 additions and 97 deletions

View file

@ -4,7 +4,6 @@ use rustc_hir::definitions::{DefPathData, DisambiguatedDefPathData};
use rustc_middle::ty::print::{PrettyPrinter, Print, PrintError, Printer};
use rustc_middle::ty::{self, Instance, Ty, TyCtxt, TypeVisitableExt};
use rustc_middle::ty::{GenericArg, GenericArgKind};
use rustc_middle::util::common::record_time;
use std::fmt::{self, Write};
use std::mem::{self, discriminant};
@ -101,40 +100,38 @@ fn get_symbol_hash<'tcx>(
tcx.with_stable_hashing_context(|mut hcx| {
let mut hasher = StableHasher::new();
record_time(&tcx.sess.perf_stats.symbol_hash_time, || {
// the main symbol name is not necessarily unique; hash in the
// compiler's internal def-path, guaranteeing each symbol has a
// truly unique path
tcx.def_path_hash(def_id).hash_stable(&mut hcx, &mut hasher);
// the main symbol name is not necessarily unique; hash in the
// compiler's internal def-path, guaranteeing each symbol has a
// truly unique path
tcx.def_path_hash(def_id).hash_stable(&mut hcx, &mut hasher);
// Include the main item-type. Note that, in this case, the
// assertions about `has_param` may not hold, but this item-type
// ought to be the same for every reference anyway.
assert!(!item_type.has_erasable_regions());
hcx.while_hashing_spans(false, |hcx| {
item_type.hash_stable(hcx, &mut hasher);
// Include the main item-type. Note that, in this case, the
// assertions about `has_param` may not hold, but this item-type
// ought to be the same for every reference anyway.
assert!(!item_type.has_erasable_regions());
hcx.while_hashing_spans(false, |hcx| {
item_type.hash_stable(hcx, &mut hasher);
// If this is a function, we hash the signature as well.
// This is not *strictly* needed, but it may help in some
// situations, see the `run-make/a-b-a-linker-guard` test.
if let ty::FnDef(..) = item_type.kind() {
item_type.fn_sig(tcx).hash_stable(hcx, &mut hasher);
}
// If this is a function, we hash the signature as well.
// This is not *strictly* needed, but it may help in some
// situations, see the `run-make/a-b-a-linker-guard` test.
if let ty::FnDef(..) = item_type.kind() {
item_type.fn_sig(tcx).hash_stable(hcx, &mut hasher);
}
// also include any type parameters (for generic items)
args.hash_stable(hcx, &mut hasher);
// also include any type parameters (for generic items)
args.hash_stable(hcx, &mut hasher);
if let Some(instantiating_crate) = instantiating_crate {
tcx.def_path_hash(instantiating_crate.as_def_id())
.stable_crate_id()
.hash_stable(hcx, &mut hasher);
}
if let Some(instantiating_crate) = instantiating_crate {
tcx.def_path_hash(instantiating_crate.as_def_id())
.stable_crate_id()
.hash_stable(hcx, &mut hasher);
}
// We want to avoid accidental collision between different types of instances.
// Especially, `VTableShim`s and `ReifyShim`s may overlap with their original
// instances without this.
discriminant(&instance.def).hash_stable(hcx, &mut hasher);
});
// We want to avoid accidental collision between different types of instances.
// Especially, `VTableShim`s and `ReifyShim`s may overlap with their original
// instances without this.
discriminant(&instance.def).hash_stable(hcx, &mut hasher);
});
// 64 bits should be enough to avoid collisions.