[LLVMdev] Threading support

Chris Lattner sabre at nondot.org
Tue Mar 23 17:04:01 PST 2004


On Mon, 22 Mar 2004, Reid Spencer wrote:
> You are correct that today LLVM doesn't handle multi-threaded programs.
> However, I believe Misha is working on this now (correct me if I'm wrong
> Misha). To file a bugzilla on this would be a little redundant. Its a
> well-known issue and one that is being worked on.

Actually there are two different issues here.  First, the JIT does not use
locking, so if you run a threaded program in it, you might get "reentrant
compilation" assertions.  Fixing/implementing this should be pretty
straight-forward, it's just that noone has tackled it yet.

Second, and completely seperate, LLVM does not provide any intrinsic
support for threaded programs (such as locking intrinsics, etc).  Note
that this is not a bug, and doesn't prevent working on threaded programs,
you just need to use a preexisting threads library, like pthreads.  I say
that this is not a bug because it does not prevent the correct compilation
of threaded programs at all.  In the future, we may add features to LLVM
to make it easier to express the parallelism to the compiler, allowing for
interesting analysis and optimization potentials, but that's purely a new
feature, not a bug fix...

-Chris

-- 
http://llvm.cs.uiuc.edu/
http://www.nondot.org/~sabre/Projects/




More information about the llvm-dev mailing list