<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Thu, Jul 19, 2018 at 1:43 AM Marco Castelluccio <<a href="mailto:mcastelluccio@mozilla.com">mcastelluccio@mozilla.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Il 18/07/2018 20:52, David Li via Phabricator ha scritto:<br>
<br>
> davidxl added inline comments.<br>
><br>
><br>
> ================<br>
> Comment at: test/profile/Inputs/instrprof-gcov-fork.c.gcov:9<br>
> +// CHECK-NEXT:function func1 called 1 returned 100% blocks executed 100%<br>
> +// CHECK-NEXT:        2:    3:void func1() {}<br>
> +// CHECK-NEXT:function func2 called 2 returned 100% blocks executed 100%<br>
> ----------------<br>
> func1 is executed once not twice.<br>
This is a pre-existing problem<br>
(<a href="https://bugs.llvm.org/show_bug.cgi?id=38065" rel="noreferrer" target="_blank">https://bugs.llvm.org/show_bug.cgi?id=38065</a>), but you can see that<br>
after the patch it is actually executed once ("called 1").<br>
<br></blockquote><div><br></div><div>why is the entry count shows 2 here? This looks like a different issue though.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
><br>
><br>
> ================<br>
> Comment at: test/profile/Inputs/instrprof-gcov-fork.c.gcov:11<br>
> +// CHECK-NEXT:function func2 called 2 returned 100% blocks executed 100%<br>
> +// CHECK-NEXT:        4:    4:void func2() {}<br>
> +// CHECK-NEXT:        -:    5:<br>
> ----------------<br>
> func2 is executed twice not 4 times.<br>
Same here.<br>
<br>
<br>
><br>
><br>
> ================<br>
> Comment at: test/profile/Inputs/instrprof-gcov-fork.c.gcov:20<br>
> +// CHECK-NEXT:        -:   11:<br>
> +// CHECK-NEXT:        1:   12:  func2();<br>
> +// CHECK-NEXT:        -:   13:<br>
> ----------------<br>
> this line should be executed twice.<br>
><br>
><br>
> ================<br>
> Comment at: test/profile/Inputs/instrprof-gcov-fork.c.gcov:22<br>
> +// CHECK-NEXT:        -:   13:<br>
> +// CHECK-NEXT:        1:   14:  return 0;<br>
> +// CHECK-NEXT:        -:   15:}<br>
> ----------------<br>
> same here.<br>
> davidxl added a comment.<br>
><br>
> One of the real issues is that func1, fork, and func2 are in the same BB and share the same profile counter. The BB ending with fork should be split so that func2 's block has its own counter.<br>
<br>
Exactly, these are due to the problem I mentioned in the summary, which<br>
probably has to be fixed in the Clang/LLVM side.<br>
I think they are unrelated problems though, this patch is going to fix<br>
the double counting, the other patch would fix the BBs in the function<br>
which calls fork.<br></blockquote><div><br></div><div><br></div><div>Ok.</div><div> </div></div></div>