<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 - Latent assertion failure in AArch64InstrInfo::genAlternativeCodeSequence()"
   href="https://bugs.llvm.org/show_bug.cgi?id=48753">48753</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Latent assertion failure in AArch64InstrInfo::genAlternativeCodeSequence()
          </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>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>Backend: AArch64
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>rupprecht@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>arnaud.degrandmaison@arm.com, llvm-bugs@lists.llvm.org, smithp352@googlemail.com, Ties.Stuij@arm.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre><a href="https://reviews.llvm.org/D93779">https://reviews.llvm.org/D93779</a> (landed as
49142991a685bd427d7e877c29c77371dfb7634c) changes ADT/SmallVector.h, which
makes clang smart enough to diagnose a -Wsometimes-uninitialized for a `MUL`
value passed to a SmallVector in AArch64InstrInfo.cpp. This build warning (or
error when -Werror is enabled) is fixed by always initializing to nullptr in
752fafda3dbf1f4885c64408a13ddb67c91ccb13, but if we add an assertion that MUL
is not nullptr when we add it to the SmallVector, we get an assertion failure
in two tests:

$ ninja check-llvm-codegen-aarch64
FAIL: LLVM :: CodeGen/AArch64/tailmerging_in_mbp.ll (1886 of 1908)
******************** TEST 'LLVM :: CodeGen/AArch64/tailmerging_in_mbp.ll'
FAILED ********************
Script:
--
: 'RUN: at line 1';   /home/rupprecht/src/llvm-build/dev/bin/llc
</home/rupprecht/src/llvm-project/llvm/test/CodeGen/AArch64/tailmerging_in_mbp.ll
-mtriple=aarch64-eabi -verify-machine-dom-info |
/home/rupprecht/src/llvm-build/dev/bin/FileCheck --allow-unused-prefixes=false
/home/rupprecht/src/llvm-project/llvm/test/CodeGen/AArch64/tailmerging_in_mbp.ll
--
Exit Code: 2

Command Output (stderr):
--
llc:
/home/rupprecht/src/llvm-project/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp:5697:
virtual void
llvm::AArch64InstrInfo::genAlternativeCodeSequence(llvm::MachineInstr &,
llvm::MachineCombinerPattern, SmallVectorImpl<llvm::MachineInstr *> &,
SmallVectorImpl<llvm::MachineInstr *> &, DenseMap<unsigned int, unsigned int>
&) const: Assertion `MUL && "MUL was never set"' failed.
PLEASE submit a bug report to <a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> and include the crash
backtrace.
Stack dump:
0.      Program arguments: /home/rupprecht/src/llvm-build/dev/bin/llc
-mtriple=aarch64-eabi -verify-machine-dom-info
1.      Running pass 'Function Pass Manager' on module '<stdin>'.
2.      Running pass 'Machine InstCombiner' on function '@test'
...
Failed Tests (2):
  LLVM :: CodeGen/AArch64/tailmerging_in_mbp.ll
  LLVM :: CodeGen/AArch64/urem-seteq-nonzero.ll

The assertion is already added to llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
at the end of AArch64InstrInfo::genAlternativeCodeSequence(), but commented
out. Uncomment to reproduce the above.</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>