1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -passes=slp-vectorizer < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=skylake -slp-threshold=-14 | FileCheck %s
4 define void @test(i1 %c, ptr %arg) {
6 ; CHECK-NEXT: br i1 [[C:%.*]], label [[IF:%.*]], label [[ELSE:%.*]]
8 ; CHECK-NEXT: [[ARG2_2:%.*]] = getelementptr inbounds i8, ptr [[ARG:%.*]], i64 24
9 ; CHECK-NEXT: [[TMP1:%.*]] = load <2 x i64>, ptr [[ARG]], align 8
10 ; CHECK-NEXT: [[TMP2:%.*]] = shufflevector <2 x i64> [[TMP1]], <2 x i64> poison, <2 x i32> <i32 1, i32 0>
11 ; CHECK-NEXT: [[TMP3:%.*]] = load <2 x i64>, ptr [[ARG2_2]], align 8
12 ; CHECK-NEXT: [[TMP4:%.*]] = shufflevector <2 x i64> [[TMP3]], <2 x i64> poison, <2 x i32> <i32 1, i32 0>
13 ; CHECK-NEXT: [[TMP5:%.*]] = call <4 x i64> @llvm.vector.insert.v4i64.v2i64(<4 x i64> poison, <2 x i64> [[TMP4]], i64 0)
14 ; CHECK-NEXT: [[TMP6:%.*]] = call <4 x i64> @llvm.vector.insert.v4i64.v2i64(<4 x i64> [[TMP5]], <2 x i64> [[TMP2]], i64 2)
15 ; CHECK-NEXT: br label [[JOIN:%.*]]
17 ; CHECK-NEXT: [[ARG_2:%.*]] = getelementptr inbounds i8, ptr [[ARG]], i64 24
18 ; CHECK-NEXT: [[TMP7:%.*]] = load <2 x i64>, ptr [[ARG]], align 8
19 ; CHECK-NEXT: [[TMP8:%.*]] = shufflevector <2 x i64> [[TMP7]], <2 x i64> poison, <2 x i32> <i32 1, i32 0>
20 ; CHECK-NEXT: [[TMP9:%.*]] = load <2 x i64>, ptr [[ARG_2]], align 8
21 ; CHECK-NEXT: [[TMP10:%.*]] = shufflevector <2 x i64> [[TMP9]], <2 x i64> poison, <2 x i32> <i32 1, i32 0>
22 ; CHECK-NEXT: [[TMP11:%.*]] = call <4 x i64> @llvm.vector.insert.v4i64.v2i64(<4 x i64> poison, <2 x i64> [[TMP10]], i64 0)
23 ; CHECK-NEXT: [[TMP12:%.*]] = call <4 x i64> @llvm.vector.insert.v4i64.v2i64(<4 x i64> [[TMP11]], <2 x i64> [[TMP8]], i64 2)
24 ; CHECK-NEXT: br label [[JOIN]]
26 ; CHECK-NEXT: [[TMP13:%.*]] = phi <4 x i64> [ [[TMP6]], [[IF]] ], [ [[TMP12]], [[ELSE]] ]
27 ; CHECK-NEXT: ret void
29 br i1 %c, label %if, label %else
32 %i2.0 = load i64, ptr %arg, align 8
33 %arg2.1 = getelementptr inbounds i8, ptr %arg, i64 8
34 %i2.1 = load i64, ptr %arg2.1, align 8
35 %arg2.2 = getelementptr inbounds i8, ptr %arg, i64 24
36 %i2.2 = load i64, ptr %arg2.2, align 8
37 %arg2.3 = getelementptr inbounds i8, ptr %arg, i64 32
38 %i2.3 = load i64, ptr %arg2.3, align 8
42 %i.0 = load i64, ptr %arg, align 8
43 %arg.1 = getelementptr inbounds i8, ptr %arg, i64 8
44 %i.1 = load i64, ptr %arg.1, align 8
45 %arg.2 = getelementptr inbounds i8, ptr %arg, i64 24
46 %i.2 = load i64, ptr %arg.2, align 8
47 %arg.3 = getelementptr inbounds i8, ptr %arg, i64 32
48 %i.3 = load i64, ptr %arg.3, align 8
52 %phi.3 = phi i64 [ %i2.3, %if ], [ %i.3, %else ]
53 %phi.2 = phi i64 [ %i2.2, %if ], [ %i.2, %else ]
54 %phi.1 = phi i64 [ %i2.1, %if ], [ %i.1, %else ]
55 %phi.0 = phi i64 [ %i2.0, %if ], [ %i.0, %else ]