[LLVMdev] Getting the Stack Pointer

David Greene dag at cray.com
Tue Mar 4 09:44:42 PST 2008


On Tuesday 04 March 2008 12:16, Chris Lattner wrote:

> > Would it be ok to add a getStackPointerRegister method to
> > TargetRegisterInfo?
>
> Why do you need to do this in a register allocator?  Typically you want to
> refer to abstract frame indices.  Wouldn't fernando's debugger use a
> similar representation?

I don't need it in the allocator.  I need it in Fernando's spiller that prints
the IR used by the debugger.  The IR includes references to the stack
pointer.  I need to add some sMira IR instructions at the top of the function 
to define the stack pointer (and other things) so it isn't flagged as 
undefined by the debugger.

I suppose we could change Fernando's IR so it works with abstract stack
indices but there are other times I've wanted to know the stack pointer as
well, especially when dumping debug info.

                                                    -Dave



More information about the llvm-dev mailing list