[PATCH] D36361: [X86] Enable isel to use the PAUSE instruction even when SSE2 is disabled

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 5 11:38:24 PDT 2017


craig.topper created this revision.

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.


https://reviews.llvm.org/D36361

Files:
  lib/Target/X86/X86InstrSSE.td


Index: lib/Target/X86/X86InstrSSE.td
===================================================================
--- lib/Target/X86/X86InstrSSE.td
+++ lib/Target/X86/X86InstrSSE.td
@@ -3695,8 +3695,7 @@
 // Pause. This "instruction" is encoded as "rep; nop", so even though it
 // was introduced with SSE2, it's backward compatible.
 def PAUSE : I<0x90, RawFrm, (outs), (ins),
-              "pause", [(int_x86_sse2_pause)], IIC_SSE_PAUSE>,
-              OBXS, Requires<[HasSSE2]>;
+              "pause", [(int_x86_sse2_pause)], IIC_SSE_PAUSE>, OBXS;
 }
 
 let SchedRW = [WriteFence] in {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36361.109886.patch
Type: text/x-patch
Size: 583 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170805/41dd0844/attachment.bin>


More information about the llvm-commits mailing list