add_subdirectory(test)
add_subdirectory(fuzzing)
endif()
+
+add_subdirectory(benchmarks)
add_libc_benchmark_analysis(${conf_target} ${run_target})
endfunction()
-function(add_libc_benchmark name file)
+function(add_libc_benchmark name file entrypoint_target)
set(libc_target libc-${name}-benchmark)
add_executable(${libc_target}
EXCLUDE_FROM_ALL
LibcMemoryBenchmarkMain.h
LibcMemoryBenchmarkMain.cpp
)
- target_link_libraries(${libc_target} PUBLIC json)
+
+ get_target_property(entrypoint_object_file ${entrypoint_target} "OBJECT_FILE_RAW")
+ target_link_libraries(${libc_target} PUBLIC json ${entrypoint_object_file})
foreach(configuration "small" "big")
add_libc_benchmark_configuration(${libc_target} ${configuration})
endforeach()
endfunction()
-add_libc_benchmark(memcpy Memcpy.cpp)
-add_libc_benchmark(memcmp Memcmp.cpp)
-add_libc_benchmark(memset Memset.cpp)
+add_libc_benchmark(memcpy Memcpy.cpp libc.src.string.memcpy)
+add_libc_benchmark(memset Memset.cpp libc.src.string.memset)
#include "llvm/Support/raw_ostream.h"
#include <memory>
+namespace __llvm_libc {
+extern void *memcpy(void *__restrict, const void *__restrict, size_t);
+} // namespace __llvm_libc
+
namespace llvm {
namespace libc_benchmarks {
#include "llvm/ADT/StringSwitch.h"
#include "llvm/Support/raw_ostream.h"
+namespace __llvm_libc {
+void *memset(void *, int, size_t);
+} // namespace __llvm_libc
+
namespace llvm {
namespace libc_benchmarks {
BenchmarkResult benchmark(const BenchmarkOptions &Options,
StringRef FunctionName, size_t Size) override {
- FunctionPrototype Function =
- StringSwitch<FunctionPrototype>(FunctionName).Case("memset", &::memset);
+ FunctionPrototype Function = StringSwitch<FunctionPrototype>(FunctionName)
+ .Case("memset", &__llvm_libc::memset);
return llvm::libc_benchmarks::benchmark(
Options, PP, [this, Function, Size](ParameterType p) {
Function(DstBuffer + p.DstOffset, MemsetValue, Size);
add_subdirectory(MPFRWrapper)
add_subdirectory(testutils)
add_subdirectory(UnitTest)
-add_subdirectory(benchmarks)