[LLVMdev] Getting the Stack Pointer

Chris Lattner sabre at nondot.org
Tue Mar 4 10:35:19 PST 2008


On Tue, 4 Mar 2008, David Greene wrote:
>> 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.

It sounds like the debugger is operating at the wrong abstraction level 
here.  If it's just the RA debugger, using frame indices makes the most 
sense.

> 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.

I'm not sure what you mean here.  If this is for debug dumps in the 
register allocator, dumping the stack pointer would be the *wrong* thing, 
because the frame indexes may end up being relative to the SP or the BP.

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/



More information about the llvm-dev mailing list