<div dir="ltr">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.<div>
<br></div><div>Mark</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 23, 2014 at 1:38 PM, David Glanzman <span dir="ltr"><<a href="mailto:gland@seas.upenn.edu" target="_blank">gland@seas.upenn.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>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 (<a href="https://github.com/motonacciu/clomp" target="_blank">https://github.com/motonacciu/clomp</a> and <a href="http://llvm.org/devmtg/2013-04/pellegrini-slides.pdf" target="_blank">http://llvm.org/devmtg/2013-04/pellegrini-slides.pdf</a>), 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.<br>

<br></div><div>Thanks,<br></div><div>David<br></div></div>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br></div>