[LLVMdev] Finding live registers at a specific point in a MachineFunction and spilling them

Stephen Crane sjcrane at uci.edu
Tue Sep 3 19:20:10 PDT 2013

On Sep 3, 2013, at 17:21 , Manuel Jacob <me at manueljacob.de> wrote:
> The problem is to safe registers that contain gc pointers to the stack
> before a call and reload them after the call. Is there an Analysis Pass
> that computes information about which registers are live during a
> specific instruction? I looked at LiveIntervals and LiveVariables, but
> they seem to be for cases when the pass knows the register and wants to
> find the points where it is live. My code knows the point and wants to
> find the registers that are live.

I've been doing something similar using the RegisterScavenger class. However, I'm no LLVM expert (yet), so that may not be the best way.

> Another part of the problem is to spill the registers to the stack. Do
> you think this is possible with the existing register spilling code?

I would also be interested to know if anyone has adapted the existing register spilling code for other uses. Didn't seem very flexible to me at first glance.

- Stephen

More information about the llvm-dev mailing list