rustfmt 0.8.1
This commit is contained in:
@@ -68,11 +68,12 @@ impl LiveValueVec {
|
||||
|
||||
/// Add a new live value to `values`.
|
||||
fn push(&mut self, value: Value, endpoint: Inst, affinity: Affinity) {
|
||||
self.values.push(LiveValue {
|
||||
value: value,
|
||||
endpoint: endpoint,
|
||||
affinity: affinity,
|
||||
});
|
||||
self.values
|
||||
.push(LiveValue {
|
||||
value: value,
|
||||
endpoint: endpoint,
|
||||
affinity: affinity,
|
||||
});
|
||||
}
|
||||
|
||||
/// Remove all elements.
|
||||
@@ -163,11 +164,14 @@ impl LiveValueTracker {
|
||||
// If the immediate dominator exits, we must have a stored list for it. This is a
|
||||
// requirement to the order EBBs are visited: All dominators must have been processed
|
||||
// before the current EBB.
|
||||
let idom_live_list =
|
||||
self.idom_sets.get(&idom).expect("No stored live set for dominator");
|
||||
let idom_live_list = self.idom_sets
|
||||
.get(&idom)
|
||||
.expect("No stored live set for dominator");
|
||||
// Get just the values that are live-in to `ebb`.
|
||||
for &value in idom_live_list.as_slice(&self.idom_pool) {
|
||||
let lr = liveness.get(value).expect("Immediate dominator value has no live range");
|
||||
let lr = liveness
|
||||
.get(value)
|
||||
.expect("Immediate dominator value has no live range");
|
||||
|
||||
// Check if this value is live-in here.
|
||||
if let Some(endpoint) = lr.livein_local_end(ebb, program_order) {
|
||||
@@ -179,7 +183,9 @@ impl LiveValueTracker {
|
||||
// Now add all the live arguments to `ebb`.
|
||||
let first_arg = self.live.values.len();
|
||||
for value in dfg.ebb_args(ebb) {
|
||||
let lr = liveness.get(value).expect("EBB argument value has no live range");
|
||||
let lr = liveness
|
||||
.get(value)
|
||||
.expect("EBB argument value has no live range");
|
||||
assert_eq!(lr.def(), ebb.into());
|
||||
match lr.def_local_end().into() {
|
||||
ExpandedProgramPoint::Inst(endpoint) => {
|
||||
@@ -259,16 +265,15 @@ impl LiveValueTracker {
|
||||
|
||||
/// Save the current set of live values so it is associated with `idom`.
|
||||
fn save_idom_live_set(&mut self, idom: Inst) {
|
||||
let values = self.live
|
||||
.values
|
||||
.iter()
|
||||
.map(|lv| lv.value);
|
||||
let values = self.live.values.iter().map(|lv| lv.value);
|
||||
let pool = &mut self.idom_pool;
|
||||
// If there already is a set saved for `idom`, just keep it.
|
||||
self.idom_sets.entry(idom).or_insert_with(|| {
|
||||
let mut list = ValueList::default();
|
||||
list.extend(values, pool);
|
||||
list
|
||||
});
|
||||
self.idom_sets
|
||||
.entry(idom)
|
||||
.or_insert_with(|| {
|
||||
let mut list = ValueList::default();
|
||||
list.extend(values, pool);
|
||||
list
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user