| Issue |
63813
|
| Summary |
[AArch64] Cannot select `AArch64ISD::SRAD_MERGE_OP1` for `srem` with vector of -1's
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
HazyFish
|
## Description
When enabling `sve` feature on AArch64, the following code crashes with `LLVM ERROR: Cannot select: t25: nxv16i8 = AArch64ISD::SRAD_MERGE_OP1 t24, t21, TargetConstant:i32<0>`.
This problem is similar to a previously fixed issue #59647 but with different cause.
## Minimal Reproduction
https://godbolt.org/z/1jqa7eqK6
### Code
```ll
define void @test(ptr %0) {
%V1 = load <8 x i8>, ptr %0
%V2 = srem <8 x i8> %V1, <i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1>
store <8 x i8> %V2, ptr %0
ret void
}
```
### Stack Trace
```console
LLVM ERROR: Cannot select: t25: nxv16i8 = AArch64ISD::SRAD_MERGE_OP1 t24, t21, TargetConstant:i32<0>
t24: nxv16i1 = AArch64ISD::PTRUE TargetConstant:i32<8>
t23: i32 = TargetConstant<8>
t21: nxv16i8 = insert_subvector undef:nxv16i8, t5, Constant:i64<0>
t20: nxv16i8 = undef
t5: v8i8,ch = load<(load (s64) from %ir.0)> t0, t2, undef:i64
t2: i64,ch = CopyFromReg t0, Register:i64 %0
t1: i64 = Register %0
t4: i64 = undef
t19: i64 = Constant<0>
t22: i32 = TargetConstant<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-assertions-trunk/bin/llc -o /app/output.s -x86-asm-syntax=intel -mtriple=aarch64 -mattr=+v9a <source>
1. Running pass 'Function Pass Manager' on module '<source>'.
2. Running pass 'AArch64 Instruction Selection' on function '@test'
#0 0x0000557c07b7a15f llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x354b15f)
#1 0x0000557c07b778b4 SignalHandler(int) Signals.cpp:0:0
#2 0x00007faa7e7ba420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
#3 0x00007faa7e28700b raise (/lib/x86_64-linux-gnu/libc.so.6+0x4300b)
#4 0x00007faa7e266859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22859)
#5 0x0000557c04e09a66 llvm::RISCVISAInfo::updateImplication() (.cold) RISCVISAInfo.cpp:0:0
#6 0x0000557c0793702d llvm::SelectionDAGISel::CannotYetSelect(llvm::SDNode*) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x330802d)
#7 0x0000557c07938f6a llvm::SelectionDAGISel::SelectCodeCommon(llvm::SDNode*, unsigned char const*, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3309f6a)
#8 0x0000557c05175f0b (anonymous namespace)::AArch64DAGToDAGISel::Select(llvm::SDNode*) AArch64ISelDAGToDAG.cpp:0:0
#9 0x0000557c07933630 llvm::SelectionDAGISel::DoInstructionSelection() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3304630)
#10 0x0000557c07940e44 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3311e44)
#11 0x0000557c079444c8 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x33154c8)
#12 0x0000557c07946192 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (.part.0) SelectionDAGISel.cpp:0:0
#13 0x0000557c06e196ce llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#14 0x0000557c073b37f1 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2d847f1)
#15 0x0000557c073b3a39 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2d84a39)
#16 0x0000557c073b42b2 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2d852b2)
#17 0x0000557c04ec6634 compileModule(char**, llvm::LLVMContext&) llc.cpp:0:0
#18 0x0000557c04e0ef06 main (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x7dff06)
#19 0x00007faa7e268083 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24083)
#20 0x0000557c04ebca1e _start (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x88da1e)
Program terminated with signal: SIGSEGV
Compiler returned: 139
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs