Issue 234541
Summary [PHIElimination] Assertion "Could not use a debug instruction to query mi2iMap" with DBG_VALUE in wasm cleanup pad
Labels new issue
Assignees
Reporter stbergmann
    (Ran into this when trying to compile something with latest emsdk 6.13, here's a stripped down reproducer:)

With recent LLVM trunk and the attached `test.ll` (named `test.ll.txt` so I could attach it here),
```
$ llc -O1 -exception-model=wasm test.ll -o /dev/null
llc: /home/sberg/github.com/llvm/llvm-project/llvm/include/llvm/CodeGen/SlotIndexes.h:387: SlotIndex llvm::SlotIndexes::getInstructionIndex(const MachineInstr &, bool) const: Assertion `!BundleNonDebug.isDebugInstr() && "Could not use a debug instruction to query mi2iMap."' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0.	Program arguments: /home/sberg/llvm/inst/bin/llc -O1 -exception-model=wasm test.ll -o /dev/null
1.	Running pass 'Function Pass Manager' on module 'test.ll'.
2.	Running pass 'Eliminate PHI nodes for register allocation' on function '@_ZL24lcl_HaveCommonAttributesR12IStyleAccessPK10SfxItemSettRS2_RNSt3__210shared_ptrIS1_EE'
 #0 0x000000000586f58b llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/sberg/github.com/llvm/llvm-project/llvm/lib/Support/Unix/Signals.inc:931:13
 #1 0x000000000586cd24 llvm::sys::RunSignalHandlers() /home/sberg/github.com/llvm/llvm-project/llvm/lib/Support/Signals.cpp:109:18
 #2 0x00000000058702bb SignalHandler(int, siginfo_t*, void*) /home/sberg/github.com/llvm/llvm-project/llvm/lib/Support/Unix/Signals.inc:474:38
 #3 0x00007fac94496070 __restore_rt (/lib64/libc.so.6+0x94070)
 #4 0x00007fac944f1cec __pthread_kill_implementation (/lib64/libc.so.6+0xefcec)
 #5 0x00007fac94495f4e gsignal (/lib64/libc.so.6+0x93f4e)
 #6 0x00007fac9447d43f abort (/lib64/libc.so.6+0x7b43f)
 #7 0x00007fac9447e490 _IO_peekc_locked.cold (/lib64/libc.so.6+0x7c490)
 #8 0x00007fac9448dc85 __assert_fail (/lib64/libc.so.6+0x8bc85)
 #9 0x0000000005d956d8 (/home/sberg/llvm/inst/bin/llc+0x5d956d8)
#10 0x0000000008420daf llvm::SlotIndex::isValid() const /home/sberg/github.com/llvm/llvm-project/llvm/include/llvm/CodeGen/SlotIndexes.h:129:14
#11 0x0000000008420daf llvm::SlotIndex::listEntry() const /home/sberg/github.com/llvm/llvm-project/llvm/include/llvm/CodeGen/SlotIndexes.h:98:14
#12 0x0000000008420daf llvm::SlotIndex::getRegSlot(bool) const /home/sberg/github.com/llvm/llvm-project/llvm/include/llvm/CodeGen/SlotIndexes.h:236:24
#13 0x0000000008420daf (anonymous namespace)::PHIEliminationImpl::LowerPHINode(llvm::MachineBasicBlock&, llvm::MachineInstrBundleIterator<llvm::MachineInstr, false>, bool) /home/sberg/github.com/llvm/llvm-project/llvm/lib/CodeGen/PHIElimination.cpp:629:44
#14 0x0000000008420daf (anonymous namespace)::PHIEliminationImpl::EliminatePHINodes(llvm::MachineFunction&, llvm::MachineBasicBlock&) /home/sberg/github.com/llvm/llvm-project/llvm/lib/CodeGen/PHIElimination.cpp:320:5
#15 0x0000000008420daf (anonymous namespace)::PHIEliminationImpl::run(llvm::MachineFunction&) /home/sberg/github.com/llvm/llvm-project/llvm/lib/CodeGen/PHIElimination.cpp:256:16
#16 0x0000000008423909 (anonymous namespace)::PHIElimination::runOnMachineFunction(llvm::MachineFunction&) /home/sberg/github.com/llvm/llvm-project/llvm/lib/CodeGen/PHIElimination.cpp:172:17
#17 0x00000000082cb9fb llvm::MachineFunctionPass::runOnFunction(llvm::Function&) /home/sberg/github.com/llvm/llvm-project/llvm/lib/CodeGen/MachineFunctionPass.cpp:101:7
#18 0x00000000098fee1b llvm::FPPassManager::runOnFunction(llvm::Function&) /home/sberg/github.com/llvm/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:0:27
#19 0x00000000099057c2 llvm::FPPassManager::runOnModule(llvm::Module&) /home/sberg/github.com/llvm/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1471:13
#20 0x00000000098ff7cf (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&) /home/sberg/github.com/llvm/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:0:27
#21 0x00000000098ff7cf llvm::legacy::PassManagerImpl::run(llvm::Module&) /home/sberg/github.com/llvm/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:533:44
#22 0x00000000059163bb compileModule(char**, llvm::SmallVectorImpl<llvm::PassPlugin>&, llvm::LLVMContext&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&) /home/sberg/github.com/llvm/llvm-project/llvm/tools/llc/lib/llcdriver.cpp:887:17
#23 0x00000000059132a3 llcMain /home/sberg/github.com/llvm/llvm-project/llvm/tools/llc/lib/llcdriver.cpp:467:13
#24 0x00000000058577cf main /home/sberg/github.com/llvm/llvm-project/llvm/tools/llc/llc.cpp:15:10
#25 0x00007fac9447f301 __libc_start_call_main (/lib64/libc.so.6+0x7d301)
#26 0x00007fac9447f418 __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x7d418)
#27 0x00000000058576b5 _start (/home/sberg/llvm/inst/bin/llc+0x58576b5)
Aborted                    (core dumped) ~/llvm/inst/bin/llc -O1 -exception-model=wasm test.ll -o /dev/null
```

[test.ll.txt](https://github.com/user-attachments/files/33812101/test.ll.txt)
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to