summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/pause.c
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2017-08-05 23:35:54 +0000
committerCraig Topper <craig.topper@intel.com>2017-08-05 23:35:54 +0000
commit9d8e9ff6206347ae56f242daf17d08160a184b2e (patch)
tree9846a0807cce531e69e1bcf3528b37f0b61e068c /clang/test/CodeGen/pause.c
parent6bfa2aee78785d340ac185a30c666d22130fe018 (diff)
downloadbcm5719-llvm-9d8e9ff6206347ae56f242daf17d08160a184b2e.tar.gz
bcm5719-llvm-9d8e9ff6206347ae56f242daf17d08160a184b2e.zip
[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 llvm-svn: 310191
Diffstat (limited to 'clang/test/CodeGen/pause.c')
-rw-r--r--clang/test/CodeGen/pause.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/CodeGen/pause.c b/clang/test/CodeGen/pause.c
new file mode 100644
index 00000000000..1a8e10aec04
--- /dev/null
+++ b/clang/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();
+}
OpenPOWER on IntegriCloud