remove constraint around memcpy when storing to stack

This commit is contained in:
Brendan Hansknecht 2022-07-16 11:34:47 -07:00
parent dc74803c18
commit 872f6101f9
No known key found for this signature in database
GPG key ID: A2E3B0B6E483038E

View file

@ -734,7 +734,11 @@ impl<
ASM::mov_base32_freg64(buf, to_offset, reg);
}
_ if layout.stack_size(self.target_info) == 0 => {}
_ if layout.safe_to_memcpy() && layout.stack_size(self.target_info) > 8 => {
// TODO: Verify this is always true.
// The dev backend does not deal with refcounting and does not care about if data is safe to memcpy.
// It is just temporarily storing the value due to needing to free registers.
// Later, it will be reloaded and stored in refcounted as needed.
_ if layout.stack_size(self.target_info) > 8 => {
let (from_offset, size) = self.stack_offset_and_size(sym);
debug_assert!(from_offset % 8 == 0);
debug_assert!(size % 8 == 0);