1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=slp-vectorizer -S -mtriple=x86_64-unknown-linux-gnu -mcpu=bdver2 < %s | FileCheck %s
4 ; Function Attrs: nounwind uwtable
5 define void @get_block(i32 %y_pos) local_unnamed_addr #0 {
6 ; CHECK-LABEL: @get_block(
8 ; CHECK-NEXT: br label [[LAND_LHS_TRUE:%.*]]
9 ; CHECK: land.lhs.true:
10 ; CHECK-NEXT: br i1 undef, label [[IF_THEN:%.*]], label [[IF_END:%.*]]
12 ; CHECK-NEXT: unreachable
14 ; CHECK-NEXT: [[SUB14:%.*]] = sub nsw i32 [[Y_POS:%.*]], undef
15 ; CHECK-NEXT: [[SHR15:%.*]] = ashr i32 [[SUB14]], 2
16 ; CHECK-NEXT: [[TMP0:%.*]] = insertelement <4 x i32> poison, i32 [[SHR15]], i32 0
17 ; CHECK-NEXT: [[TMP1:%.*]] = insertelement <4 x i32> [[TMP0]], i32 [[SUB14]], i32 1
18 ; CHECK-NEXT: [[TMP2:%.*]] = shufflevector <4 x i32> [[TMP1]], <4 x i32> poison, <4 x i32> <i32 0, i32 1, i32 1, i32 1>
19 ; CHECK-NEXT: [[TMP3:%.*]] = icmp sgt <4 x i32> [[TMP2]], <i32 0, i32 -1, i32 -5, i32 -9>
20 ; CHECK-NEXT: [[TMP4:%.*]] = insertelement <4 x i32> [[TMP2]], i32 undef, i32 1
21 ; CHECK-NEXT: [[TMP5:%.*]] = insertelement <4 x i32> [[TMP4]], i32 undef, i32 2
22 ; CHECK-NEXT: [[TMP6:%.*]] = insertelement <4 x i32> [[TMP5]], i32 undef, i32 3
23 ; CHECK-NEXT: [[TMP7:%.*]] = select <4 x i1> [[TMP3]], <4 x i32> [[TMP6]], <4 x i32> zeroinitializer
24 ; CHECK-NEXT: [[TMP8:%.*]] = icmp slt <4 x i32> [[TMP7]], undef
25 ; CHECK-NEXT: [[TMP9:%.*]] = select <4 x i1> [[TMP8]], <4 x i32> [[TMP7]], <4 x i32> undef
26 ; CHECK-NEXT: [[TMP10:%.*]] = extractelement <4 x i32> [[TMP9]], i32 0
27 ; CHECK-NEXT: [[TMP11:%.*]] = sext i32 [[TMP10]] to i64
28 ; CHECK-NEXT: [[ARRAYIDX31:%.*]] = getelementptr inbounds ptr, ptr undef, i64 [[TMP11]]
29 ; CHECK-NEXT: [[TMP12:%.*]] = extractelement <4 x i32> [[TMP9]], i32 1
30 ; CHECK-NEXT: [[TMP13:%.*]] = sext i32 [[TMP12]] to i64
31 ; CHECK-NEXT: [[ARRAYIDX31_1:%.*]] = getelementptr inbounds ptr, ptr undef, i64 [[TMP13]]
32 ; CHECK-NEXT: [[TMP14:%.*]] = extractelement <4 x i32> [[TMP9]], i32 2
33 ; CHECK-NEXT: [[TMP15:%.*]] = sext i32 [[TMP14]] to i64
34 ; CHECK-NEXT: [[ARRAYIDX31_2:%.*]] = getelementptr inbounds ptr, ptr undef, i64 [[TMP15]]
35 ; CHECK-NEXT: [[TMP16:%.*]] = extractelement <4 x i32> [[TMP9]], i32 3
36 ; CHECK-NEXT: [[TMP17:%.*]] = sext i32 [[TMP16]] to i64
37 ; CHECK-NEXT: [[ARRAYIDX31_3:%.*]] = getelementptr inbounds ptr, ptr undef, i64 [[TMP17]]
38 ; CHECK-NEXT: unreachable
41 br label %land.lhs.true
43 land.lhs.true: ; preds = %entry
44 br i1 undef, label %if.then, label %if.end
46 if.then: ; preds = %land.lhs.true
49 if.end: ; preds = %land.lhs.true
50 %sub14 = sub nsw i32 %y_pos, undef
51 %shr15 = ashr i32 %sub14, 2
52 %cmp.i.i = icmp sgt i32 %shr15, 0
53 %cond.i.i = select i1 %cmp.i.i, i32 %shr15, i32 0
54 %cmp.i4.i = icmp slt i32 %cond.i.i, undef
55 %cond.i5.i = select i1 %cmp.i4.i, i32 %cond.i.i, i32 undef
56 %idxprom30 = sext i32 %cond.i5.i to i64
57 %arrayidx31 = getelementptr inbounds ptr, ptr undef, i64 %idxprom30
58 %cmp.i.i.1 = icmp sgt i32 %sub14, -1
59 %cond.i.i.1 = select i1 %cmp.i.i.1, i32 undef, i32 0
60 %cmp.i4.i.1 = icmp slt i32 %cond.i.i.1, undef
61 %cond.i5.i.1 = select i1 %cmp.i4.i.1, i32 %cond.i.i.1, i32 undef
62 %idxprom30.1 = sext i32 %cond.i5.i.1 to i64
63 %arrayidx31.1 = getelementptr inbounds ptr, ptr undef, i64 %idxprom30.1
64 %cmp.i.i.2 = icmp sgt i32 %sub14, -5
65 %cond.i.i.2 = select i1 %cmp.i.i.2, i32 undef, i32 0
66 %cmp.i4.i.2 = icmp slt i32 %cond.i.i.2, undef
67 %cond.i5.i.2 = select i1 %cmp.i4.i.2, i32 %cond.i.i.2, i32 undef
68 %idxprom30.2 = sext i32 %cond.i5.i.2 to i64
69 %arrayidx31.2 = getelementptr inbounds ptr, ptr undef, i64 %idxprom30.2
70 %cmp.i.i.3 = icmp sgt i32 %sub14, -9
71 %cond.i.i.3 = select i1 %cmp.i.i.3, i32 undef, i32 0
72 %cmp.i4.i.3 = icmp slt i32 %cond.i.i.3, undef
73 %cond.i5.i.3 = select i1 %cmp.i4.i.3, i32 %cond.i.i.3, i32 undef
74 %idxprom30.3 = sext i32 %cond.i5.i.3 to i64
75 %arrayidx31.3 = getelementptr inbounds ptr, ptr undef, i64 %idxprom30.3