Fix checker: after moving edge-moves to prior to last branch of block (for simpler semantics for library user), we can no longer check blockparams; but this is fine because they do not exist in post-regalloc code.

This commit is contained in:
Chris Fallin
2021-05-09 19:38:20 -07:00
parent 4f26b1c78f
commit b7fd53efc5

View File

@@ -549,6 +549,11 @@ impl<'a, F: Function> Checker<'a, F> {
self.bb_insts.get_mut(&block).unwrap().push(checkinst); self.bb_insts.get_mut(&block).unwrap().push(checkinst);
} }
// Skip if this is a branch: the blockparams do not
// exist in post-regalloc code, and the edge-moves
// have to be inserted before the branch rather than
// after.
if !self.f.is_branch(inst) {
// Instruction itself. // Instruction itself.
let operands: Vec<_> = self.f.inst_operands(inst).iter().cloned().collect(); let operands: Vec<_> = self.f.inst_operands(inst).iter().cloned().collect();
let allocs: Vec<_> = out.inst_allocs(inst).iter().cloned().collect(); let allocs: Vec<_> = out.inst_allocs(inst).iter().cloned().collect();
@@ -561,6 +566,7 @@ impl<'a, F: Function> Checker<'a, F> {
}; };
debug!("checker: adding inst {:?}", checkinst); debug!("checker: adding inst {:?}", checkinst);
self.bb_insts.get_mut(&block).unwrap().push(checkinst); self.bb_insts.get_mut(&block).unwrap().push(checkinst);
}
// Any inserted edits after instruction. // Any inserted edits after instruction.
self.handle_edits(block, out, &mut insert_idx, ProgPoint::after(inst)); self.handle_edits(block, out, &mut insert_idx, ProgPoint::after(inst));