Greetings, I have a plan to use LLVM to undertake runtime optimisation of computational chemistry programs. As part of this, I'd like to be able to invoke lli and pass it a list of passes to run, in the manner of opt. For example:> lli -load=llvm/mem_trace_pass/bin/lib/hello.so -hello ./my_bitcode.bcThe current implementation of lli (updated from SVN as of three nights ago) doesn't seem to support this. Too see if it would work, I transplanted the required functionality from the opt tool, so the above invocation now works - the pass 'hello' is run by the JIT. This has led to a couple of questions: 1. Did I miss something? As far as I can see, the current JIT implementation has a hardcoded list of pre-defined passes, which deal with bitcode to machine code transformations. The interpreter doesn't seem to have anything to do with passes. 2. Is granting this ability to the JIT desirable? If so, I'm happy to clean up my temporary hack job and submit a patch. Cheers, Warren Armstrong
On Oct 28, 2007, at 10:38 PM, Warren Armstrong wrote:> Greetings, > > I have a plan to use LLVM to undertake runtime optimisation of > computational chemistry programs.Ok.> As part of this, I'd like to be able > to invoke lli and pass it a list of passes to run, in the manner of > opt. For example: > >> lli -load=llvm/mem_trace_pass/bin/lib/hello.so -hello ./my_bitcode.bc > > The current implementation of lli (updated from SVN as of three nights > ago) doesn't seem to support this. Too see if it would work, I > transplanted the required functionality from the opt tool, so the > above > invocation now works - the pass 'hello' is run by the JIT. This > has led to a couple of questions: > > 1. Did I miss something?Nope.> 2. Is granting this ability to the JIT desirable? If so, I'm > happy to > clean up my temporary hack job and submit a patch.Not so much. "lli" is supposed to be a really simple driver around the JIT, it isn't supposed to be a maximally useful user program. If you'd like a version of lli that runs optimizations, I'd suggest taking lli, copying it, and tuning it into the tool that you'd like it to be. I'd like to keep lli simple and focused on what it does, which is provide primitive command line access to the jit/interpreter. Note that you can potentially just use a shell script which does: opt foo.bc -myopt | lli ... -Chris
Chris Lattner wrote:>> 2. Is granting this ability to the JIT desirable? If so, I'm >> happy to >> clean up my temporary hack job and submit a patch. >> > > Not so much. "lli" is supposed to be a really simple driver around > the JIT, it isn't supposed to be a maximally useful user program. > > If you'd like a version of lli that runs optimizations, I'd suggest > taking lli, copying it, and tuning it into the tool that you'd like > it to be. I'd like to keep lli simple and focused on what it does, > which is provide primitive command line access to the jit/interpreter. > > Note that you can potentially just use a shell script which does: > > opt foo.bc -myopt | lli ... > > -Chris >Ah, ok. A shell script wouldn't work, because I'm envisioning optimisation happening at runtime. I'll use your idea of creating a customised version of lli. Thanks, Warren
Seemingly Similar Threads
- [LLVMdev] User-specified JIT passes
- [LLVMdev] Requiring a pass to run before/after a pass? (Adding PHIs and updating uses)
- optim seems to be finding a local minimum
- [LLVMdev] Requiring a pass to run before/after a pass? (Adding PHIs and updating uses)
- [LLVMdev] Resolving a function symbol using JIT.