[libc-commits] [libc] ef36e83 - [libc] Using llvm_libc memcpy in mem* benchmarks.

Anthony Steinhauser via libc-commits libc-commits at lists.llvm.org
Thu Sep 24 22:04:06 PDT 2020


Author: Anthony Steinhauser
Date: 2020-09-24T22:03:52-07:00
New Revision: ef36e8380a9109c43ef4a564083428a14a9b818a

URL: https://github.com/llvm/llvm-project/commit/ef36e8380a9109c43ef4a564083428a14a9b818a
DIFF: https://github.com/llvm/llvm-project/commit/ef36e8380a9109c43ef4a564083428a14a9b818a.diff

LOG: [libc] Using llvm_libc memcpy in mem* benchmarks.

Currently the mem* benchmarks use memcpy from Glibc and memset from LLVM libc.
That's misleading and produces inconsistent results and behaviors.

This change makes Memcpy.cpp consistent with Memset.cpp:
https://github.com/llvm/llvm-project/blob/master/libc/benchmarks/Memset.cpp#L49

Reviewers: sivachandra

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D88271

Added: 
    

Modified: 
    libc/benchmarks/Memcpy.cpp

Removed: 
    


################################################################################
diff  --git a/libc/benchmarks/Memcpy.cpp b/libc/benchmarks/Memcpy.cpp
index eb3085355762..4c7b86c5261d 100644
--- a/libc/benchmarks/Memcpy.cpp
+++ b/libc/benchmarks/Memcpy.cpp
@@ -48,8 +48,8 @@ struct MemcpyContext : public BenchmarkRunner {
 
   BenchmarkResult benchmark(const BenchmarkOptions &Options,
                             StringRef FunctionName, size_t Size) override {
-    FunctionPrototype Function =
-        StringSwitch<FunctionPrototype>(FunctionName).Case("memcpy", &::memcpy);
+    FunctionPrototype Function = StringSwitch<FunctionPrototype>(FunctionName)
+                                     .Case("memcpy", &__llvm_libc::memcpy);
     return llvm::libc_benchmarks::benchmark(
         Options, PP, [this, Function, Size](ParameterType p) {
           Function(DstBuffer + p.DstOffset, SrcBuffer + p.SrcOffset, Size);


        


More information about the libc-commits mailing list