Skip to main content

Module ref_prop

Module ref_prop 

Source

Re-exportsยง

use std::borrow::Cow; ๐Ÿ”’
use rustc_data_structures::fx::FxHashSet; ๐Ÿ”’
use rustc_index::IndexVec; ๐Ÿ”’
use rustc_index::bit_set::DenseBitSet; ๐Ÿ”’
use rustc_middle::ty::TyCtxt; ๐Ÿ”’
use rustc_mir_dataflow::Analysis; ๐Ÿ”’
use rustc_mir_dataflow::impls::MaybeStorageDead; ๐Ÿ”’
use rustc_mir_dataflow::impls::always_storage_live_locals; ๐Ÿ”’
use rustc_span::bug; ๐Ÿ”’
use tracing::debug; ๐Ÿ”’
use tracing::instrument; ๐Ÿ”’
use tracing::instrument; ๐Ÿ”’
use crate::PassPolicy; ๐Ÿ”’
use crate::ssa::SsaLocals; ๐Ÿ”’
use crate::ssa::StorageLiveLocals; ๐Ÿ”’
use rustc_middle::mir::visit::*; ๐Ÿ”’
use rustc_middle::mir::*; ๐Ÿ”’

Structsยง

ReferencePropagation ๐Ÿ”’
Propagate references using SSA analysis.
Replacer ๐Ÿ”’
Utility to help performing substitution of *pattern by target.

Enumsยง

Value ๐Ÿ”’

Functionsยง

compute_replacement ๐Ÿ”’
For each local, save the place corresponding to *local.
fully_replaceable_locals ๐Ÿ”’
Compute the set of locals that can be fully replaced.
move_to_copy_pointers ๐Ÿ”’
The SSA analysis done by SsaLocals treats Operand::Move as a read, even though in general Operand::Move represents pass-by-pointer where the callee can overwrite the pointee (Miri always considers the place deinitialized). CopyProp has a similar trick to turn Operand::Move into Operand::Copy when required for an optimization, but in this pass we just turn all moves of pointers into copies because pointers should be by-value anyway.
propagate_ssa ๐Ÿ”’