<html>
    <head>
      <base href="https://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 --- - MachineScheduler: clusterNeighboringMemOps can lead to unstable output"
   href="https://llvm.org/bugs/show_bug.cgi?id=28942">28942</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>MachineScheduler: clusterNeighboringMemOps can lead to unstable output
          </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>Windows NT
          </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>Common Code Generator Code
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>gberry@codeaurora.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The code in BaseMemOpClusterMutation::clusterNeighboringMemOps() builds a
sorted list of MemOpInfos, and the ordering of this list can ultimately effect
the code generated (whether loads/stores get clustered when scheduling). 
std::sort is used to sort the entries, which is not stable w.r.t. the order of
equal elements.

Unstable output could be generated for the same input if two different
implementations of std::sort were used.  The clustering decision for equal
MemOpInfos could also be altered e.g. by the addition of extra MemOpInfos in
the list before or after the equal elements.  I ran into the latter case
refactoring the code for AArch64InstrInfo::getMemOpBaseRegImmOfs().</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>