[llvm] r222767 - Small model and JIT generally don't go well with each other.

Lang Hames lhames at gmail.com
Wed Nov 26 14:41:05 PST 2014


Hi Andy,

I believe this is now implemented by the
RTDyldMemoryManager::reserveAllocationSpace method. This would actually be
perfect for the LLI use case. Thanks for reminding me of it. :)

Cheers,
Lang.



On Wed, Nov 26, 2014 at 2:19 PM, Kaylor, Andrew <andrew.kaylor at intel.com>
wrote:

>  There was a suggestion back in January  (and even a patch) that we add
> an option to have RuntimeDyld scan the image before it does any allocation
> and give the memory manager enough information to pre-allocate all the
> blocks that would be necessary.  Here’s a link to the discussion:
>
>
>
> http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-January/069267.html
>
>
>
> One of my colleagues actually wrote a memory manager that worked this way
> back when we were first implementing RuntimeDyld for ELF on x86-64
> platforms, but after some discussion we decided that it was more
> complicated than we wanted -- at least for a default implementation of the
> memory manager.  That said, this issue has come up regularly so I
> definitely think it is worth addressing.
>
>
>
> -Andy
>
>
>
>
>
> *From:* llvm-commits-bounces at cs.uiuc.edu [mailto:
> llvm-commits-bounces at cs.uiuc.edu] *On Behalf Of *Lang Hames
> *Sent:* Wednesday, November 26, 2014 11:52 AM
> *To:* Commit Messages and Patches for LLVM
> *Subject:* Re: [llvm] r222767 - Small model and JIT generally don't go
> well with each other.
>
>
>
> > The default implementation does *not* do that.
>
>
>
> That's why I suggested that we add a new mode with a memory manager that
> does do that. ;)
>
>
>
> > The necessary mmap flags are not portable either.
>
>
>
> I don't think we'd need mmap. I'm imagining that this mode would be for
> regression tests only. It would use a trivial RTDyldMemoryManager subclass
> that wraps a bump-ptr allocator and reserves some small amount of memory
> (~16Mb seems like it should be fine) up front.
>
>
>
> Another item for the JIT to-do list. :)
>
>
>
> Cheers,
>
> Lang.
>
>
>
> On Wed, Nov 26, 2014 at 2:25 AM, Joerg Sonnenberger <
> joerg at britannica.bec.de> wrote:
>
> On Tue, Nov 25, 2014 at 11:07:16PM -0800, Lang Hames wrote:
> > It may be worth filing a bug for this, since we still want
> small-code-model
> > to be supported in the JIT. To make this testable we'd need to add a mode
> > to LLI that guarantees allocations compatible with small code model.
>
> As discussed with echristo on IRC, small code model for JIT does work IF
> the memory manager ensures that the constraints are implemented. The
> default implementation does *not* do that. The necessary mmap flags are
> not portable either.
>
> Joerg
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141126/768e3d79/attachment.html>


More information about the llvm-commits mailing list