Rollup merge of #99022 - pierwill:always-storage-live-locals, r=pierwill
MIR dataflow: Rename function to `always_storage_live_locals` Related to #99021. r? ```@JakobDegen``` (as discussed on Zulip)
This commit is contained in:
commit
416dc43124
@ -15,7 +15,7 @@ use rustc_middle::ty::layout::{
|
|||||||
use rustc_middle::ty::{
|
use rustc_middle::ty::{
|
||||||
self, query::TyCtxtAt, subst::SubstsRef, ParamEnv, Ty, TyCtxt, TypeFoldable,
|
self, query::TyCtxtAt, subst::SubstsRef, ParamEnv, Ty, TyCtxt, TypeFoldable,
|
||||||
};
|
};
|
||||||
use rustc_mir_dataflow::storage::always_live_locals;
|
use rustc_mir_dataflow::storage::always_storage_live_locals;
|
||||||
use rustc_query_system::ich::StableHashingContext;
|
use rustc_query_system::ich::StableHashingContext;
|
||||||
use rustc_session::Limit;
|
use rustc_session::Limit;
|
||||||
use rustc_span::{Pos, Span};
|
use rustc_span::{Pos, Span};
|
||||||
@ -707,7 +707,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
|||||||
let mut locals = IndexVec::from_elem(dummy, &body.local_decls);
|
let mut locals = IndexVec::from_elem(dummy, &body.local_decls);
|
||||||
|
|
||||||
// Now mark those locals as live that have no `Storage*` annotations.
|
// Now mark those locals as live that have no `Storage*` annotations.
|
||||||
let always_live = always_live_locals(self.body());
|
let always_live = always_storage_live_locals(self.body());
|
||||||
for local in locals.indices() {
|
for local in locals.indices() {
|
||||||
if always_live.contains(local) {
|
if always_live.contains(local) {
|
||||||
locals[local].value = LocalValue::Live(Operand::Immediate(Immediate::Uninit));
|
locals[local].value = LocalValue::Live(Operand::Immediate(Immediate::Uninit));
|
||||||
|
@ -15,7 +15,7 @@ use rustc_middle::ty::fold::BottomUpFolder;
|
|||||||
use rustc_middle::ty::subst::Subst;
|
use rustc_middle::ty::subst::Subst;
|
||||||
use rustc_middle::ty::{self, InstanceDef, ParamEnv, Ty, TyCtxt, TypeFoldable, TypeVisitable};
|
use rustc_middle::ty::{self, InstanceDef, ParamEnv, Ty, TyCtxt, TypeFoldable, TypeVisitable};
|
||||||
use rustc_mir_dataflow::impls::MaybeStorageLive;
|
use rustc_mir_dataflow::impls::MaybeStorageLive;
|
||||||
use rustc_mir_dataflow::storage::always_live_locals;
|
use rustc_mir_dataflow::storage::always_storage_live_locals;
|
||||||
use rustc_mir_dataflow::{Analysis, ResultsCursor};
|
use rustc_mir_dataflow::{Analysis, ResultsCursor};
|
||||||
use rustc_target::abi::{Size, VariantIdx};
|
use rustc_target::abi::{Size, VariantIdx};
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ impl<'tcx> MirPass<'tcx> for Validator {
|
|||||||
let param_env = tcx.param_env(def_id);
|
let param_env = tcx.param_env(def_id);
|
||||||
let mir_phase = self.mir_phase;
|
let mir_phase = self.mir_phase;
|
||||||
|
|
||||||
let always_live_locals = always_live_locals(body);
|
let always_live_locals = always_storage_live_locals(body);
|
||||||
let storage_liveness = MaybeStorageLive::new(always_live_locals)
|
let storage_liveness = MaybeStorageLive::new(always_live_locals)
|
||||||
.into_engine(tcx, body)
|
.into_engine(tcx, body)
|
||||||
.iterate_to_fixpoint()
|
.iterate_to_fixpoint()
|
||||||
|
@ -7,7 +7,7 @@ use rustc_middle::mir::{self, Local};
|
|||||||
//
|
//
|
||||||
// FIXME: Currently, we need to traverse the entire MIR to compute this. We should instead store it
|
// FIXME: Currently, we need to traverse the entire MIR to compute this. We should instead store it
|
||||||
// as a field in the `LocalDecl` for each `Local`.
|
// as a field in the `LocalDecl` for each `Local`.
|
||||||
pub fn always_live_locals(body: &mir::Body<'_>) -> BitSet<Local> {
|
pub fn always_storage_live_locals(body: &mir::Body<'_>) -> BitSet<Local> {
|
||||||
let mut always_live_locals = BitSet::new_filled(body.local_decls.len());
|
let mut always_live_locals = BitSet::new_filled(body.local_decls.len());
|
||||||
|
|
||||||
for block in body.basic_blocks() {
|
for block in body.basic_blocks() {
|
||||||
|
@ -67,7 +67,7 @@ use rustc_middle::ty::{self, AdtDef, Ty, TyCtxt};
|
|||||||
use rustc_mir_dataflow::impls::{
|
use rustc_mir_dataflow::impls::{
|
||||||
MaybeBorrowedLocals, MaybeLiveLocals, MaybeRequiresStorage, MaybeStorageLive,
|
MaybeBorrowedLocals, MaybeLiveLocals, MaybeRequiresStorage, MaybeStorageLive,
|
||||||
};
|
};
|
||||||
use rustc_mir_dataflow::storage;
|
use rustc_mir_dataflow::storage::always_storage_live_locals;
|
||||||
use rustc_mir_dataflow::{self, Analysis};
|
use rustc_mir_dataflow::{self, Analysis};
|
||||||
use rustc_target::abi::VariantIdx;
|
use rustc_target::abi::VariantIdx;
|
||||||
use rustc_target::spec::PanicStrategy;
|
use rustc_target::spec::PanicStrategy;
|
||||||
@ -1379,7 +1379,7 @@ impl<'tcx> MirPass<'tcx> for StateTransform {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
let always_live_locals = storage::always_live_locals(&body);
|
let always_live_locals = always_storage_live_locals(&body);
|
||||||
|
|
||||||
let liveness_info =
|
let liveness_info =
|
||||||
locals_live_across_suspend_points(tcx, body, &always_live_locals, movable);
|
locals_live_across_suspend_points(tcx, body, &always_live_locals, movable);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user