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
5 ; CHECK-LABEL: define {{[^@]+}}@main(
7 ; CHECK-NEXT: [[T:%.*]] = alloca <8 x i32>, align 32
8 ; CHECK-NEXT: [[T1:%.*]] = bitcast <8 x i32>* [[T]] to [8 x i32]*
9 ; CHECK-NEXT: [[T2:%.*]] = alloca i32, align 4
10 ; CHECK-NEXT: [[T3:%.*]] = bitcast <8 x i32>* [[T]] to i8*
11 ; CHECK-NEXT: [[T4:%.*]] = getelementptr inbounds <8 x i32>, <8 x i32>* [[T]], i64 0, i64 0
12 ; CHECK-NEXT: [[T5:%.*]] = getelementptr inbounds [8 x i32], [8 x i32]* [[T1]], i64 0, i64 1
13 ; CHECK-NEXT: [[T6:%.*]] = getelementptr inbounds [8 x i32], [8 x i32]* [[T1]], i64 0, i64 2
14 ; CHECK-NEXT: [[T7:%.*]] = getelementptr inbounds [8 x i32], [8 x i32]* [[T1]], i64 0, i64 3
15 ; CHECK-NEXT: [[T8:%.*]] = getelementptr inbounds [8 x i32], [8 x i32]* [[T1]], i64 0, i64 4
16 ; CHECK-NEXT: [[T9:%.*]] = getelementptr inbounds [8 x i32], [8 x i32]* [[T1]], i64 0, i64 6
17 ; CHECK-NEXT: [[T10:%.*]] = getelementptr inbounds [8 x i32], [8 x i32]* [[T1]], i64 0, i64 5
18 ; CHECK-NEXT: [[T11:%.*]] = getelementptr inbounds [8 x i32], [8 x i32]* [[T1]], 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>* [[T]], align 32
20 ; CHECK-NEXT: [[T12:%.*]] = bitcast i32* [[T2]] to i8*
21 ; CHECK-NEXT: [[T13:%.*]] = load i32, i32* [[T4]], align 32
22 ; CHECK-NEXT: [[T14:%.*]] = load i32, i32* [[T5]], align 4
23 ; CHECK-NEXT: [[T15:%.*]] = icmp slt i32 [[T14]], [[T13]]
24 ; CHECK-NEXT: [[T16:%.*]] = select i1 [[T15]], i32 [[T14]], i32 [[T13]]
25 ; CHECK-NEXT: [[T17:%.*]] = zext i1 [[T15]] to i32
26 ; CHECK-NEXT: [[T18:%.*]] = load i32, i32* [[T6]], align 8
27 ; CHECK-NEXT: [[T19:%.*]] = icmp slt i32 [[T18]], [[T16]]
28 ; CHECK-NEXT: [[T20:%.*]] = select i1 [[T19]], i32 [[T18]], i32 [[T16]]
29 ; CHECK-NEXT: [[T21:%.*]] = select i1 [[T19]], i32 2, i32 [[T16]]
30 ; CHECK-NEXT: [[T22:%.*]] = load i32, i32* [[T7]], align 4
31 ; CHECK-NEXT: [[T23:%.*]] = icmp slt i32 [[T22]], [[T20]]
32 ; CHECK-NEXT: [[T24:%.*]] = select i1 [[T23]], i32 [[T22]], i32 [[T20]]
33 ; CHECK-NEXT: [[T25:%.*]] = select i1 [[T23]], i32 3, i32 [[T21]]
34 ; CHECK-NEXT: [[T26:%.*]] = load i32, i32* [[T8]], align 16
35 ; CHECK-NEXT: [[T27:%.*]] = icmp slt i32 [[T26]], [[T24]]
36 ; CHECK-NEXT: [[T28:%.*]] = select i1 [[T27]], i32 [[T26]], i32 [[T24]]
37 ; CHECK-NEXT: [[T29:%.*]] = select i1 [[T27]], i32 4, i32 [[T25]]
38 ; CHECK-NEXT: [[T30:%.*]] = load i32, i32* [[T10]], align 4
39 ; CHECK-NEXT: [[T31:%.*]] = icmp slt i32 [[T30]], [[T28]]
40 ; CHECK-NEXT: [[T32:%.*]] = select i1 [[T31]], i32 [[T30]], i32 [[T28]]
41 ; CHECK-NEXT: [[T33:%.*]] = select i1 [[T31]], i32 5, i32 [[T29]]
42 ; CHECK-NEXT: [[T34:%.*]] = load i32, i32* [[T9]], align 8
43 ; CHECK-NEXT: [[T35:%.*]] = icmp slt i32 [[T34]], [[T32]]
44 ; CHECK-NEXT: [[T36:%.*]] = select i1 [[T35]], i32 [[T34]], i32 [[T32]]
45 ; CHECK-NEXT: [[T37:%.*]] = select i1 [[T35]], i32 6, i32 [[T33]]
46 ; CHECK-NEXT: [[T38:%.*]] = load i32, i32* [[T11]], align 4
47 ; CHECK-NEXT: [[T39:%.*]] = icmp slt i32 [[T38]], [[T36]]
48 ; CHECK-NEXT: [[T40:%.*]] = select i1 [[T39]], i32 7, i32 [[T37]]
49 ; CHECK-NEXT: store i32 [[T40]], i32* [[T2]], align 4
50 ; CHECK-NEXT: ret i32 0
53 %t = alloca <8 x i32>, align 32
54 %t1 = bitcast <8 x i32>* %t to [8 x i32]*
55 %t2 = alloca i32, align 4
56 %t3 = bitcast <8 x i32>* %t to i8*
57 %t4 = getelementptr inbounds <8 x i32>, <8 x i32>* %t, i64 0, i64 0
58 %t5 = getelementptr inbounds [8 x i32], [8 x i32]* %t1, i64 0, i64 1
59 %t6 = getelementptr inbounds [8 x i32], [8 x i32]* %t1, i64 0, i64 2
60 %t7 = getelementptr inbounds [8 x i32], [8 x i32]* %t1, i64 0, i64 3
61 %t8 = getelementptr inbounds [8 x i32], [8 x i32]* %t1, i64 0, i64 4
62 %t9 = getelementptr inbounds [8 x i32], [8 x i32]* %t1, i64 0, i64 6
63 %t10 = getelementptr inbounds [8 x i32], [8 x i32]* %t1, i64 0, i64 5
64 %t11 = getelementptr inbounds [8 x i32], [8 x i32]* %t1, 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>* %t, align 32
66 %t12 = bitcast i32* %t2 to i8*
67 %t13 = load i32, i32* %t4, align 32
68 %t14 = load i32, i32* %t5, align 4
69 %t15 = icmp slt i32 %t14, %t13
70 %t16 = select i1 %t15, i32 %t14, i32 %t13
71 %t17 = zext i1 %t15 to i32
72 %t18 = load i32, i32* %t6, align 8
73 %t19 = icmp slt i32 %t18, %t16
74 %t20 = select i1 %t19, i32 %t18, i32 %t16
75 %t21 = select i1 %t19, i32 2, i32 %t16
76 %t22 = load i32, i32* %t7, align 4
77 %t23 = icmp slt i32 %t22, %t20
78 %t24 = select i1 %t23, i32 %t22, i32 %t20
79 %t25 = select i1 %t23, i32 3, i32 %t21
80 %t26 = load i32, i32* %t8, align 16
81 %t27 = icmp slt i32 %t26, %t24
82 %t28 = select i1 %t27, i32 %t26, i32 %t24
83 %t29 = select i1 %t27, i32 4, i32 %t25
84 %t30 = load i32, i32* %t10, align 4
85 %t31 = icmp slt i32 %t30, %t28
86 %t32 = select i1 %t31, i32 %t30, i32 %t28
87 %t33 = select i1 %t31, i32 5, i32 %t29
88 %t34 = load i32, i32* %t9, align 8
89 %t35 = icmp slt i32 %t34, %t32
90 %t36 = select i1 %t35, i32 %t34, i32 %t32
91 %t37 = select i1 %t35, i32 6, i32 %t33
92 %t38 = load i32, i32* %t11, align 4
93 %t39 = icmp slt i32 %t38, %t36
94 %t40 = select i1 %t39, i32 7, i32 %t37
95 store i32 %t40, i32* %t2, align 4