search for: endfunctionbody

Displaying 16 results from an estimated 16 matches for "endfunctionbody".

2008 Dec 17
1
[LLVMdev] Getting the start and end address of JITted code
Here's my problem, which I raised on IRC: JIT::getPointerToFunction gets the address of the start of a function. But how do I find out where the end of the function is? I need this to register the function for profiling. varth said: aph, you need to intercept the "endFunctionBody" call on the memory manager, it will tell you the start pointer and the end pointer But how can I do this? The obvious way would be for me to inherit from DefaultMemoryManager and pass an instance of my class to ExecutionEngine::createJIT. But DefaultMemoryManager isn't public so I can&...
2008 Dec 17
0
[LLVMdev] Getting the start and end address of JITted code
...#39;s my problem, which I raised on IRC: > > JIT::getPointerToFunction gets the address of the start of a function. > But how do I find out where the end of the function is? I need this > to register the function for profiling. > > varth said: aph, you need to intercept the "endFunctionBody" call on > the memory manager, it will tell you the start pointer and the end > pointer > Yep, that's what I said :) > But how can I do this? The obvious way would be for me to inherit > from DefaultMemoryManager and pass an instance of my class to > ExecutionEngine...
2008 Dec 17
1
[LLVMdev] Getting the start and end address of JITted code
...I raised on IRC: >> >> JIT::getPointerToFunction gets the address of the start of a function. >> But how do I find out where the end of the function is? I need this >> to register the function for profiling. >> >> varth said: aph, you need to intercept the "endFunctionBody" call on >> the memory manager, it will tell you the start pointer and the end >> pointer >> > > Yep, that's what I said :) > >> But how can I do this? The obvious way would be for me to inherit >> from DefaultMemoryManager and pass an instance...
2008 Dec 17
5
[LLVMdev] Windows build problems
Folks, Is anyone else the failure below? On Mac OS X everything builds properly... Thanks for any help, snaroff -------------- next part -------------- A non-text attachment was scrubbed... Name: Picture 27.png Type: image/png Size: 18959 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20081217/e7d37fee/attachment.png>
2013 Oct 01
2
[LLVMdev] JITMemoryManager
...ionBody(F, ActualSize); } virtual uint8_t *allocateStub(const llvm::GlobalValue *F, unsigned StubSize, unsigned Alignment) { return mgr()->allocateStub(F, StubSize, Alignment); } virtual void endFunctionBody(const llvm::Function *F, uint8_t *FunctionStart, uint8_t *FunctionEnd) { return mgr()->endFunctionBody(F, FunctionStart, FunctionEnd); } virtual uint8_t *allocateSpace(intptr_t Size, unsigned Alignment) {...
2013 Oct 02
0
[LLVMdev] JITMemoryManager
...} > virtual uint8_t *allocateStub(const llvm::GlobalValue *F, > unsigned StubSize, > unsigned Alignment) { > return mgr()->allocateStub(F, StubSize, Alignment); > } > virtual void endFunctionBody(const llvm::Function *F, > uint8_t *FunctionStart, > uint8_t *FunctionEnd) { > return mgr()->endFunctionBody(F, FunctionStart, FunctionEnd); > } > virtual uint8_t *allocateSpace(intptr_t Size, un...
2013 Oct 02
3
[LLVMdev] JITMemoryManager
...rtual uint8_t *allocateStub(const llvm::GlobalValue *F, >> unsigned StubSize, >> unsigned Alignment) { >> return mgr()->allocateStub(F, StubSize, Alignment); >> } >> virtual void endFunctionBody(const llvm::Function *F, >> uint8_t *FunctionStart, >> uint8_t *FunctionEnd) { >> return mgr()->endFunctionBody(F, FunctionStart, FunctionEnd); >> } >> virtual uint8_t *allocateSpa...
2011 Jul 06
2
[LLVMdev] [MCJIT] Why does it allocate function by function?
...ss for MCJIT to be able to run ELFs on ELF-platforms. One thing bothers me: I see that the RTDyldMemoryManager-based allocator is always passed to MCJIT and to RuntimeDyld classes from outside. This enforces the approach that memory will be allocated function by function with startFunctionBody/endFunctionBody. This maybe was good for the old JIT, but not for MCJIT. For ELF for example this isn't right. ELF is designed to be loaded into memory as a whole. I don't know much about MachO, but most likely it should be normally loaded into memory by OS in one block too, as a consequence of effici...
2009 Jan 28
1
[LLVMdev] Newbie question: Getting info about JIT-compiled function
...GetFunctionFromSymbolTable(). Is there a supported way to get at > > the JitSymbolEntry for a function? If not, is there an alternate > > way to determine the size (in bytes) of the native function? > > The answer seems to be "create your own memory manager and define > endFunctionBody()". If you have a look at class MyJITMemoryManager in > http://icedtea.classpath.org/hg/icedtea6/file/0507a324ec22/ports/hotspot/src/share/vm/shark/sharkBuilder.hpp you'll see how I did it. I took a look and it makes sense (though it does seem a bit heavyweight). I'll give it a t...
2009 Jul 03
0
[LLVMdev] Question about memory allocation in JIT
...on's machine code. >   uint8_t *FnEnd = CurBufferPtr; > > +  std::vector<MachineRelocation> BackupRelocations = Relocations; >   if (!Relocations.empty()) { >     CurFn = F.getFunction(); >     NumRelos += Relocations.size(); > @@ -1028,8 +1030,18 @@ >   MemMgr->endFunctionBody(F.getFunction(), BufferBegin, CurBufferPtr); > >   if (CurBufferPtr == BufferEnd) { > -    retryWithMoreMemory(F); > -    return true; > +         for (unsigned i = 0, e = BackupRelocations.size(); i != e; ++i) { > +                 MachineRelocation &MR = BackupRelocations[i]...
2009 Jan 27
1
[LLVMdev] Newbie question: Getting info about JIT-compiled function
Apologies if this is a FAQ. I am using the LLVM JIT facility on an x86_64 platform. I generate IR for a single function using IRBuilder(), use the FunctionPassManager to do some optimization passes, and then call ExecutionEngine::getPointerToFunction() to get a native-code version of the function. Everything works fine so far. Two questions: Question (1): How can I get the size of the native
2011 Jul 06
0
[LLVMdev] [MCJIT] Why does it allocate function by function?
...MCJIT to be able to run ELFs on ELF-platforms. > > One thing bothers me: I see that the RTDyldMemoryManager-based allocator is always passed to MCJIT and to RuntimeDyld classes from outside. This enforces the approach that memory will be allocated function by function with startFunctionBody/endFunctionBody. This maybe was good for the old JIT, but not for MCJIT. > > For ELF for example this isn't right. ELF is designed to be loaded into memory as a whole. I don't know much about MachO, but most likely it should be normally loaded into memory by OS in one block too, as a consequence of...
2009 Jul 01
3
[LLVMdev] Question about memory allocation in JIT
Hello! Working with LLVM JIT-compiler I found a small bug and I'd like to correct it. Namely, on some tests LLVM fails with message "JIT: Ran out of space for generated machine code!" This error emerges because the test creates big static array. Global variables are placed into memory block for function, that is first seen using given variable. Besides, during memory allocation
2007 Dec 11
0
[LLVMdev] Exception handling in JIT
...> >getPersonalityIndex()]); > + > + Result = EmitEHFrame(Personalities[Personalities.size() - > 1], EHFramePtr, > + StartFunction, EndFunction, > ExceptionTable); > + > + unsigned char *FnEnd = CurBufferPtr; > + MemMgr->endFunctionBody(F.getFunction(), BufferBegin, FnEnd); > + MMI->EndFunction(); > + > + __register_frame(Result); > + > + return false; > + } > + > + }; > + > /// JITEmitter - The JIT implementation of the > MachineCodeEmitter, which is > /// used to...
2007 Dec 12
3
[LLVMdev] Exception handling in JIT
...>> + >> + Result = EmitEHFrame(Personalities[Personalities.size() - >> 1], EHFramePtr, >> + StartFunction, EndFunction, >> ExceptionTable); >> + >> + unsigned char *FnEnd = CurBufferPtr; >> + MemMgr->endFunctionBody(F.getFunction(), BufferBegin, FnEnd); >> + MMI->EndFunction(); >> + >> + __register_frame(Result); >> + >> + return false; >> + } >> + >> + }; >> + >> /// JITEmitter - The JIT implementation of the >> Machi...
2007 Dec 10
2
[LLVMdev] Exception handling in JIT
Hi everyone, Here's a patch that enables exception handling when jitting. I've copy/pasted _many_code from lib/Codegen/DwarfWriter.cpp, so we may need to factorize it, but the functionality is there and I'm very happy with it :) lli should now be able to execute the output from llvm-gcc when using exceptions (the UnwindInst instruction is not involved in this patch). Just add the