[LLVMdev] multi-threading in llvm

Dmitry N. Mikushin maemarcus at gmail.com
Mon Sep 12 07:18:01 PDT 2011


Hi Alexandra,

I don't know much, maybe this topic should be bridged with polly-dev
(adding it to CC) to bring it more attention.

Indeed, polly uses ScopPass, that creates serious limitations in
compatibility with other passes. To my understanding, scops are used
because ISL loop analysis tool uses scops. In fact, just for handling
OpenMP directives scops are not required, unless one need to make sure
OpenMP directive is set for loop with parallel iterations.

Btw, it would be very interesting to know more about your
project/purpose for this!

- D.

2011/9/8 Jimborean Alexandra <xinfinity_a at yahoo.com>:
> Hi,
>
> I want to execute the iterations of a loop in parallel, by inserting calls
> either to pthreads or to the gomp library at the LLVM IR level. As a first
> step, I inserted an omp pragma in a C file and compiled it with llvm-gcc to
> check the generated LLVM code. If I understand correctly, to parallelize the
> loop in LLVM IR, I have to separate the loop in a new function, put all
> required parameters in a structure, make the call to the gomp library, and
> restore all values from the structure in the original variables.
> Also, I have to compute the number of iterations allocated to each thread
> and insert in the loop body a new condition, such that each thread executes
> only its slice.
> Is that correct?
> As far as I know, both llvm-gcc and Polly already offer support for OpenMP,
> by inserting calls to the gomp library. Can this code be reused? Is there a
> pass that I can call to do all these code transformations?
>
> I had a look at the CodeGeneration from Polly. Is it possible to use it
> without creating the Scops, by transforming it into a LoopPass?
> Could you indicate how is this handled in llvm-gcc?
> Thank you for your help.
> Alexandra.
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>




More information about the llvm-dev mailing list