<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/54982>54982</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[AArch64][SVE] Don't know how to widen the operands for INSERT_SUBVECTOR
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
stevesuzuki-arm
</td>
</tr>
</table>
<pre>
`llvm.experimental.vector.insert.nxv16i8.nxv3i8` https://godbolt.org/z/5E11a9czT
```
define void @sliceup_vector_i8_3_16(<vscale x 3 x i8> %a , i8 %b, i8* %c) #0 {
%1 = call <vscale x 16 x i8> @llvm.experimental.vector.insert.nxv16i8.nxv3i8(<vscale x 16 x i8> undef, <vscale x 3 x i8> %a, i64 0)
%2= insertelement <vscale x 16 x i8> %1, i8 %b, i64 3
%3 = bitcast i8* %c to <vscale x 16 x i8>*
store <vscale x 16 x i8> %2, <vscale x 16 x i8>* %3
ret void
}
```
Crashes with target triple = "aarch64-linux-gnu" -mattr=+sve2 -O3
(though nxv4i8.nxv3i8 or other combination works fine)
```LLVM ERROR: Don't know how to widen the operands for INSERT_SUBVECTOR
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 -mattr=+sve2 -O3 <source>
1. Running pass 'Function Pass Manager' on module '<source>'.
2. Running pass 'AArch64 Instruction Selection' on function '@sliceup_vector_i8_3_16'
#0 0x00005562d8588baf PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
#1 0x00005562d858661c SignalHandler(int) Signals.cpp:0:0
#2 0x00007f9e7d8823c0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x143c0)
#3 0x00007f9e7d34f03b raise (/lib/x86_64-linux-gnu/libc.so.6+0x4303b)
#4 0x00007f9e7d32e859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22859)
#5 0x00005562d84cb088 llvm::report_fatal_error(llvm::Twine const&, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x30cb088)
#6 0x00005562d84cb1f8 (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x30cb1f8)
#7 0x00005562d8421512 llvm::DAGTypeLegalizer::WidenVecOp_INSERT_SUBVECTOR(llvm::SDNode*) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x3021512)
#8 0x00005562d842d7db llvm::DAGTypeLegalizer::WidenVectorOperand(llvm::SDNode*, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x302d7db)
#9 0x00005562d83ef793 llvm::DAGTypeLegalizer::run() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2fef793)
#10 0x00005562d83f06f6 llvm::SelectionDAG::LegalizeTypes() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2ff06f6)
#11 0x00005562d8385f53 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2f85f53)
#12 0x00005562d8389ab3 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2f89ab3)
#13 0x00005562d838b1e8 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (.part.960) SelectionDAGISel.cpp:0:0
#14 0x00005562d78c7636 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x24c7636)
#15 0x00005562d7d7c936 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x297c936)
#16 0x00005562d7d7cc89 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x297cc89)
#17 0x00005562d7d7d5c9 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x297d5c9)
#18 0x00005562d5f3aba8 compileModule(char**, llvm::LLVMContext&) llc.cpp:0:0
#19 0x00005562d5e92d97 main (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0xa92d97)
#20 0x00007f9e7d3300b3 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x240b3)
#21 0x00005562d5f315ca _start (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0xb315ca)
Compiler returned: 139
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzFmF1T8jgUxz9NucnAtElfL7hAxGed0UdHXPeyk6YBupamk6SKfvo9SREI6uruw-wyAk1q_-d3Tk5OEgpRvoy92K_rp_WIb1ouqzVvNK1HT5xpIUdVo7jUo2bzFMRVar5JlcIDaKV1qzwy8fAF_C1FWYhaj4RcQusV3tEsCGjGXu89_9zzJ_DI9s82S76oGo6eRFUiL_RVXTHetXlvNK_SnORB7OHUI9MnxWjN0QYReINtMkMejih8TKFprov-0sMT02IezuCb-MhLznprCF5wJ0AeOUegVqND3SDeC4f_NBIu4oFU14CPBuxzFyx2HCIfiB1QbDh7e7zmBuNTYPDqOBCgSBw5Yv0uKs2o0geBQlp8ogv_sVdQ4D3_GwB87KWjYwH2YpJrO-rbrEjOP0yP_nMqqVpxhZ4rvUKayiU8q2XV1tw65GFMqWSrOBzWVdNthsumgz40XFOtJfyHh8_UE4eOmy0AjJZeiW65QjB64W4QkZBI6BWXiIl1UTVUV6JBz0I-KmTSdDc8O8qrq4drNLu7u7mDGYDORePhRKPHRjyjFbwhrs9VyRsEokhAKtGmBCkwc_lzPru7z-e_nz3MpvfwuNW9vZpN5jOkumJdaURR0S0hUK2Q2kgdzTQIRleMgBQaJlm3X8NWij8hU6FZKdVxBRcI7EIesboruWVhJqKooOxRS8r4qDc_19CBym7dGiu2y4db2a0US0nXCCLfmSQ0EBD1C9EaK0DQVjWXQ5gsNWSINH01bZZD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