1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -mtriple=x86_64-unknown-linux -slp-vectorizer -S -mcpu=corei7 | FileCheck %s
7 ; CHECK-NEXT: [[TMP:%.*]] = alloca <8 x i32>, align 32
8 ; CHECK-NEXT: [[TMP1:%.*]] = bitcast <8 x i32>* [[TMP]] to [8 x i32]*
9 ; CHECK-NEXT: [[TMP2:%.*]] = alloca i32, align 4
10 ; CHECK-NEXT: [[TMP3:%.*]] = bitcast <8 x i32>* [[TMP]] to i8*
11 ; CHECK-NEXT: [[TMP4:%.*]] = getelementptr inbounds <8 x i32>, <8 x i32>* [[TMP]], i64 0, i64 0
12 ; CHECK-NEXT: [[TMP5:%.*]] = getelementptr inbounds [8 x i32], [8 x i32]* [[TMP1]], i64 0, i64 1
13 ; CHECK-NEXT: [[TMP6:%.*]] = getelementptr inbounds [8 x i32], [8 x i32]* [[TMP1]], i64 0, i64 2
14 ; CHECK-NEXT: [[TMP7:%.*]] = getelementptr inbounds [8 x i32], [8 x i32]* [[TMP1]], i64 0, i64 3
15 ; CHECK-NEXT: [[TMP8:%.*]] = getelementptr inbounds [8 x i32], [8 x i32]* [[TMP1]], i64 0, i64 4
16 ; CHECK-NEXT: [[TMP9:%.*]] = getelementptr inbounds [8 x i32], [8 x i32]* [[TMP1]], i64 0, i64 6
17 ; CHECK-NEXT: [[TMP10:%.*]] = getelementptr inbounds [8 x i32], [8 x i32]* [[TMP1]], i64 0, i64 5
18 ; CHECK-NEXT: [[TMP11:%.*]] = getelementptr inbounds [8 x i32], [8 x i32]* [[TMP1]], i64 0, i64 7
19 ; CHECK-NEXT: store <8 x i32> <i32 -221320154, i32 -756426931, i32 563883532, i32 382683935, i32 144890241, i32 -1052877364, i32 -1052877364, i32 -1016007675>, <8 x i32>* [[TMP]], align 32
20 ; CHECK-NEXT: [[TMP12:%.*]] = bitcast i32* [[TMP2]] to i8*
21 ; CHECK-NEXT: [[TMP13:%.*]] = load i32, i32* [[TMP4]], align 32
22 ; CHECK-NEXT: [[TMP14:%.*]] = load i32, i32* [[TMP5]], align 4
23 ; CHECK-NEXT: [[TMP15:%.*]] = icmp slt i32 [[TMP14]], [[TMP13]]
24 ; CHECK-NEXT: [[TMP16:%.*]] = select i1 [[TMP15]], i32 [[TMP14]], i32 [[TMP13]]
25 ; CHECK-NEXT: [[TMP17:%.*]] = zext i1 [[TMP15]] to i32
26 ; CHECK-NEXT: [[TMP18:%.*]] = load i32, i32* [[TMP6]], align 8
27 ; CHECK-NEXT: [[TMP19:%.*]] = icmp slt i32 [[TMP18]], [[TMP16]]
28 ; CHECK-NEXT: [[TMP20:%.*]] = select i1 [[TMP19]], i32 [[TMP18]], i32 [[TMP16]]
29 ; CHECK-NEXT: [[TMP21:%.*]] = select i1 [[TMP19]], i32 2, i32 [[TMP16]]
30 ; CHECK-NEXT: [[TMP22:%.*]] = load i32, i32* [[TMP7]], align 4
31 ; CHECK-NEXT: [[TMP23:%.*]] = icmp slt i32 [[TMP22]], [[TMP20]]
32 ; CHECK-NEXT: [[TMP24:%.*]] = select i1 [[TMP23]], i32 [[TMP22]], i32 [[TMP20]]
33 ; CHECK-NEXT: [[TMP25:%.*]] = select i1 [[TMP23]], i32 3, i32 [[TMP21]]
34 ; CHECK-NEXT: [[TMP26:%.*]] = load i32, i32* [[TMP8]], align 16
35 ; CHECK-NEXT: [[TMP27:%.*]] = icmp slt i32 [[TMP26]], [[TMP24]]
36 ; CHECK-NEXT: [[TMP28:%.*]] = select i1 [[TMP27]], i32 [[TMP26]], i32 [[TMP24]]
37 ; CHECK-NEXT: [[TMP29:%.*]] = select i1 [[TMP27]], i32 4, i32 [[TMP25]]
38 ; CHECK-NEXT: [[TMP30:%.*]] = load i32, i32* [[TMP10]], align 4
39 ; CHECK-NEXT: [[TMP31:%.*]] = icmp slt i32 [[TMP30]], [[TMP28]]
40 ; CHECK-NEXT: [[TMP32:%.*]] = select i1 [[TMP31]], i32 [[TMP30]], i32 [[TMP28]]
41 ; CHECK-NEXT: [[TMP33:%.*]] = select i1 [[TMP31]], i32 5, i32 [[TMP29]]
42 ; CHECK-NEXT: [[TMP34:%.*]] = load i32, i32* [[TMP9]], align 8
43 ; CHECK-NEXT: [[TMP35:%.*]] = icmp slt i32 [[TMP34]], [[TMP32]]
44 ; CHECK-NEXT: [[TMP36:%.*]] = select i1 [[TMP35]], i32 [[TMP34]], i32 [[TMP32]]
45 ; CHECK-NEXT: [[TMP37:%.*]] = select i1 [[TMP35]], i32 6, i32 [[TMP33]]
46 ; CHECK-NEXT: [[TMP38:%.*]] = load i32, i32* [[TMP11]], align 4
47 ; CHECK-NEXT: [[TMP39:%.*]] = icmp slt i32 [[TMP38]], [[TMP36]]
48 ; CHECK-NEXT: [[TMP40:%.*]] = select i1 [[TMP39]], i32 7, i32 [[TMP37]]
49 ; CHECK-NEXT: store i32 [[TMP40]], i32* [[TMP2]], align 4
50 ; CHECK-NEXT: ret i32 0
53 %tmp = alloca <8 x i32>, align 32
54 %tmp1 = bitcast <8 x i32>* %tmp to [8 x i32]*
55 %tmp2 = alloca i32, align 4
56 %tmp3 = bitcast <8 x i32>* %tmp to i8*
57 %tmp4 = getelementptr inbounds <8 x i32>, <8 x i32>* %tmp, i64 0, i64 0
58 %tmp5 = getelementptr inbounds [8 x i32], [8 x i32]* %tmp1, i64 0, i64 1
59 %tmp6 = getelementptr inbounds [8 x i32], [8 x i32]* %tmp1, i64 0, i64 2
60 %tmp7 = getelementptr inbounds [8 x i32], [8 x i32]* %tmp1, i64 0, i64 3
61 %tmp8 = getelementptr inbounds [8 x i32], [8 x i32]* %tmp1, i64 0, i64 4
62 %tmp9 = getelementptr inbounds [8 x i32], [8 x i32]* %tmp1, i64 0, i64 6
63 %tmp10 = getelementptr inbounds [8 x i32], [8 x i32]* %tmp1, i64 0, i64 5
64 %tmp11 = getelementptr inbounds [8 x i32], [8 x i32]* %tmp1, i64 0, i64 7
65 store <8 x i32> <i32 -221320154, i32 -756426931, i32 563883532, i32 382683935, i32 144890241, i32 -1052877364, i32 -1052877364, i32 -1016007675>, <8 x i32>* %tmp, align 32
66 %tmp12 = bitcast i32* %tmp2 to i8*
67 %tmp13 = load i32, i32* %tmp4, align 32
68 %tmp14 = load i32, i32* %tmp5, align 4
69 %tmp15 = icmp slt i32 %tmp14, %tmp13
70 %tmp16 = select i1 %tmp15, i32 %tmp14, i32 %tmp13
71 %tmp17 = zext i1 %tmp15 to i32
72 %tmp18 = load i32, i32* %tmp6, align 8
73 %tmp19 = icmp slt i32 %tmp18, %tmp16
74 %tmp20 = select i1 %tmp19, i32 %tmp18, i32 %tmp16
75 %tmp21 = select i1 %tmp19, i32 2, i32 %tmp16
76 %tmp22 = load i32, i32* %tmp7, align 4
77 %tmp23 = icmp slt i32 %tmp22, %tmp20
78 %tmp24 = select i1 %tmp23, i32 %tmp22, i32 %tmp20
79 %tmp25 = select i1 %tmp23, i32 3, i32 %tmp21
80 %tmp26 = load i32, i32* %tmp8, align 16
81 %tmp27 = icmp slt i32 %tmp26, %tmp24
82 %tmp28 = select i1 %tmp27, i32 %tmp26, i32 %tmp24
83 %tmp29 = select i1 %tmp27, i32 4, i32 %tmp25
84 %tmp30 = load i32, i32* %tmp10, align 4
85 %tmp31 = icmp slt i32 %tmp30, %tmp28
86 %tmp32 = select i1 %tmp31, i32 %tmp30, i32 %tmp28
87 %tmp33 = select i1 %tmp31, i32 5, i32 %tmp29
88 %tmp34 = load i32, i32* %tmp9, align 8
89 %tmp35 = icmp slt i32 %tmp34, %tmp32
90 %tmp36 = select i1 %tmp35, i32 %tmp34, i32 %tmp32
91 %tmp37 = select i1 %tmp35, i32 6, i32 %tmp33
92 %tmp38 = load i32, i32* %tmp11, align 4
93 %tmp39 = icmp slt i32 %tmp38, %tmp36
94 %tmp40 = select i1 %tmp39, i32 7, i32 %tmp37
95 store i32 %tmp40, i32* %tmp2, align 4