[LLVMdev] A Question

Kenneth Uildriks 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:

> Hi
> 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
executable.

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...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100824/4c537c09/attachment.html>


More information about the llvm-dev mailing list