[−][src]Struct rustc_passes::liveness::RWUTable

pub(in liveness) struct RWUTable {
    packed_rwus: Vec<u32>,
    unpacked_rwus: Vec<RWU>,
}

Conceptually, this is like a Vec<RWU>. But the number of RWUs can get very large, so it uses a more compact representation that takes advantage of the fact that when the number of RWUs is large, most of them have an invalid reader and an invalid writer.

Fields

packed_rwus: Vec<u32>

Each entry in packed_rwus is either INV_INV_FALSE, INV_INV_TRUE, or an index into unpacked_rwus. In the common cases, this compacts the 65 bits of data into 32; in the uncommon cases, it expands the 65 bits in 96.

More compact representations are possible -- e.g., use only 2 bits per packed RWU and make the secondary table a HashMap that maps from indices to RWUs -- but this one strikes a good balance between size and speed.

unpacked_rwus: Vec<RWU>

Implementations

impl RWUTable[src]

pub(in liveness) fn new(
    num_rwus: usize
) -> RWUTable
[src]

pub(in liveness) fn get(
    &self,
    idx: usize
) -> RWU
[src]

pub(in liveness) fn get_reader(
    &self,
    idx: usize
) -> Option<LiveNode>
[src]

pub(in liveness) fn get_writer(
    &self,
    idx: usize
) -> Option<LiveNode>
[src]

pub(in liveness) fn get_used(
    &self,
    idx: usize
) -> bool
[src]

pub(in liveness) fn copy_packed(
    &mut self,
    dst_idx: usize,
    src_idx: usize
)
[src]

pub(in liveness) fn assign_unpacked(
    &mut self,
    idx: usize,
    rwu: RWU
)
[src]

pub(in liveness) fn assign_inv_inv(
    &mut self,
    idx: usize
)
[src]

Auto Trait Implementations

impl RefUnwindSafe for RWUTable

impl Send for RWUTable

impl Sync for RWUTable

impl Unpin for RWUTable

impl UnwindSafe for RWUTable

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized, 
[src]

impl<T> Borrow<T> for T where
    T: ?Sized, 
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.