Issue 61625
Summary llvm.fminnum.v16f16 causes: cannot select v16f16 = X86ISD::FMIN
Labels new issue
Assignees
Reporter nulldatamap
    After upgrading to LLVM-15, we have run into this issue:
The vectorizer will now generate the intrinsic `llvm.minnum.v16f16` in some cases and this causes the following compiler crash:
```
LVM ERROR: Cannot select: 0x5621390e1aa8: v8f16 = X86ISD::FMIN 0x5621390e1838, 0x5621390e1768
  0x5621390e1838: v8f16,ch = CopyFromReg 0x5621390616e8, Register:v8f16 %1
    0x5621390e17d0: v8f16 = Register %1
  0x5621390e1768: v8f16,ch = CopyFromReg 0x5621390616e8, Register:v8f16 %0
    0x5621390e1700: v8f16 = Register %0
In function: test
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /opt/compiler-explorer/clang-15.0.0/bin/llc -o /app/output.s -x86-asm-syntax=intel -O3 <source>
1.	Running pass 'Function Pass Manager' on module '<source>'.
2.	Running pass 'X86 DAG->DAG Instruction Selection' on function '@test'
 #0 0x00005621350ae594 PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
 #1 0x00005621350abdf4 SignalHandler(int) Signals.cpp:0:0
 #2 0x00007f16ac5ab420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
 #3 0x00007f16ac07800b raise (/lib/x86_64-linux-gnu/libc.so.6+0x4300b)
 #4 0x00007f16ac057859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22859)
 #5 0x00005621328f3655 llvm::DisplayGraph(llvm::StringRef, bool, llvm::GraphProgram::Name) (.cold) GraphWriter.cpp:0:0
 #6 0x0000562134e85480 llvm::SelectionDAGISel::CannotYetSelect(llvm::SDNode*) (/opt/compiler-explorer/clang-15.0.0/bin/llc+0x2e75480)
 #7 0x0000562134e8aa1a llvm::SelectionDAGISel::SelectCodeCommon(llvm::SDNode*, unsigned char const*, unsigned int) (/opt/compiler-explorer/clang-15.0.0/bin/llc+0x2e7aa1a)
 #8 0x00005621339e45bf (anonymous namespace)::X86DAGToDAGISel::Select(llvm::SDNode*) X86ISelDAGToDAG.cpp:0:0
 #9 0x0000562134e83300 llvm::SelectionDAGISel::DoInstructionSelection() (/opt/compiler-explorer/clang-15.0.0/bin/llc+0x2e73300)
#10 0x0000562134e8ede9 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/compiler-explorer/clang-15.0.0/bin/llc+0x2e7ede9)
#11 0x0000562134e91aa1 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-15.0.0/bin/llc+0x2e81aa1)
#12 0x0000562134e943a8 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (.part.0) SelectionDAGISel.cpp:0:0
#13 0x00005621339ee605 (anonymous namespace)::X86DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) X86ISelDAGToDAG.cpp:0:0
#14 0x00005621343a4449 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#15 0x0000562134834c10 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-15.0.0/bin/llc+0x2824c10)
#16 0x0000562134834d89 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-15.0.0/bin/llc+0x2824d89)
#17 0x0000562134835970 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-15.0.0/bin/llc+0x2825970)
#18 0x00005621329b160b compileModule(char**, llvm::LLVMContext&) llc.cpp:0:0
#19 0x00005621329021c2 main (/opt/compiler-explorer/clang-15.0.0/bin/llc+0x8f21c2)
#20 0x00007f16ac059083 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24083)
#21 0x00005621329a98fe _start (/opt/compiler-explorer/clang-15.0.0/bin/llc+0x9998fe)
```

Here's a small repro:
```llvm
define <8 x half> @test(<8 x half> %x, <8 x half> %y) {
  %1 = call <8 x half> @llvm.minnum.v16f16(<8 x half> %x, <8 x half> %y)
  ret <8 x half> %1
}

declare <8 x half> @llvm.minnum.v16f16(<8 x half> %x, <8 x half> %y)
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to