0
0
mirror of https://github.com/llvm/llvm-project.git synced 2025-04-25 09:16:05 +00:00
llvm-project/llvm/benchmarks/GetIntrinsicInfoTableEntriesBM.cpp
Luke Drummond b55c52c047 Revert "Renormalize line endings whitespace only after dccebddb3b80"
This reverts commit 9d98acb196a40fee5229afeb08f95fd36d41c10a.
2024-10-18 21:16:50 +01:00

31 lines
1023 B
C++

//===- GetIntrinsicInfoTableEntries.cpp - IIT signature benchmark ---------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "benchmark/benchmark.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/IR/Intrinsics.h"
using namespace llvm;
using namespace Intrinsic;
static void BM_GetIntrinsicInfoTableEntries(benchmark::State &state) {
SmallVector<IITDescriptor> Table;
for (auto _ : state) {
for (ID ID = 1; ID < num_intrinsics; ++ID) {
// This makes sure the vector does not keep growing, as well as after the
// first iteration does not result in additional allocations.
Table.clear();
getIntrinsicInfoTableEntries(ID, Table);
}
}
}
BENCHMARK(BM_GetIntrinsicInfoTableEntries);
BENCHMARK_MAIN();