[PATCH] Add support for symbolic large constant entries inside stackmaps

Marius Wachtler undingen at gmail.com
Tue Apr 21 16:00:23 PDT 2015


Hi,

On Tue, Apr 21, 2015 at 2:19 AM, Philip Reames <listmail at philipreames.com>
wrote:

>  Can you put this up on phabricator?  That will make review easier.
>

I have put it up one phabricator: http://reviews.llvm.org/D9176 and I
created https://llvm.org/bugs/show_bug.cgi?id=23306 for the "run out of
registers" bug.

Is there anything special about the fact these locations hold constants?
> Or are you essentially just storing the location of a global variable as a
> relocatable symbol?  (Side note: What actually knows how to update the
> resulting symbol in the stackmap format?)
>

There is nothing special about them, I'm just storing the location of a
global variable as a relocatable symbol. LLVM currently already emits a
relocatable sym entry for the ''Function Address' field inside the
stackmap, this patch just adds support for also emitting symbol inside the
stackmap "Constant" entries when the patchpoint has a GV as live argument.
So the mechanism for updating the relocation inside a stackmap is already
available and in use by the MCJIT for the 'Function Address'. Pyston just
intercepts: RTDyldMemoryManager::getSymbolAddress() and return the real
address when the object get's loaded.

StkSizeRecord[NumFunctions] {
  uint64 : Function Address
  uint64 : Stack Size
}

But I have to warn you guys I'm a novice inside this codebase, so please
review this patch carefully.



>
>  Currently when a patchpoint has a constant variable as live argument it
> will materialize it in a register. Which we don't want because the live
> variables are rarely used (also the regalloc runs out of registers when
> having to many const variables as argument to the pp?!?...).
>
> This sounds like a bug.  Could you try to isolate and file a test case?
>
>  This patch emits a symbol reference inside the array of large constants
> in the stackmap. The stack map format is untouched by this patch.
>
>  Together with
> http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20150330/269160.html
> this should make it possible to cache more JITed functions containing
> patchpoints.
>
>  Looking forward to comments on this patch.
> Cheers,
> Marius
>
>
>
>
> _______________________________________________
> llvm-commits mailing listllvm-commits at cs.uiuc.eduhttp://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150422/0b71ae0d/attachment.html>


More information about the llvm-commits mailing list