|
1 | 1 | ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py |
2 | | -; RUN: opt < %s -mtriple=aarch64-unknown-linux-gnu -passes="print<cost-model>" -cost-kind=throughput 2>&1 -disable-output | FileCheck %s --check-prefix=THROUGHPUT |
| 2 | +; RUN: opt < %s -mtriple=aarch64-linux-gnu -passes="print<cost-model>" -cost-kind=throughput 2>&1 -disable-output | FileCheck %s --check-prefix=RECIP |
| 3 | +; RUN: opt < %s -mtriple=aarch64-linux-gnu -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output | FileCheck %s --check-prefix=COST |
3 | 4 |
|
4 | 5 | ; Verify the cost of (vector) multiply instructions. |
5 | 6 |
|
6 | 7 | target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128" |
7 | 8 |
|
8 | 9 | define <2 x i8> @t1(<2 x i8> %a, <2 x i8> %b) { |
9 | | -; THROUGHPUT-LABEL: 't1' |
10 | | -; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <2 x i8> %a, %b |
11 | | -; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i8> %1 |
| 10 | +; RECIP-LABEL: 't1' |
| 11 | +; RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <2 x i8> %a, %b |
| 12 | +; RECIP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i8> %1 |
| 13 | +; |
| 14 | +; COST-LABEL: 't1' |
| 15 | +; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <2 x i8> %a, %b |
| 16 | +; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i8> %1 |
12 | 17 | ; |
13 | 18 | %1 = mul <2 x i8> %a, %b |
14 | 19 | ret <2 x i8> %1 |
15 | 20 | } |
16 | 21 |
|
17 | 22 | define <4 x i8> @t2(<4 x i8> %a, <4 x i8> %b) { |
18 | | -; THROUGHPUT-LABEL: 't2' |
19 | | -; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <4 x i8> %a, %b |
20 | | -; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i8> %1 |
| 23 | +; RECIP-LABEL: 't2' |
| 24 | +; RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <4 x i8> %a, %b |
| 25 | +; RECIP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i8> %1 |
| 26 | +; |
| 27 | +; COST-LABEL: 't2' |
| 28 | +; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <4 x i8> %a, %b |
| 29 | +; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i8> %1 |
21 | 30 | ; |
22 | 31 | %1 = mul <4 x i8> %a, %b |
23 | 32 | ret <4 x i8> %1 |
24 | 33 | } |
25 | 34 |
|
26 | 35 | define <8 x i8> @t3(<8 x i8> %a, <8 x i8> %b) { |
27 | | -; THROUGHPUT-LABEL: 't3' |
28 | | -; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <8 x i8> %a, %b |
29 | | -; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i8> %1 |
| 36 | +; RECIP-LABEL: 't3' |
| 37 | +; RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <8 x i8> %a, %b |
| 38 | +; RECIP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i8> %1 |
| 39 | +; |
| 40 | +; COST-LABEL: 't3' |
| 41 | +; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <8 x i8> %a, %b |
| 42 | +; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i8> %1 |
30 | 43 | ; |
31 | 44 | %1 = mul <8 x i8> %a, %b |
32 | 45 | ret <8 x i8> %1 |
33 | 46 | } |
34 | 47 |
|
35 | 48 | define <16 x i8> @t4(<16 x i8> %a, <16 x i8> %b) { |
36 | | -; THROUGHPUT-LABEL: 't4' |
37 | | -; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <16 x i8> %a, %b |
38 | | -; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %1 |
| 49 | +; RECIP-LABEL: 't4' |
| 50 | +; RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <16 x i8> %a, %b |
| 51 | +; RECIP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %1 |
| 52 | +; |
| 53 | +; COST-LABEL: 't4' |
| 54 | +; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <16 x i8> %a, %b |
| 55 | +; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i8> %1 |
39 | 56 | ; |
40 | 57 | %1 = mul <16 x i8> %a, %b |
41 | 58 | ret <16 x i8> %1 |
42 | 59 | } |
43 | 60 |
|
44 | 61 | define <32 x i8> @t5(<32 x i8> %a, <32 x i8> %b) { |
45 | | -; THROUGHPUT-LABEL: 't5' |
46 | | -; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %1 = mul <32 x i8> %a, %b |
47 | | -; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %1 |
| 62 | +; RECIP-LABEL: 't5' |
| 63 | +; RECIP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %1 = mul <32 x i8> %a, %b |
| 64 | +; RECIP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %1 |
| 65 | +; |
| 66 | +; COST-LABEL: 't5' |
| 67 | +; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <32 x i8> %a, %b |
| 68 | +; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <32 x i8> %1 |
48 | 69 | ; |
49 | 70 | %1 = mul <32 x i8> %a, %b |
50 | 71 | ret <32 x i8> %1 |
51 | 72 | } |
52 | 73 |
|
53 | 74 | define <2 x i16> @t6(<2 x i16> %a, <2 x i16> %b) { |
54 | | -; THROUGHPUT-LABEL: 't6' |
55 | | -; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <2 x i16> %a, %b |
56 | | -; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i16> %1 |
| 75 | +; RECIP-LABEL: 't6' |
| 76 | +; RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <2 x i16> %a, %b |
| 77 | +; RECIP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i16> %1 |
| 78 | +; |
| 79 | +; COST-LABEL: 't6' |
| 80 | +; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <2 x i16> %a, %b |
| 81 | +; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i16> %1 |
57 | 82 | ; |
58 | 83 | %1 = mul <2 x i16> %a, %b |
59 | 84 | ret <2 x i16> %1 |
60 | 85 | } |
61 | 86 |
|
62 | 87 | define <4 x i16> @t7(<4 x i16> %a, <4 x i16> %b) { |
63 | | -; THROUGHPUT-LABEL: 't7' |
64 | | -; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <4 x i16> %a, %b |
65 | | -; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i16> %1 |
| 88 | +; RECIP-LABEL: 't7' |
| 89 | +; RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <4 x i16> %a, %b |
| 90 | +; RECIP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i16> %1 |
| 91 | +; |
| 92 | +; COST-LABEL: 't7' |
| 93 | +; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <4 x i16> %a, %b |
| 94 | +; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i16> %1 |
66 | 95 | ; |
67 | 96 | %1 = mul <4 x i16> %a, %b |
68 | 97 | ret <4 x i16> %1 |
69 | 98 | } |
70 | 99 |
|
71 | 100 | define <8 x i16> @t8(<8 x i16> %a, <8 x i16> %b) { |
72 | | -; THROUGHPUT-LABEL: 't8' |
73 | | -; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <8 x i16> %a, %b |
74 | | -; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %1 |
| 101 | +; RECIP-LABEL: 't8' |
| 102 | +; RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <8 x i16> %a, %b |
| 103 | +; RECIP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %1 |
| 104 | +; |
| 105 | +; COST-LABEL: 't8' |
| 106 | +; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <8 x i16> %a, %b |
| 107 | +; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i16> %1 |
75 | 108 | ; |
76 | 109 | %1 = mul <8 x i16> %a, %b |
77 | 110 | ret <8 x i16> %1 |
78 | 111 | } |
79 | 112 |
|
80 | 113 | define <16 x i16> @t9(<16 x i16> %a, <16 x i16> %b) { |
81 | | -; THROUGHPUT-LABEL: 't9' |
82 | | -; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %1 = mul <16 x i16> %a, %b |
83 | | -; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %1 |
| 114 | +; RECIP-LABEL: 't9' |
| 115 | +; RECIP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %1 = mul <16 x i16> %a, %b |
| 116 | +; RECIP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %1 |
| 117 | +; |
| 118 | +; COST-LABEL: 't9' |
| 119 | +; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <16 x i16> %a, %b |
| 120 | +; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <16 x i16> %1 |
84 | 121 | ; |
85 | 122 | %1 = mul <16 x i16> %a, %b |
86 | 123 | ret <16 x i16> %1 |
87 | 124 | } |
88 | 125 |
|
89 | 126 | define <2 x i32> @t10(<2 x i32> %a, <2 x i32> %b) { |
90 | | -; THROUGHPUT-LABEL: 't10' |
91 | | -; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <2 x i32> %a, %b |
92 | | -; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i32> %1 |
| 127 | +; RECIP-LABEL: 't10' |
| 128 | +; RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <2 x i32> %a, %b |
| 129 | +; RECIP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i32> %1 |
| 130 | +; |
| 131 | +; COST-LABEL: 't10' |
| 132 | +; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <2 x i32> %a, %b |
| 133 | +; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i32> %1 |
93 | 134 | ; |
94 | 135 | %1 = mul <2 x i32> %a, %b |
95 | 136 | ret <2 x i32> %1 |
96 | 137 | } |
97 | 138 |
|
98 | 139 | define <4 x i32> @t11(<4 x i32> %a, <4 x i32> %b) { |
99 | | -; THROUGHPUT-LABEL: 't11' |
100 | | -; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <4 x i32> %a, %b |
101 | | -; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %1 |
| 140 | +; RECIP-LABEL: 't11' |
| 141 | +; RECIP-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <4 x i32> %a, %b |
| 142 | +; RECIP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %1 |
| 143 | +; |
| 144 | +; COST-LABEL: 't11' |
| 145 | +; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <4 x i32> %a, %b |
| 146 | +; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i32> %1 |
102 | 147 | ; |
103 | 148 | %1 = mul <4 x i32> %a, %b |
104 | 149 | ret <4 x i32> %1 |
105 | 150 | } |
106 | 151 |
|
107 | 152 | define <8 x i32> @t12(<8 x i32> %a, <8 x i32> %b) { |
108 | | -; THROUGHPUT-LABEL: 't12' |
109 | | -; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %1 = mul <8 x i32> %a, %b |
110 | | -; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %1 |
| 153 | +; RECIP-LABEL: 't12' |
| 154 | +; RECIP-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %1 = mul <8 x i32> %a, %b |
| 155 | +; RECIP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %1 |
| 156 | +; |
| 157 | +; COST-LABEL: 't12' |
| 158 | +; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <8 x i32> %a, %b |
| 159 | +; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <8 x i32> %1 |
111 | 160 | ; |
112 | 161 | %1 = mul <8 x i32> %a, %b |
113 | 162 | ret <8 x i32> %1 |
114 | 163 | } |
115 | 164 |
|
116 | 165 | define <2 x i64> @t13(<2 x i64> %a, <2 x i64> %b) { |
117 | | -; THROUGHPUT-LABEL: 't13' |
118 | | -; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %1 = mul nsw <2 x i64> %a, %b |
119 | | -; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %1 |
| 166 | +; RECIP-LABEL: 't13' |
| 167 | +; RECIP-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %1 = mul nsw <2 x i64> %a, %b |
| 168 | +; RECIP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %1 |
| 169 | +; |
| 170 | +; COST-LABEL: 't13' |
| 171 | +; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul nsw <2 x i64> %a, %b |
| 172 | +; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x i64> %1 |
120 | 173 | ; |
121 | 174 | %1 = mul nsw <2 x i64> %a, %b |
122 | 175 | ret <2 x i64> %1 |
123 | 176 | } |
124 | 177 |
|
125 | 178 | define <4 x i64> @t14(<4 x i64> %a, <4 x i64> %b) { |
126 | | -; THROUGHPUT-LABEL: 't14' |
127 | | -; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 28 for instruction: %1 = mul nsw <4 x i64> %a, %b |
128 | | -; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %1 |
| 179 | +; RECIP-LABEL: 't14' |
| 180 | +; RECIP-NEXT: Cost Model: Found an estimated cost of 28 for instruction: %1 = mul nsw <4 x i64> %a, %b |
| 181 | +; RECIP-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %1 |
| 182 | +; |
| 183 | +; COST-LABEL: 't14' |
| 184 | +; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul nsw <4 x i64> %a, %b |
| 185 | +; COST-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <4 x i64> %1 |
129 | 186 | ; |
130 | 187 | %1 = mul nsw <4 x i64> %a, %b |
131 | 188 | ret <4 x i64> %1 |
|
0 commit comments