1*dcf0160bSRahul Joshi //===- GetIntrinsicInfoTableEntries.cpp - IIT signature benchmark ---------===// 2*dcf0160bSRahul Joshi // 3*dcf0160bSRahul Joshi // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4*dcf0160bSRahul Joshi // See https://llvm.org/LICENSE.txt for license information. 5*dcf0160bSRahul Joshi // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6*dcf0160bSRahul Joshi // 7*dcf0160bSRahul Joshi //===----------------------------------------------------------------------===// 8*dcf0160bSRahul Joshi 9*dcf0160bSRahul Joshi #include "benchmark/benchmark.h" 10*dcf0160bSRahul Joshi #include "llvm/ADT/SmallVector.h" 11*dcf0160bSRahul Joshi #include "llvm/IR/Intrinsics.h" 12*dcf0160bSRahul Joshi 13*dcf0160bSRahul Joshi using namespace llvm; 14*dcf0160bSRahul Joshi using namespace Intrinsic; 15*dcf0160bSRahul Joshi 16*dcf0160bSRahul Joshi static void BM_GetIntrinsicInfoTableEntries(benchmark::State &state) { 17*dcf0160bSRahul Joshi SmallVector<IITDescriptor> Table; 18*dcf0160bSRahul Joshi for (auto _ : state) { 19*dcf0160bSRahul Joshi for (ID ID = 1; ID < num_intrinsics; ++ID) { 20*dcf0160bSRahul Joshi // This makes sure the vector does not keep growing, as well as after the 21*dcf0160bSRahul Joshi // first iteration does not result in additional allocations. 22*dcf0160bSRahul Joshi Table.clear(); 23*dcf0160bSRahul Joshi getIntrinsicInfoTableEntries(ID, Table); 24*dcf0160bSRahul Joshi } 25*dcf0160bSRahul Joshi } 26*dcf0160bSRahul Joshi } 27*dcf0160bSRahul Joshi 28*dcf0160bSRahul Joshi BENCHMARK(BM_GetIntrinsicInfoTableEntries); 29*dcf0160bSRahul Joshi 30*dcf0160bSRahul Joshi BENCHMARK_MAIN(); 31