Fix test failures introduced by PR #113697 (#116941)
[llvm-project.git] / llvm / benchmarks / GetIntrinsicInfoTableEntriesBM.cpp
blob7f3bd3bc9eb6b3df884a7f1239a1a7e6ebef0b29
1 //===- GetIntrinsicInfoTableEntries.cpp - IIT signature benchmark ---------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #include "benchmark/benchmark.h"
10 #include "llvm/ADT/SmallVector.h"
11 #include "llvm/IR/Intrinsics.h"
13 using namespace llvm;
14 using namespace Intrinsic;
16 static void BM_GetIntrinsicInfoTableEntries(benchmark::State &state) {
17 SmallVector<IITDescriptor> Table;
18 for (auto _ : state) {
19 for (ID ID = 1; ID < num_intrinsics; ++ID) {
20 // This makes sure the vector does not keep growing, as well as after the
21 // first iteration does not result in additional allocations.
22 Table.clear();
23 getIntrinsicInfoTableEntries(ID, Table);
28 BENCHMARK(BM_GetIntrinsicInfoTableEntries);
30 BENCHMARK_MAIN();