[llvm-dev] Adding pragma related metadata to only one loop

Nitish Srivastava via llvm-dev llvm-dev at lists.llvm.org
Wed Sep 13 11:23:29 PDT 2017

Hi everyone,

  I wanted to assign a new pragma for loops in clang. Let's call it
"#pragma XXX" which can be applied to any loop in the entire loop
hierarchy. I added the support for my pragma by following the same steps as
were being used in the default implementation of "unroll" pragma.

  But now, when I compile any program using clang to llvm IR it attaches
the pragma related metadata to the loop as well as to all the loops nested
inside it. I just want to add the metadata to that particular loop and not
all the loops nested inside it. Can someone suggest what would be the right
way of doing this? or rather what files should I look into.

  So far I have made changes in the following files:

1) include/clang/Basic/Attr.td
2) include/clang/Parse/Parser.h
3) lib/CodeGen/CGLoopInfo.cpp
4) lib/CodeGen/CGLoopInfo.h
5) lib/Parse/ParsePragma.cpp
6) lib/Sema/SemaStmtAttr.cpp

  Any help would be appreciated.


Best Regards,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170913/5f8b027d/attachment.html>

More information about the llvm-dev mailing list