[LLVMdev] is there some canonical way to extend liveness?

Philip Reames listmail at philipreames.com
Tue Feb 17 20:11:05 PST 2015


On 02/17/2015 06:49 PM, Andy Ayers wrote:
>
> Yes, one of the cases comes from GC – at times the code generator must 
> ensure a particular reference is live and reported at every safepoint. 
> This is in the context of a precise GC, though there’s also a 
> conservative mode that we plan to use initially until we get the 
> precise GC reporting correct. Either way that reference must remain live.
>
Ok, glad we're on the same page.
>
> We haven’t yet decided when or how we’ll insert safepoints, though we 
> had been thinking of doing it fairly early on to provide some 
> opportunity for optimizers to reason about them.
>
If you want, I'm happy to chat in person or phone about some of the 
tradeoffs here.  We could also stick to email, but I find that involved 
back and forth discussions tend to be easier with voice.
>
> If I understand the proposal for gc.statepoint correctly, this would 
> be a degenerate case with no function to call and no use of the 
> relocated value.
>
Yes.  It's not really a case we'd thought about per se.  If you want to 
poll on return, this is easy.  If you want it to just hold something 
live, but otherwise not actually call anything, we'd have to implement 
something to get good code gen.  Providing a dummy function which you 
called would be a good way to get started.
>
> *From:*Philip Reames [mailto:listmail at philipreames.com]
> *Sent:* Tuesday, February 17, 2015 4:42 PM
> *To:* Andy Ayers; llvmdev at cs.uiuc.edu
> *Subject:* Re: [LLVMdev] is there some canonical way to extend liveness?
>
> I'm assuming that you're asking this in the context of GC?  Are you 
> doing conservative stack scanning?
>
> One way you could address this would be to place a gc.statepoint 
> immediately before the return with the value you need held live 
> mentioned.  This would also give you a precise stackmap at that 
> location (for the variables explicitly listed).
>
> Philip
>
> On 02/17/2015 12:46 PM, Andy Ayers wrote:
>
>     In other compilers I’ve worked on there were special pseudo
>     instructions (or similar mechanisms like adding extra source
>     operands to returns) that allowed you to artificially extend
>     lifetimes of values. For instance we might have a requirement that
>     a certain local (say the ‘this pointer’) remain live throughout
>     the method.
>
>     Is there anything like this in LLVM?
>
>
>
>
>     _______________________________________________
>
>     LLVM Developers mailing list
>
>     LLVMdev at cs.uiuc.edu  <mailto:LLVMdev at cs.uiuc.edu>          http://llvm.cs.uiuc.edu
>
>     http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150217/878c555d/attachment.html>


More information about the llvm-dev mailing list