[Workflow] Roll back some settings since they caused more issues
[llvm-project.git] / libc / benchmarks / MemorySizeDistributions.cpp
blobf003cebd9c3762f5e7d6e408a08f7a21e0134792
1 #include "MemorySizeDistributions.h"
3 #include "llvm/Support/ErrorHandling.h"
4 #include "llvm/Support/raw_ostream.h"
6 namespace llvm {
7 namespace libc_benchmarks {
9 static constexpr double MemmoveGoogleA[] = {
10 #include "distributions/MemmoveGoogleA.csv"
12 static constexpr double MemmoveGoogleB[] = {
13 #include "distributions/MemmoveGoogleB.csv"
15 static constexpr double MemmoveGoogleD[] = {
16 #include "distributions/MemmoveGoogleD.csv"
18 static constexpr double MemmoveGoogleQ[] = {
19 #include "distributions/MemmoveGoogleQ.csv"
21 static constexpr double MemmoveGoogleL[] = {
22 #include "distributions/MemmoveGoogleL.csv"
24 static constexpr double MemmoveGoogleM[] = {
25 #include "distributions/MemmoveGoogleM.csv"
27 static constexpr double MemmoveGoogleS[] = {
28 #include "distributions/MemmoveGoogleS.csv"
30 static constexpr double MemmoveGoogleW[] = {
31 #include "distributions/MemmoveGoogleW.csv"
33 static constexpr double MemmoveGoogleU[] = {
34 #include "distributions/MemmoveGoogleU.csv"
36 static constexpr double MemcmpGoogleA[] = {
37 #include "distributions/MemcmpGoogleA.csv"
39 static constexpr double MemcmpGoogleB[] = {
40 #include "distributions/MemcmpGoogleB.csv"
42 static constexpr double MemcmpGoogleD[] = {
43 #include "distributions/MemcmpGoogleD.csv"
45 static constexpr double MemcmpGoogleQ[] = {
46 #include "distributions/MemcmpGoogleQ.csv"
48 static constexpr double MemcmpGoogleL[] = {
49 #include "distributions/MemcmpGoogleL.csv"
51 static constexpr double MemcmpGoogleM[] = {
52 #include "distributions/MemcmpGoogleM.csv"
54 static constexpr double MemcmpGoogleS[] = {
55 #include "distributions/MemcmpGoogleS.csv"
57 static constexpr double MemcmpGoogleW[] = {
58 #include "distributions/MemcmpGoogleW.csv"
60 static constexpr double MemcmpGoogleU[] = {
61 #include "distributions/MemcmpGoogleU.csv"
63 static constexpr double MemcpyGoogleA[] = {
64 #include "distributions/MemcpyGoogleA.csv"
66 static constexpr double MemcpyGoogleB[] = {
67 #include "distributions/MemcpyGoogleB.csv"
69 static constexpr double MemcpyGoogleD[] = {
70 #include "distributions/MemcpyGoogleD.csv"
72 static constexpr double MemcpyGoogleQ[] = {
73 #include "distributions/MemcpyGoogleQ.csv"
75 static constexpr double MemcpyGoogleL[] = {
76 #include "distributions/MemcpyGoogleL.csv"
78 static constexpr double MemcpyGoogleM[] = {
79 #include "distributions/MemcpyGoogleM.csv"
81 static constexpr double MemcpyGoogleS[] = {
82 #include "distributions/MemcpyGoogleS.csv"
84 static constexpr double MemcpyGoogleW[] = {
85 #include "distributions/MemcpyGoogleW.csv"
87 static constexpr double MemcpyGoogleU[] = {
88 #include "distributions/MemcpyGoogleU.csv"
90 static constexpr double MemsetGoogleA[] = {
91 #include "distributions/MemsetGoogleA.csv"
93 static constexpr double MemsetGoogleB[] = {
94 #include "distributions/MemsetGoogleB.csv"
96 static constexpr double MemsetGoogleD[] = {
97 #include "distributions/MemsetGoogleD.csv"
99 static constexpr double MemsetGoogleQ[] = {
100 #include "distributions/MemsetGoogleQ.csv"
102 static constexpr double MemsetGoogleL[] = {
103 #include "distributions/MemsetGoogleL.csv"
105 static constexpr double MemsetGoogleM[] = {
106 #include "distributions/MemsetGoogleM.csv"
108 static constexpr double MemsetGoogleS[] = {
109 #include "distributions/MemsetGoogleS.csv"
111 static constexpr double MemsetGoogleW[] = {
112 #include "distributions/MemsetGoogleW.csv"
114 static constexpr double MemsetGoogleU[] = {
115 #include "distributions/MemsetGoogleU.csv"
117 static constexpr double Uniform384To4096[] = {
118 #include "distributions/Uniform384To4096.csv"
121 ArrayRef<MemorySizeDistribution> getMemmoveSizeDistributions() {
122 static constexpr MemorySizeDistribution kDistributions[] = {
123 {"memmove Google A", MemmoveGoogleA},
124 {"memmove Google B", MemmoveGoogleB},
125 {"memmove Google D", MemmoveGoogleD},
126 {"memmove Google L", MemmoveGoogleL},
127 {"memmove Google M", MemmoveGoogleM},
128 {"memmove Google Q", MemmoveGoogleQ},
129 {"memmove Google S", MemmoveGoogleS},
130 {"memmove Google U", MemmoveGoogleU},
131 {"memmove Google W", MemmoveGoogleW},
132 {"uniform 384 to 4096", Uniform384To4096},
134 return kDistributions;
137 ArrayRef<MemorySizeDistribution> getMemcpySizeDistributions() {
138 static constexpr MemorySizeDistribution kDistributions[] = {
139 {"memcpy Google A", MemcpyGoogleA},
140 {"memcpy Google B", MemcpyGoogleB},
141 {"memcpy Google D", MemcpyGoogleD},
142 {"memcpy Google L", MemcpyGoogleL},
143 {"memcpy Google M", MemcpyGoogleM},
144 {"memcpy Google Q", MemcpyGoogleQ},
145 {"memcpy Google S", MemcpyGoogleS},
146 {"memcpy Google U", MemcpyGoogleU},
147 {"memcpy Google W", MemcpyGoogleW},
148 {"uniform 384 to 4096", Uniform384To4096},
150 return kDistributions;
153 ArrayRef<MemorySizeDistribution> getMemsetSizeDistributions() {
154 static constexpr MemorySizeDistribution kDistributions[] = {
155 {"memset Google A", MemsetGoogleA},
156 {"memset Google B", MemsetGoogleB},
157 {"memset Google D", MemsetGoogleD},
158 {"memset Google L", MemsetGoogleL},
159 {"memset Google M", MemsetGoogleM},
160 {"memset Google Q", MemsetGoogleQ},
161 {"memset Google S", MemsetGoogleS},
162 {"memset Google U", MemsetGoogleU},
163 {"memset Google W", MemsetGoogleW},
164 {"uniform 384 to 4096", Uniform384To4096},
166 return kDistributions;
169 ArrayRef<MemorySizeDistribution> getMemcmpSizeDistributions() {
170 static constexpr MemorySizeDistribution kDistributions[] = {
171 {"memcmp Google A", MemcmpGoogleA},
172 {"memcmp Google B", MemcmpGoogleB},
173 {"memcmp Google D", MemcmpGoogleD},
174 {"memcmp Google L", MemcmpGoogleL},
175 {"memcmp Google M", MemcmpGoogleM},
176 {"memcmp Google Q", MemcmpGoogleQ},
177 {"memcmp Google S", MemcmpGoogleS},
178 {"memcmp Google U", MemcmpGoogleU},
179 {"memcmp Google W", MemcmpGoogleW},
180 {"uniform 384 to 4096", Uniform384To4096},
182 return kDistributions;
185 MemorySizeDistribution
186 getDistributionOrDie(ArrayRef<MemorySizeDistribution> Distributions,
187 StringRef Name) {
188 size_t Index = 0;
189 for (const auto &MSD : Distributions) {
190 if (MSD.Name == Name)
191 return MSD;
192 ++Index;
194 std::string Message;
195 raw_string_ostream Stream(Message);
196 Stream << "Unknown MemorySizeDistribution '" << Name
197 << "', available distributions:\n";
198 for (const auto &MSD : Distributions)
199 Stream << "'" << MSD.Name << "'\n";
200 report_fatal_error(Stream.str());
203 } // namespace libc_benchmarks
204 } // namespace llvm