[LLVMdev] multi-threading in llvm

Tobias Grosser tobias at grosser.es
Mon Sep 12 09:10:09 PDT 2011


On 09/12/2011 04:56 PM, Sebastian Pop wrote:
> On Mon, Sep 12, 2011 at 10:44, Tobias Grosser<tobias at grosser.es>  wrote:
>>> You can have the parallel code generation part of Polly working as
>>> a LoopPass.
>>
>> Are you sure about this? In CodeGeneration we basically translate a CLooG
>> AST into LLVM-IR. Without a CLooG AST this does not work.
>
> I mean you could rewrite that code to work on a per loop basis, like
> graphite does: flag the parallel loops in the code generation of polly
> and then independently of polly, as a LoopPass, iterate over all the
> loops and code generate the parallel ones.

Yes, that's true and probably a good idea. It is more work as generating 
it directly in Polly, but it facilitates reuse of code. We can probably 
reuse quite a bit of the code in the existing OpenMP code generation.

We (or actually someone) may work on three things:

1) The high level OpenMP intrinsics that can be lowered to actual 
library calls

This can be reused by an clang OpenMP extensions as well as by polly 
directly.

2) An OpenMP builder, that allows to build OpenMP loops from scratch

3) The actual parallelizer, that takes an LLVM-IR loop and parallelizes 
it with OpenMP intrinsics.

Cheers
Tobi





More information about the llvm-dev mailing list