forked from OSchip/llvm-project
[libc] Memory function benchmarks: rename MemcmpConfiguration in MemcmpOrBcmpConfiguration
This will help make sense of the double use of the same type in https://reviews.llvm.org/D111622#inline-1065560. Differential Revision: https://reviews.llvm.org/D111868
This commit is contained in:
parent
6678db00e6
commit
4a9bcb605b
|
@ -15,7 +15,7 @@ extern int bcmp(const void *, const void *, size_t);
|
|||
// List of implementations to test.
|
||||
|
||||
using llvm::libc_benchmarks::BzeroConfiguration;
|
||||
using llvm::libc_benchmarks::MemcmpConfiguration;
|
||||
using llvm::libc_benchmarks::MemcmpOrBcmpConfiguration;
|
||||
using llvm::libc_benchmarks::MemcpyConfiguration;
|
||||
using llvm::libc_benchmarks::MemsetConfiguration;
|
||||
|
||||
|
@ -24,13 +24,13 @@ llvm::ArrayRef<MemcpyConfiguration> getMemcpyConfigurations() {
|
|||
{__llvm_libc::memcpy, "__llvm_libc::memcpy"}};
|
||||
return llvm::makeArrayRef(kMemcpyConfigurations);
|
||||
}
|
||||
llvm::ArrayRef<MemcmpConfiguration> getMemcmpConfigurations() {
|
||||
static constexpr MemcmpConfiguration kMemcmpConfigurations[] = {
|
||||
llvm::ArrayRef<MemcmpOrBcmpConfiguration> getMemcmpConfigurations() {
|
||||
static constexpr MemcmpOrBcmpConfiguration kMemcmpConfiguration[] = {
|
||||
{__llvm_libc::memcmp, "__llvm_libc::memcmp"}};
|
||||
return llvm::makeArrayRef(kMemcmpConfigurations);
|
||||
return llvm::makeArrayRef(kMemcmpConfiguration);
|
||||
}
|
||||
llvm::ArrayRef<MemcmpConfiguration> getBcmpConfigurations() {
|
||||
static constexpr MemcmpConfiguration kBcmpConfigurations[] = {
|
||||
llvm::ArrayRef<MemcmpOrBcmpConfiguration> getBcmpConfigurations() {
|
||||
static constexpr MemcmpOrBcmpConfiguration kBcmpConfigurations[] = {
|
||||
{__llvm_libc::bcmp, "__llvm_libc::bcmp"}};
|
||||
return llvm::makeArrayRef(kBcmpConfigurations);
|
||||
}
|
||||
|
@ -43,4 +43,4 @@ llvm::ArrayRef<BzeroConfiguration> getBzeroConfigurations() {
|
|||
static constexpr BzeroConfiguration kBzeroConfigurations[] = {
|
||||
{__llvm_libc::bzero, "__llvm_libc::bzero"}};
|
||||
return llvm::makeArrayRef(kBzeroConfigurations);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,9 +26,9 @@ struct BzeroConfiguration {
|
|||
llvm::StringRef Name;
|
||||
};
|
||||
|
||||
using MemcmpFunction = int (*)(const void *, const void *, size_t);
|
||||
struct MemcmpConfiguration {
|
||||
MemcmpFunction Function;
|
||||
using MemcmpOrBcmpFunction = int (*)(const void *, const void *, size_t);
|
||||
struct MemcmpOrBcmpConfiguration {
|
||||
MemcmpOrBcmpFunction Function;
|
||||
llvm::StringRef Name;
|
||||
};
|
||||
|
||||
|
|
|
@ -238,9 +238,9 @@ struct ComparisonSetup : public ParameterBatch {
|
|||
return getMemcmpSizeDistributions();
|
||||
}
|
||||
|
||||
inline int Call(ParameterType Parameter, MemcmpFunction Memcmp) {
|
||||
return Memcmp(LhsBuffer + Parameter.OffsetBytes,
|
||||
RhsBuffer + Parameter.OffsetBytes, Parameter.SizeBytes);
|
||||
inline int Call(ParameterType Parameter, MemcmpOrBcmpFunction MemcmpOrBcmp) {
|
||||
return MemcmpOrBcmp(LhsBuffer + Parameter.OffsetBytes,
|
||||
RhsBuffer + Parameter.OffsetBytes, Parameter.SizeBytes);
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
|
@ -15,7 +15,7 @@ using llvm::Twine;
|
|||
using llvm::libc_benchmarks::BzeroConfiguration;
|
||||
using llvm::libc_benchmarks::ComparisonSetup;
|
||||
using llvm::libc_benchmarks::CopySetup;
|
||||
using llvm::libc_benchmarks::MemcmpConfiguration;
|
||||
using llvm::libc_benchmarks::MemcmpOrBcmpConfiguration;
|
||||
using llvm::libc_benchmarks::MemcpyConfiguration;
|
||||
using llvm::libc_benchmarks::MemorySizeDistribution;
|
||||
using llvm::libc_benchmarks::MemsetConfiguration;
|
||||
|
@ -94,12 +94,12 @@ extern llvm::ArrayRef<MemcpyConfiguration> getMemcpyConfigurations();
|
|||
BENCHMARK_MEMORY_FUNCTION(BM_Memcpy, CopySetup, MemcpyConfiguration,
|
||||
getMemcpyConfigurations());
|
||||
|
||||
extern llvm::ArrayRef<MemcmpConfiguration> getMemcmpConfigurations();
|
||||
BENCHMARK_MEMORY_FUNCTION(BM_Memcmp, ComparisonSetup, MemcmpConfiguration,
|
||||
extern llvm::ArrayRef<MemcmpOrBcmpConfiguration> getMemcmpConfigurations();
|
||||
BENCHMARK_MEMORY_FUNCTION(BM_Memcmp, ComparisonSetup, MemcmpOrBcmpConfiguration,
|
||||
getMemcmpConfigurations());
|
||||
|
||||
extern llvm::ArrayRef<MemcmpConfiguration> getBcmpConfigurations();
|
||||
BENCHMARK_MEMORY_FUNCTION(BM_Bcmp, ComparisonSetup, MemcmpConfiguration,
|
||||
extern llvm::ArrayRef<MemcmpOrBcmpConfiguration> getBcmpConfigurations();
|
||||
BENCHMARK_MEMORY_FUNCTION(BM_Bcmp, ComparisonSetup, MemcmpOrBcmpConfiguration,
|
||||
getBcmpConfigurations());
|
||||
|
||||
extern llvm::ArrayRef<MemsetConfiguration> getMemsetConfigurations();
|
||||
|
|
Loading…
Reference in New Issue