<html>
    <head>
      <base href="http://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 --- - BranchProbabilityInfo is not using the right heuristics inside loops"
   href="http://llvm.org/bugs/show_bug.cgi?id=18705">18705</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>BranchProbabilityInfo is not using the right heuristics inside loops
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </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>Global Analyses
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>bob.wilson@apple.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>The BranchProbabilityInfo analysis applies a series of heuristics to determine
branch weights. In cases when multiple heuristics could apply, it uses the
first one. The LoopBranchHeuristics are the 4th of 8 heuristics that it tries.
The calcLoopBranchHeuristics function starts like this:

  Loop *L = LI->getLoopFor(BB);
  if (!L)
    return false;

That is the only "return false" in the function. I.E., any basic block inside a
loop will be handled by this heuristic, and we will never even try using any of
the later heuristics inside a loop. Worse, the "InEdges" (anything that is
neither an exit nor a back edge) are always handled by dividing the loop weight
by the number of InEdge successors, which seems unlikely to be the right thing
to do in many cases.</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>