<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/105783>105783</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[SLPVectorizer] Assertion failure: vector_insert parameters must have the same element type
</td>
</tr>
<tr>
<th>Labels</th>
<td>
llvm:SLPVectorizer,
crash-on-valid
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
alexey-bataev
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
dtcxzyw
</td>
</tr>
</table>
<pre>
Reproducer:
```
; bin/opt -passes=slp-vectorizer reduced.ll -S
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define i1 @main() {
entry:
%conv57.us.us.us736.us.1.i = trunc i64 0 to i32
%cond.i.us.us.us737.us.1.i = tail call i32 @llvm.smax.i32(i32 %conv57.us.us.us736.us.1.i, i32 0)
%cmp60.us.us.us738.us.1.i = icmp slt i32 %cond.i.us.us.us737.us.1.i, 0
%conv57.us.us.us736.us.2.i = trunc i64 0 to i32
%cond.i.us.us.us737.us.2.i = tail call i32 @llvm.smax.i32(i32 %conv57.us.us.us736.us.2.i, i32 0)
%cmp60.us.us.us738.us.2.i = icmp slt i32 %cond.i.us.us.us737.us.2.i, 0
%arrayidx56.us.us.us735.us.2.1.i = getelementptr [10 x [5 x [5 x i64]]], ptr null, i64 0, i64 0, i64 1, i64 2
%0 = load i64, ptr %arrayidx56.us.us.us735.us.2.1.i, align 8
%conv57.us.us.us736.us.2.1.i = trunc i64 %0 to i32
%cond.i.us.us.us737.us.2.1.i = tail call i32 @llvm.smax.i32(i32 %conv57.us.us.us736.us.2.1.i, i32 0)
%cmp60.us.us.us738.us.2.1.i = icmp slt i32 %cond.i.us.us.us737.us.2.1.i, 0
%arrayidx56.us.us.us735.us.3.1.i = getelementptr [10 x [5 x [5 x i64]]], ptr null, i64 0, i64 0, i64 1, i64 1
%1 = load i64, ptr %arrayidx56.us.us.us735.us.3.1.i, align 8
%conv57.us.us.us736.us.3.1.i = trunc i64 %1 to i32
%cond.i.us.us.us737.us.3.1.i = tail call i32 @llvm.smax.i32(i32 %conv57.us.us.us736.us.3.1.i, i32 0)
%cmp60.us.us.us738.us.3.1.i = icmp slt i32 %cond.i.us.us.us737.us.3.1.i, 0
ret i1 %cmp60.us.us.us738.us.3.1.i
}
```
```
vector_insert parameters must have the same element type.
%1 = call <4 x i32> @llvm.vector.insert.v4i32.v2i64(<4 x i32> <i32 poison, i32 poison, i32 0, i32 0>, <2 x i64> %0, i64 0)
LLVM ERROR: Broken module found, compilation aborted!
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: bin/opt -passes=slp-vectorizer reduced.ll -S
1. Running pass "verify" on module "reduced.ll"
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0 libLLVMSupport.so.20.0git 0x00007aac30a12be2 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 66
1 libLLVMSupport.so.20.0git 0x00007aac30a0faaf llvm::sys::RunSignalHandlers() + 47
2 libLLVMSupport.so.20.0git 0x00007aac30a0fbf5
3 libc.so.6 0x00007aac30442520
4 libc.so.6 0x00007aac304969fc pthread_kill + 300
5 libc.so.6 0x00007aac30442476 raise + 22
6 libc.so.6 0x00007aac304287f3 abort + 211
7 libLLVMSupport.so.20.0git 0x00007aac3086c6a1
8 libLLVMSupport.so.20.0git 0x00007aac3091c1e0
9 libLLVMCore.so.20.0git 0x00007aac29195468
10 libLLVMOptDriver.so.20.0git 0x00007aac30b77525
11 libLLVMCore.so.20.0git 0x00007aac29150b2a llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) + 1434
12 libLLVMOptDriver.so.20.0git 0x00007aac30b84fb7 llvm::runPassPipeline(llvm::StringRef, llvm::Module&, llvm::TargetMachine*, llvm::TargetLibraryInfoImpl*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::StringRef, llvm::ArrayRef<llvm::PassPlugin>, llvm::ArrayRef<std::function<void (llvm::PassBuilder&)>>, llvm::opt_tool::OutputKind, llvm::opt_tool::VerifierKind, bool, bool, bool, bool, bool, bool, bool) + 8631
13 libLLVMOptDriver.so.20.0git 0x00007aac30b90952 optMain + 10594
14 libc.so.6 0x00007aac30429d90
15 libc.so.6 0x00007aac30429e40 __libc_start_main + 128
16 opt 0x000063015e8e1095 _start + 37
Aborted (core dumped)
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8WFtv4y4W_zT0BSXCB18f8pD0ov9oW03VjEbafYmwjRO2GCzAmeb_6Vdg57ZNZ5rZ0UZWjPG58Ts_OCdh1oq14nyGkgUCYJK_8d2kZI7xLQJAyd0N691Gm1ntqre_dz9uSl3vZi-8M7ruK24QnSNyh8gcpWS8hke6wKVQCB505_CkY9Zyi-idld1kyyunjfibG2y4t1JPpcST5aDpmFlzh2vmmGQ73TuM6B1GAHzSIjrnkw4yguicQvjyj9H5ox-lcfiaiMMgghzReQT5pMnJOFJhKt2rp_Fk6cUAzkJxRnSS78N4y9NVGk969ar0DzWRQvVvk7XqD1rDd80boTgWEUYxaZmHIkdQYJQtBgGunNkd4MMYQVJptU2yaW-HK6OpH0RTEXw706sKizTGBDuNBR39jZr1VJxoZmeaTEhcMSm9ko9Hym07tS17m3orkIfpn_hHcBtUCYLiNN62S8mJeH7qVFRth610-Gj8cojeOPklCvArFD72AX8EBrgOBrgKBngPAzOG7UT9lqQnwskgvMd4zR2XvOXKdc5glCwigt_8PTne_A5I7sYLbrGXVL2UYTEexneDaD84hZYEh1KzOlgcDf06Ti_JpFgrnJ_R9SLC76kePH-O7fCH-A7XMh6u5DxcYv3HMNL_V7qjk3Ci69NNr0w3vZzu6JPppn8o3fTadNMr003fpdtw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