[libc-commits] [PATCH] D145235: [libc] Add memcpy with software prefetcher

Guillaume Chatelet via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Jul 18 04:23:32 PDT 2023


gchatelet marked an inline comment as done.
gchatelet added inline comments.


================
Comment at: libc/src/string/memory_utils/op_x86.h:50
 
+static constexpr size_t kCachelineSize = 64;
+
----------------
Matt wrote:
> Perhaps you may be able to reuse the cache line information in the subtargets, e.g.,
> - `CacheLineSize`, https://github.com/llvm/llvm-project/blob/d036bf071111001aadf3fc8cbbf058246046a62e/llvm/lib/Target/AArch64/AArch64Subtarget.cpp#L101
> - exposed via `getCacheLineSize()`, https://github.com/llvm/llvm-project/blob/1ee4d880e8760256c606fe55b7af85a4f70d006d/llvm/lib/Target/AArch64/AArch64Subtarget.h#L234
> - cf. `getCPUCacheLineSize` for X86, https://github.com/llvm/llvm-project/blob/1ee4d880e8760256c606fe55b7af85a4f70d006d/clang/lib/Basic/Targets/X86.cpp#L1376
> 
Unfortunately LLVM libc doesn't have access to LLVM sources, to implement a libc you need to be very careful about the dependencies you're pulling in. We can only import very specific macro defining C headers, that's it.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145235/new/

https://reviews.llvm.org/D145235



More information about the libc-commits mailing list