Allocate a temporary for 64-bit constant loads in the s390x backend (#5357)
Avoid reusing a destination virtual register for 64-bit constants in the s390x backend. This change addresses a case identified by the regalloc2 ssa validator, as the destination register was written to twice when constants were generated via the MachInst::gen_constant function.
This commit is contained in:
@@ -104,7 +104,7 @@ pub fn mem_finalize(
|
||||
} else {
|
||||
let tmp = writable_spilltmp_reg();
|
||||
assert!(base != tmp.to_reg());
|
||||
insts.extend(Inst::load_constant64(tmp, off as u64));
|
||||
insts.extend(Inst::load_constant64(tmp, off as u64, |_| tmp));
|
||||
MemArg::reg_plus_reg(base, tmp.to_reg(), mem.get_flags())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user