1; RUN: opt < %s -cost-model -analyze -mtriple=systemz-unknown -mcpu=z13 | FileCheck %s
2;
3; Note: The scalarized vector instructions costs are not including any
4; extracts, due to the undef operands.
5
6define void @add() {
7  %res0 = add i8 undef, undef
8  %res1 = add i16 undef, undef
9  %res2 = add i32 undef, undef
10  %res3 = add i64 undef, undef
11  %res4 = add <2 x i8> undef, undef
12  %res5 = add <2 x i16> undef, undef
13  %res6 = add <2 x i32> undef, undef
14  %res7 = add <2 x i64> undef, undef
15  %res8 = add <4 x i8> undef, undef
16  %res9 = add <4 x i16> undef, undef
17  %res10 = add <4 x i32> undef, undef
18  %res11 = add <4 x i64> undef, undef
19  %res12 = add <8 x i8> undef, undef
20  %res13 = add <8 x i16> undef, undef
21  %res14 = add <8 x i32> undef, undef
22  %res15 = add <8 x i64> undef, undef
23  %res16 = add <16 x i8> undef, undef
24  %res17 = add <16 x i16> undef, undef
25  %res18 = add <16 x i32> undef, undef
26  %res19 = add <16 x i64> undef, undef
27
28; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res0 = add i8 undef, undef
29; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res1 = add i16 undef, undef
30; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res2 = add i32 undef, undef
31; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res3 = add i64 undef, undef
32; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res4 = add <2 x i8> undef, undef
33; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res5 = add <2 x i16> undef, undef
34; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res6 = add <2 x i32> undef, undef
35; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res7 = add <2 x i64> undef, undef
36; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res8 = add <4 x i8> undef, undef
37; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res9 = add <4 x i16> undef, undef
38; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res10 = add <4 x i32> undef, undef
39; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   %res11 = add <4 x i64> undef, undef
40; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res12 = add <8 x i8> undef, undef
41; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res13 = add <8 x i16> undef, undef
42; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   %res14 = add <8 x i32> undef, undef
43; CHECK: Cost Model: Found an estimated cost of 4 for instruction:   %res15 = add <8 x i64> undef, undef
44; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res16 = add <16 x i8> undef, undef
45; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   %res17 = add <16 x i16> undef, undef
46; CHECK: Cost Model: Found an estimated cost of 4 for instruction:   %res18 = add <16 x i32> undef, undef
47; CHECK: Cost Model: Found an estimated cost of 8 for instruction:   %res19 = add <16 x i64> undef, undef
48
49  ret void;
50}
51
52define void @sub() {
53  %res0 = sub i8 undef, undef
54  %res1 = sub i16 undef, undef
55  %res2 = sub i32 undef, undef
56  %res3 = sub i64 undef, undef
57  %res4 = sub <2 x i8> undef, undef
58  %res5 = sub <2 x i16> undef, undef
59  %res6 = sub <2 x i32> undef, undef
60  %res7 = sub <2 x i64> undef, undef
61  %res8 = sub <4 x i8> undef, undef
62  %res9 = sub <4 x i16> undef, undef
63  %res10 = sub <4 x i32> undef, undef
64  %res11 = sub <4 x i64> undef, undef
65  %res12 = sub <8 x i8> undef, undef
66  %res13 = sub <8 x i16> undef, undef
67  %res14 = sub <8 x i32> undef, undef
68  %res15 = sub <8 x i64> undef, undef
69  %res16 = sub <16 x i8> undef, undef
70  %res17 = sub <16 x i16> undef, undef
71  %res18 = sub <16 x i32> undef, undef
72  %res19 = sub <16 x i64> undef, undef
73
74; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res0 = sub i8 undef, undef
75; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res1 = sub i16 undef, undef
76; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res2 = sub i32 undef, undef
77; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res3 = sub i64 undef, undef
78; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res4 = sub <2 x i8> undef, undef
79; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res5 = sub <2 x i16> undef, undef
80; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res6 = sub <2 x i32> undef, undef
81; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res7 = sub <2 x i64> undef, undef
82; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res8 = sub <4 x i8> undef, undef
83; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res9 = sub <4 x i16> undef, undef
84; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res10 = sub <4 x i32> undef, undef
85; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   %res11 = sub <4 x i64> undef, undef
86; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res12 = sub <8 x i8> undef, undef
87; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res13 = sub <8 x i16> undef, undef
88; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   %res14 = sub <8 x i32> undef, undef
89; CHECK: Cost Model: Found an estimated cost of 4 for instruction:   %res15 = sub <8 x i64> undef, undef
90; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res16 = sub <16 x i8> undef, undef
91; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   %res17 = sub <16 x i16> undef, undef
92; CHECK: Cost Model: Found an estimated cost of 4 for instruction:   %res18 = sub <16 x i32> undef, undef
93; CHECK: Cost Model: Found an estimated cost of 8 for instruction:   %res19 = sub <16 x i64> undef, undef
94
95  ret void;
96}
97
98define void @mul() {
99  %res0 = mul i8 undef, undef
100  %res1 = mul i16 undef, undef
101  %res2 = mul i32 undef, undef
102  %res3 = mul i64 undef, undef
103  %res4 = mul <2 x i8> undef, undef
104  %res5 = mul <2 x i16> undef, undef
105  %res6 = mul <2 x i32> undef, undef
106  %res7 = mul <2 x i64> undef, undef
107  %res8 = mul <4 x i8> undef, undef
108  %res9 = mul <4 x i16> undef, undef
109  %res10 = mul <4 x i32> undef, undef
110  %res11 = mul <4 x i64> undef, undef
111  %res12 = mul <8 x i8> undef, undef
112  %res13 = mul <8 x i16> undef, undef
113  %res14 = mul <8 x i32> undef, undef
114  %res15 = mul <8 x i64> undef, undef
115  %res16 = mul <16 x i8> undef, undef
116  %res17 = mul <16 x i16> undef, undef
117  %res18 = mul <16 x i32> undef, undef
118  %res19 = mul <16 x i64> undef, undef
119
120; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res0 = mul i8 undef, undef
121; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res1 = mul i16 undef, undef
122; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res2 = mul i32 undef, undef
123; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res3 = mul i64 undef, undef
124; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res4 = mul <2 x i8> undef, undef
125; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res5 = mul <2 x i16> undef, undef
126; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res6 = mul <2 x i32> undef, undef
127; CHECK: Cost Model: Found an estimated cost of 3 for instruction:   %res7 = mul <2 x i64> undef, undef
128; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res8 = mul <4 x i8> undef, undef
129; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res9 = mul <4 x i16> undef, undef
130; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res10 = mul <4 x i32> undef, undef
131; CHECK: Cost Model: Found an estimated cost of 6 for instruction:   %res11 = mul <4 x i64> undef, undef
132; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res12 = mul <8 x i8> undef, undef
133; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res13 = mul <8 x i16> undef, undef
134; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   %res14 = mul <8 x i32> undef, undef
135; CHECK: Cost Model: Found an estimated cost of 12 for instruction:   %res15 = mul <8 x i64> undef, undef
136; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res16 = mul <16 x i8> undef, undef
137; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   %res17 = mul <16 x i16> undef, undef
138; CHECK: Cost Model: Found an estimated cost of 4 for instruction:   %res18 = mul <16 x i32> undef, undef
139; CHECK: Cost Model: Found an estimated cost of 24 for instruction:   %res19 = mul <16 x i64> undef, undef
140
141  ret void;
142}
143