<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 - Teach instruction scheduling and other reordering passes about LFENCE speculation barrier semantics"
   href="https://bugs.llvm.org/show_bug.cgi?id=45167">45167</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Teach instruction scheduling and other reordering passes about LFENCE speculation barrier semantics
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </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>zbrid@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Problem

We added speculation barrier semantics to LFENCE, but haven't taught
instruction scheduling (or other reordering passes) about that semantic.

The compiler may reorder LFENCEs in a basic block in a way that may not be
correct, whether reordering branch instructions and LFENCEs or loads/stores and
LFENCEs.

Possible directions to go in for a test case:
A MIR basic block with LFENCEs interleaved with multiple `jCC` instructions --
it is not valid to sink or hoist the LFENCEs.

Another posible testing strategy would be to interleave stores with an LFENCE. 
For example, store -> LFENCE -> load: historically changing this to LFENCE ->
store -> load is okay, but from the perspective of speculative execution there
is a difference between the two orderings.</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>