search for: finishfunct

Displaying 20 results from an estimated 46 matches for "finishfunct".

2009 Mar 16
2
[LLVMdev] MachO and ELF Writers/MachineCodeEmittersarehard-codedinto LLVMTargetMachine
...lloc function could be called before >> outputting say a 4 byte int and could realloc and copy code and when >> finally >> written the fixups could be applied. > > IIRC the memory allocation is done in the MachineCodeEmitter, not the > higher level (see startFunction and finishFunction). The current > implementation has startFunction allocate some (arbitrary) reserve > size in the output vector, and if we the emitter runs out of space, > finishFunction returns a failure, causing the whole process to occur > again. This is icky. As I said the MachineCodeEmitter wor...
2009 Mar 16
0
[LLVMdev] MachO and ELF Writers/MachineCodeEmittersarehard-codedinto LLVMTargetMachine
...hOWriter is responsible for creation of MachOCodeEmitter, via it's getMachineCodeEmitter function. 2. MachOCodeEmitter - a MachineCodeEmitter. Friend class of MachOWriter (friend class == broken encapsulation!?) startFunction allocates storage in the text section for the current function. finishFunction emits constant-pools, jumptables; transforms relocations adding globals to the MachOWriter's PendingGlobals list, and all relocations to the parent section's relocation list; adds a symbol for the function to the MachOWriter's SymbolTable. [In general, all the operations in finishFu...
2009 Mar 16
0
[LLVMdev] MachO and ELF Writers/MachineCodeEmitters arehard-codedinto LLVMTargetMachine
...hin the outputted code. Then a alloc function could be called before > outputting say a 4 byte int and could realloc and copy code and when finally > written the fixups could be applied. IIRC the memory allocation is done in the MachineCodeEmitter, not the higher level (see startFunction and finishFunction). The current implementation has startFunction allocate some (arbitrary) reserve size in the output vector, and if we the emitter runs out of space, finishFunction returns a failure, causing the whole process to occur again. This is icky. It would be far better if the underlying buffer would gr...
2009 Mar 16
1
[LLVMdev] MachO and ELF Writers/MachineCodeEmitters arehard-codedinto LLVMTargetMachine
...hin the outputted code. Then a alloc function could be called before > outputting say a 4 byte int and could realloc and copy code and when finally > written the fixups could be applied. IIRC the memory allocation is done in the MachineCodeEmitter, not the higher level (see startFunction and finishFunction). The current implementation has startFunction allocate some (arbitrary) reserve size in the output vector, and if we the emitter runs out of space, finishFunction returns a failure, causing the whole process to occur again. This is icky. It would be far better if the underlying buffer would gr...
2009 Mar 16
2
[LLVMdev] MachO and ELF Writers/MachineCodeEmitters arehard-codedinto LLVMTargetMachine
On Mon, Mar 16, 2009 at 3:26 AM, Aaron Gray <aaronngray.lists at googlemail.com > wrote: > On Sun, Mar 15, 2009 at 10:52 PM, Aaron Gray < > aaronngray.lists at googlemail.com> wrote: > >> I like the idea of a generic MachineCodeWriter, although I prefer the >>> name 'ObjectFileWriter'... >>> >> >> Thats much more descriptive of
2012 Jul 19
2
[LLVMdev] Help with PPC64 JIT
Hello, I am currently working with PPC64 JIT support for LLVM. So far I could make function calls work by adding function descriptors in 'lib/Target/PowerPC/PPCJITInfo.h' and adding a virtual method at 'LLVM::TargetJITInfo' that is called within 'JITEmitter::finishFunction' just after 'sys::Memory::InvalidateInstructionCache' to update the Global Mapping with function descriptor instead of the function address. The JIT function descriptor is loaded correctly in 'JIT::runFunction', instead of assuming the JIT function code is an ODP. Now I'...
2011 Apr 19
2
[LLVMdev] Crash in llvm::JITDwarfEmitter::EmitDwarfTable on 2.8 and 2.9 release but not on trunk?
...mory. Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000 0x0000000100852203 in llvm::JITDwarfEmitter::EmitDwarfTable () at context.h:491 (gdb) bt #0 0x0000000100852203 in llvm::JITDwarfEmitter::EmitDwarfTable () at context.h:491 #1 0x0000000100859a76 in (anonymous namespace)::JITEmitter::finishFunction () at context.h:491 #2 0x0000000100871a6a in (anonymous namespace)::Emitter<llvm::JITCodeEmitter>::runOnMachineFunction () at stl_tree.h:1050 #3 0x0000000100b1381d in llvm::MachineFunctionPass::runOnFunction () at stl_tree.h:1050 #4 0x0000000100ee15f0 in llvm::FPPassManager::runOnFuncti...
2008 Sep 25
3
[LLVMdev] Kaleidoscope doesn't work properly
...b/libthr.so.3 #2 0x4889b76a in abort () from /lib/libc.so.7 #3 0x0831f8a0 in llvm::JIT::getPointerToNamedFunction () #4 0x0832177a in llvm::JIT::getPointerToFunction () #5 0x083275a2 in (anonymous namespace)::JITEmitter::getPointerToGlobal () #6 0x083280e4 in (anonymous namespace)::JITEmitter::finishFunction () #7 0x0805f8d0 in (anonymous namespace)::Emitter::runOnMachineFunction () #8 0x081deee8 in llvm::MachineFunctionPass::runOnFunction () #9 0x08561cd7 in llvm::FPPassManager::runOnFunction () #10 0x08562185 in llvm::FunctionPassManagerImpl::run () #11 0x08562337 in llvm::FunctionPassManager::...
2012 Jul 20
0
[LLVMdev] Help with PPC64 JIT
...iao, Duncan. > I am currently working with PPC64 JIT support for LLVM. So far I could make function calls > work by adding function descriptors in 'lib/Target/PowerPC/PPCJITInfo.h' and adding a > virtual method at 'LLVM::TargetJITInfo' that is called within 'JITEmitter::finishFunction' > just after 'sys::Memory::InvalidateInstructionCache' to update the Global Mapping with > function descriptor instead of the function address. The JIT function descriptor is > loaded correctly in 'JIT::runFunction', instead of assuming the JIT function code is >...
2011 Apr 19
0
[LLVMdev] Crash in llvm::JITDwarfEmitter::EmitDwarfTable on 2.8 and 2.9 release but not on trunk?
...NVALID_ADDRESS at address: 0x0000000000000000 > 0x0000000100852203 in llvm::JITDwarfEmitter::EmitDwarfTable () at context.h:491 > (gdb) bt > #0 0x0000000100852203 in llvm::JITDwarfEmitter::EmitDwarfTable () at context.h:491 > #1 0x0000000100859a76 in (anonymous namespace)::JITEmitter::finishFunction () at context.h:491 > #2 0x0000000100871a6a in (anonymous namespace)::Emitter<llvm::JITCodeEmitter>::runOnMachineFunction () at stl_tree.h:1050 > #3 0x0000000100b1381d in llvm::MachineFunctionPass::runOnFunction () at stl_tree.h:1050 > #4 0x0000000100ee15f0 in llvm::FPPassManag...
2009 Mar 16
0
[LLVMdev] MachO and ELF Writers/MachineCodeEmitters arehard-codedinto LLVMTargetMachine
On Sun, Mar 15, 2009 at 10:52 PM, Aaron Gray < aaronngray.lists at googlemail.com> wrote: > I like the idea of a generic MachineCodeWriter, although I prefer the >> name 'ObjectFileWriter'... >> > > Thats much more descriptive of the functionality. > Sorry, I disagree actually the MachineCodeEmitter or the 'MachineCodeWritter' does not do any file
2007 Dec 11
0
[LLVMdev] Exception handling in JIT
...t; + > + /// startFunction - This callback is invoked when the specified > function is > + /// about to be code generated. This initializes the > BufferBegin/End/Ptr > + /// fields. > + /// > + virtual void startFunction(MachineFunction &F) = 0; > + > + /// finishFunction - This callback is invoked when the specified > function has > + /// finished code generation. If a buffer overflow has > occurred, this method > + /// returns true (the callee is required to try again), > otherwise it returns > + /// false. > + /// > + virtua...
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
2008 Mar 30
3
[LLVMdev] Being able to know the jitted code-size before emitting
Hi everyone, vmkit requires to know the size of a jitted method before emitting the method. This allows to allocate the correct size for the method. The attached patch creates this functionality when the flag SizedMemoryCode is on. In order to implement this functionality, i had to virtualize some MachineCodeEmitter functions. Is it OK to commit the patch? Thanks, Nicolas --------------
2008 Apr 01
2
[LLVMdev] Being able to know the jitted code-size before emitting
...nitJumpTableInfo(F.getJumpTableInfo()); >> + >> + ConstantPoolBase = (void*)(((uintptr_t) ConstantPoolBase) + >> CurBufferPtr); >> + JumpTableBase = (void*)(((uintptr_t) JumpTableBase) + >> CurBufferPtr); >> + } >> + >> + virtual bool finishFunction(MachineFunction &F) { >> + MCE->setCurrentPtr(CurBufferPtr); >> + return false; >> + } >> + virtual void startFunctionStub(unsigned StubSize, unsigned >> Alignment) {} >> + virtual void *finishFunctionStub(const Function *F) { return 0; } &gt...
2008 Mar 31
0
[LLVMdev] Being able to know the jitted code-size before emitting
....getConstantPool()); > + initJumpTableInfo(F.getJumpTableInfo()); > + > + ConstantPoolBase = (void*)(((uintptr_t) ConstantPoolBase) + > CurBufferPtr); > + JumpTableBase = (void*)(((uintptr_t) JumpTableBase) + > CurBufferPtr); > + } > + > + virtual bool finishFunction(MachineFunction &F) { > + MCE->setCurrentPtr(CurBufferPtr); > + return false; > + } > + virtual void startFunctionStub(unsigned StubSize, unsigned > Alignment) {} > + virtual void *finishFunctionStub(const Function *F) { return 0; } > + virtual void addRel...
2009 Mar 15
3
[LLVMdev] MachO and ELF Writers/MachineCodeEmitters arehard-codedinto LLVMTargetMachine
>I like the idea of a generic MachineCodeWriter, although I prefer the >name 'ObjectFileWriter'... Thats much more descriptive of the functionality. >I think we need to take a hard look at which bits of the >Writer/Emitter infrastructure are needed for what tasks (Object File >Emittion, JIT, etc.) and make sure that our abstractions are flexible >enough... I would
2008 Apr 01
0
[LLVMdev] Being able to know the jitted code-size before emitting
...bleInfo()); >>> + >>> + ConstantPoolBase = (void*)(((uintptr_t) ConstantPoolBase) + >>> CurBufferPtr); >>> + JumpTableBase = (void*)(((uintptr_t) JumpTableBase) + >>> CurBufferPtr); >>> + } >>> + >>> + virtual bool finishFunction(MachineFunction &F) { >>> + MCE->setCurrentPtr(CurBufferPtr); >>> + return false; >>> + } >>> + virtual void startFunctionStub(unsigned StubSize, unsigned >>> Alignment) {} >>> + virtual void *finishFunctionStub(const Function...
2008 Sep 25
0
[LLVMdev] Kaleidoscope doesn't work properly
...4889b76a in abort () from /lib/libc.so.7 > #3 0x0831f8a0 in llvm::JIT::getPointerToNamedFunction () > #4 0x0832177a in llvm::JIT::getPointerToFunction () > #5 0x083275a2 in (anonymous namespace)::JITEmitter::getPointerToGlobal () > #6 0x083280e4 in (anonymous namespace)::JITEmitter::finishFunction () > #7 0x0805f8d0 in (anonymous namespace)::Emitter::runOnMachineFunction () > #8 0x081deee8 in llvm::MachineFunctionPass::runOnFunction () > #9 0x08561cd7 in llvm::FPPassManager::runOnFunction () > #10 0x08562185 in llvm::FunctionPassManagerImpl::run () > #11 0x08562337 in ll...
2009 Jul 03
0
[LLVMdev] Question about memory allocation in JIT
...s.  So we should backup Relocations before changes in "for (unsigned i = 0, e = Relocations.size(); i != e; ++i) {" loop, and, in case of buffer overflow, we should remove globals from mappings.  Also, we should clear ConstPoolAddresses.  There are only two changes in function JITEmitter::finishFunction: > > > --- lib/ExecutionEngine/JIT/JITEmitter.cpp      (original patch) > +++ lib/ExecutionEngine/JIT/JITEmitter.cpp      (my changes) > @@ -946,6 +947,7 @@ >   // FnEnd is the end of the function's machine code. >   uint8_t *FnEnd = CurBufferPtr; > > +  std::vecto...