<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 - *Potential* missing optimization opportunity for bzhi when input is 64bit but output is 32 bit?"
   href="https://bugs.llvm.org/show_bug.cgi?id=36419">36419</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>*Potential* missing optimization opportunity for bzhi when input is 64bit but output is 32 bit?
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </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>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>lebedev.ri@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>It's a very simple function that gets some low bits from the cache.

<a href="https://godbolt.org/g/f9JjP3">https://godbolt.org/g/f9JjP3</a>

The first variant does not work when count == 32, but is optimized down to just
the bzhi.
The second variant *does* work when count == 32, but is *NOT* optimized down to
just the bzhi.
The third variant *does* work when count == 32, and *IS* optimized down to just
the bzhi.

The difference between the first and second/third variant is the 32 vs 64 bit
size of mask.
The difference between the first/second and third variant is the 32 vs 64 bit
return type.

I'm wondering if the second variant can still be optimized to bzhi,
and then still return 32-bit by discarding the upper half?</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>