[llvm-bugs] [Bug 48188] New: Assertion failed: (TmpVec.size() > 1), function buildUnmerge, llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp, line 609

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Nov 15 17:21:03 PST 2020


https://bugs.llvm.org/show_bug.cgi?id=48188

            Bug ID: 48188
           Summary: Assertion failed: (TmpVec.size() > 1), function
                    buildUnmerge,
                    llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp, line
                    609
           Product: new-bugs
           Version: 11.0
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: jake.goulding at gmail.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

Created attachment 24164
  --> https://bugs.llvm.org/attachment.cgi?id=24164&action=edit
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 https://bugs.llvm.org/ 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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20201116/65f431c3/attachment.html>


More information about the llvm-bugs mailing list