diff --git a/cranelift/codegen/src/isa/s390x/inst/mod.rs b/cranelift/codegen/src/isa/s390x/inst/mod.rs index 706c50d4d96e..8e3e4eda5748 100644 --- a/cranelift/codegen/src/isa/s390x/inst/mod.rs +++ b/cranelift/codegen/src/isa/s390x/inst/mod.rs @@ -974,21 +974,27 @@ fn s390x_get_operands VReg>(inst: &Inst, collector: &mut OperandC collector.reg_reuse_def(rd, 1); collector.reg_use(ri); collector.reg_use(rn); - collector.reg_use(lane_reg); + if lane_reg != zero_reg() { + collector.reg_use(lane_reg); + } } &Inst::VecInsertLaneUndef { rd, rn, lane_reg, .. } => { collector.reg_def(rd); collector.reg_use(rn); - collector.reg_use(lane_reg); + if lane_reg != zero_reg() { + collector.reg_use(lane_reg); + } } &Inst::VecExtractLane { rd, rn, lane_reg, .. } => { collector.reg_def(rd); collector.reg_use(rn); - collector.reg_use(lane_reg); + if lane_reg != zero_reg() { + collector.reg_use(lane_reg); + } } &Inst::VecInsertLaneImm { rd, ri, .. } => { collector.reg_reuse_def(rd, 1);