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: [[TMP1:%.*]] = load <2 x i64>, ptr [[ARG:%.*]], align 8
9 ; CHECK-NEXT: [[ARG2_2:%.*]] = getelementptr inbounds i8, ptr [[ARG]], i64 24
10 ; CHECK-NEXT: [[TMP2:%.*]] = load <2 x i64>, ptr [[ARG2_2]], align 8
11 ; CHECK-NEXT: [[TMP3:%.*]] = shufflevector <2 x i64> [[TMP2]], <2 x i64> poison, <4 x i32> <i32 1, i32 0, i32 poison, i32 poison>
12 ; CHECK-NEXT: [[TMP4:%.*]] = shufflevector <2 x i64> [[TMP1]], <2 x i64> poison, <4 x i32> <i32 1, i32 0, i32 poison, i32 poison>
13 ; CHECK-NEXT: [[TMP5:%.*]] = shufflevector <4 x i64> [[TMP3]], <4 x i64> [[TMP4]], <4 x i32> <i32 0, i32 1, i32 4, i32 5>
14 ; CHECK-NEXT: br label [[JOIN:%.*]]
16 ; CHECK-NEXT: [[TMP6:%.*]] = load <2 x i64>, ptr [[ARG]], align 8
17 ; CHECK-NEXT: [[ARG_2:%.*]] = getelementptr inbounds i8, ptr [[ARG]], i64 24
18 ; CHECK-NEXT: [[TMP7:%.*]] = load <2 x i64>, ptr [[ARG_2]], align 8
19 ; CHECK-NEXT: [[TMP8:%.*]] = shufflevector <2 x i64> [[TMP7]], <2 x i64> poison, <4 x i32> <i32 1, i32 0, i32 poison, i32 poison>
20 ; CHECK-NEXT: [[TMP9:%.*]] = shufflevector <2 x i64> [[TMP6]], <2 x i64> poison, <4 x i32> <i32 1, i32 0, i32 poison, i32 poison>
21 ; CHECK-NEXT: [[TMP10:%.*]] = shufflevector <4 x i64> [[TMP8]], <4 x i64> [[TMP9]], <4 x i32> <i32 0, i32 1, i32 4, i32 5>
22 ; CHECK-NEXT: br label [[JOIN]]
24 ; CHECK-NEXT: [[TMP11:%.*]] = phi <4 x i64> [ [[TMP5]], [[IF]] ], [ [[TMP10]], [[ELSE]] ]
25 ; CHECK-NEXT: ret void
27 br i1 %c, label %if, label %else
30 %i2.0 = load i64, ptr %arg, align 8
31 %arg2.1 = getelementptr inbounds i8, ptr %arg, i64 8
32 %i2.1 = load i64, ptr %arg2.1, align 8
33 %arg2.2 = getelementptr inbounds i8, ptr %arg, i64 24
34 %i2.2 = load i64, ptr %arg2.2, align 8
35 %arg2.3 = getelementptr inbounds i8, ptr %arg, i64 32
36 %i2.3 = load i64, ptr %arg2.3, align 8
40 %i.0 = load i64, ptr %arg, align 8
41 %arg.1 = getelementptr inbounds i8, ptr %arg, i64 8
42 %i.1 = load i64, ptr %arg.1, align 8
43 %arg.2 = getelementptr inbounds i8, ptr %arg, i64 24
44 %i.2 = load i64, ptr %arg.2, align 8
45 %arg.3 = getelementptr inbounds i8, ptr %arg, i64 32
46 %i.3 = load i64, ptr %arg.3, align 8
50 %phi.3 = phi i64 [ %i2.3, %if ], [ %i.3, %else ]
51 %phi.2 = phi i64 [ %i2.2, %if ], [ %i.2, %else ]
52 %phi.1 = phi i64 [ %i2.1, %if ], [ %i.1, %else ]
53 %phi.0 = phi i64 [ %i2.0, %if ], [ %i.0, %else ]