1 //===- GetIntrinsicInfoTableEntries.cpp - IIT signature benchmark ---------===//
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
7 //===----------------------------------------------------------------------===//
9 #include "benchmark/benchmark.h"
10 #include "llvm/ADT/SmallVector.h"
11 #include "llvm/IR/Intrinsics.h"
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.
23 getIntrinsicInfoTableEntries(ID
, Table
);
28 BENCHMARK(BM_GetIntrinsicInfoTableEntries
);