1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
2 ; RUN: opt -passes=slp-vectorizer -mtriple=x86_64-unknown-linux-gnu -mcpu=skx -S < %s | FileCheck %s
3 ; RUN: opt -passes=slp-vectorizer -mtriple=x86_64-unknown-linux-gnu -mcpu=skx -S < %s -slp-threshold=-100 | FileCheck %s --check-prefix=CHECK-SLP-THRESHOLD
6 ; CHECK-LABEL: define void @test
7 ; CHECK-SAME: () #[[ATTR0:[0-9]+]] {
9 ; CHECK-NEXT: [[COND_IN_V:%.*]] = select i1 false, ptr null, ptr null
10 ; CHECK-NEXT: br label [[BB:%.*]]
12 ; CHECK-NEXT: [[V:%.*]] = load i64, ptr [[COND_IN_V]], align 8
13 ; CHECK-NEXT: [[BV:%.*]] = icmp eq i64 [[V]], 0
14 ; CHECK-NEXT: [[IN_1:%.*]] = getelementptr i64, ptr [[COND_IN_V]], i64 4
15 ; CHECK-NEXT: [[V_1:%.*]] = load i64, ptr [[IN_1]], align 8
16 ; CHECK-NEXT: [[BV_1:%.*]] = icmp eq i64 [[V_1]], 0
17 ; CHECK-NEXT: [[IN_2:%.*]] = getelementptr i64, ptr [[COND_IN_V]], i64 8
18 ; CHECK-NEXT: [[V_2:%.*]] = load i64, ptr [[IN_2]], align 8
19 ; CHECK-NEXT: [[BV_2:%.*]] = icmp eq i64 [[V_2]], 0
20 ; CHECK-NEXT: [[IN_3:%.*]] = getelementptr i64, ptr [[COND_IN_V]], i64 12
21 ; CHECK-NEXT: [[V_3:%.*]] = load i64, ptr [[IN_3]], align 8
22 ; CHECK-NEXT: [[BV_3:%.*]] = icmp eq i64 [[V_3]], 0
23 ; CHECK-NEXT: ret void
25 ; CHECK-SLP-THRESHOLD-LABEL: define void @test
26 ; CHECK-SLP-THRESHOLD-SAME: () #[[ATTR0:[0-9]+]] {
27 ; CHECK-SLP-THRESHOLD-NEXT: entry:
28 ; CHECK-SLP-THRESHOLD-NEXT: [[COND_IN_V:%.*]] = select i1 false, ptr null, ptr null
29 ; CHECK-SLP-THRESHOLD-NEXT: br label [[BB:%.*]]
30 ; CHECK-SLP-THRESHOLD: bb:
31 ; CHECK-SLP-THRESHOLD-NEXT: [[TMP0:%.*]] = insertelement <4 x ptr> poison, ptr [[COND_IN_V]], i32 0
32 ; CHECK-SLP-THRESHOLD-NEXT: [[TMP1:%.*]] = shufflevector <4 x ptr> [[TMP0]], <4 x ptr> poison, <4 x i32> zeroinitializer
33 ; CHECK-SLP-THRESHOLD-NEXT: [[TMP2:%.*]] = getelementptr i64, <4 x ptr> [[TMP1]], <4 x i64> <i64 12, i64 8, i64 4, i64 0>
34 ; CHECK-SLP-THRESHOLD-NEXT: [[TMP3:%.*]] = call <4 x i64> @llvm.masked.gather.v4i64.v4p0(<4 x ptr> [[TMP2]], i32 8, <4 x i1> splat (i1 true), <4 x i64> poison)
35 ; CHECK-SLP-THRESHOLD-NEXT: [[TMP4:%.*]] = icmp eq <4 x i64> [[TMP3]], zeroinitializer
36 ; CHECK-SLP-THRESHOLD-NEXT: ret void
39 %cond.in.v = select i1 false, ptr null, ptr null
43 %v = load i64, ptr %cond.in.v, align 8
44 %bv = icmp eq i64 %v, 0
45 %in.1 = getelementptr i64, ptr %cond.in.v, i64 4
46 %v.1 = load i64, ptr %in.1, align 8
47 %bv.1 = icmp eq i64 %v.1, 0
48 %in.2 = getelementptr i64, ptr %cond.in.v, i64 8
49 %v.2 = load i64, ptr %in.2, align 8
50 %bv.2 = icmp eq i64 %v.2, 0
51 %in.3 = getelementptr i64, ptr %cond.in.v, i64 12
52 %v.3 = load i64, ptr %in.3, align 8
53 %bv.3 = icmp eq i64 %v.3, 0