[LLVMdev] A Question
kennethuil at gmail.com
Tue Aug 24 05:55:59 PDT 2010
On Tue, Aug 24, 2010 at 2:27 AM, hamed hamzehi <mohammadhamzehi at yahoo.com>wrote:
> I want to use LLVM to automatically generate *multithreaded code for
> execution* on multicore processors. My problem is code generation for
> multicores and concurrency primitives.
> Is there any facilities for code generation? How should I start?
> Best Regards.
You'll need a threading library for your platform. Then create function
declarations for the threading functions, call them from your generated
code, and off you go. Be sure to link the threading libraries in to your
LLVM does not have anything threading specific in the IR language definition
other than the atomic primitives. You can create locks and stuff with
those, or use the ones provided by your threading library. LLVM has nothing
built in for generating code that knows how to spawn a new thread.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev