1
Fork 0

Rollup merge of #130297 - nnethercote:dataflow-cleanups, r=cjgillot

Dataflow cleanups

r? `@cjgillot`
This commit is contained in:
Matthias Krüger 2024-09-13 18:25:45 +02:00 committed by GitHub
commit c5e0f9ae42
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 161 additions and 167 deletions

View file

@ -885,12 +885,12 @@ struct StorageConflictVisitor<'a, 'tcx> {
impl<'a, 'tcx, R> rustc_mir_dataflow::ResultsVisitor<'a, 'tcx, R>
for StorageConflictVisitor<'a, 'tcx>
{
type FlowState = BitSet<Local>;
type Domain = BitSet<Local>;
fn visit_statement_before_primary_effect(
&mut self,
_results: &mut R,
state: &Self::FlowState,
state: &Self::Domain,
_statement: &'a Statement<'tcx>,
loc: Location,
) {
@ -900,7 +900,7 @@ impl<'a, 'tcx, R> rustc_mir_dataflow::ResultsVisitor<'a, 'tcx, R>
fn visit_terminator_before_primary_effect(
&mut self,
_results: &mut R,
state: &Self::FlowState,
state: &Self::Domain,
_terminator: &'a Terminator<'tcx>,
loc: Location,
) {
@ -909,13 +909,13 @@ impl<'a, 'tcx, R> rustc_mir_dataflow::ResultsVisitor<'a, 'tcx, R>
}
impl StorageConflictVisitor<'_, '_> {
fn apply_state(&mut self, flow_state: &BitSet<Local>, loc: Location) {
fn apply_state(&mut self, state: &BitSet<Local>, loc: Location) {
// Ignore unreachable blocks.
if let TerminatorKind::Unreachable = self.body.basic_blocks[loc.block].terminator().kind {
return;
}
self.eligible_storage_live.clone_from(flow_state);
self.eligible_storage_live.clone_from(state);
self.eligible_storage_live.intersect(&**self.saved_locals);
for local in self.eligible_storage_live.iter() {

View file

@ -724,13 +724,13 @@ impl<'mir, 'tcx>
ResultsVisitor<'mir, 'tcx, Results<'tcx, ValueAnalysisWrapper<ConstAnalysis<'_, 'tcx>>>>
for Collector<'tcx, '_>
{
type FlowState = State<FlatSet<Scalar>>;
type Domain = State<FlatSet<Scalar>>;
#[instrument(level = "trace", skip(self, results, statement))]
fn visit_statement_before_primary_effect(
&mut self,
results: &mut Results<'tcx, ValueAnalysisWrapper<ConstAnalysis<'_, 'tcx>>>,
state: &Self::FlowState,
state: &Self::Domain,
statement: &'mir Statement<'tcx>,
location: Location,
) {
@ -752,7 +752,7 @@ impl<'mir, 'tcx>
fn visit_statement_after_primary_effect(
&mut self,
results: &mut Results<'tcx, ValueAnalysisWrapper<ConstAnalysis<'_, 'tcx>>>,
state: &Self::FlowState,
state: &Self::Domain,
statement: &'mir Statement<'tcx>,
location: Location,
) {
@ -777,7 +777,7 @@ impl<'mir, 'tcx>
fn visit_terminator_before_primary_effect(
&mut self,
results: &mut Results<'tcx, ValueAnalysisWrapper<ConstAnalysis<'_, 'tcx>>>,
state: &Self::FlowState,
state: &Self::Domain,
terminator: &'mir Terminator<'tcx>,
location: Location,
) {