s390x: Fix regalloc checker error (#4973)

For ShiftRR and VecShiftRR, if shift_reg is zero_reg(), the
instruction does not actually use any register value.

Fixes #4969
This commit is contained in:
Ulrich Weigand
2022-09-28 16:25:23 +01:00
committed by GitHub
parent cdecc858b4
commit 83bb6fd4c8

View File

@@ -539,8 +539,10 @@ fn s390x_get_operands<F: Fn(VReg) -> VReg>(inst: &Inst, collector: &mut OperandC
} => { } => {
collector.reg_def(rd); collector.reg_def(rd);
collector.reg_use(rn); collector.reg_use(rn);
if shift_reg != zero_reg() {
collector.reg_use(shift_reg); collector.reg_use(shift_reg);
} }
}
&Inst::RxSBG { rd, rn, .. } => { &Inst::RxSBG { rd, rn, .. } => {
collector.reg_mod(rd); collector.reg_mod(rd);
collector.reg_use(rn); collector.reg_use(rn);
@@ -744,8 +746,10 @@ fn s390x_get_operands<F: Fn(VReg) -> VReg>(inst: &Inst, collector: &mut OperandC
} => { } => {
collector.reg_def(rd); collector.reg_def(rd);
collector.reg_use(rn); collector.reg_use(rn);
if shift_reg != zero_reg() {
collector.reg_use(shift_reg); collector.reg_use(shift_reg);
} }
}
&Inst::VecSelect { rd, rn, rm, ra, .. } => { &Inst::VecSelect { rd, rn, rm, ra, .. } => {
collector.reg_def(rd); collector.reg_def(rd);
collector.reg_use(rn); collector.reg_use(rn);