<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Incorrect sample profile when braces omitted"
href="https://llvm.org/bugs/show_bug.cgi?id=28990">28990</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Incorrect sample profile when braces omitted
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>dcallahan@fb.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=16959" name="attach_16959" title="script to demonstrate">attachment 16959</a> <a href="attachment.cgi?id=16959&action=edit" title="script to demonstrate">[details]</a></span>
script to demonstrate
Attached are two source variables, <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - Need to add product version numbers"
href="show_bug.cgi?id=1">bug1</a>.cc and <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - Customize Bugzilla to have some LLVM flavah"
href="show_bug.cgi?id=2">bug2</a>.cc which differ only in the
placement of braces around a then-statement. When these braces are omitted, a
profile-based sample is incorrect while it is correct when they are present.
Reproduction steps are in <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - Need to add product version numbers"
href="show_bug.cgi?id=1">bug1</a>.sh
create_llvm_prof is available at <a href="https://github.com/google/autofdo">https://github.com/google/autofdo</a>
The incorrect sample derived from <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - Need to add product version numbers"
href="show_bug.cgi?id=1">bug1</a>.cc (from llvm-profdata show) is:
Function: _Z8clampSumPdidd: 100803968, 0, 13 sampled lines
Samples collected in the function's body {
0: 0
1: 0
2.1: 908152
2.2: 908138
3: 908139
4: 0
5: 908146
6: 908142
7: 908150
9: 908149
10: 908146
11: 908138
13: 4
}
while the correct sample derived from <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - Customize Bugzilla to have some LLVM flavah"
href="show_bug.cgi?id=2">bug2</a>.cc is
Function: _Z8clampSumPdidd: 101434538, 1, 14 sampled lines
Samples collected in the function's body {
0: 1
1: 1
2.1: 913831
2.2: 913817
3: 913818
4: 0
5: 913830
6: 913826
7: 0
8: 913834
9: 913831
10: 913827
11: 913821
13: 1
}
where the key differences is the value for relative line 7, it should be 0.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>