[PATCH] D17093: [X86] Add address space for SS segment

Michael LeMay via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 15 11:17:24 PDT 2016


mlemay-intel updated this revision to Diff 53923.
mlemay-intel added a comment.

Use FileCheck instead of grep in test.


http://reviews.llvm.org/D17093

Files:
  lib/Target/X86/X86ISelDAGToDAG.cpp
  test/CodeGen/X86/movss.ll

Index: test/CodeGen/X86/movss.ll
===================================================================
--- /dev/null
+++ test/CodeGen/X86/movss.ll
@@ -0,0 +1,9 @@
+; RUN: llc < %s -march=x86 | FileCheck %s
+
+define i32 @foo() nounwind readonly {
+entry:
+; CHECK: ss
+	%tmp = load i32*, i32* addrspace(258)* getelementptr (i32*, i32* addrspace(258)* inttoptr (i32 72 to i32* addrspace(258)*), i32 31)		; <i32*> [#uses=1]
+	%tmp1 = load i32, i32* %tmp		; <i32> [#uses=1]
+	ret i32 %tmp1
+}
Index: lib/Target/X86/X86ISelDAGToDAG.cpp
===================================================================
--- lib/Target/X86/X86ISelDAGToDAG.cpp
+++ lib/Target/X86/X86ISelDAGToDAG.cpp
@@ -1424,11 +1424,13 @@
     return false;
   X86ISelAddressMode AM;
   unsigned AddrSpace = Mgs->getPointerInfo().getAddrSpace();
-  // AddrSpace 256 -> GS, 257 -> FS.
+  // AddrSpace 256 -> GS, 257 -> FS, 258 -> SS.
   if (AddrSpace == 256)
     AM.Segment = CurDAG->getRegister(X86::GS, MVT::i16);
   if (AddrSpace == 257)
     AM.Segment = CurDAG->getRegister(X86::FS, MVT::i16);
+  if (AddrSpace == 258)
+    AM.Segment = CurDAG->getRegister(X86::SS, MVT::i16);
 
   SDLoc DL(N);
   Base = Mgs->getBasePtr();
@@ -1473,11 +1475,13 @@
       Parent->getOpcode() != X86ISD::EH_SJLJ_LONGJMP) { // longjmp
     unsigned AddrSpace =
       cast<MemSDNode>(Parent)->getPointerInfo().getAddrSpace();
-    // AddrSpace 256 -> GS, 257 -> FS.
+    // AddrSpace 256 -> GS, 257 -> FS, 258 -> SS.
     if (AddrSpace == 256)
       AM.Segment = CurDAG->getRegister(X86::GS, MVT::i16);
     if (AddrSpace == 257)
       AM.Segment = CurDAG->getRegister(X86::FS, MVT::i16);
+    if (AddrSpace == 258)
+      AM.Segment = CurDAG->getRegister(X86::SS, MVT::i16);
   }
 
   if (matchAddress(N, AM))


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17093.53923.patch
Type: text/x-patch
Size: 1760 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160415/94873ebc/attachment.bin>


More information about the llvm-commits mailing list