[llvm/llvm-project] [AArch64] Crash when lowering histogram.umin with SVE: LLVM ERROR:SplitVectorOperand Op #2: t11: ch = llvm.experimental.vector.histogram.umin t0, TargetConstant:i64<173>, t9, t6, t8
- 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 in `SplitVectorOperand` with SVE https://llvm.godbolt.org/z/j5ETEzrr1
```llvm
; llc -mtriple=aarch64 -mattr=+sve
define void @g( %p, i32 %inc, %m) {
call void @llvm.experimental.vector.histogram.umin( %p, i32 %inc, %m)
ret void
}
```
```
SplitVectorOperand Op #2: t11: ch = llvm.experimental.vector.histogram.umin t0, TargetConstant:i64<173>, t9, t6, t8
LLVM ERROR: Do not know how to split this operator's operand!
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 '@g'
#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 0x000076f915c45330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
#4 0x000076f915c9ec0c pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x9ec0c)
#5 0x000076f915c4527e raise (/lib/x86_64-linux-gnu/libc.so.6+0x4527e)
#6 0x000076f915c288ff 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 0x00000000043e65e1 (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x43e65e1)
#9 0x0000000004300965 llvm::DAGTypeLegalizer::SplitVectorOperand(llvm::SDNode*, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x4300965)
#10 0x00000000042c5145 llvm::DAGTypeLegalizer::run() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x42c5145)
#11 0x00000000042c5f44 llvm::SelectionDAG::LegalizeTypes() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x42c5f44)
#12 0x000000000421cf0b llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x421cf0b)
#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 0x000076f915c2a1ca (/lib/x86_64-linux-gnu/libc.so.6+0x2a1ca)
#23 0x000076f915c2a28b __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 supplied llc reproducer with -mtriple=aarch64 -mattr=+sve and tracing AArch64 Instruction Selection into DAGTypeLegalizer::SplitVectorOperand. Investigate how llvm.experimental.vector.histogram.umin operands are legalized; done means the reproducer no longer crashes and the failure has regression coverage.
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
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100