summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2017-08-07 20:15:58 +0000
committerHans Wennborg <hans@hanshq.net>2017-08-07 20:15:58 +0000
commitef9c5ea4c7fced70a44b90887b90f72e45441802 (patch)
tree939cd0f5e049a0d29c44e8be99bc8de6f7a6de40 /test
parent22ec3c010bb6e43db3058248057f01389ccdaa13 (diff)
Merging r310191:
------------------------------------------------------------------------ r310191 | ctopper | 2017-08-05 16:35:54 -0700 (Sat, 05 Aug 2017) | 18 lines [X86] Enable isel to use the PAUSE instruction even when SSE2 is disabled. Clang part Summary: On older processors this instruction encoding is treated as a NOP. MSVC doesn't disable intrinsics based on features the way clang/gcc does. Because the PAUSE instruction encoding doesn't crash older processors, some software out there uses these intrinsics without checking for SSE2. This change also seems to also be consistent with gcc behavior. Fixes PR34079 Reviewers: RKSimon, zvi Reviewed By: RKSimon Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D36362 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_50@310294 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/pause.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/CodeGen/pause.c b/test/CodeGen/pause.c
new file mode 100644
index 0000000000..1a8e10aec0
--- /dev/null
+++ b/test/CodeGen/pause.c
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -ffreestanding %s -triple=i386-pc-win32 -target-feature -sse2 -emit-llvm -o - -Wall -Werror | FileCheck %s
+// RUN: %clang_cc1 -ffreestanding %s -triple=i386-pc-win32 -target-feature +sse2 -emit-llvm -o - -Wall -Werror | FileCheck %s
+
+
+#include <x86intrin.h>
+
+void test_mm_pause() {
+ // CHECK-LABEL: test_mm_pause
+ // CHECK: call void @llvm.x86.sse2.pause()
+ return _mm_pause();
+}