Issue 178788
Summary [SystemZ] `Impossible reg-to-reg copy` with `fmul` + `ret` of `<4 x half>`
Labels backend:SystemZ, crash-on-valid
Assignees
Reporter alexrp
    ```llvm
; ModuleID = 'reduced.bc'
target datalayout = "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-v128:64-a:8:16-n32:64"
target triple = "s390x-unknown-linux5.10.0-gnu2.31.0"

define fastcc <4 x half> @"behavior.vector.test.vector division operators.S.doTheTestDiv__anon_96254"(<4 x half> %0) #0 {
Entry:
  %1 = fmul <4 x half> %0, zeroinitializer
  ret <4 x half> %1
}

attributes #0 = { "target-cpu"="z15" }
```

```console
❯ llc --version | head -n2
LLVM (http://llvm.org/):
  LLVM version 22.1.0-rc2
❯ llc -O0 reduced.ll
Impossible reg-to-reg copy
UNREACHABLE executed at /home/alexrp/Sources/llvm/llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp:1017!
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: llc -O0 reduced.ll
1.      Running pass 'Function Pass Manager' on module 'reduced.ll'.
2.      Running pass 'Post-RA pseudo instruction expansion pass' on function '@"behavior.vector.test.vector division operators.S.doTheTestDiv__anon_96254"'
 #0 0x00007edbf2c2206d llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/alexrp/Sources/llvm/llvm/lib/Support/Unix/Signals.inc:846:3
 #1 0x00007edbf2c1f1a4 llvm::sys::RunSignalHandlers() /home/alexrp/Sources/llvm/llvm/lib/Support/Signals.cpp:108:20
 #2 0x00007edbf2c1f9bc SignalHandler(int, siginfo_t*, void*) /home/alexrp/Sources/llvm/llvm/lib/Support/Unix/Signals.inc:429:14
 #3 0x00007edbf1445f60 (/lib/x86_64-linux-gnu/libc.so.6+0x45f60)
 #4 0x00007edbf14a5fed __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
 #5 0x00007edbf14a5fed __pthread_kill_internal ./nptl/pthread_kill.c:89:10
 #6 0x00007edbf14a5fed pthread_kill ./nptl/pthread_kill.c:100:10
 #7 0x00007edbf1445e2e raise ./signal/../sysdeps/posix/raise.c:27:6
 #8 0x00007edbf1428888 internal_signal_block_all ./stdlib/../sysdeps/unix/sysv/linux/internal-signals.h:81:3
 #9 0x00007edbf1428888 __abort_lock_wrlock ./stdlib/abort.c:62:3
#10 0x00007edbf1428888 abort ./stdlib/abort.c:85:3
#11 0x00007edbf2b2953e (/opt/llvm-22/bin/../lib/libLLVM.so.22.1-rc2+0xf2953e)
#12 0x00007edbf7205e63 llvm::MCInstrInfo::get(unsigned int) const /home/alexrp/Sources/llvm/llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp:1017:5
#13 0x00007edbf7205e63 llvm::SystemZInstrInfo::copyPhysReg(llvm::MachineBasicBlock&, llvm::MachineInstrBundleIterator<llvm::MachineInstr, false>, llvm::DebugLoc const&, llvm::Register, llvm::Register, bool, bool, bool) const /home/alexrp/Sources/llvm/llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp:917:12
#14 0x00007edbf34a9158 llvm::MachineInstr::getNumOperands() const /home/alexrp/Sources/llvm/llvm/include/llvm/CodeGen/MachineInstr.h:602:44
#15 0x00007edbf34a9158 llvm::TargetInstrInfo::lowerCopy(llvm::MachineInstr*, llvm::TargetRegisterInfo const*) const /home/alexrp/Sources/llvm/llvm/lib/CodeGen/TargetInstrInfo.cpp:904:25
#16 0x00007edbf304ce78 (anonymous namespace)::ExpandPostRA::run(llvm::MachineFunction&) (.constprop.0) /home/alexrp/Sources/llvm/llvm/lib/CodeGen/ExpandPostRAPseudos.cpp:161:20
#17 0x00007edbf304d748 (anonymous namespace)::ExpandPostRALegacy::runOnMachineFunction(llvm::MachineFunction&) /home/alexrp/Sources/llvm/llvm/lib/CodeGen/ExpandPostRAPseudos.cpp:139:1
#18 0x00007edbf31aae2a llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) /home/alexrp/Sources/llvm/llvm/lib/CodeGen/MachineFunctionPass.cpp:108:30
#19 0x00007edbf2ddd9aa llvm::FPPassManager::runOnFunction(llvm::Function&) /home/alexrp/Sources/llvm/llvm/lib/IR/LegacyPassManager.cpp:1398:40
#20 0x00007edbf2dddbb5 llvm::ilist_detail::node_base_prevnext<llvm::ilist_node_base<true, void>, true>::getNext() const /home/alexrp/Sources/llvm/llvm/include/llvm/ADT/ilist_node_base.h:42:38
#21 0x00007edbf2dddbb5 llvm::ilist_node_impl<llvm::ilist_detail::node_options<llvm::Function, true, false, void, false, void>>::getNext() /home/alexrp/Sources/llvm/llvm/include/llvm/ADT/ilist_node.h:108:66
#22 0x00007edbf2dddbb5 llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Function, true, false, void, false, void>, false, false>::operator++() /home/alexrp/Sources/llvm/llvm/include/llvm/ADT/ilist_iterator.h:187:25
#23 0x00007edbf2dddbb5 llvm::FPPassManager::runOnModule(llvm::Module&) /home/alexrp/Sources/llvm/llvm/lib/IR/LegacyPassManager.cpp:1443:22
#24 0x00007edbf2dde44f runOnModule /home/alexrp/Sources/llvm/llvm/lib/IR/LegacyPassManager.cpp:1513:38
#25 0x00007edbf2dde44f llvm::legacy::PassManagerImpl::run(llvm::Module&) /home/alexrp/Sources/llvm/llvm/lib/IR/LegacyPassManager.cpp:531:55
#26 0x0000647c531459f5 compileModule(char**, llvm::SmallVectorImpl<llvm::PassPlugin>&, llvm::LLVMContext&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&) /home/alexrp/Sources/llvm/llvm/tools/llc/llc.cpp:874:34
#27 0x0000647c53138f5c main /home/alexrp/Sources/llvm/llvm/tools/llc/llc.cpp:462:35
#28 0x00007edbf142a575 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:74:3
#29 0x00007edbf142a628 call_init ./csu/../csu/libc-start.c:128:20
#30 0x00007edbf142a628 __libc_start_main ./csu/../csu/libc-start.c:347:5
#31 0x0000647c53139ce5 _start (/opt/llvm-22/bin/llc+0x15ce5)
fish: Job 1, 'llc -O0 reduced.ll' terminated by signal SIGABRT (Abort)
```

Note: This LLVM build includes ffb940d7fb9d3a0abd655b90642fe2201550bbd5.

cc @uweigand @JonPsson
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to