1 ; RUN: llc < %s -o /dev/null
4 ; Test that we dont get a crash after an invalid build_vector combine.
7 target triple = "aarch64-unknown-linux-gnu"
8 define void @test_crash(ptr %dst_ptr) {
10 %vec_load = load <4 x i16>, ptr undef, align 8
11 %0 = sext <4 x i16> %vec_load to <4 x i32>
12 %add71vec = add nsw <4 x i32> %0, <i32 32, i32 32, i32 32, i32 32>
13 %add104vec = add nsw <4 x i32> %add71vec, zeroinitializer
14 %add105vec = add nsw <4 x i32> zeroinitializer, %add104vec
15 %vec = lshr <4 x i32> %add105vec, <i32 6, i32 6, i32 6, i32 6>
16 %1 = trunc <4 x i32> %vec to <4 x i16>
17 %2 = shufflevector <4 x i16> %1, <4 x i16> undef, <2 x i32> <i32 1, i32 2>
18 %3 = sext <2 x i16> %2 to <2 x i32>
19 %4 = shufflevector <2 x i32> %3, <2 x i32> poison, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>
20 %5 = shufflevector <4 x i32> undef, <4 x i32> %4, <4 x i32> <i32 0, i32 4, i32 5, i32 undef>
21 %6 = insertelement <4 x i32> %5, i32 undef, i64 3
22 %7 = add nsw <4 x i32> %6, zeroinitializer
23 %8 = select <4 x i1> zeroinitializer, <4 x i32> %7, <4 x i32> undef
24 %9 = trunc <4 x i32> %8 to <4 x i8>
25 store <4 x i8> %9, ptr %dst_ptr, align 1