Skip to content

Commit

Permalink
s390x: Fix more regalloc checker errors (#5121)
Browse files Browse the repository at this point in the history
For VecInsertLane[Undef] and VecExtractLane, if lane_reg is zero_reg(),
the instruction does not actually use any register value.

Fixes #5090
  • Loading branch information
uweigand authored Oct 25, 2022
1 parent 39b3b1d commit b61e678
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions cranelift/codegen/src/isa/s390x/inst/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -974,21 +974,27 @@ fn s390x_get_operands<F: Fn(VReg) -> 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);
Expand Down

0 comments on commit b61e678

Please sign in to comment.