[LLVMdev] adding a new pragma in OpenMP

Duncan Sands baldrick at free.fr
Thu Oct 14 00:52:34 PDT 2010


Hi Hari,

>    I am trying to add an extension to OpenMP through a new pragma. I was
> wondering if there is any way I can declare a new pragma and define a
> set of rules for macro expansion or use PassManager in LLVM to expand
> the pragma. Thanks in advance.

the only LLVM front-ends that support OpenMP are llvm-gcc and dragonegg.
Both of these expand out all OpenMP constructs before generating LLVM IR.
(LLVM IR has no special support for OpenMP).  So any new pragma support
needs to be added to one of these front-ends.  For both front-ends, the
OpenMP expansion is done by gcc's OpenMP lowering pass.  So adding a new
pragma to one of these is exactly the same as adding a new pragma to gcc.

Ciao,

Duncan.



More information about the llvm-dev mailing list