Struct rustc_mir_transform::dest_prop::Conflicts
source · struct Conflicts<'a> {
relevant_locals: &'a BitSet<Local>,
matrix: BitMatrix<Local, Local>,
unify_cache: BitSet<Local>,
unified_locals: InPlaceUnificationTable<UnifyLocal>,
}
Fields
relevant_locals: &'a BitSet<Local>
matrix: BitMatrix<Local, Local>
The conflict matrix. It is always symmetric and the adjacency matrix of the corresponding conflict graph.
unify_cache: BitSet<Local>
Preallocated BitSet
used by unify
.
unified_locals: InPlaceUnificationTable<UnifyLocal>
Tracks locals that have been merged together to prevent cycles and propagate conflicts.
Implementations
sourceimpl<'a> Conflicts<'a>
impl<'a> Conflicts<'a>
fn build<'tcx>(
tcx: TyCtxt<'tcx>,
body: &Body<'tcx>,
relevant_locals: &'a BitSet<Local>
) -> Self
fn record_dataflow_conflicts(&mut self, new_conflicts: &mut BitSet<Local>)
fn record_local_conflict(&mut self, a: Local, b: Local, why: &str)
sourcefn record_statement_conflicts(&mut self, stmt: &Statement<'_>)
fn record_statement_conflicts(&mut self, stmt: &Statement<'_>)
Records locals that must not overlap during the evaluation of stmt
. These locals conflict
and must not be merged.
fn record_terminator_conflicts(&mut self, term: &Terminator<'_>)
sourcefn can_unify(&mut self, a: Local, b: Local) -> bool
fn can_unify(&mut self, a: Local, b: Local) -> bool
Checks whether a
and b
may be merged. Returns false
if there’s a conflict.
sourcefn unify(&mut self, a: Local, b: Local)
fn unify(&mut self, a: Local, b: Local)
Merges the conflicts of a
and b
, so that each one inherits all conflicts of the other.
can_unify
must have returned true
for the same locals, or this may panic or lead to
miscompiles.
This is called when the pass makes the decision to unify a
and b
(or parts of a
and
b
) and is needed to ensure that future unification decisions take potentially newly
introduced conflicts into account.
For an example, assume we have locals _0
, _1
, _2
, and _3
. There are these conflicts:
_0
<->_1
_1
<->_2
_3
<->_0
We then decide to merge _2
with _3
since they don’t conflict. Then we decide to merge
_2
with _0
, which also doesn’t have a conflict in the above list. However _2
is now
_3
, which does conflict with _0
.
Auto Trait Implementations
impl<'a> RefUnwindSafe for Conflicts<'a>
impl<'a> Send for Conflicts<'a>
impl<'a> Sync for Conflicts<'a>
impl<'a> Unpin for Conflicts<'a>
impl<'a> UnwindSafe for Conflicts<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Layout
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 136 bytes