MCPcopy Create free account
hub / github.com/Amanieu/regalloc3 / meet

Method meet

src/debug_utils/checker.rs:66–83  ·  view source on GitHub ↗

Lattice meet operation when merging initial block states from multiple predecessors. This only keeps the common subset of values between the two incoming states. This also records whether any changes occurs, which helps determine when a fixed point has been reached.

(&mut self, other: &Self, changed: &mut bool)

Source from the content-addressed store, hash-verified

64 /// This also records whether any changes occurs, which helps determine when
65 /// a fixed point has been reached.
66 fn meet(&mut self, other: &Self, changed: &mut bool) {
67 self.unit_values.retain(|unit, values| {
68 if let Some(other_values) = other.unit_values.get(unit) {
69 values.retain(|&mut value| {
70 if !other_values.contains(&value) {
71 *changed = true;
72 false
73 } else {
74 true
75 }
76 });
77 !values.is_empty()
78 } else {
79 *changed = !values.is_empty();
80 false
81 }
82 });
83 }
84
85 /// Removes the given value from all `AllocationUnit`s.
86 ///

Callers 1

check_blockMethod · 0.80

Calls 4

retainMethod · 0.80
getMethod · 0.45
containsMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected