<div dir="ltr">This is more in Adrian's territory (he reviewed it & it's the modules debug info stuff which he's worked on that this is a fix for), but yes - the change seems reasonable enough & the bug seems problematic/annoying enough that it'd be worth taking for 3.8</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 25, 2016 at 11:55 AM, Hans Wennborg via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I'm not sure who's the code owner here, and I'm not qualified to<br>
review it myself because I don't know what arc and note files are :-)<br>
<br>
Just for a second opinion; David, does this look reasonable to you?<br>
<div class="HOEnZb"><div class="h5"><br>
On Mon, Jan 25, 2016 at 10:14 AM, Vedant Kumar <<a href="mailto:vsk@apple.com">vsk@apple.com</a>> wrote:<br>
> Hi,<br>
><br>
> I'd like to propose taking this commit for the 3.8 branch.<br>
><br>
> It stops the compiler from writing out gcov-style arc and note files for module CU's.<br>
><br>
> thanks<br>
> vedant<br>
><br>
>> On Jan 21, 2016, at 9:04 AM, Vedant Kumar via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br>
>><br>
>> Author: vedantk<br>
>> Date: Thu Jan 21 11:04:42 2016<br>
>> New Revision: 258406<br>
>><br>
>> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=258406&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=258406&view=rev</a><br>
>> Log:<br>
>> [GCOV] Avoid emitting profile arcs for module and skeleton CUs<br>
>><br>
>> Do not emit profile arc files and note files for module and skeleton<br>
>> CU's.<br>
>><br>
>> Our users report seeing unexpected *.gcda and *.gcno files in their<br>
>> projects when using gcov-style profiling with modules or frameworks.<br>
>> The unwanted files come from these modules. This is not very helpful<br>
>> for end-users. Further, we've seen reports of instrumented programs<br>
>> crashing while writing these files out (due to I/O failures).<br>
><br>
> ^ We've also seen crashes because the gcda is not meant to be backwards-compatible. This results in "cannot merge previous GCDA" errors.<br>
><br>
>><br>
>> rdar://problem/22838296<br>
>><br>
>> Reviewed-by: aprantl<br>
>><br>
>> Differential Revision: <a href="http://reviews.llvm.org/D15997" rel="noreferrer" target="_blank">http://reviews.llvm.org/D15997</a><br>
>><br>
>> Added:<br>
>>    llvm/trunk/test/Transforms/GCOVProfiling/modules.ll<br>
>> Modified:<br>
>>    llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp<br>
>><br>
>> Modified: llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp<br>
>> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp?rev=258406&r1=258405&r2=258406&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp?rev=258406&r1=258405&r2=258406&view=diff</a><br>
>> ==============================================================================<br>
>> --- llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp (original)<br>
>> +++ llvm/trunk/lib/Transforms/Instrumentation/GCOVProfiling.cpp Thu Jan 21 11:04:42 2016<br>
>> @@ -494,6 +494,11 @@ void GCOVProfiler::emitProfileNotes() {<br>
>>     // LTO, we'll generate the same .gcno files.<br>
>><br>
>>     auto *CU = cast<DICompileUnit>(CU_Nodes->getOperand(i));<br>
>> +<br>
>> +    // Skip module skeleton (and module) CUs.<br>
>> +    if (CU->getDWOId())<br>
>> +      continue;<br>
>> +<br>
>>     std::error_code EC;<br>
>>     raw_fd_ostream out(mangleName(CU, "gcno"), EC, sys::fs::F_None);<br>
>>     std::string EdgeDestinations;<br>
>> @@ -853,6 +858,11 @@ Function *GCOVProfiler::insertCounterWri<br>
>>   if (CU_Nodes) {<br>
>>     for (unsigned i = 0, e = CU_Nodes->getNumOperands(); i != e; ++i) {<br>
>>       auto *CU = cast<DICompileUnit>(CU_Nodes->getOperand(i));<br>
>> +<br>
>> +      // Skip module skeleton (and module) CUs.<br>
>> +      if (CU->getDWOId())<br>
>> +        continue;<br>
>> +<br>
>>       std::string FilenameGcda = mangleName(CU, "gcda");<br>
>>       uint32_t CfgChecksum = FileChecksums.empty() ? 0 : FileChecksums[i];<br>
>>       Builder.CreateCall(StartFile,<br>
>><br>
>> Added: llvm/trunk/test/Transforms/GCOVProfiling/modules.ll<br>
>> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GCOVProfiling/modules.ll?rev=258406&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GCOVProfiling/modules.ll?rev=258406&view=auto</a><br>
>> ==============================================================================<br>
>> --- llvm/trunk/test/Transforms/GCOVProfiling/modules.ll (added)<br>
>> +++ llvm/trunk/test/Transforms/GCOVProfiling/modules.ll Thu Jan 21 11:04:42 2016<br>
>> @@ -0,0 +1,12 @@<br>
>> +; RUN: opt -insert-gcov-profiling -o - < %s | llvm-dis | FileCheck -check-prefix=EMIT-ARCS %s<br>
>> +<br>
>> +; EMIT-ARCS-NOT: call void @llvm_gcda_start_file<br>
>> +<br>
>> +!<a href="http://llvm.dbg.cu" rel="noreferrer" target="_blank">llvm.dbg.cu</a> = !{!0}<br>
>> +!llvm.module.flags = !{!3, !4}<br>
>> +<br>
>> +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "LLVM", isOptimized: false, runtimeVersion: 2, splitDebugFilename: "my.dwo", emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !2, globals: !2, imports: !2, dwoId: 43981)<br>
>> +!1 = !DIFile(filename: "<stdin>", directory: "/")<br>
>> +!2 = !{}<br>
>> +!3 = !{i32 2, !"Dwarf Version", i32 4}<br>
>> +!4 = !{i32 2, !"Debug Info Version", i32 3}<br>
>><br>
>><br>
>> _______________________________________________<br>
>> llvm-commits mailing list<br>
>> <a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
>> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
><br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br></div>