xref: /llvm-project/llvm/test/Analysis/CostModel/SystemZ/load_store.ll (revision 964565f42eb8f06dc8610b44d56b432a8c2cb50b)
1; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -mtriple=systemz-unknown -mcpu=zEC12 | FileCheck %s --check-prefixes=CHECK,ZEC12
2; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -mtriple=systemz-unknown -mcpu=z13 | FileCheck %s --check-prefixes=CHECK,Z13
3; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -mtriple=systemz-unknown -mcpu=z14 | FileCheck %s --check-prefixes=CHECK,Z14
4
5define void @store() {
6  store i8 undef, ptr undef
7  store i16 undef, ptr undef
8  store i32 undef, ptr undef
9  store i64 undef, ptr undef
10  store i128 undef, ptr undef
11  store float undef, ptr undef
12  store double undef, ptr undef
13  store fp128 undef, ptr undef
14  store <2 x i8> undef, ptr undef
15  store <2 x i16> undef, ptr undef
16  store <2 x i32> undef, ptr undef
17  store <2 x i64> undef, ptr undef
18  store <2 x float> undef, ptr undef
19  store <2 x double> undef, ptr undef
20  store <4 x i8> undef, ptr undef
21  store <4 x i16> undef, ptr undef
22  store <4 x i32> undef, ptr undef
23  store <4 x i64> undef, ptr undef
24  store <4 x float> undef, ptr undef
25  store <4 x double> undef, ptr undef
26  store <8 x i8> undef, ptr undef
27  store <8 x i16> undef, ptr undef
28  store <8 x i32> undef, ptr undef
29  store <8 x i64> undef, ptr undef
30  store <8 x float> undef, ptr undef
31  store <8 x double> undef, ptr undef
32  store <16 x i8> undef, ptr undef
33  store <16 x i16> undef, ptr undef
34  store <16 x i32> undef, ptr undef
35  store <16 x i64> undef, ptr undef
36  store <16 x float> undef, ptr undef
37  store <16 x double> undef, ptr undef
38
39; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   store i8 undef, ptr undef
40; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   store i16 undef, ptr undef
41; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   store i32 undef, ptr undef
42; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   store i64 undef, ptr undef
43; ZEC12: Cost Model: Found an estimated cost of 2 for instruction:   store i128 undef, ptr undef
44; Z13:   Cost Model: Found an estimated cost of 1 for instruction:   store i128 undef, ptr undef
45; Z14:   Cost Model: Found an estimated cost of 1 for instruction:   store i128 undef, ptr undef
46; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   store float undef, ptr undef
47; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   store double undef, ptr undef
48; ZEC12: Cost Model: Found an estimated cost of 2 for instruction:   store fp128 undef, ptr undef
49; Z13:   Cost Model: Found an estimated cost of 2 for instruction:   store fp128 undef, ptr undef
50; Z14:   Cost Model: Found an estimated cost of 1 for instruction:   store fp128 undef, ptr undef
51; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   store <2 x i8> undef, ptr undef
52; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   store <2 x i16> undef, ptr undef
53; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   store <2 x i32> undef, ptr undef
54; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   store <2 x i64> undef, ptr undef
55; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   store <2 x float> undef, ptr undef
56; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   store <2 x double> undef, ptr undef
57; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   store <4 x i8> undef, ptr undef
58; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   store <4 x i16> undef, ptr undef
59; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   store <4 x i32> undef, ptr undef
60; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   store <4 x i64> undef, ptr undef
61; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   store <4 x float> undef, ptr undef
62; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   store <4 x double> undef, ptr undef
63; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   store <8 x i8> undef, ptr undef
64; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   store <8 x i16> undef, ptr undef
65; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   store <8 x i32> undef, ptr undef
66; CHECK: Cost Model: Found an estimated cost of 4 for instruction:   store <8 x i64> undef, ptr undef
67; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   store <8 x float> undef, ptr undef
68; CHECK: Cost Model: Found an estimated cost of 4 for instruction:   store <8 x double> undef, ptr undef
69; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   store <16 x i8> undef, ptr undef
70; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   store <16 x i16> undef, ptr undef
71; CHECK: Cost Model: Found an estimated cost of 4 for instruction:   store <16 x i32> undef, ptr undef
72; CHECK: Cost Model: Found an estimated cost of 8 for instruction:   store <16 x i64> undef, ptr undef
73; CHECK: Cost Model: Found an estimated cost of 4 for instruction:   store <16 x float> undef, ptr undef
74; CHECK: Cost Model: Found an estimated cost of 8 for instruction:   store <16 x double> undef, ptr undef
75
76  ret void;
77}
78
79define void @load() {
80  load i8, ptr undef
81  load i16, ptr undef
82  load i32, ptr undef
83  load i64, ptr undef
84  load i128, ptr undef
85  load float, ptr undef
86  load double, ptr undef
87  load fp128, ptr undef
88  load <2 x i8>, ptr undef
89  load <2 x i16>, ptr undef
90  load <2 x i32>, ptr undef
91  load <2 x i64>, ptr undef
92  load <2 x float>, ptr undef
93  load <2 x double>, ptr undef
94  load <4 x i8>, ptr undef
95  load <4 x i16>, ptr undef
96  load <4 x i32>, ptr undef
97  load <4 x i64>, ptr undef
98  load <4 x float>, ptr undef
99  load <4 x double>, ptr undef
100  load <8 x i8>, ptr undef
101  load <8 x i16>, ptr undef
102  load <8 x i32>, ptr undef
103  load <8 x i64>, ptr undef
104  load <8 x float>, ptr undef
105  load <8 x double>, ptr undef
106  load <16 x i8>, ptr undef
107  load <16 x i16>, ptr undef
108  load <16 x i32>, ptr undef
109  load <16 x i64>, ptr undef
110  load <16 x float>, ptr undef
111  load <16 x double>, ptr undef
112
113; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %1 = load i8, ptr undef
114; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %2 = load i16, ptr undef
115; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %3 = load i32, ptr undef
116; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %4 = load i64, ptr undef
117; ZEC12: Cost Model: Found an estimated cost of 2 for instruction:   %5 = load i128, ptr undef
118; Z13:   Cost Model: Found an estimated cost of 1 for instruction:   %5 = load i128, ptr undef
119; Z14:   Cost Model: Found an estimated cost of 1 for instruction:   %5 = load i128, ptr undef
120; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %6 = load float, ptr undef
121; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %7 = load double, ptr undef
122; ZEC12: Cost Model: Found an estimated cost of 2 for instruction:   %8 = load fp128, ptr undef
123; Z13:   Cost Model: Found an estimated cost of 2 for instruction:   %8 = load fp128, ptr undef
124; Z14:   Cost Model: Found an estimated cost of 1 for instruction:   %8 = load fp128, ptr undef
125; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %9 = load <2 x i8>, ptr undef
126; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %10 = load <2 x i16>, ptr undef
127; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %11 = load <2 x i32>, ptr undef
128; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %12 = load <2 x i64>, ptr undef
129; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %13 = load <2 x float>, ptr undef
130; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %14 = load <2 x double>, ptr undef
131; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %15 = load <4 x i8>, ptr undef
132; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %16 = load <4 x i16>, ptr undef
133; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %17 = load <4 x i32>, ptr undef
134; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   %18 = load <4 x i64>, ptr undef
135; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %19 = load <4 x float>, ptr undef
136; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   %20 = load <4 x double>, ptr undef
137; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %21 = load <8 x i8>, ptr undef
138; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %22 = load <8 x i16>, ptr undef
139; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   %23 = load <8 x i32>, ptr undef
140; CHECK: Cost Model: Found an estimated cost of 4 for instruction:   %24 = load <8 x i64>, ptr undef
141; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   %25 = load <8 x float>, ptr undef
142; CHECK: Cost Model: Found an estimated cost of 4 for instruction:   %26 = load <8 x double>, ptr undef
143; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %27 = load <16 x i8>, ptr undef
144; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   %28 = load <16 x i16>, ptr undef
145; CHECK: Cost Model: Found an estimated cost of 4 for instruction:   %29 = load <16 x i32>, ptr undef
146; CHECK: Cost Model: Found an estimated cost of 8 for instruction:   %30 = load <16 x i64>, ptr undef
147; CHECK: Cost Model: Found an estimated cost of 4 for instruction:   %31 = load <16 x float>, ptr undef
148; CHECK: Cost Model: Found an estimated cost of 8 for instruction:   %32 = load <16 x double>, ptr undef
149
150  ret void;
151}
152