[LLVMdev] Is there any known bug related to NoDuplicate in LLVM/Clang 3.5

Lu Mitnick king19880326 at gmail.com
Thu Feb 5 10:37:02 PST 2015


Hello all,

I am using LLVM/Clang 3.5 to build a C++ extension. Such C++ extension
contains a special function named "barrier", which shouldn't be duplicated.
So I add __attribute__((noduplicate)) on barrier declaration.

For some reasons, I also add AlwaysInlineAttr attribute on each function
except main function. The generated LLVM IR what I expect is only a main
function with many LLVM IRs.

However when I counts the number of barrier function call of the output
LLVM IR, I found the number is more than I used in source code. I am
wondering whether there is any known bug related to NoDuplicate in
LLVM/Clang 3.5?

PS. To find out the problematic LLVM pass that may duplicate my barrier
function call. I also used -print-after-all to dump the generated LLVM IR
of each pass. But the main function is too huge and the called pass is too
much therefore it is not feasible to debug in this way. Do you have any
other debug tips to find out the problematic LLVM pass?

Any suggestion is welcomed.

Thanks,
Yi-Hong
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150206/a6750bc1/attachment.html>


More information about the llvm-dev mailing list