[LLVMdev] Design question on implementing OpenMP support

Gautam B.T. gautam.bt at gmail.com
Tue Nov 9 12:58:05 PST 2010


Hello,

I had earlier mailed the list[1] about adding OpenMP support to Clang and LLVM
Polly.

The LLVM Polly wiki page earlier mentioned a design[2] where Clang and LLVM
Polly would emit annotations to the code and there would be a seperate pass that
would transform the code using these annotations. The issue I see with this
approach is that this pass will have to be run immediately after the Clang and
LLVM Polly emit these intrinsics. Otherwise a different pass might make the
annotations invalid. A dead code elimination pass might remove the code for
which these annotations were meant for example.

I believe the simpler way is to have a library of classes to represent OpenMP
directives and functions to transform these objects to LLVM objects and then
have LLVM and Clang use this library directly.

I would like to know if I am missing something about the design using
annotations as well as any alternative designs.

[1] http://128.174.252.7/pipermail/llvmdev/2010-October/035568.html
[2] http://wiki.llvm.org/index.php?title=Polyhedral_optimization_framework&oldid=991

--
Gautam



More information about the llvm-dev mailing list