<html>
    <head>
      <base href="https://bugs.llvm.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 - Support "__builtin_expect_with_probability" (C/C++)"
   href="https://bugs.llvm.org/show_bug.cgi?id=39469">39469</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Support "__builtin_expect_with_probability" (C/C++)
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </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>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C++
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>haneef503@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The next GCC includes support for a new builtin ` ` [1] that is similar to
`__builtin_expect()`, except with support for real probabilities:


<span class="quote">> (long exp, long c, long probability)</span >

<span class="quote">> The built-in has same semantics as __builtin_expect_with_probability,
> but user can provide expected probability (in percent) for value of exp.
> Last argument probability is of float type and valid values are in
> inclusive range 0.0f and 1.0f.</span >

This builtin is useful in that it allows better specification of branch
probabilities, which in theory should be able to be used to make more informed
decisions regarding code block generation and organization.


[1]:
<a href="https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html#index-_005f_005fbuiltin_005fexpect_005fwith_005fprobability">https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html#index-_005f_005fbuiltin_005fexpect_005fwith_005fprobability</a></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>