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 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
9 ; CHECK-NEXT: br i1 undef, label [[BB1:%.*]], label [[BB2:%.*]]
11 ; CHECK-NEXT: ret void
13 ; CHECK-NEXT: [[T:%.*]] = select i1 undef, i16 undef, i16 15
14 ; CHECK-NEXT: [[T3:%.*]] = sext i16 undef to i32
15 ; CHECK-NEXT: [[T4:%.*]] = sext i16 [[T]] to i32
16 ; CHECK-NEXT: [[T5:%.*]] = sub nsw i32 undef, [[T4]]
17 ; CHECK-NEXT: [[T6:%.*]] = sub i32 [[T5]], undef
18 ; CHECK-NEXT: [[T7:%.*]] = sub nsw i32 63, [[T3]]
19 ; CHECK-NEXT: [[T8:%.*]] = sub i32 [[T7]], undef
20 ; CHECK-NEXT: [[T9:%.*]] = add i32 [[T8]], undef
21 ; CHECK-NEXT: [[T10:%.*]] = add nsw i32 [[T6]], 15
22 ; CHECK-NEXT: [[T11:%.*]] = icmp sgt i32 [[T9]], [[T10]]
23 ; CHECK-NEXT: [[T12:%.*]] = select i1 [[T11]], i32 [[T9]], i32 [[T10]]
24 ; CHECK-NEXT: [[T13:%.*]] = add nsw i32 [[T6]], 31
25 ; CHECK-NEXT: [[T14:%.*]] = icmp sgt i32 [[T12]], [[T13]]
26 ; CHECK-NEXT: [[T15:%.*]] = select i1 [[T14]], i32 [[T12]], i32 [[T13]]
27 ; CHECK-NEXT: [[T16:%.*]] = add nsw i32 [[T6]], 47
28 ; CHECK-NEXT: [[T17:%.*]] = icmp sgt i32 [[T15]], [[T16]]
29 ; CHECK-NEXT: [[T18:%.*]] = select i1 [[T17]], i32 [[T15]], i32 [[T16]]
30 ; CHECK-NEXT: [[T19:%.*]] = select i1 undef, i32 [[T18]], i32 undef
31 ; CHECK-NEXT: [[T20:%.*]] = icmp sgt i32 [[T19]], 63
32 ; CHECK-NEXT: [[T21:%.*]] = sub nsw i32 undef, [[T3]]
33 ; CHECK-NEXT: [[T22:%.*]] = sub i32 [[T21]], undef
34 ; CHECK-NEXT: [[T23:%.*]] = sub nsw i32 undef, [[T4]]
35 ; CHECK-NEXT: [[T24:%.*]] = sub i32 [[T23]], undef
36 ; CHECK-NEXT: [[T25:%.*]] = add nsw i32 [[T24]], -49
37 ; CHECK-NEXT: [[T30:%.*]] = add nsw i32 [[T22]], -33
38 ; CHECK-NEXT: [[T35:%.*]] = add nsw i32 [[T24]], -33
39 ; CHECK-NEXT: [[T40:%.*]] = add nsw i32 [[T22]], -17
40 ; CHECK-NEXT: [[OP_RDX:%.*]] = icmp slt i32 undef, [[T40]]
41 ; CHECK-NEXT: [[OP_RDX1:%.*]] = select i1 [[OP_RDX]], i32 undef, i32 [[T40]]
42 ; CHECK-NEXT: [[OP_RDX2:%.*]] = icmp slt i32 [[T35]], [[T30]]
43 ; CHECK-NEXT: [[OP_RDX3:%.*]] = select i1 [[OP_RDX2]], i32 [[T35]], i32 [[T30]]
44 ; CHECK-NEXT: [[OP_RDX4:%.*]] = icmp slt i32 [[OP_RDX1]], [[OP_RDX3]]
45 ; CHECK-NEXT: [[OP_RDX5:%.*]] = select i1 [[OP_RDX4]], i32 [[OP_RDX1]], i32 [[OP_RDX3]]
46 ; CHECK-NEXT: [[OP_RDX6:%.*]] = icmp slt i32 [[OP_RDX5]], [[T25]]
47 ; CHECK-NEXT: [[OP_RDX7:%.*]] = select i1 [[OP_RDX6]], i32 [[OP_RDX5]], i32 [[T25]]
48 ; CHECK-NEXT: [[T45:%.*]] = icmp sgt i32 undef, [[OP_RDX7]]
49 ; CHECK-NEXT: unreachable
52 br i1 undef, label %bb1, label %bb2
58 %t = select i1 undef, i16 undef, i16 15
59 %t3 = sext i16 undef to i32
60 %t4 = sext i16 %t to i32
61 %t5 = sub nsw i32 undef, %t4
62 %t6 = sub i32 %t5, undef
63 %t7 = sub nsw i32 63, %t3
64 %t8 = sub i32 %t7, undef
65 %t9 = add i32 %t8, undef
66 %t10 = add nsw i32 %t6, 15
67 %t11 = icmp sgt i32 %t9, %t10
68 %t12 = select i1 %t11, i32 %t9, i32 %t10
69 %t13 = add nsw i32 %t6, 31
70 %t14 = icmp sgt i32 %t12, %t13
71 %t15 = select i1 %t14, i32 %t12, i32 %t13
72 %t16 = add nsw i32 %t6, 47
73 %t17 = icmp sgt i32 %t15, %t16
74 %t18 = select i1 %t17, i32 %t15, i32 %t16
75 %t19 = select i1 undef, i32 %t18, i32 undef
76 %t20 = icmp sgt i32 %t19, 63
77 %t21 = sub nsw i32 undef, %t3
78 %t22 = sub i32 %t21, undef
79 %t23 = sub nsw i32 undef, %t4
80 %t24 = sub i32 %t23, undef
81 %t25 = add nsw i32 %t24, -49
82 %t26 = icmp sgt i32 %t25, undef
83 %t27 = select i1 %t26, i32 undef, i32 %t25
84 %t28 = icmp sgt i32 %t27, undef
85 %t29 = select i1 %t28, i32 undef, i32 %t27
86 %t30 = add nsw i32 %t22, -33
87 %t31 = icmp sgt i32 %t30, undef
88 %t32 = select i1 %t31, i32 undef, i32 %t30
89 %t33 = icmp sgt i32 %t32, %t29
90 %t34 = select i1 %t33, i32 %t29, i32 %t32
91 %t35 = add nsw i32 %t24, -33
92 %t36 = icmp sgt i32 %t35, undef
93 %t37 = select i1 %t36, i32 undef, i32 %t35
94 %t38 = icmp sgt i32 %t37, %t34
95 %t39 = select i1 %t38, i32 %t34, i32 %t37
96 %t40 = add nsw i32 %t22, -17
97 %t41 = icmp sgt i32 %t40, undef
98 %t42 = select i1 %t41, i32 undef, i32 %t40
99 %t43 = icmp sgt i32 %t42, %t39
100 %t44 = select i1 %t43, i32 %t39, i32 %t42
101 %t45 = icmp sgt i32 undef, %t44