diff --git a/cranelift/codegen/src/isa/s390x/inst/mod.rs b/cranelift/codegen/src/isa/s390x/inst/mod.rs index 68cc20af91..a28c8913ed 100644 --- a/cranelift/codegen/src/isa/s390x/inst/mod.rs +++ b/cranelift/codegen/src/isa/s390x/inst/mod.rs @@ -539,7 +539,9 @@ fn s390x_get_operands VReg>(inst: &Inst, collector: &mut OperandC } => { collector.reg_def(rd); collector.reg_use(rn); - collector.reg_use(shift_reg); + if shift_reg != zero_reg() { + collector.reg_use(shift_reg); + } } &Inst::RxSBG { rd, rn, .. } => { collector.reg_mod(rd); @@ -744,7 +746,9 @@ fn s390x_get_operands VReg>(inst: &Inst, collector: &mut OperandC } => { collector.reg_def(rd); collector.reg_use(rn); - collector.reg_use(shift_reg); + if shift_reg != zero_reg() { + collector.reg_use(shift_reg); + } } &Inst::VecSelect { rd, rn, rm, ra, .. } => { collector.reg_def(rd);