Hi All, Can anyone explain why the MachineRelocation field "NeedsStub" is set to true for GlobalValues on x86_64, but false on plain x86? This is causing the JITEmitter to allocate a stub for every GlobalValue relocation it encounters on x86_64, quickly exhausting the 512K region for stubs in the default JIT memory manager. Is this expected behavior? Is there anyway to override the stub generation? In this case, why are stubs even being allocated, my understanding was that they were merely placeholders for lazy JIT? The same application running on plain x86 requires no such stubs and therefore runs correctly. There is currently no stub deallocation functionality in the default memory manager, so the x86_64 version can only JIT a few thousand functions before the ExecutionEngine crashes with a JIT: Ran out of space for function stubs error. Thoughts? Thanks, Eric -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090413/ad32a1c2/attachment.html>
On Apr 13, 2009, at 8:09 AM, Eric wrote:> Hi All, > > Can anyone explain why the MachineRelocation field "NeedsStub" is > set to true for GlobalValues on x86_64, butThat's true for large code model or Mac OS X. Right now, x86_64 targets uses small code model by default. However, in JIT, the GV memory are allocated in heap and they are not guaranteed to be *close*. So the JIT is currently emitting stubs for all of them. Evan> false on plain x86? This is causing the JITEmitter to allocate a > stub for every GlobalValue relocation it encounters on x86_64, > quickly exhausting the 512K region for stubs in the default JIT > memory manager. Is this expected behavior? Is there anyway to > override the stub generation? In this case, why are stubs even being > allocated, my understanding was that they were merely placeholders > for lazy JIT? > > The same application running on plain x86 requires no such stubs and > therefore runs correctly. There is currently no stub deallocation > functionality in the default memory manager, so the x86_64 version > can only JIT a few thousand functions before the ExecutionEngine > crashes with a JIT: Ran out of space for function stubs error. > > Thoughts? > > Thanks, > Eric > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reasonably Related Threads
- [LLVMdev] [unladen-swallow] Re: Why does the x86-64 JIT emit stubs for external calls?
- [LLVMdev] [PATCH][RFC] Bug #4406: stubs for external functions should be registered even if DlsymStubs are disabled
- [LLVMdev] Being able to know the jitted code-size before emitting
- [LLVMdev] Being able to know the jitted code-size before emitting
- [LLVMdev] Being able to know the jitted code-size before emitting