1
1
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2
- ; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output | FileCheck %s
3
- ; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -mcpu=neoverse-n1 | FileCheck %s
4
- ; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -mcpu=neoverse-n2 | FileCheck %s
5
- ; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -mcpu=neoverse-v1 | FileCheck %s
6
- ; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -mcpu=neoverse-v2 | FileCheck %s
7
- ; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -mcpu=kryo | FileCheck %s
2
+ ; RUN: opt < %s -passes="print<cost-model>" -cost-kind=all 2>&1 -disable-output | FileCheck %s
3
+ ; RUN: opt < %s -passes="print<cost-model>" -cost-kind=all 2>&1 -disable-output -mcpu=neoverse-n1 | FileCheck %s
4
+ ; RUN: opt < %s -passes="print<cost-model>" -cost-kind=all 2>&1 -disable-output -mcpu=neoverse-n2 | FileCheck %s
5
+ ; RUN: opt < %s -passes="print<cost-model>" -cost-kind=all 2>&1 -disable-output -mcpu=neoverse-v1 | FileCheck %s
6
+ ; RUN: opt < %s -passes="print<cost-model>" -cost-kind=all 2>&1 -disable-output -mcpu=neoverse-v2 | FileCheck %s
7
+ ; RUN: opt < %s -passes="print<cost-model>" -cost-kind=all 2>&1 -disable-output -mcpu=kryo | FileCheck %s
8
8
9
9
target datalayout = "e-m:e-i64:64-i128:128-n32:64-S128"
10
10
target triple = "aarch64--linux-gnu"
11
11
12
12
define void @vectorInstrCost () {
13
13
; CHECK-LABEL: 'vectorInstrCost'
14
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction : %ta0 = extractelement <8 x i1> undef, i32 0
15
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction : %ta1 = extractelement <8 x i1> undef, i32 1
16
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction : %t1 = extractelement <8 x i8> undef, i32 0
17
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction : %t2 = extractelement <8 x i8> undef, i32 1
18
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction : %t3 = extractelement <4 x i16> undef, i32 0
19
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction : %t4 = extractelement <4 x i16> undef, i32 1
20
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction : %t5 = extractelement <2 x i32> undef, i32 0
21
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction : %t6 = extractelement <2 x i32> undef, i32 1
22
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction : %t7 = extractelement <2 x i64> undef, i32 0
23
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction : %t8 = extractelement <2 x i64> undef, i32 1
24
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction : %t9 = extractelement <4 x half> undef, i32 0
25
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction : %t10 = extractelement <4 x half> undef, i32 1
26
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction : %t11 = extractelement <2 x float> undef, i32 0
27
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction : %t12 = extractelement <2 x float> undef, i32 1
28
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction : %t13 = extractelement <2 x double> undef, i32 0
29
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction : %t14 = extractelement <2 x double> undef, i32 1
30
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction : %t31 = insertelement <8 x i1> undef, i1 false, i32 0
31
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction : %t41 = insertelement <8 x i1> undef, i1 true, i32 1
32
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction : %t30 = insertelement <8 x i8> undef, i8 0, i32 0
33
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction : %t40 = insertelement <8 x i8> undef, i8 1, i32 1
34
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction : %t50 = insertelement <4 x i16> undef, i16 2, i32 0
35
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction : %t60 = insertelement <4 x i16> undef, i16 3, i32 1
36
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction : %t70 = insertelement <2 x i32> undef, i32 4, i32 0
37
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction : %t80 = insertelement <2 x i32> undef, i32 5, i32 1
38
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction : %t90 = insertelement <2 x i64> undef, i64 6, i32 0
39
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction : %t100 = insertelement <2 x i64> undef, i64 7, i32 1
40
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction : %t110 = insertelement <4 x half> zeroinitializer, half 0xH0000, i64 0
41
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction : %t120 = insertelement <4 x half> zeroinitializer, half 0xH0000, i64 1
42
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction : %t130 = insertelement <2 x float> zeroinitializer, float 0.000000e+00, i64 0
43
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction : %t140 = insertelement <2 x float> zeroinitializer, float 0.000000e+00, i64 1
44
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction : %t150 = insertelement <2 x double> zeroinitializer, double 0.000000e+00, i64 0
45
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction : %t160 = insertelement <2 x double> zeroinitializer, double 0.000000e+00, i64 1
46
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction : ret void
14
+ ; CHECK-NEXT: Cost Model: Found costs of 3 for: %ta0 = extractelement <8 x i1> undef, i32 0
15
+ ; CHECK-NEXT: Cost Model: Found costs of 3 for: %ta1 = extractelement <8 x i1> undef, i32 1
16
+ ; CHECK-NEXT: Cost Model: Found costs of 2 for: %t1 = extractelement <8 x i8> undef, i32 0
17
+ ; CHECK-NEXT: Cost Model: Found costs of 2 for: %t2 = extractelement <8 x i8> undef, i32 1
18
+ ; CHECK-NEXT: Cost Model: Found costs of 2 for: %t3 = extractelement <4 x i16> undef, i32 0
19
+ ; CHECK-NEXT: Cost Model: Found costs of 2 for: %t4 = extractelement <4 x i16> undef, i32 1
20
+ ; CHECK-NEXT: Cost Model: Found costs of 2 for: %t5 = extractelement <2 x i32> undef, i32 0
21
+ ; CHECK-NEXT: Cost Model: Found costs of 2 for: %t6 = extractelement <2 x i32> undef, i32 1
22
+ ; CHECK-NEXT: Cost Model: Found costs of 2 for: %t7 = extractelement <2 x i64> undef, i32 0
23
+ ; CHECK-NEXT: Cost Model: Found costs of 2 for: %t8 = extractelement <2 x i64> undef, i32 1
24
+ ; CHECK-NEXT: Cost Model: Found costs of 0 for: %t9 = extractelement <4 x half> undef, i32 0
25
+ ; CHECK-NEXT: Cost Model: Found costs of 2 for: %t10 = extractelement <4 x half> undef, i32 1
26
+ ; CHECK-NEXT: Cost Model: Found costs of 0 for: %t11 = extractelement <2 x float> undef, i32 0
27
+ ; CHECK-NEXT: Cost Model: Found costs of 2 for: %t12 = extractelement <2 x float> undef, i32 1
28
+ ; CHECK-NEXT: Cost Model: Found costs of 0 for: %t13 = extractelement <2 x double> undef, i32 0
29
+ ; CHECK-NEXT: Cost Model: Found costs of 2 for: %t14 = extractelement <2 x double> undef, i32 1
30
+ ; CHECK-NEXT: Cost Model: Found costs of 3 for: %t31 = insertelement <8 x i1> undef, i1 false, i32 0
31
+ ; CHECK-NEXT: Cost Model: Found costs of 3 for: %t41 = insertelement <8 x i1> undef, i1 true, i32 1
32
+ ; CHECK-NEXT: Cost Model: Found costs of 2 for: %t30 = insertelement <8 x i8> undef, i8 0, i32 0
33
+ ; CHECK-NEXT: Cost Model: Found costs of 2 for: %t40 = insertelement <8 x i8> undef, i8 1, i32 1
34
+ ; CHECK-NEXT: Cost Model: Found costs of 2 for: %t50 = insertelement <4 x i16> undef, i16 2, i32 0
35
+ ; CHECK-NEXT: Cost Model: Found costs of 2 for: %t60 = insertelement <4 x i16> undef, i16 3, i32 1
36
+ ; CHECK-NEXT: Cost Model: Found costs of 2 for: %t70 = insertelement <2 x i32> undef, i32 4, i32 0
37
+ ; CHECK-NEXT: Cost Model: Found costs of 2 for: %t80 = insertelement <2 x i32> undef, i32 5, i32 1
38
+ ; CHECK-NEXT: Cost Model: Found costs of 2 for: %t90 = insertelement <2 x i64> undef, i64 6, i32 0
39
+ ; CHECK-NEXT: Cost Model: Found costs of 2 for: %t100 = insertelement <2 x i64> undef, i64 7, i32 1
40
+ ; CHECK-NEXT: Cost Model: Found costs of 0 for: %t110 = insertelement <4 x half> zeroinitializer, half 0xH0000, i64 0
41
+ ; CHECK-NEXT: Cost Model: Found costs of 2 for: %t120 = insertelement <4 x half> zeroinitializer, half 0xH0000, i64 1
42
+ ; CHECK-NEXT: Cost Model: Found costs of 0 for: %t130 = insertelement <2 x float> zeroinitializer, float 0.000000e+00, i64 0
43
+ ; CHECK-NEXT: Cost Model: Found costs of 2 for: %t140 = insertelement <2 x float> zeroinitializer, float 0.000000e+00, i64 1
44
+ ; CHECK-NEXT: Cost Model: Found costs of 0 for: %t150 = insertelement <2 x double> zeroinitializer, double 0.000000e+00, i64 0
45
+ ; CHECK-NEXT: Cost Model: Found costs of 2 for: %t160 = insertelement <2 x double> zeroinitializer, double 0.000000e+00, i64 1
46
+ ; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for : ret void
47
47
;
48
48
%ta0 = extractelement <8 x i1 > undef , i32 0
49
49
%ta1 = extractelement <8 x i1 > undef , i32 1
@@ -85,9 +85,9 @@ define void @vectorInstrCost() {
85
85
86
86
define <8 x i8 > @LD1_B (<8 x i8 > %vec , ptr noundef %i ) {
87
87
; CHECK-LABEL: 'LD1_B'
88
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction : %v1 = load i8, ptr %i, align 1
89
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction : %v2 = insertelement <8 x i8> %vec, i8 %v1, i32 1
90
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction : ret <8 x i8> %v2
88
+ ; CHECK-NEXT: Cost Model: Found costs of RThru:1 CodeSize:1 Lat:4 SizeLat: 1 for: %v1 = load i8, ptr %i, align 1
89
+ ; CHECK-NEXT: Cost Model: Found costs of 3 for: %v2 = insertelement <8 x i8> %vec, i8 %v1, i32 1
90
+ ; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for : ret <8 x i8> %v2
91
91
;
92
92
entry:
93
93
%v1 = load i8 , ptr %i , align 1
97
97
98
98
define <4 x i16 > @LD1_H (<4 x i16 > %vec , ptr noundef %i ) {
99
99
; CHECK-LABEL: 'LD1_H'
100
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction : %v1 = load i16, ptr %i, align 2
101
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction : %v2 = insertelement <4 x i16> %vec, i16 %v1, i32 2
102
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction : ret <4 x i16> %v2
100
+ ; CHECK-NEXT: Cost Model: Found costs of RThru:1 CodeSize:1 Lat:4 SizeLat: 1 for: %v1 = load i16, ptr %i, align 2
101
+ ; CHECK-NEXT: Cost Model: Found costs of 3 for: %v2 = insertelement <4 x i16> %vec, i16 %v1, i32 2
102
+ ; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for : ret <4 x i16> %v2
103
103
;
104
104
entry:
105
105
%v1 = load i16 , ptr %i , align 2
@@ -109,9 +109,9 @@ entry:
109
109
110
110
define <4 x i32 > @LD1_W (<4 x i32 > %vec , ptr noundef %i ) {
111
111
; CHECK-LABEL: 'LD1_W'
112
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction : %v1 = load i32, ptr %i, align 4
113
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction : %v2 = insertelement <4 x i32> %vec, i32 %v1, i32 3
114
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction : ret <4 x i32> %v2
112
+ ; CHECK-NEXT: Cost Model: Found costs of RThru:1 CodeSize:1 Lat:4 SizeLat: 1 for: %v1 = load i32, ptr %i, align 4
113
+ ; CHECK-NEXT: Cost Model: Found costs of 3 for: %v2 = insertelement <4 x i32> %vec, i32 %v1, i32 3
114
+ ; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for : ret <4 x i32> %v2
115
115
;
116
116
entry:
117
117
%v1 = load i32 , ptr %i , align 4
@@ -121,9 +121,9 @@ entry:
121
121
122
122
define <2 x i64 > @LD1_X (<2 x i64 > %vec , ptr noundef %i ) {
123
123
; CHECK-LABEL: 'LD1_X'
124
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction : %v1 = load i64, ptr %i, align 8
125
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction : %v2 = insertelement <2 x i64> %vec, i64 %v1, i32 0
126
- ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction : ret <2 x i64> %v2
124
+ ; CHECK-NEXT: Cost Model: Found costs of RThru:1 CodeSize:1 Lat:4 SizeLat: 1 for: %v1 = load i64, ptr %i, align 8
125
+ ; CHECK-NEXT: Cost Model: Found costs of 3 for: %v2 = insertelement <2 x i64> %vec, i64 %v1, i32 0
126
+ ; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for : ret <2 x i64> %v2
127
127
;
128
128
entry:
129
129
%v1 = load i64 , ptr %i , align 8
0 commit comments