[LLVMdev] [RFC] OpenMP Representation in LLVM IR

Andrey Bokhanko andreybokhanko at gmail.com
Wed Oct 3 01:15:54 PDT 2012


> While I think that it will be relatively easy to have the intrinsics
> serve as code-motion barriers for other code that might be threads
> sensitive (like other external function calls), we would need to think
> through exactly how this would work. The easiest thing would be to make
> the intrinsics have having unmodeled side effects, although we might
> want to do something more intelligent.

Yes, that's exactly the idea.

> Where do you propose placing the parallel loop intrinsics calls
> relative to the loop code?

In preloop ("opening" intrinsic) and postloop ("closing" one).

> Will this inhibit restructuring (like loop
> interchange), fusion, etc. if necessary?

I guess so... Loops usually deal with reading/writing memory, and if
an intrinsic is marked as "modifies everything", this hardly leaves
any possibility for [at least] the optimizations you mentioned.

But this is different from what I have in mind. Basically, the plan is
to perform analysis and some optimizations before procedurization, and
do the rest (including loop restructuring) after it. This is not
mentioned in the proposal (we tried to be succint -- only 20 pages
long! :-)), but explained in detail in [Tian05] (sorry, the link in
the proposal doesn't lead you directly to pdf file; use this one
instead: http://citeseerx.ist.psu.edu/viewdoc/download?doi=


More information about the llvm-dev mailing list