search for: startfunction

Displaying 20 results from an estimated 54 matches for "startfunction".

2007 Dec 11
0
[LLVMdev] Exception handling in JIT
...erflow > + /// condition). > + unsigned char *CurBufferPtr; I am not sure if it makes sense for this to maintain it's own buffers. Can it be modified to use MachineCodeEmitter? > + > + MachineModuleInfo* MMI; > +public: > + virtual ~DwarfEmitter() {} > + > + /// 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...
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 Feb 04
0
[LLVMdev] Exception handling in JIT
...lID) { > + assert(0 && "emit Label not implementated yet!"); > + abort(); > + } > + > + > + virtual void setModuleInfo(llvm::MachineModuleInfo* MMI) { } > + > + > /// JIT SPECIFIC FUNCTIONS - DO NOT IMPLEMENT THESE HERE! > void startFunctionStub(unsigned StubSize, unsigned Alignment = > 1) { > assert(0 && "JIT specific function called!"); > Index: lib/CodeGen/MachOWriter.cpp > =================================================================== > --- lib/CodeGen/MachOWriter.cpp (revision 46612) &...
2008 Feb 01
2
[LLVMdev] Exception handling in JIT
Dear all, Here's a new patch with Evan's comments (thx Evan!) and some cleanups. Now the (duplicated) exception handling code is in a new file: lib/ExecutionEngine/JIT/JITDwarfEmitter. This patch should work on linux/x86 and linux/ppc (tested). Nicolas -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: jit-exceptions.patch URL:
2008 Apr 17
1
[LLVMdev] Being able to know the jitted code-size before emitting
Thx again Evan for the review. Here's a new patch for the JIT in itself. The major changes are: 1) A JITMemoryManager now has a flag saying "I require to know the size of what you want to emit" 2) DwarfJITEmitter is augmented with GetSize* functions 3) JITEmitter::startFunction checks if the JITMemoryManager requires to know the size. If so, it computes it and gives it through the ActualPtr argument. I suppose it's OK to commit, but if anyone wants to complain, I'm listening :) Thanks, Nicolas Evan Cheng wrote: > On Apr 16, 2008, at 1:46 AM, Nicolas Geof...
2007 Dec 12
3
[LLVMdev] Exception handling in JIT
...rits MachineCodeEmitter? There are MachineCodeEmitter functions that are really not related to MachineCodeEmitter (eg addRelocation, getConstantPoolEntryAddress, etc). >> + >> + MachineModuleInfo* MMI; >> +public: >> + virtual ~DwarfEmitter() {} >> + >> + /// 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; >> + >> + //...
2009 Mar 16
2
[LLVMdev] MachO and ELF Writers/MachineCodeEmittersarehard-codedinto LLVMTargetMachine
...ted 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. As I said the Machin...
2009 Mar 16
0
[LLVMdev] MachO and ELF Writers/MachineCodeEmitters arehard-codedinto LLVMTargetMachine
...refering > within 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...
2009 Mar 16
1
[LLVMdev] MachO and ELF Writers/MachineCodeEmitters arehard-codedinto LLVMTargetMachine
...refering > within 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...
2009 Mar 16
0
[LLVMdev] MachO and ELF Writers/MachineCodeEmittersarehard-codedinto LLVMTargetMachine
...le header and finalize the various object file segments, respectively. The MachOWriter 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 th...
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
2015 Jun 17
2
[LLVMdev] Inline hint for methods defined in-class
...te to functions that are explicitly marked inline, but not if they are defined in the class body. I tried the following patch, which I believe handles the in-class definition case: --- a/lib/CodeGen/CodeGenFunction.cpp +++ b/lib/CodeGen/CodeGenFunction.cpp @@ -630,7 +630,7 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, if (const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(D)) { if (!CGM.getCodeGenOpts().NoInline) { for (auto RI : FD->redecls()) - if (RI->isInlineSpecified()) { + if (RI->isInlined()) { Fn->addFnAttr(llvm::Attribute::Inl...
2015 Jun 17
2
[LLVMdev] Inline hint for methods defined in-class
...y marked > inline, but not if they are defined in the class body. I tried the following > patch, which I believe handles the in-class definition > case: > > --- a/lib/CodeGen/CodeGenFunction.cpp > +++ b/lib/CodeGen/CodeGenFunction.cpp > @@ -630,7 +630,7 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, > if (const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(D)) { > if (!CGM.getCodeGenOpts().NoInline) { > for (auto RI : FD->redecls()) > - if (RI->isInlineSpecified()) { > + if (RI->isInlined()) { > Fn->...
2012 Dec 19
2
[LLVMdev] Function inline causes crash in clang for .ast to .s
...generate .s from .ast for same file, *>clang inline-test.c -std=c99 -fgnu89-inline -emit-ast -o inline-test.ast* *>clang inline-test.ast -std=c99 -fgnu89-inline -S -o inline-test.s* clang-3.2: $HOME/llvm/tools/clang/lib/CodeGen/CodeGenFunction.cpp:342: void clang::CodeGen::CodeGenFunction::*StartFunction*(clang::GlobalDecl, clang::QualType, llvm::Function*, const clang::CodeGen::CGFunctionInfo&, const clang::CodeGen::FunctionArgList&, clang::SourceLocation): Assertion `*CurFn->isDeclaration() && "Function already has body?"*' failed. >From crash message it seems...
2009 Mar 16
2
[LLVMdev] MachO and ELFWriters/MachineCodeEmittersarehard-codedinto LLVMTargetMachine
...E) and as a constructor argument. > This class receives (during construction) a reference to a > MachineCodeEmitter (e.g. MachOCodeEmitter, which in turn stores a > reference to a MachOWritter). > > The runOnMachineFunction for the X86CodeEmitter does: > - call MachOCodeEmitter::startFunction > - for each basicblock in function: > - call MachOCodeEmitter::StartMachineBasicBlock > - for each instruction in basicblock: > - emit instruction, using MachineCodeEmitter::emit* functions > - call MachOCodeEmitter::finishFunction > > [This runOnMachineFunction coul...
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
...BufferPtr = 0; >> + BufferBegin = 0; >> + BufferEnd = (unsigned char*)-1; >> + } >> + >> + void initConstantPool(MachineConstantPool *MCP); >> + >> + void initJumpTableInfo(MachineJumpTableInfo *MJTI); >> + >> + >> + virtual void startFunction(MachineFunction &F) { >> + CurBufferPtr = 0; >> + Fn = &F; >> + >> + // Ensure the constant pool/jump table info is at least 4-byte >> aligned. >> + emitAlignment(16); >> + >> + initConstantPool(F.getConstantPool()); >>...
2008 Mar 31
0
[LLVMdev] Being able to know the jitted code-size before emitting
...abelLocations = locations; > + CurBufferPtr = 0; > + BufferBegin = 0; > + BufferEnd = (unsigned char*)-1; > + } > + > + void initConstantPool(MachineConstantPool *MCP); > + > + void initJumpTableInfo(MachineJumpTableInfo *MJTI); > + > + > + virtual void startFunction(MachineFunction &F) { > + CurBufferPtr = 0; > + Fn = &F; > + > + // Ensure the constant pool/jump table info is at least 4-byte > aligned. > + emitAlignment(16); > + > + initConstantPool(F.getConstantPool()); > + initJumpTableInfo(F.getJumpTabl...
2015 Jun 24
4
[LLVMdev] Inline hint for methods defined in-class
...ass body. I tried the > following > >> patch, which I believe handles the in-class definition > >> case: > >> > >> --- a/lib/CodeGen/CodeGenFunction.cpp > >> +++ b/lib/CodeGen/CodeGenFunction.cpp > >> @@ -630,7 +630,7 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, > >> if (const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(D)) { > >> if (!CGM.getCodeGenOpts().NoInline) { > >> for (auto RI : FD->redecls()) > >> - if (RI->isInlineSpecified()) { > >> + if (...
2008 Apr 01
0
[LLVMdev] Being able to know the jitted code-size before emitting
...egin = 0; >>> + BufferEnd = (unsigned char*)-1; >>> + } >>> + >>> + void initConstantPool(MachineConstantPool *MCP); >>> + >>> + void initJumpTableInfo(MachineJumpTableInfo *MJTI); >>> + >>> + >>> + virtual void startFunction(MachineFunction &F) { >>> + CurBufferPtr = 0; >>> + Fn = &F; >>> + >>> + // Ensure the constant pool/jump table info is at least 4-byte >>> aligned. >>> + emitAlignment(16); >>> + >>> + initConstantPool(F...