[llvm-branch-commits] [llvm-branch] r121534 - in /llvm/branches/Apple/whitney: lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/tlv-2.ll

Daniel Dunbar daniel at zuster.org
Fri Dec 10 13:32:05 PST 2010


Author: ddunbar
Date: Fri Dec 10 15:32:04 2010
New Revision: 121534

URL: http://llvm.org/viewvc/llvm-project?rev=121534&view=rev
Log:
Merge r121330:
--
Author: Eric Christopher <echristo at apple.com>
Date:   Thu Dec 9 00:27:58 2010 +0000

    Remove extraneous copy from DAG conversion for darwin tls. This was
    popping up at O0 when it wasn't folded and the fast allocator would
    complain.

Added:
    llvm/branches/Apple/whitney/test/CodeGen/X86/tlv-2.ll
Modified:
    llvm/branches/Apple/whitney/lib/Target/X86/X86ISelLowering.cpp

Modified: llvm/branches/Apple/whitney/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/whitney/lib/Target/X86/X86ISelLowering.cpp?rev=121534&r1=121533&r2=121534&view=diff
==============================================================================
--- llvm/branches/Apple/whitney/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/branches/Apple/whitney/lib/Target/X86/X86ISelLowering.cpp Fri Dec 10 15:32:04 2010
@@ -6204,11 +6204,10 @@
     // TLSCALL will be codegen'ed as call. Inform MFI that function has calls.
     MachineFrameInfo *MFI = DAG.getMachineFunction().getFrameInfo();
     MFI->setAdjustsStack(true);
-
+    
     // And our return value (tls address) is in the standard call return value
     // location.
-    unsigned Reg = Subtarget->is64Bit() ? X86::RAX : X86::EAX;
-    return DAG.getCopyFromReg(Chain, DL, Reg, getPointerTy());
+    return Chain;
   }
 
   assert(false &&

Added: llvm/branches/Apple/whitney/test/CodeGen/X86/tlv-2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/whitney/test/CodeGen/X86/tlv-2.ll?rev=121534&view=auto
==============================================================================
--- llvm/branches/Apple/whitney/test/CodeGen/X86/tlv-2.ll (added)
+++ llvm/branches/Apple/whitney/test/CodeGen/X86/tlv-2.ll Fri Dec 10 15:32:04 2010
@@ -0,0 +1,32 @@
+; RUN: llc < %s -mtriple x86_64-apple-darwin -O0 | FileCheck %s
+
+ at b = thread_local global i32 5, align 4
+ at a = thread_local global i32 0, align 4
+ at c = internal thread_local global i32 0, align 4
+ at d = internal thread_local global i32 5, align 4
+
+define void @foo() nounwind ssp {
+entry:
+  store i32 1, i32* @a, align 4
+  ; CHECK: movq    _a at TLVP(%rip), %rdi
+  ; CHECK: callq   *(%rdi)
+  ; CHECK: movl    $1, (%rax)
+  
+  store i32 2, i32* @b, align 4
+  ; CHECK: movq    _b at TLVP(%rip), %rdi
+  ; CHECK: callq   *(%rdi)
+  ; CHECK: movl    $2, (%rax)
+
+  store i32 3, i32* @c, align 4
+  ; CHECK: movq    _c at TLVP(%rip), %rdi
+  ; CHECK: callq   *(%rdi)
+  ; CHECK: movl    $3, (%rax)
+  
+  store i32 4, i32* @d, align 4
+  ; CHECK: movq    _d at TLVP(%rip), %rdi
+  ; CHECK: callq   *(%rdi)
+  ; CHECK: movl    $4, (%rax)
+  ; CHECK: addq    $8, %rsp
+  
+  ret void
+}





More information about the llvm-branch-commits mailing list