<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 --- - [TableGen] DFA table wrong with multiple itineraries"
   href="https://llvm.org/bugs/show_bug.cgi?id=28451">28451</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[TableGen] DFA table wrong with multiple itineraries
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>tools
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.8
          </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>TableGen
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>lars+llvmbug@6xq.net
          </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>Created <span class=""><a href="attachment.cgi?id=16708" name="attach_16708" title="Truncated tblgen debugging output">attachment 16708</a> <a href="attachment.cgi?id=16708&action=edit" title="Truncated tblgen debugging output">[details]</a></span>
Truncated tblgen debugging output

Commit bf390b05bc5c3674520ae480af69d1a935a06f2b does not take into account that
multiple itineraries can exist for the same architecture and assigns FU
name/value mappings for all of them to the same FUNameToBitsMap in
collectAllFuncUnits, overwriting previous ones. This results in an (seemingly
unrelated) assertion failure, because the generated DFA table lacks the
expected state transitions:

clang-3.8: /lib/CodeGen/DFAPacketizer.cpp:129: void
llvm::DFAPacketizer::reserveResources(const llvm::MCInstrDesc*): Assertion
`CachedTable.count(StateTrans) != 0' failed.

See attached log of -debug-only dfa-emitter, which demonstrates the problem
(CoreVAItineraries_1slot’s ME0 stage is assigned value 0x4, which is
overwritten by CoreVAItineraries_4slot’s ME0=0x10 and used in
collectAllInsnClasses below).</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>