search for: finalizeobject

Displaying 20 results from an estimated 60 matches for "finalizeobject".

2014 Nov 13
2
[LLVMdev] finalizeObject function implemetation in MCJIT is wrong
Hi all. I found some issue in implementation of finalizeObject function in MCJIT.cpp. If you look at the source code of the function, you can notice that machine code for second "owned" module will never be generated if it doesn't depend on the first one. More over it will cause a crash if entry point isn't in first module. Implementation of...
2014 Nov 18
2
[LLVMdev] finalizeObject function implemetation in MCJIT is wrong
...ikie <dblaikie at gmail.com> wrote: > [+Lang, owner of JITs, defender of register allocators, etc] > > On Thu, Nov 13, 2014 at 8:29 AM, Radek Zagorowicz < > radek.zagorowicz at gmail.com> wrote: > >> Hi all. >> >> I found some issue in implementation of finalizeObject function in >> MCJIT.cpp. If you look at the source code of the function, you can notice >> that machine code for second "owned" module will never be generated if it >> doesn't depend on the first one. More over it will cause a crash if entry >> point isn't...
2015 Mar 25
2
[LLVMdev] MCJIT finalizeObject output to use in external process
...execution. > > > > -Andy > > > > > > *From:* llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] *On > Behalf Of *Dave Pitsbawn > *Sent:* Wednesday, March 25, 2015 4:07 PM > *To:* LLVM Developers Mailing List > *Subject:* [LLVMdev] MCJIT finalizeObject output to use in external > process > > > > A need has arisen to generate code using MCJIT but not in the target > process instead in a different process (and possibly even different machine > though not in the scope). > > > > Reading through the tutorials and MCJIT...
2015 Mar 25
2
[LLVMdev] MCJIT finalizeObject output to use in external process
A need has arisen to generate code using MCJIT but not in the target process instead in a different process (and possibly even different machine though not in the scope). Reading through the tutorials and MCJIT design document, it seems like this is possible or was kept in mind during design of MCJIT. How do I achieve this? Are there examples? Dave -------------- next part -------------- An
2015 Mar 26
2
[LLVMdev] MCJIT finalizeObject output to use in external process
...code may depend on relative offsets staying fixed. > > > > -Andy > > > > *From:* Dave Pitsbawn [mailto:dpitsbawn at gmail.com] > *Sent:* Wednesday, March 25, 2015 5:00 PM > *To:* Kaylor, Andrew > *Cc:* LLVM Developers Mailing List > *Subject:* Re: [LLVMdev] MCJIT finalizeObject output to use in external > process > > > > Aha. Thanks. > > > > Seems like I need to call mapSectionAddress with the target address. But > how I copy the code? What function would I call? > > > > On Wed, Mar 25, 2015 at 4:32 PM, Kaylor, Andrew <andrew.k...
2013 Jun 03
5
[LLVMdev] MCJIT and Kaleidoscope Tutorial
Hi all, I tried to modify Kaleidoscope Tutorial (toy.cpp from llvm/examples/Kaleidoscope/Chapter7, LLVM 3.3 release branch) in order to use MCJIT instead of JIT. I get segmentation fault when running toy.cpp with fibonacci example from the tutorial. My modified toy.cpp is in attachment and still works with JIT (when #define USE_MCJIT line is commented out). I read discussions regarding
2015 Mar 27
2
[LLVMdev] MCJIT finalizeObject output to use in external process
...counters a call to an external > function. > > > > -Andy > > > > *From:* Dave Pitsbawn [mailto:dpitsbawn at gmail.com] > *Sent:* Wednesday, March 25, 2015 7:42 PM > > *To:* Kaylor, Andrew > *Cc:* LLVM Developers Mailing List > *Subject:* Re: [LLVMdev] MCJIT finalizeObject output to use in external > process > > > > No, I was asking how to extract the code from MCJIT, and you said it use a > custom memory manager. > > > > When you say that I must treat each section as a block, do you mean that > there is inter-block relative offsets n...
2013 Jun 04
0
[LLVMdev] MCJIT and Kaleidoscope Tutorial
Am 04.06.2013 16:05, schrieb David Tweed: > | I am curious about JMM->invalidInstructionCache(), which I found in > | lli.cpp implementation. lli.cpp contains also call finalizeObject(), I > | just overlooked it. lli.cpp calls finalizeObject(), which calls > | applyPermissions, which in turn calls invalidateInstructionCache. So why > | lli.cpp does call JMM->invalidInstructionCache() explicitely again ? > > My suspicion is it's a historical development; bec...
2019 May 07
2
Reuse llvm::ExecutionEngine
...t instance for a new module again? I first tried calling llvm::EngineBuilder without setting a Module, I planned to add it later - but when I do this the "create" function will crash. Another test I ran was calling "removeModule" of the llvm::ExecutionEngine after the call to finalizeObject. Then I added the same module again and ran finalizeObject again. The result was weird, I suddenly became error messages about the relocation - I take this came because I applied a memory mapping in the first run. So to make it short: Is the llvm::ExecutionEngine designed for a reuse or is it bett...
2013 Nov 05
4
[LLVMdev] Android build patch
...to the MCJIT to make it work on ARM). It still doesn't work, but at this point I have no idea why and it'll be a while before I get to look at it again: the Android debug tools simply crash and give no output whatsoever, so all I know is that the test app exits somewhere inside MCJIT::finalizeObject. On 05/11/13 07:13, Renato Golin wrote: > On 30 October 2013 17:08, James Lyon <jameslyon0 at gmail.com > <mailto:jameslyon0 at gmail.com>> wrote: > > Sadly even though it builds I can't get generated code to work - > it appears at the moment that the genera...
2013 Nov 05
0
[LLVMdev] Android build patch
Is it possible to try your program on a non-Android Linux? It might make debugging a bit less painful. If you haven't updated to the trunk code recently, it's possible that calling finalizeObject more than once would cause a crash. The changes that introduced multiple module support should have fixed that issue. It might be useful to set breakpoints in the memory manager you are using. During finalizeObject you are likely to see calls to finalizeMemory, getSymbolAddress, registerEHFrames...
2013 Jun 04
1
[LLVMdev] MCJIT and Kaleidoscope Tutorial
Hi Andrew, Am 04.06.2013 02:13, schrieb Kaylor, Andrew: > Hi Dmitri, > > You might want to try replacing the call to JMM->invalidInstructionCache() with a call to TheExecutionEngine->finalizeObject(). If you are getting a non-NULL pointer from getPointerToFunction but it crashes when you try to call it, that is most likely because the memory for the generated code has not been marked as executable. That happens inside finalizeObject, which also invalidates the code cache. Thanks a lot, thi...
2019 May 08
2
Reuse llvm::ExecutionEngine
...reenshot for the first problem I noticed: [https://media.discordapp.net/attachments/534012750045642783/575369402195640321/unknown.png] This code will crash when calling "eeBuilder.create". But I also looked at what happens if I do reuse the llvm::ExecutionEngine. After the call to "finalizeObject" I use "removeModule" for the Module I used. If I know parse the same module again and pass it to that llvm::ExecutionEngine, it will notice the duplication and rename the symbols, like when it does when you add the same module two times. If I add a different module everything behave...
2013 Jun 04
0
[LLVMdev] MCJIT and Kaleidoscope Tutorial
Hi Dmitri, You might want to try replacing the call to JMM->invalidInstructionCache() with a call to TheExecutionEngine->finalizeObject(). If you are getting a non-NULL pointer from getPointerToFunction but it crashes when you try to call it, that is most likely because the memory for the generated code has not been marked as executable. That happens inside finalizeObject, which also invalidates the code cache. Even so, this wil...
2013 Jun 04
1
[LLVMdev] MCJIT and Kaleidoscope Tutorial
...e 04, 2013 7:20 AM To: David Tweed Cc: Kaylor, Andrew; LLVM Dev Subject: Re: [LLVMdev] MCJIT and Kaleidoscope Tutorial Am 04.06.2013 16:05, schrieb David Tweed: > | I am curious about JMM->invalidInstructionCache(), which I found in > | lli.cpp implementation. lli.cpp contains also call finalizeObject(), > | I just overlooked it. lli.cpp calls finalizeObject(), which calls > | applyPermissions, which in turn calls invalidateInstructionCache. So > | why lli.cpp does call JMM->invalidInstructionCache() explicitely again ? > > My suspicion is it's a historical development;...
2013 Oct 14
3
[LLVMdev] A weird, reproducable problem with MCJIT
I switched my Common Lisp compiler to use MCJIT on the weekend and ran into a weird problem compiling one particular function. It crashes with an EXC_BAD_ACCESS error in MCJIT::finalizeObject when calling processFDE. The weird part is that the function does not appear to do anything special and I've whittled it down to the minimum size that still causes the crash. If I remove even one statement it compiles fine. Note: The function doesn't make much sense anymore but it does co...
2013 Oct 14
0
[LLVMdev] A weird, reproducable problem with MCJIT
...unday, October 13, 2013 10:52 PM To: llvmdev at cs.uiuc.edu Subject: [LLVMdev] A weird, reproducable problem with MCJIT I switched my Common Lisp compiler to use MCJIT on the weekend and ran into a weird problem compiling one particular function. It crashes with an EXC_BAD_ACCESS error in MCJIT::finalizeObject when calling processFDE. The weird part is that the function does not appear to do anything special and I've whittled it down to the minimum size that still causes the crash. If I remove even one statement it compiles fine. Note: The function doesn't make much sense anymore but it does co...
2014 Mar 26
7
[LLVMdev] Lots of regtest failures on PPC64/Linux
...odule&) + 4294123632 [ 3149s] 13 libLLVMMCJIT.so 0x00003fff7eff6a20 llvm::MCJIT::emitObject(llvm::Module*) + 4294875216 [ 3149s] 14 libLLVMMCJIT.so 0x00003fff7eff6dfc llvm::MCJIT::generateCodeForModule(llvm::Module*) + 4294876180 [ 3149s] 15 libLLVMMCJIT.so 0x00003fff7eff7674 llvm::MCJIT::finalizeObject() + 4294878228 [ 3149s] 16 lli 0x000000001000cf9c main + 4294831444 [ 3149s] 17 libc.so.6 0x00003fff7e5f796c [ 3149s] 18 libc.so.6 0x00003fff7e5f7b74 __libc_start_main + 4293370644 Others seems to be unexpected outputs. Any help tracking these down would be appreciate...
2013 Nov 08
2
[LLVMdev] UNREACHABLE executed at MCJIT.cpp:322!
...the first one will be a problem, but the second one prevents me from testing anything. I don't know how to fix the problem. My code works when using the non-MC JIT, and I added to my EngineBuilder: .setUseMCJIT(true) Reading from a tutorial* I also tried finalizing the engine object: ee->finalizeObject() I'd like to get this working since in the release notes for 3.4 it indicates exception handling has been removed from the old JIT. I need exception handling support and would like to get MCJIT working prior to upgrading to 3.4 later. *http://blog.llvm.org/2013/07/using-mcjit-with-kaleidosc...
2015 Sep 14
2
JIT: Mapping global variable in JIT'ted code to variable in running program
...argv[]) { // This file, jit.cpp has been compiled to bitcode (clang -S -emit-llvm jit.cpp) // and is read into Module M here Module *M = ... ExecutionEngine *ee = ... myglobal = 42; ee->addGlobalMapping(M->getGlobalVariable("myglobal"), (void*)&myglobal); ee->finalizeObject(); void(*fptr)() = (void(*)())ee->getFunctionAddress("printMyGlobal"); fptr(); printMyGlobal(); } // end file jit.cpp I compile this file (jit.cpp) into bitcode which I then load int M. M also contains a global variable called myglobal. I want to "map" the myglobal...