[LLVMdev] Adding custom #pragma for clang

Mark Heffernan meheff at google.com
Tue Jul 29 11:31:18 PDT 2014


A number of new pragmas were added recently to clang to support loop
optimization hints.  The syntax is "#pragma clang loop ..." where "..." is
a sequence of hints such as "unroll(4)".  These hints result in llvm.loop
metadata being added to the IR to annotate the loop.  Depending upon what
you're doing this may be a good model to follow.

Mark


On Wed, Jul 23, 2014 at 1:38 PM, David Glanzman <gland at seas.upenn.edu>
wrote:

> I'd like to add a custom #pragma directive in clang for research
> purposes.  I'm familiar with the LLVM pass-writing interface but new to the
> rest of LLVM and clang.  I've looked into Simone Pellegrini's work on a
> #pragma interface (https://github.com/motonacciu/clomp and
> http://llvm.org/devmtg/2013-04/pellegrini-slides.pdf), but I'm in no
> position to determine if this approach is applicable for the latest version
> of clang, or how to go about updating things.  Any advice would be greatly
> appreciated.
>
> Thanks,
> David
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140729/0815a4a4/attachment.html>


More information about the llvm-dev mailing list