[NFC][Py Reformat] Added more commits to .git-blame-ignore-revs
[llvm-project.git] / libc / benchmarks / automemcpy / lib / CodeGenMain.cpp
blob3f4e6fc0423a18ff56d0d723252233d0057c02f9
1 #include "automemcpy/CodeGen.h"
2 #include "automemcpy/RandomFunctionGenerator.h"
3 #include <optional>
4 #include <unordered_set>
6 namespace llvm {
7 namespace automemcpy {
9 std::vector<FunctionDescriptor> generateFunctionDescriptors() {
10 std::unordered_set<FunctionDescriptor, FunctionDescriptor::Hasher> Seen;
11 std::vector<FunctionDescriptor> FunctionDescriptors;
12 RandomFunctionGenerator P;
13 while (std::optional<FunctionDescriptor> MaybeFD = P.next()) {
14 FunctionDescriptor FD = *MaybeFD;
15 if (Seen.count(FD)) // FIXME: Z3 sometimes returns twice the same object.
16 continue;
17 Seen.insert(FD);
18 FunctionDescriptors.push_back(std::move(FD));
20 return FunctionDescriptors;
23 } // namespace automemcpy
24 } // namespace llvm
26 int main(int, char **) {
27 llvm::automemcpy::Serialize(llvm::outs(),
28 llvm::automemcpy::generateFunctionDescriptors());