caller-saved register saving


I am working on a new target, and would like to save the caller-saved regs at the call-site.

I have used the ADJCALLSTACKDOWN / UP pseudo-instructions, and my idea was to eliminate these, and in doing this using the RegScavenger to find the caller-saved live regs, and the push / pop these.

I find that there are no such regs actually live there. It seems that these registers are somehow COPY:d and not coalesced, and thus not live across the call.

Is this correct? How does this work? It looked like there was a method in PrologueEpilogueInserter for these regs before, but it has been removed. Please explain.