Closed StrongerXi closed 3 years ago
While writing this PR, I realized that the caller-saved reg preservation can be implemented without exposing call instruction or caller-saved regs to register allocator -- just make call instruction write to all the caller-saved temps and pre-color those temps.
Validity of this idea is TBD.
live_across != intersection(live_in, live_out)
because a temp fromlive_in
could be re-written and used after this instruction, but its old definition was "killed" by the instruction, e.g.,T1 := T1 + 1
.The only place we're using this incorrect formula is register allocator, but fortunately (or unfortunately really) it never triggered any bug, because currently call instruction only writes to
RAX
, butRAX
is not read by call instruction.