[LLVMdev] Performance degradation when repeatedly exchanging JITted functions

James Molloy James.Molloy at arm.com
Tue Mar 6 08:09:36 PST 2012


Surely you need to patch *all* functions, not just the initial?

The point is with the current solution no matter which version of the function another function is linked to, it will hit a sled of JMPs and eventually end up at the newest.

If you only patched the first, that sled wouldn't work. So you'd have to patch all instances. That still shouldn't be too hard.

Cheers,

James

-----Original Message-----
From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Joerg Sonnenberger
Sent: 06 March 2012 15:45
To: llvmdev at cs.uiuc.edu
Subject: Re: [LLVMdev] Performance degradation when repeatedly exchanging JITted functions

On Tue, Mar 06, 2012 at 04:29:28PM +0100, Clemens Hammacher wrote:
> I think a solution would be to always call a function through it's
> stub, so that there is a single location to update when the function
> is exchanged. This would mean that there is always exactly one level
> of indirection, which is worse for programs that don't exchange
> functions at runtime, but is much better in our scenario.

Actually, you just have to make sure that you always patch the initial
function. You don't have to force it to be a stub.

Joerg
_______________________________________________
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