save some work
This commit is contained in:
@@ -1164,13 +1164,18 @@ fn calc_live_bitmaps<'a, F: Function>(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for inst in insns.rev().iter() {
|
// TODO: evaluate if this generates better code than insns.rev().iter()
|
||||||
for pos in &[OperandPos::Late, OperandPos::Early] {
|
let last_idx = insns.last().index();
|
||||||
|
let len = last_idx - insns.first().index() + 1;
|
||||||
|
for inst_rev_idx in 0..len {
|
||||||
|
let inst = Inst::new(last_idx - inst_rev_idx);
|
||||||
|
// TODO: this differs from the algo in liveranges.rs by not iterating through the positions
|
||||||
|
// as in SSA it should make no difference as there can be no vreg that is both a use and def at
|
||||||
|
// a single instruction
|
||||||
for op in state.func.inst_operands(inst) {
|
for op in state.func.inst_operands(inst) {
|
||||||
if op.as_fixed_nonallocatable().is_some() {
|
if op.as_fixed_nonallocatable().is_some() {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if op.pos() == *pos {
|
|
||||||
let was_live = live.get(op.vreg().vreg());
|
let was_live = live.get(op.vreg().vreg());
|
||||||
trace!("op {:?} was_live = {}", op, was_live);
|
trace!("op {:?} was_live = {}", op, was_live);
|
||||||
match op.kind() {
|
match op.kind() {
|
||||||
@@ -1183,8 +1188,8 @@ fn calc_live_bitmaps<'a, F: Function>(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
// TODO: i dont get why blockparams are not live when going in?
|
||||||
for &blockparam in state.func.block_params(block) {
|
for &blockparam in state.func.block_params(block) {
|
||||||
live.set(blockparam.vreg(), false);
|
live.set(blockparam.vreg(), false);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user