Don't allow reuse_def constraints in the s390x Loop instruction (#5336)

This commit is contained in:
Trevor Elliott
2022-11-28 17:52:11 -08:00
committed by GitHub
parent 368004428a
commit a5a0645aff
2 changed files with 17 additions and 1 deletions

View File

@@ -1068,6 +1068,12 @@ fn s390x_get_operands<F: Fn(VReg) -> VReg>(inst: &Inst, collector: &mut OperandC
for inst in body.iter() {
s390x_get_operands(inst, collector);
}
// `reuse_def` constraints can't be permitted in a Loop instruction because the operand
// index will always be relative to the Loop instruction, not the individual
// instruction in the loop body. However, fixed-nonallocatable registers used with
// instructions that would have emitted `reuse_def` constraints are fine.
debug_assert!(collector.no_reuse_def());
}
&Inst::CondBreak { .. } => {}
&Inst::VirtualSPOffsetAdj { .. } => {}