[PATCH] D11338: [X86] Add missing _m_prefetch intrinsic

Simon Pilgrim llvm-dev at redking.me.uk
Mon Jul 27 12:02:20 PDT 2015


This revision was automatically updated to reflect the committed changes.
Closed by commit rL243305: [X86] Add missing _m_prefetch intrinsic (authored by RKSimon).

Changed prior to commit:
  http://reviews.llvm.org/D11338?vs=30112&id=30716#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D11338

Files:
  cfe/trunk/lib/Headers/prfchwintrin.h
  cfe/trunk/test/CodeGen/prefetchw-builtins.c

Index: cfe/trunk/lib/Headers/prfchwintrin.h
===================================================================
--- cfe/trunk/lib/Headers/prfchwintrin.h
+++ cfe/trunk/lib/Headers/prfchwintrin.h
@@ -30,6 +30,12 @@
 
 #if defined(__PRFCHW__) || defined(__3dNOW__)
 static __inline__ void __attribute__((__always_inline__, __nodebug__))
+_m_prefetch(void *__P)
+{
+  __builtin_prefetch (__P, 0, 3 /* _MM_HINT_T0 */);
+}
+
+static __inline__ void __attribute__((__always_inline__, __nodebug__))
 _m_prefetchw(void *__P)
 {
   __builtin_prefetch (__P, 1, 3 /* _MM_HINT_T0 */);
Index: cfe/trunk/test/CodeGen/prefetchw-builtins.c
===================================================================
--- cfe/trunk/test/CodeGen/prefetchw-builtins.c
+++ cfe/trunk/test/CodeGen/prefetchw-builtins.c
@@ -5,8 +5,14 @@
 
 #include <x86intrin.h>
 
-void prefetch_w(void *p) {
+void test_m_prefetch(void *p) {
+  return _m_prefetch(p);
+  // CHECK-LABEL: define void @test_m_prefetch
+  // CHECK: call void @llvm.prefetch({{.*}}, i32 0, i32 3, i32 1)
+}
+
+void test_m_prefetch_w(void *p) {
   return _m_prefetchw(p);
-// CHECK: @prefetch_w
+// CHECK-LABEL: define void : @test_m_prefetch_w
 // CHECK: call void @llvm.prefetch({{.*}}, i32 1, i32 3, i32 1)
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11338.30716.patch
Type: text/x-patch
Size: 1242 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150727/8a613365/attachment.bin>


More information about the cfe-commits mailing list