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:%.*]] = insertelement <4 x ptr> poison, ptr [[ARG:%.*]], i32 0
9 ; CHECK-NEXT: [[TMP2:%.*]] = shufflevector <4 x ptr> [[TMP1]], <4 x ptr> poison, <4 x i32> zeroinitializer
10 ; CHECK-NEXT: [[TMP3:%.*]] = getelementptr i8, <4 x ptr> [[TMP2]], <4 x i64> <i64 32, i64 24, i64 8, i64 0>
11 ; CHECK-NEXT: [[TMP4:%.*]] = call <4 x i64> @llvm.masked.gather.v4i64.v4p0(<4 x ptr> [[TMP3]], i32 8, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i64> poison)
12 ; CHECK-NEXT: br label [[JOIN:%.*]]
14 ; CHECK-NEXT: [[TMP5:%.*]] = insertelement <4 x ptr> poison, ptr [[ARG]], i32 0
15 ; CHECK-NEXT: [[TMP6:%.*]] = shufflevector <4 x ptr> [[TMP5]], <4 x ptr> poison, <4 x i32> zeroinitializer
16 ; CHECK-NEXT: [[TMP7:%.*]] = getelementptr i8, <4 x ptr> [[TMP6]], <4 x i64> <i64 32, i64 24, i64 8, i64 0>
17 ; CHECK-NEXT: [[TMP8:%.*]] = call <4 x i64> @llvm.masked.gather.v4i64.v4p0(<4 x ptr> [[TMP7]], i32 8, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i64> poison)
18 ; CHECK-NEXT: br label [[JOIN]]
20 ; CHECK-NEXT: [[TMP9:%.*]] = phi <4 x i64> [ [[TMP4]], [[IF]] ], [ [[TMP8]], [[ELSE]] ]
21 ; CHECK-NEXT: ret void
23 br i1 %c, label %if, label %else
26 %i2.0 = load i64, ptr %arg, align 8
27 %arg2.1 = getelementptr inbounds i8, ptr %arg, i64 8
28 %i2.1 = load i64, ptr %arg2.1, align 8
29 %arg2.2 = getelementptr inbounds i8, ptr %arg, i64 24
30 %i2.2 = load i64, ptr %arg2.2, align 8
31 %arg2.3 = getelementptr inbounds i8, ptr %arg, i64 32
32 %i2.3 = load i64, ptr %arg2.3, align 8
36 %i.0 = load i64, ptr %arg, align 8
37 %arg.1 = getelementptr inbounds i8, ptr %arg, i64 8
38 %i.1 = load i64, ptr %arg.1, align 8
39 %arg.2 = getelementptr inbounds i8, ptr %arg, i64 24
40 %i.2 = load i64, ptr %arg.2, align 8
41 %arg.3 = getelementptr inbounds i8, ptr %arg, i64 32
42 %i.3 = load i64, ptr %arg.3, align 8
46 %phi.3 = phi i64 [ %i2.3, %if ], [ %i.3, %else ]
47 %phi.2 = phi i64 [ %i2.2, %if ], [ %i.2, %else ]
48 %phi.1 = phi i64 [ %i2.1, %if ], [ %i.1, %else ]
49 %phi.0 = phi i64 [ %i2.0, %if ], [ %i.0, %else ]