[libc] [llvm] [libc] Adding a version of memset with software prefetching (PR #70857)

via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 7 11:20:58 PST 2023


================
@@ -48,6 +48,13 @@ using generic_v256 = uint8_t __attribute__((__vector_size__(32)));
 using generic_v512 = uint8_t __attribute__((__vector_size__(64)));
 } // namespace LIBC_NAMESPACE
 
+namespace LIBC_NAMESPACE::sw_prefetch {
+// Size of a cacheline for software prefetching
+static constexpr size_t kCachelineSize = 64;
+// prefetch for write
+static inline void PrefetchW(CPtr dst) { __builtin_prefetch(dst, 1, 3); }
----------------
doshimili wrote:

Moved both functions to `src/string/memory_utils/utils.h` and renamed to `prefetch_for_write`

https://github.com/llvm/llvm-project/pull/70857


More information about the llvm-commits mailing list