<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 - x86/uops-CMOV16rm-noreg test fails if run on a CPU for which no scheduling machine model exists"
   href="https://bugs.llvm.org/show_bug.cgi?id=50013">50013</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>x86/uops-CMOV16rm-noreg test fails if run on a CPU for which no scheduling machine model exists
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>tools
          </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>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>llvm-exegesis
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>llvm@lukegb.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>clement.courbet@gmail.com, gchatelet@google.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=24763" name="attach_24763" title="CMOV16rm-uops.yaml">attachment 24763</a> <a href="attachment.cgi?id=24763&action=edit" title="CMOV16rm-uops.yaml">[details]</a></span>
CMOV16rm-uops.yaml

This is annoying, because it means that in release tarballs `make check-all`
will fail with an inscrutable error.

In particular, this fails on amdfam10 machines, such as those used by one of
the machines in the NixOS project's builder pool. The bug report I filed there
was <a href="https://github.com/NixOS/nixpkgs/issues/119673">https://github.com/NixOS/nixpkgs/issues/119673</a>.

A copy of the generated CMOV16rm-uops.yaml from the "bad" machine is
<a href="https://p.lukegb.com/IdeallyDashingPelican.yaml">https://p.lukegb.com/IdeallyDashingPelican.yaml</a> (also attached here).

This generates, on a debug build, using roughly the command line "llvm-exegesis
-mode=analysis -benchmarks-file=IdeallyDashingPelican.yaml
-analysis-clusters-output-file=- -analysis-numpoints=1":

llvm-exegesis:
/home/lukegb/debugit/llvm-project/llvm/include/llvm/MC/MCSchedule.h:348: const
llvm::MCSchedClassDesc* llvm::MCSchedModel::getSchedClassDesc(unsigned int)
const: Assertion `hasInstrSchedModel() && "No scheduling machine model"'
failed.

---

It looks like the intent when writing the test was to force the CPU model used
to be bdver2, however llvm-exegesis doesn't actually seem to use the mcpu flag
at all for -mode=analysis.

I can see a few possibilities for resolving this, some of which make more sense
than others (and I'm not fully familiar with LLVM to be able to say which of
these make any sense):

1) Split the test in two: one to produce a benchmark model and validate some
aspects of it, and a separate test which uses an in-tree-provided separate file
to check that analysis works.
2) Just skip the test if the current host CPU doesn't have a model available
for it.
   - Note: it would be nice to have llvm-exegesis itself provide a better error
message. I only managed to catch this properly after rebuilding in debug mode,
because it's an assertion failure only. If llvm-exegesis cleanly checked this
invariant then it'd be less problematic. This is a bit orthogonal to fixing the
test because the test would (or at least, should?) still fail even if there was
better error output.

Obviously in the ideal case LLVM would have scheduling models for every CPU in
existence :))</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>