[LLVMdev] Multithreaded code generation
Tobias Grosser
grosser at fim.uni-passau.de
Tue Oct 5 04:01:38 PDT 2010
On 10/05/2010 12:30 PM, hamed hamzehi wrote:
> Hi,
>
> In fact I have some theory on instruction level parallelism( i have a
> partitioning algorithm), then first of all, i want to generate a
> multithreaded code from LLVM IR (in assembly level) with a given
> partitioning. My problem is how can i use a thread library(like Pthread)
> or OS system calls in LLVM IR to create and manage threads?
OK. For this I propose to insert calls to libgomp (gnuopenmp) or the mpc
openmp library.
If you check out mpc you will find explanations how to use it to create
OpenMP constructs by hand in a header file called mpcomp_abi.h located
inside the mpc/MPC_OpenMP/include directory.
As a starter I would write C code that does what you expect and compile
it to LLVM-IR to see how the libraries are inserted in the LLVM-IR.
Cheers
Tobi
More information about the llvm-dev
mailing list