Open eponier opened 3 months ago
Note that there is a file testing this feature, namely tests/success/pointers/x86-64/test_spill_loop.jazz
and it does not need the trick of using a subarray, but I think it is because of the while loop. The stack ptr
is not dead and thus not removed.
I have a function
fn f (reg ptr u8[N] r) -> reg ptr u8[N]
that uses a lot of registers, so I want to spill the argument before the call and unspill it after the call.But in this code, the region associated to variable
s
, and then to variabler
is partial. I have to copy backr
intos
after the call. This spurious assignment will be removed by stack alloc, there is code dedicated to it.This is accepted by the compiler, but does not do what I want at all. The first
s = r
is removed, sinces
is dead. Here is a solution.This works as expected, but is not so natural.