search for: parseassemblystring

Displaying 20 results from an estimated 32 matches for "parseassemblystring".

2008 Dec 23
2
[LLVMdev] ParseAssemblyString change of behaviour
Hi, when upgrading my compiler from LLVM 2.1 to 2.4 I stumbled upon a change of behaviour in ParseAssemblyString. For an interactive toplevel I am generating .ll source and feeding it into ParseAssemblyString like this: Module* parsedModule = ParseAssemblyString( code, targetModule, &errorInfo ); where targetModule is the module I expect all the LLVM code to go. Until 2.1 the globals, types and...
2008 Dec 23
0
[LLVMdev] ParseAssemblyString change of behaviour
On Dec 23, 2008, at 7:15 AM, Jan Rehders wrote: > Hi, > > when upgrading my compiler from LLVM 2.1 to 2.4 I stumbled upon a > change of behaviour in ParseAssemblyString. For an interactive > toplevel I am generating .ll source and feeding it into > ParseAssemblyString like this: Hi Jan, I don't think that there is any intentional change here. It sounds like a bug. -Chris
2006 Nov 28
2
[LLVMdev] question about the LLVM JIT
...ngine->addGlobalMapping(YourModule->getNamedGlobal(name), address); > The 2nd question I have has to do with recompiling code. > > The 'library' I'm creating, that sits between llvm's (c++) libs and Python, > will remain minimal so I decided to use ParseAssemblyString to get .ll > sourcecode into the JIT. Ok. > I do not see how I can tell the jit when this .ll code contains a function > that should overwrite a previous version of it. > For instance, when there is a function "int %func() { ret int 5 }" and later > I want this replace...
2006 Mar 23
0
[LLVMdev] Re: LLVM JIT questions
...requested feature that will hopefully be implemented soon. To do this, use something like this: JIT->freeMachineCodeForFunction(Fn); // currently a noop Fn->eraseFromParent(); // Deletes the LLVM IR for Fn. this will only work if nothing uses Fn of course :) > * We use ParseAssemblyString() too add code to a module. (this is done > by the same code that generates the >100Mb pypy.ll file) Now wishing to > use replace some of that code with another version. (after the function > has been run already) (pypy might turn out to JIT generate blocks > instead of functions...
2006 May 05
2
[LLVMdev] ExecutionEngine blew the stack ?
On Fri, 5 May 2006, Simon Burton wrote: > This leads me to my next question: as I make more and more functions > with the EE, it slows down. I am re-using the Module, ExistingModuleProvider, > and ExecutionEngine, and pumping the parser like so: > M = ParseAssemblyString(AsmString, M); > ISTM that there should be a way of creating multiple modules/EEs but I ran > into trouble when I tried that (some time ago). Can you quantify what you mean? How does it "slow down"? -Chris -- http://nondot.org/sabre/ http://llvm.org/
2006 Nov 29
0
[LLVMdev] question about the LLVM JIT
...function "int %func() { ret int 5 }" >> and later I want this replaced by "int %func() { ret int 10 }". >> If I remember correctly this gives a 'function already defined' >> error message. I tried to use a seperate module for each call to >> ParseAssemblyString + addModuleProvider. >> In that way there was a problem with functions calling into other >> modules. (which perhaps I could try to solve if would understand >> addGlobalMapping better) > > This is somewhat tricky. To replace a function in-place like this, > you sh...
2006 May 05
0
[LLVMdev] ExecutionEngine blew the stack ?
...: > > On Fri, 5 May 2006, Simon Burton wrote: > > This leads me to my next question: as I make more and more functions > > with the EE, it slows down. I am re-using the Module, ExistingModuleProvider, > > and ExecutionEngine, and pumping the parser like so: > > M = ParseAssemblyString(AsmString, M); > > ISTM that there should be a way of creating multiple modules/EEs but I ran > > into trouble when I tried that (some time ago). > > Can you quantify what you mean? How does it "slow down"? It slows in the construction phase, so one of these calls:...
2006 May 05
0
[LLVMdev] ExecutionEngine blew the stack ?
...y decomposable into subfuctions so it looks like that's the correct way to handle this. This leads me to my next question: as I make more and more functions with the EE, it slows down. I am re-using the Module, ExistingModuleProvider, and ExecutionEngine, and pumping the parser like so: M = ParseAssemblyString(AsmString, M); ISTM that there should be a way of creating multiple modules/EEs but I ran into trouble when I tried that (some time ago). Is there a way around this ? I'm looking for scalability. Simon. -- Simon Burton, B.Sc. Licensed PO Box 8066 ANU Canberra 2601 Australia Ph. 61 02 6249...
2006 May 05
1
[LLVMdev] ExecutionEngine blew the stack ?
On Fri, 5 May 2006 16:43:13 +1000 Simon Burton <simon at arrowtheory.com> wrote: > > It slows in the construction phase, so one of these calls: > M = ParseAssemblyString(AsmString, M); > verifyModule( *M ) > M->getNamedFunction(name); > EE->getPointerToFunction > > It feels like there is a linear name lookup going on somewhere. it's verifyModule (of course). As the module grows, it takes longer to verify. So, I will disable this...
2011 Dec 29
2
[LLVMdev] How to free memory of JIT'd function
...ease? Here is the code. int main(int argc, char **argv) { InitializeNativeTarget(); LLVMContext Context; Module *M = new Module("test", Context); ExecutionEngine* EE = llvm::EngineBuilder(M).setEngineKind(EngineKind::JIT).create(); while (true) { SMDiagnostic error; ParseAssemblyString("define i32 @factorial(i32 %X) nounwind uwtable {\n" " %1 = alloca i32, align 4\n" " %2 = alloca i32, align 4\n" " store i32 %X, i32* %2, align 4\n" " %3...
2017 Jan 26
2
Question about versioning of LVVM IR
Hello, It is likely that I missing something however I have to ask. We are working on Mull project https://github.com/mull-project which deals with LLVM IR in the first place so it is often that we encounter errors like the following one when we do things like parseAssemblyString(IR, Err, GlobalCtx);`: ``` test: <string>:7237:187: error: invalid field 'variable' !1526 = distinct !DIGlobalVariable(name: "test_info_", linkageName: "_ZN14Hello_sup_Test10test_info_E", scope: !0, file: !1527, line: 4, type: !1528, isLocal: false, isDefinition:...
2006 Apr 13
2
[LLVMdev] standalone llvm
...int main() { Module *M = NULL; char *AsmString = "; ModuleID = 'test'\n\ \n\ implementation ; Functions:\n\ \n\ int %add1(int %AnArg) {\n\ EntryBlock:\n\ %addresult = add int 1, %AnArg ; <int> [#uses=1]\n\ ret int %addresult\n\ }\n\ "; M = ParseAssemblyString(AsmString, NULL); ExistingModuleProvider* MP = new ExistingModuleProvider(M); ExecutionEngine* EE = ExecutionEngine::create(MP, false); std::cout << "We just constructed this LLVM module:\n\n" << *M; Function *F = M->getNamedFunction("add1"); assert(...
2006 Apr 19
2
[LLVMdev] floating point exception and SSE2 instructions
Hi, I'm building a little JIT that creates functions to do array manipulations, eg. sum all the elements of a double* array. I'm writing this in python, generating llvm assembly intructions and piping that through a call to ParseAssemblyString, ExecutionEngine, etc. It's working OK on integer values, but i'm getting nasty floating point exceptions when i try this on double* values. I've seen this behaviour before on this platform (debian Intel P4) when I tried using ATLAS with sse2. I'm pretty sure it's valid assemb...
2007 Oct 19
0
[LLVMdev] OCaml Install Error
...AndRelinkFunction? I've build an interactive toplevel implemented in OCaml and I have to pull of some stunts to be able to change the definition of a function. (emit a .ll file containing the code, looking up the function and calling removeBody, then reading the .ll file back in using ParseAssemblyString). I noticed that functions are represented as an llvalue which makes turning it into a Function* unsafe if I'm correct? greetings, Jan On 2. Okt 2007, at 19:51, Gordon Henriksen wrote: > On 2007-10-02, at 10:46, Jan Rehders wrote: > >> where can I read more about this? I assu...
2006 May 05
1
[LLVMdev] ExecutionEngine blew the stack ?
Hi Simon, You're probably right. LLVM's instruction selector is recursive so it can run out of stack space. Select_store used to have enormous stack frame (thanks to some gcc issues), we had to do all kinds of tricks to get it under control. I just took a look at it, it's around 0.7k. It used to be around 20k on x86 Mac OS X. It's also possible that it has gotten into a
2012 Jan 05
0
[LLVMdev] How to free memory of JIT'd function
...argv) { >   InitializeNativeTarget(); > >   LLVMContext Context; > >   Module *M = new Module("test", Context); >   ExecutionEngine* EE = > llvm::EngineBuilder(M).setEngineKind(EngineKind::JIT).create(); > >   while (true) { >     SMDiagnostic error; >     ParseAssemblyString("define i32 @factorial(i32 %X) nounwind uwtable {\n" >                         "  %1 = alloca i32, align 4\n" >                         "  %2 = alloca i32, align 4\n" >                         "  store i32 %X, i32* %2, align 4\n" >                ...
2007 Oct 02
2
[LLVMdev] OCaml Install Error
On 2007-10-02, at 10:46, Jan Rehders wrote: > where can I read more about this? I assume (hope) the lib provides > some kind of OCaml bindings? I could not find any trace of it in > the 2.1 release source so I guess it's currently SVN only? Jan, Here's a trivial example. $ cat metahelloworld.ml (* metahelloworld.ml *) open Llvm open Llvm_bitwriter let _ = let filename
2009 Jan 02
3
[LLVMdev] Private headers and testing
...e outset. Or, I can just feed each individual method in the class exactly the corner cases I will want it to handle, and verify its output (or side effects) exactly, to make sure I pin-pointed the issue. Or, let's say I want to write some tests for the LLParser -- the only public API is "ParseAssemblyString", I can't unittest each individual method. The unittest for this using the public API will be very brittle as it would have to check the contents of the returned error message, instead of calling each Parse*() function directly and analyzing its output. Of course, we should still have a...
2012 Jan 10
1
[LLVMdev] How to free memory of JIT'd function
...> >   LLVMContext Context; > > > >   Module *M = new Module("test", Context); > >   ExecutionEngine* EE = > > llvm::EngineBuilder(M).setEngineKind(EngineKind::JIT).create(); > > > >   while (true) { > >     SMDiagnostic error; > >     ParseAssemblyString("define i32 @factorial(i32 %X) nounwind > >     uwtable {\n" > >                         "  %1 = alloca i32, align 4\n" > >                         "  %2 = alloca i32, align 4\n" > >                         "  store i32 %X, i32* %2, align 4...
2011 Aug 24
0
[LLVMdev] v3.0 type system rewrite question
...be a problem with the parser not picking up on named types currently defined in a given Module (global context). However, I don't have much experience with the LLVM internals so there's a good chance that I'm not fully understanding the new changes ;) For Example: This works fine (via ParseAssemblyString): "%my_type = type double define double @my_func(%my_type %a) { entry: %return = fmul %my_type %a, 5.0 ret %my_type %return }" However splitting this into two independent calls results in a parser error. So this ... "%my_type = type double" followed at a later date by...