<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </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 - It's best for the DFG to always have some guess of basic block frequency"
   href="https://bugs.webkit.org/show_bug.cgi?id=151350">151350</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>It's best for the DFG to always have some guess of basic block frequency
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>WebKit Nightly Build
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </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>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>JavaScriptCore
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>fpizlo&#64;apple.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Previously we used PNaN whenever we weren't sure about the execution frequency. This was partly to ensure that the execution frequencies &quot;made sense&quot;.  I think that this is the wrong approach, and it's definitely not profitable when you consider how B3 will use the frequencies.  We should define frequency by what effects it has on optimization and correctness.  I propose:

- Frequency has no effect on correctness.  It should be OK to pass any bag of double bits, including NaN, as the frequency.  Using NaN could cause the compiler to make silly and unprofitable decisions, but it shouldn't break anything.

- Frequency should be used for register allocation and layout.  Higher frequency means that we want to prioritize that basic block.  Some optimizations that frequency will affect:

    Register allocation: temporaries used in a block with higher frequency will get higher priority.

    Layout: when a block branches to multiple blocks, the block with highest frequency is likely to be scheduled closest, so that in the best case it will be the fall-through block.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>