[AArch64] Crash when lowering histogram.umin with SVE: LLVM ERROR: Cannot select: intrinsic %llvm.experimental.vector.histogram.umin
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
Trying to lower `@llvm.experimental.vector.histogram.umin` crashes with SVE https://llvm.godbolt.org/z/Y54s1cfxx
```llvm
; llc -mtriple=aarch64 -mattr=+sve
define void @f( %p, i64 %inc, %m) {
call void @llvm.experimental.vector.histogram.umin( %p, i64 %inc, %m)
ret void
}
```
```
LLVM ERROR: Cannot select: intrinsic %llvm.experimental.vector.histogram.umin
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: /opt/compiler-explorer/clang-assertions-trunk/bin/llc -o /app/output.s -x86-asm-syntax=intel -mtriple=aarch64 -mattr=+sve
1. Running pass 'Function Pass Manager' on module ''.
2. Running pass 'AArch64 Instruction Selection' on function '@f'
#0 0x00000000044a91d8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x44a91d8)
#1 0x00000000044a6084 llvm::sys::RunSignalHandlers() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x44a6084)
#2 0x00000000044a61fe SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#3 0x00007a4579645330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
#4 0x00007a457969ec0c pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x9ec0c)
#5 0x00007a457964527e raise (/lib/x86_64-linux-gnu/libc.so.6+0x4527e)
#6 0x00007a45796288ff abort (/lib/x86_64-linux-gnu/libc.so.6+0x288ff)
#7 0x00000000007c2d92 llvm::json::operator==(llvm::json::Value const&, llvm::json::Value const&) (.cold) JSON.cpp:0:0
#8 0x0000000004209245 llvm::SelectionDAGISel::CannotYetSelect(llvm::SDNode*) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x4209245)
#9 0x000000000421327d llvm::SelectionDAGISel::SelectCodeCommon(llvm::SDNode*, unsigned char const*, unsigned int, unsigned char const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x421327d)
#10 0x0000000000e08815 (anonymous namespace)::AArch64DAGToDAGISel::Select(llvm::SDNode*) AArch64ISelDAGToDAG.cpp:0:0
#11 0x000000000420c3c4 llvm::SelectionDAGISel::DoInstructionSelection() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x420c3c4)
#12 0x000000000421d748 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x421d748)
#13 0x0000000004220f66 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x4220f66)
#14 0x0000000004222664 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x4222664)
#15 0x000000000421bb0e llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x421bb0e)
#16 0x00000000032399ad llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#17 0x000000000387cc11 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x387cc11)
#18 0x000000000387d141 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x387d141)
#19 0x000000000387db01 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x387db01)
#20 0x0000000000890ac1 compileModule(char**, llvm::SmallVectorImpl&, llvm::LLVMContext&, std::__cxx11::basic_string, std::allocator>&) llc.cpp:0:0
#21 0x00000000007c6ecc main (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x7c6ecc)
#22 0x00007a457962a1ca (/lib/x86_64-linux-gnu/libc.so.6+0x2a1ca)
#23 0x00007a457962a28b __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28b)
#24 0x0000000000885a15 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x885a15)
Program terminated with signal: SIGSEGV
Compiler returned: 139
```
Contributor guide
Research direction
Start by running the provided llc reproducer with -mtriple=aarch64 and -mattr=+sve, then inspect AArch64ISelDAGToDAG.cpp and the AArch64 instruction-selection path for llvm.experimental.vector.histogram.umin. Done means the reproducer no longer crashes during AArch64 instruction selection and the behavior is covered by an appropriate regression test.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100