<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 - Assertion failed: (TmpVec.size() > 1), function buildUnmerge, llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp, line 609"
   href="https://bugs.llvm.org/show_bug.cgi?id=48188">48188</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion failed: (TmpVec.size() > 1), function buildUnmerge, llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp, line 609
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>11.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </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>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>jake.goulding@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=24164" name="attach_24164" title="LLVM IR to reproduce the crash">attachment 24164</a> <a href="attachment.cgi?id=24164&action=edit" title="LLVM IR to reproduce the crash">[details]</a></span>
LLVM IR to reproduce the crash

```
 % ./bin/llc ../build/bugpoint-reduced-simplified.ll -filetype=obj
-mcpu=apple-a12 -march=arm64 -O0
Assertion failed: (TmpVec.size() > 1), function buildUnmerge, file
/Users/shepmaster/Projects/llvm-project/llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp,
line 609.
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: ./bin/llc ../build/bugpoint-reduced-simplified.ll
-filetype=obj -mcpu=apple-a12 -march=arm64 -O0
1.      Running pass 'Function Pass Manager' on module
'../build/bugpoint-reduced-simplified.ll'.
2.      Running pass 'Legalizer' on function
'@_ZN3std2io5stdio8print_to17h83af8c48359573cfE'
0  llc                      0x0000000106c22658
llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 76
1  llc                      0x0000000106c22b68
PrintStackTraceSignalHandler(void*) + 32
2  llc                      0x0000000106c20bd8 llvm::sys::RunSignalHandlers() +
124
3  llc                      0x0000000106c24ac4 SignalHandler(int) + 208
4  libsystem_platform.dylib 0x000000018941cc44 _sigtramp + 56
5  libsystem_pthread.dylib  0x00000001893d4c24 pthread_kill + 292
6  libsystem_c.dylib        0x000000018931c864 abort + 104
7  libsystem_c.dylib        0x000000018931bb68 err + 0
8  llc                      0x000000010729d1dc
llvm::MachineIRBuilder::buildUnmerge(llvm::ArrayRef<llvm::Register>,
llvm::SrcOp const&) + 168
9  llc                      0x000000010724c894
llvm::LegalizerHelper::extractParts(llvm::Register, llvm::LLT, int,
llvm::SmallVectorImpl<llvm::Register>&) + 248
10 llc                      0x0000000107244c08
llvm::LegalizerHelper::narrowScalar(llvm::MachineInstr&, unsigned int,
llvm::LLT) + 8564
11 llc                      0x0000000107241ec0
llvm::LegalizerHelper::legalizeInstrStep(llvm::MachineInstr&) + 492
12 llc                      0x000000010722bf48
llvm::Legalizer::legalizeMachineFunction(llvm::MachineFunction&,
llvm::LegalizerInfo const&, llvm::ArrayRef<llvm::GISelChangeObserver*>,
llvm::LostDebugLocObserver&, llvm::MachineIRBuilder&) + 1104
13 llc                      0x000000010722da2c
llvm::Legalizer::runOnMachineFunction(llvm::MachineFunction&) + 964
14 llc                      0x000000010552ce70
llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 460
15 llc                      0x0000000105d4a29c
llvm::FPPassManager::runOnFunction(llvm::Function&) + 548
16 llc                      0x0000000105d51a68
llvm::FPPassManager::runOnModule(llvm::Module&) + 116
17 llc                      0x0000000105d4ab08 (anonymous
namespace)::MPPassManager::runOnModule(llvm::Module&) + 688
18 llc                      0x0000000105d4a6a0
llvm::legacy::PassManagerImpl::run(llvm::Module&) + 272
19 llc                      0x0000000105d51e84
llvm::legacy::PassManager::run(llvm::Module&) + 36
20 llc                      0x0000000104597258 compileModule(char**,
llvm::LLVMContext&) + 5304
21 llc                      0x0000000104595590 main + 1288
22 libdyld.dylib            0x00000001893f0f54 start + 4
```

Doing some light debugging, I see that `NumParts` is `1`; this is what triggers
the assertion. This is computed from `SizeOp0 / NarrowSize` when `SizeOp0` is
`120` and `NarrowSize` is `64`.

The Rust fork is currently at 2e10b7a39b930ef8d9c4362509d8835b221fbc0a.
git-bisect says that the attached LLVM IR compiles successfully starting at
db464a3dbf0e8fed363a7b2b9a5b320514ca60f8.

However, I don't believe that the bug is actually *fixed*, merely hidden. The
commit in question performs more transformations to the code and causes
`SizeOp0` to be 128. When I cherry-picked that commit back to the Rust fork,
the problems continue to manifest.</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>