aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen
diff options
context:
space:
mode:
authorMichael Liao <michael.liao@intel.com>2013-03-26 17:52:08 +0000
committerMichael Liao <michael.liao@intel.com>2013-03-26 17:52:08 +0000
commit72339a0d160720c6301d629761e701e5fad56f5e (patch)
tree34f742914855c4d7709d8619c3e9cb72dd6c24ef /test/CodeGen
parentc56fff7fd231aebf4b152f60f8f11ef91835c48a (diff)
Add PRFCHW intrinsic support
- Add head 'prfchwintrin.h' to define '_m_prefetchw' which is mapped to LLVM/clang prefetch builtin - Add option '-mprfchw' to enable PRFCHW feature and pre-define '__PRFCHW__' macro git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178041 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen')
-rw-r--r--test/CodeGen/prefetchw-builtins.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/CodeGen/prefetchw-builtins.c b/test/CodeGen/prefetchw-builtins.c
new file mode 100644
index 0000000000..9c5fdc7233
--- /dev/null
+++ b/test/CodeGen/prefetchw-builtins.c
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-feature +prfchw -emit-llvm -o - %s | FileCheck %s
+
+// Don't include mm_malloc.h, it's system specific.
+#define __MM_MALLOC_H
+
+#include <x86intrin.h>
+
+void prefetch_w(void *p) {
+ return _m_prefetchw(p);
+// CHECK: @prefetch_w
+// CHECK: call void @llvm.prefetch({{.*}}, i32 1, i32 3, i32 1)
+}