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: [[CMP_I_I:%.*]] = icmp sgt i32 [[SHR15]], 0
17 ; CHECK-NEXT: [[COND_I_I:%.*]] = select i1 [[CMP_I_I]], i32 [[SHR15]], i32 0
18 ; CHECK-NEXT: [[CMP_I4_I:%.*]] = icmp slt i32 [[COND_I_I]], undef
19 ; CHECK-NEXT: [[COND_I5_I:%.*]] = select i1 [[CMP_I4_I]], i32 [[COND_I_I]], i32 undef
20 ; CHECK-NEXT: [[IDXPROM30:%.*]] = sext i32 [[COND_I5_I]] to i64
21 ; CHECK-NEXT: [[ARRAYIDX31:%.*]] = getelementptr inbounds ptr, ptr undef, i64 [[IDXPROM30]]
22 ; CHECK-NEXT: [[CMP_I_I_1:%.*]] = icmp sgt i32 [[SUB14]], -1
23 ; CHECK-NEXT: [[COND_I_I_1:%.*]] = select i1 [[CMP_I_I_1]], i32 undef, i32 0
24 ; CHECK-NEXT: [[CMP_I4_I_1:%.*]] = icmp slt i32 [[COND_I_I_1]], undef
25 ; CHECK-NEXT: [[COND_I5_I_1:%.*]] = select i1 [[CMP_I4_I_1]], i32 [[COND_I_I_1]], i32 undef
26 ; CHECK-NEXT: [[IDXPROM30_1:%.*]] = sext i32 [[COND_I5_I_1]] to i64
27 ; CHECK-NEXT: [[ARRAYIDX31_1:%.*]] = getelementptr inbounds ptr, ptr undef, i64 [[IDXPROM30_1]]
28 ; CHECK-NEXT: [[CMP_I_I_2:%.*]] = icmp sgt i32 [[SUB14]], -5
29 ; CHECK-NEXT: [[COND_I_I_2:%.*]] = select i1 [[CMP_I_I_2]], i32 undef, i32 0
30 ; CHECK-NEXT: [[CMP_I4_I_2:%.*]] = icmp slt i32 [[COND_I_I_2]], undef
31 ; CHECK-NEXT: [[COND_I5_I_2:%.*]] = select i1 [[CMP_I4_I_2]], i32 [[COND_I_I_2]], i32 undef
32 ; CHECK-NEXT: [[IDXPROM30_2:%.*]] = sext i32 [[COND_I5_I_2]] to i64
33 ; CHECK-NEXT: [[ARRAYIDX31_2:%.*]] = getelementptr inbounds ptr, ptr undef, i64 [[IDXPROM30_2]]
34 ; CHECK-NEXT: [[CMP_I_I_3:%.*]] = icmp sgt i32 [[SUB14]], -9
35 ; CHECK-NEXT: [[COND_I_I_3:%.*]] = select i1 [[CMP_I_I_3]], i32 undef, i32 0
36 ; CHECK-NEXT: [[CMP_I4_I_3:%.*]] = icmp slt i32 [[COND_I_I_3]], undef
37 ; CHECK-NEXT: [[COND_I5_I_3:%.*]] = select i1 [[CMP_I4_I_3]], i32 [[COND_I_I_3]], i32 undef
38 ; CHECK-NEXT: [[IDXPROM30_3:%.*]] = sext i32 [[COND_I5_I_3]] to i64
39 ; CHECK-NEXT: [[ARRAYIDX31_3:%.*]] = getelementptr inbounds ptr, ptr undef, i64 [[IDXPROM30_3]]
40 ; CHECK-NEXT: unreachable
43 br label %land.lhs.true
45 land.lhs.true: ; preds = %entry
46 br i1 undef, label %if.then, label %if.end
48 if.then: ; preds = %land.lhs.true
51 if.end: ; preds = %land.lhs.true
52 %sub14 = sub nsw i32 %y_pos, undef
53 %shr15 = ashr i32 %sub14, 2
54 %cmp.i.i = icmp sgt i32 %shr15, 0
55 %cond.i.i = select i1 %cmp.i.i, i32 %shr15, i32 0
56 %cmp.i4.i = icmp slt i32 %cond.i.i, undef
57 %cond.i5.i = select i1 %cmp.i4.i, i32 %cond.i.i, i32 undef
58 %idxprom30 = sext i32 %cond.i5.i to i64
59 %arrayidx31 = getelementptr inbounds ptr, ptr undef, i64 %idxprom30
60 %cmp.i.i.1 = icmp sgt i32 %sub14, -1
61 %cond.i.i.1 = select i1 %cmp.i.i.1, i32 undef, i32 0
62 %cmp.i4.i.1 = icmp slt i32 %cond.i.i.1, undef
63 %cond.i5.i.1 = select i1 %cmp.i4.i.1, i32 %cond.i.i.1, i32 undef
64 %idxprom30.1 = sext i32 %cond.i5.i.1 to i64
65 %arrayidx31.1 = getelementptr inbounds ptr, ptr undef, i64 %idxprom30.1
66 %cmp.i.i.2 = icmp sgt i32 %sub14, -5
67 %cond.i.i.2 = select i1 %cmp.i.i.2, i32 undef, i32 0
68 %cmp.i4.i.2 = icmp slt i32 %cond.i.i.2, undef
69 %cond.i5.i.2 = select i1 %cmp.i4.i.2, i32 %cond.i.i.2, i32 undef
70 %idxprom30.2 = sext i32 %cond.i5.i.2 to i64
71 %arrayidx31.2 = getelementptr inbounds ptr, ptr undef, i64 %idxprom30.2
72 %cmp.i.i.3 = icmp sgt i32 %sub14, -9
73 %cond.i.i.3 = select i1 %cmp.i.i.3, i32 undef, i32 0
74 %cmp.i4.i.3 = icmp slt i32 %cond.i.i.3, undef
75 %cond.i5.i.3 = select i1 %cmp.i4.i.3, i32 %cond.i.i.3, i32 undef
76 %idxprom30.3 = sext i32 %cond.i5.i.3 to i64
77 %arrayidx31.3 = getelementptr inbounds ptr, ptr undef, i64 %idxprom30.3