[LLVMdev] User-specified JIT passes

Chris Lattner sabre at nondot.org
Sun Oct 28 22:51:16 PDT 2007


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



More information about the llvm-dev mailing list