[LLVMdev] Forcing the Interpreter segfaults

Török Edwin edwintorok at gmail.com
Wed Nov 3 04:15:50 PDT 2010


On Tue, 2 Nov 2010 23:07:06 -0600
OvermindDL1 <overminddl1 at gmail.com> wrote:

> On Tue, Nov 2, 2010 at 3:36 PM, Salomon Brys <salomon.brys at gmail.com>
> wrote:
> > In my case, I am working on a posix regular expression library that
> > uses LLVM to execute a regular expression.
> > Each regular expression is a very small sets of code and is faster
> > to interpret than to JIT then execute.
> > I wanted to JIT only when the regular expression is executed more
> > than 20 times.
> > The benchmarks I have run show that my library is amzingly fast to
> > execute a regular expression (thanks to LLVM) but amzingly slow to
> > compile in JIT. I need the interpreter to provide a way to execute
> > a regular expression without JITing it, which would be much slower
> > BUT will result in a faster execution IF the regular expression is
> > used only two or three times. So, is there no way now to execute a
> > LLVM bitcode *without* JITing ?
> 
> If you want to submit patches to update the Interpreter to work with
> the modern code, it would certainly be liked, but the Interpreter was
> *slow*, it was designed for correctness while the JIT was being
> created, not speed.

Did you try the JIT with -O0 and the local register allocator?
It should emit worse quality code, but much faster. It might still be
faster than the interpreter.

Or you could implement your own interpreter for the regular expression.
A special purpose interpreter (your own for regexes) will always be
faster than a general purpose one (LLVM's).

Best regards,
--Edwin



More information about the llvm-dev mailing list