[LLVMdev] portable way to modify the FP register?

James Molloy James.Molloy at arm.com
Mon Dec 13 09:03:17 PST 2010


Hi,

To add to what Anton said, what if you're on a non-x86 target, or --no-frame-pointer is set?

Also, I'm intrigued as to how you guarantee that in the intervening time between the coroutine/generator function bar() returning one result and the next invocation of bar(), foo() doesn't call another function and overwrite bar()'s stack frame?

Cheers,

James Molloy
Graduate Compiler Engineer, ARM Ltd.


> -----Original Message-----
> From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu]
> On Behalf Of Salvador Abreu
> Sent: 13 December 2010 15:57
> To: llvmdev at cs.uiuc.edu
> Subject: [LLVMdev] portable way to modify the FP register?
>
> Hi,
>
> I'd like to know if there's a portable way of modifying the FP
> register, in LLVM.
>
> Suppose foo() calls bar(); bar emits a result but remains active and
> needs to be able to produce more results - a bit like a coroutine.  We
> want bar to restore FP to what it was inside foo before transferring
> control back to foo (bar's stack frame is not disposed of).
>
> We'd make sure that foo only accesses local variables via FP (SP
> addressing is disabled).
>
> What we'd like to do is something like (abstracted syntax and semantics
> :-)
>   (FP) = @llvm.frameaddress(1) ;
>
> So, is there a portable way to change FP?
>
> --
> Salvador Abreu       --  http://www.di.uevora.pt/~spa/
> Departamento de Informatica
> Universidade de Evora - PORTUGAL
>
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium.  Thank you.





More information about the llvm-dev mailing list