1
1
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2
- ; RUN: opt < %s -mtriple=aarch64-linux-gnu -passes="print<cost-model>" -cost-kind=throughput 2>&1 -disable-output | FileCheck %s --check-prefix=THROUGHPUT
3
- ; RUN: opt < %s -mtriple=aarch64-linux-gnu -passes="print<cost-model>" -cost-kind=latency 2>&1 -disable-output | FileCheck %s --check-prefix=LATENCY
4
- ; RUN: opt < %s -mtriple=aarch64-linux-gnu -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output | FileCheck %s --check-prefix=CODESIZE
2
+ ; RUN: opt < %s -mtriple=aarch64-linux-gnu -passes="print<cost-model>" -cost-kind=all 2>&1 -disable-output | FileCheck %s
5
3
6
4
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
7
5
8
6
define i32 @extract_first_i32 ({i32 , i32 } %agg ) {
9
- ; THROUGHPUT-LABEL: 'extract_first_i32'
10
- ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, i32 } %agg, 0
11
- ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 %r
12
- ;
13
- ; LATENCY-LABEL: 'extract_first_i32'
14
- ; LATENCY-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, i32 } %agg, 0
15
- ; LATENCY-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 %r
16
- ;
17
- ; CODESIZE-LABEL: 'extract_first_i32'
18
- ; CODESIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, i32 } %agg, 0
19
- ; CODESIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 %r
7
+ ; CHECK-LABEL: 'extract_first_i32'
8
+ ; CHECK-NEXT: Cost Model: Found costs of 0 for: %r = extractvalue { i32, i32 } %agg, 0
9
+ ; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret i32 %r
20
10
;
21
11
%r = extractvalue {i32 , i32 } %agg , 0
22
12
ret i32 %r
23
13
}
24
14
25
15
define i32 @extract_second_i32 ({i32 , i32 } %agg ) {
26
- ; THROUGHPUT-LABEL: 'extract_second_i32'
27
- ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, i32 } %agg, 1
28
- ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 %r
29
- ;
30
- ; LATENCY-LABEL: 'extract_second_i32'
31
- ; LATENCY-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, i32 } %agg, 1
32
- ; LATENCY-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 %r
33
- ;
34
- ; CODESIZE-LABEL: 'extract_second_i32'
35
- ; CODESIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, i32 } %agg, 1
36
- ; CODESIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 %r
16
+ ; CHECK-LABEL: 'extract_second_i32'
17
+ ; CHECK-NEXT: Cost Model: Found costs of 0 for: %r = extractvalue { i32, i32 } %agg, 1
18
+ ; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret i32 %r
37
19
;
38
20
%r = extractvalue {i32 , i32 } %agg , 1
39
21
ret i32 %r
40
22
}
41
23
42
24
define i32 @extract_i32 ({i32 , i1 } %agg ) {
43
- ; THROUGHPUT-LABEL: 'extract_i32'
44
- ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, i1 } %agg, 0
45
- ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 %r
46
- ;
47
- ; LATENCY-LABEL: 'extract_i32'
48
- ; LATENCY-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, i1 } %agg, 0
49
- ; LATENCY-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 %r
50
- ;
51
- ; CODESIZE-LABEL: 'extract_i32'
52
- ; CODESIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, i1 } %agg, 0
53
- ; CODESIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i32 %r
25
+ ; CHECK-LABEL: 'extract_i32'
26
+ ; CHECK-NEXT: Cost Model: Found costs of 0 for: %r = extractvalue { i32, i1 } %agg, 0
27
+ ; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret i32 %r
54
28
;
55
29
%r = extractvalue {i32 , i1 } %agg , 0
56
30
ret i32 %r
57
31
}
58
32
59
33
define i1 @extract_i1 ({i32 , i1 } %agg ) {
60
- ; THROUGHPUT-LABEL: 'extract_i1'
61
- ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, i1 } %agg, 1
62
- ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i1 %r
63
- ;
64
- ; LATENCY-LABEL: 'extract_i1'
65
- ; LATENCY-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, i1 } %agg, 1
66
- ; LATENCY-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i1 %r
67
- ;
68
- ; CODESIZE-LABEL: 'extract_i1'
69
- ; CODESIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, i1 } %agg, 1
70
- ; CODESIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i1 %r
34
+ ; CHECK-LABEL: 'extract_i1'
35
+ ; CHECK-NEXT: Cost Model: Found costs of 0 for: %r = extractvalue { i32, i1 } %agg, 1
36
+ ; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret i1 %r
71
37
;
72
38
%r = extractvalue {i32 , i1 } %agg , 1
73
39
ret i1 %r
74
40
}
75
41
76
42
define float @extract_float ({i32 , float } %agg ) {
77
- ; THROUGHPUT-LABEL: 'extract_float'
78
- ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, float } %agg, 1
79
- ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret float %r
80
- ;
81
- ; LATENCY-LABEL: 'extract_float'
82
- ; LATENCY-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, float } %agg, 1
83
- ; LATENCY-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret float %r
84
- ;
85
- ; CODESIZE-LABEL: 'extract_float'
86
- ; CODESIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, float } %agg, 1
87
- ; CODESIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret float %r
43
+ ; CHECK-LABEL: 'extract_float'
44
+ ; CHECK-NEXT: Cost Model: Found costs of 0 for: %r = extractvalue { i32, float } %agg, 1
45
+ ; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret float %r
88
46
;
89
47
%r = extractvalue {i32 , float } %agg , 1
90
48
ret float %r
91
49
}
92
50
93
51
define [42 x i42 ] @extract_array ({i32 , [42 x i42 ]} %agg ) {
94
- ; THROUGHPUT-LABEL: 'extract_array'
95
- ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, [42 x i42] } %agg, 1
96
- ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret [42 x i42] %r
97
- ;
98
- ; LATENCY-LABEL: 'extract_array'
99
- ; LATENCY-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, [42 x i42] } %agg, 1
100
- ; LATENCY-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret [42 x i42] %r
101
- ;
102
- ; CODESIZE-LABEL: 'extract_array'
103
- ; CODESIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, [42 x i42] } %agg, 1
104
- ; CODESIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret [42 x i42] %r
52
+ ; CHECK-LABEL: 'extract_array'
53
+ ; CHECK-NEXT: Cost Model: Found costs of 0 for: %r = extractvalue { i32, [42 x i42] } %agg, 1
54
+ ; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret [42 x i42] %r
105
55
;
106
56
%r = extractvalue {i32 , [42 x i42 ]} %agg , 1
107
57
ret [42 x i42 ] %r
108
58
}
109
59
110
60
define <42 x i42 > @extract_vector ({i32 , <42 x i42 >} %agg ) {
111
- ; THROUGHPUT-LABEL: 'extract_vector'
112
- ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, <42 x i42> } %agg, 1
113
- ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <42 x i42> %r
114
- ;
115
- ; LATENCY-LABEL: 'extract_vector'
116
- ; LATENCY-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, <42 x i42> } %agg, 1
117
- ; LATENCY-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <42 x i42> %r
118
- ;
119
- ; CODESIZE-LABEL: 'extract_vector'
120
- ; CODESIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, <42 x i42> } %agg, 1
121
- ; CODESIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <42 x i42> %r
61
+ ; CHECK-LABEL: 'extract_vector'
62
+ ; CHECK-NEXT: Cost Model: Found costs of 0 for: %r = extractvalue { i32, <42 x i42> } %agg, 1
63
+ ; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <42 x i42> %r
122
64
;
123
65
%r = extractvalue {i32 , <42 x i42 >} %agg , 1
124
66
ret <42 x i42 > %r
@@ -127,17 +69,9 @@ define <42 x i42> @extract_vector({i32, <42 x i42>} %agg) {
127
69
%T1 = type { i32 , float , <4 x i1 > }
128
70
129
71
define %T1 @extract_struct ({i32 , %T1 } %agg ) {
130
- ; THROUGHPUT-LABEL: 'extract_struct'
131
- ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, %T1 } %agg, 1
132
- ; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret %T1 %r
133
- ;
134
- ; LATENCY-LABEL: 'extract_struct'
135
- ; LATENCY-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, %T1 } %agg, 1
136
- ; LATENCY-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret %T1 %r
137
- ;
138
- ; CODESIZE-LABEL: 'extract_struct'
139
- ; CODESIZE-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = extractvalue { i32, %T1 } %agg, 1
140
- ; CODESIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret %T1 %r
72
+ ; CHECK-LABEL: 'extract_struct'
73
+ ; CHECK-NEXT: Cost Model: Found costs of 0 for: %r = extractvalue { i32, %T1 } %agg, 1
74
+ ; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret %T1 %r
141
75
;
142
76
%r = extractvalue {i32 , %T1 } %agg , 1
143
77
ret %T1 %r
0 commit comments