<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 --- - Gigantic block frequencies produced by clang in PGO" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D23758&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=SBeEpx0oXyJZxvN87NPKHYIkvnSUsFvbP_tkcSm5hlM&s=UDj4C1NdUcCAVV3blsKcZ7AFw8DJ_pV6Sw2XMqArPbM&e=">23758</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Gigantic block frequencies produced by clang in PGO
          </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>All
          </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>LLVM Codegen
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>congh@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=14434" name="attach_14434" title="CFG with edge frequencies.">attachment 14434</a> <a href="attachment.cgi?id=14434&action=edit" title="CFG with edge frequencies.">[details]</a></span>
CFG with edge frequencies.

When compiling spec2000 in PGO mode, I noticed many very large block
frequencies for some programs. They are too big to be true. One example is
164.gzip in spec2000. I made the profile data from running the binary with
options "input.random 60". The produced CFG is attached here, which shows the
hottest block has the frequency over 14E12. Note that the frequency of the
entry node is only 17, which means that the hottest node runs almost 1E12 times
more that the entry.

To find out the actual frequency of that hot node, I profiled the same program
using GCC, and also inserted a counter manually to the program. Both showed
that the hottest node ran only about 4E7 times more than the entry.

So I think there may be something wrong in LLVM's frequency calculation. 

(In the attached CFG, the numbers on edges are frequencies.)</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>