similar to: [LLVMdev] Proper way to use "host application" function from JIT code

Displaying 20 results from an estimated 20000 matches similar to: "[LLVMdev] Proper way to use "host application" function from JIT code"

2012 Apr 16
1
[LLVMdev] Proper way to use "host application" function from JIT code
Thanks Andrew, that makes sense actually. Just one thing, about the last point in my original email: all functions defined in the plugin will instead have to be explicitly declared extern "C" or I have to, somehow, obtain the mangled name (and what's the best/safest way to do that) if I want llvm::Module::getFunction to succeed? Andrea. On Apr 16, 2012, at 7:36 PM, Kaylor, Andrew
2012 Apr 16
0
[LLVMdev] Proper way to use "host application" function from JIT code
Hi Andrea, As I understand it, when the JIT emitter encounters a function call, it attempts to get a pointer to the function from the JIT engine by calling the JIT::getPointerToFunction() method. If the JIT engine isn't able to associate the function with an existing known function and can't JIT it, it will attempt to lookup the function by name. One of the ways it attempts to do so is
2017 Feb 06
3
Kaleidoscope tutorial: comments, corrections and Windows support
Hi, I'm currently working my way through the tutorial with LLVM 3.9.1 on Windows (finished chapter 4) and stumbled over a few things which could be improved: - "LLVMContext" does not exist as a variable -> "TheContext" - Chapter 3: 5 times - Chapter 4: 1 time - Chapter 5: 4 times - Chapter 6: 2 times - Chapter 7: 2 times 3.4. Function Code
2014 Jan 21
4
[LLVMdev] MCJIT versus getLazyBitcodeModule?
Thanks for the pointers. Am I correct in assuming that putting the precompiled bitcode into a second module and linking (or using the object caches) would result in ordinary function calls, but would not be able to inline the functions? -- lg On Jan 21, 2014, at 11:55 AM, Kaylor, Andrew <andrew.kaylor at intel.com> wrote: > I would say that the incompatibility is by design. Not
2012 Oct 26
3
[LLVMdev] Using LLVM to serialize object state -- and performance
I have a legacy C++ application that constructs a tree of C++ objects (an iterator tree to implement a query language). I am trying to use LLVM to "serialize" the state of this tree to disk for later loading and execution (or "compile" it to disk, if you prefer). Each of the C++ iterator objects now has a codegen() member function that adds to the LLVM code of an
2014 Jan 26
2
[LLVMdev] MCJIT versus getLazyBitcodeModule?
Hi Gael, I tried converting to your approach but I had some issues making sure that all symbols accessed by the jit modules have entries in the dynamic symbol table. To be specific, my current approach is to use MCJIT (using an objectcache) to JIT the runtime module and then let MCJIT handle linking any references from the jit'd modules; I just experimented with what I think you're doing,
2012 Apr 12
3
[LLVMdev] clang++ on MacOSX with fsf-gcc libstdc++?
Hi, the subject says it all... After some experimenting, I got a bit confused as far as what the proper thing to do might be.... I build llvm/clang from trunk sources on OSX Lion 10.7.3 (i.e. x86_64-apple-darwin11.3.0 to speak GNU's platform-ese) where I also have successfully built a fsf-gcc 4.6.2 (and lately a 4.7 for that matter) from sources. Now, I think I understand that by playing
2012 Nov 06
3
[LLVMdev] Using LLVM to serialize object state -- and performance
Thanks for responding. Sorry for the delay in my reply, but I was dealing with hurricane Sandy. Anyway.... My software build produces libmylib.so. The JIT'd function only calls external C functions in libmylib.so and not other JIT'd functions. The C functions are simple thunks to call constructors. For example, given: class BinaryNode : public Node { public: BinaryNode( Node
2012 Oct 27
0
[LLVMdev] Using LLVM to serialize object state -- and performance
I'm not sure I have a clear picture of what you're JIT'ing. If any of the JIT'ed functions call other JIT'ed functions, it may be difficult to find all the dependencies of a functions and recreate them correctly on a subsequent load. Even if the JIT'ed functions only call non-JIT'ed functions, I think you'd need some confidence that the address of the called
2011 Mar 31
3
[LLVMdev] inserting exit function into IR
Hi Joshua, I have a function foo and I want to insert exit(0) at the end of foo. The problem is M.getFunction returns null, which is understandable. I am not sure what to do. Below is the code snippet. void foo(int argc, char* argv[]) { printf("hello world\n"); exit(0); //***I want to insert this exit } My llvm code snippet is vector<const Type *> params =
2019 Aug 13
4
ORC v2 question
Hi Lang, On Tue, 13 Aug 2019 at 22:03, Lang Hames <lhames at gmail.com> wrote: > When you say your code is not getting optimized, do you mean that IR optimizations are not being applied, or that codegen optimizations are not being applied? > > What do you see if you dump the modules before/after running the pass manager on them, like this: > > dbgs() << "Before
2002 Sep 25
4
pulling data from the server
Hi all, I have started the rsync in deamon mode. When I use the following command: rsync --port 9876 u018::treeA it seems to work fine but no files are copied from the server. Using rsync without the deamon works fine. I tried to debug it a little bit, but I am unable to figure out what's wrong. 337:david@u050 /export/treeA> rsync -r -vvv --port 9876 u018::treeA opening tcp
2014 Jun 29
2
[LLVMdev] Wrong behavior modifying and executing llvm::Function with JIT Engine
Hello, The problem I'm having is that I modify a function body by using 'Value::replaceAllUsesWith' and then execute it with the JIT engine several times but I always get the output from the first iteration for all the iterations. This is what I do: I generate the following 2 functions on the fly based on the FunctionType of the declaration below in C code. define i32
2010 Nov 08
3
[LLVMdev] Calling PassManager on previously JITed Modules
Hi, Has anyone had any success with running different PassManagers on llvm::Modules they've already JITed and are executing? In detail: 1) getting the IR, in form of an llvm::Module 2) calling PassManager->run() on the module 3) calling getFunction() and getPointerToFunction() to JIT the module 4) executing the JITed code using the function pointer received in step 3 and then what I
2011 Mar 30
2
[LLVMdev] inserting exit function into IR
Hi Everyone, I am trying to insert an exit function into my IR. However, I thought I can get access to exit by using Module.getOrInsertFunction or Module.getFunction. However, I am getting a null value returned. I have searched through the llvmdev archives but not found any thing that addresses this question. Any help will be greatly appreciated. Thanks. George -------------- next part
2012 Aug 22
1
[LLVMdev] [PATCH] Fix for bug in JIT exception table allocation (no test yet)
On Aug 21, 2012, at 2:12 PM, Michael Muller <mmuller at enduden.com> wrote: > > Hi, I found a bug in the code that generates exception tables, I've attached > what I think is the correct fix. > > When you run out of space writing to a buffer, the buffer management code > simply stops writing at the end of the buffer. It is the responsibility of > the caller to
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 --------------
2010 Aug 17
4
[LLVMdev] clang: call extern function using JIT
hi, im creating a music application(image below). At the moment im using tcc compiler but im moving across to clang because of the improved compiler warnings. Can anyone please explain and show code so I can use clang's JIT to call functions in my application? Thanks. http://old.nabble.com/file/p29449300/51709341.jpeg -- View this message in context:
2012 Aug 23
0
[LLVMdev] [PATCH] Fix for bug in JIT exception table allocation (no test yet)
Eric Christopher wrote: > > On Aug 21, 2012, at 2:12 PM, Michael Muller <mmuller at enduden.com> wrote: > > > > > Hi, I found a bug in the code that generates exception tables, I've attached > > what I think is the correct fix. > > > > When you run out of space writing to a buffer, the buffer management code > > simply stops writing at the
2016 May 17
3
External function resolution: MCJIT vs ORC JIT
When using ORC JIT, I'm having trouble with external function resolution (that is, of a function defined in the app, with C linkage). I add a declaration for the function to my IR, and when I use MCJIT, it finds it and all is well, But when I use ORC JIT (I *think* correctly, at least it closely matches what I see in the tutorial), I get an LLVM error, "Program used external function