Make intern_lazy_const
actually intern its argument.
Currently it just unconditionally allocates it in the arena. For a "Clean Check" build of the the `packed-simd` benchmark, this change reduces both the `max-rss` and `faults` counts by 59%; it slightly (~3%) increases the instruction counts but the `wall-time` is unchanged. For the same builds of a few other benchmarks, `max-rss` and `faults` drop by 1--5%, but instruction counts and `wall-time` changes are in the noise. Fixes #57432, fixes #57829.
This commit is contained in:
parent
8ae730a442
commit
f2871a9ce5
17 changed files with 40 additions and 38 deletions
|
@ -203,7 +203,7 @@ impl<'cx, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for QueryNormalizer<'cx, 'gcx, 'tcx
|
|||
if let Ok(evaluated) = tcx.const_eval(param_env.and(cid)) {
|
||||
let substs = tcx.lift_to_global(&substs).unwrap();
|
||||
let evaluated = evaluated.subst(tcx, substs);
|
||||
return tcx.intern_lazy_const(ty::LazyConst::Evaluated(evaluated));
|
||||
return tcx.mk_lazy_const(ty::LazyConst::Evaluated(evaluated));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -215,7 +215,7 @@ impl<'cx, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for QueryNormalizer<'cx, 'gcx, 'tcx
|
|||
promoted: None,
|
||||
};
|
||||
if let Ok(evaluated) = tcx.const_eval(param_env.and(cid)) {
|
||||
return tcx.intern_lazy_const(ty::LazyConst::Evaluated(evaluated));
|
||||
return tcx.mk_lazy_const(ty::LazyConst::Evaluated(evaluated));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue