[PATCH] D25772: Add a macro for prefetching data

Rafael Ávila de Espíndola via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 19 07:42:01 PDT 2016

rafael created this revision.
rafael added a reviewer: dblaikie.
rafael added a subscriber: llvm-commits.

I want to use this in a binary search. It can make lld up to 1.029X faster.



Index: include/llvm/Support/Compiler.h
--- include/llvm/Support/Compiler.h
+++ include/llvm/Support/Compiler.h
@@ -118,6 +118,12 @@
+#if defined(__GNUC__)
+#define LLVM_PREFETCH(addr, rw, locality) __builtin_prefetch(addr, rw, locality)
+#define LLVM_PREFETCH(addr, rw, locality)
 #if __has_attribute(sentinel) || LLVM_GNUC_PREREQ(3, 0, 0)
 #define LLVM_END_WITH_NULL __attribute__((sentinel))

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25772.75148.patch
Type: text/x-patch
Size: 529 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161019/4c2e329a/attachment.bin>

More information about the llvm-commits mailing list