[llvm-commits] [llvm] r106433 - in /llvm/trunk: lib/Target/X86/X86Instr64bit.td test/CodeGen/X86/x86-64-tls-1.ll
Eric Christopher
echristo at apple.com
Mon Jun 21 11:21:27 PDT 2010
Author: echristo
Date: Mon Jun 21 13:21:27 2010
New Revision: 106433
URL: http://llvm.org/viewvc/llvm-project?rev=106433&view=rev
Log:
Add some codegen patterns for x86_64-linux-gnu tls codegen matching.
Based on a patch by Patrick Marlier!
Added:
llvm/trunk/test/CodeGen/X86/x86-64-tls-1.ll
Modified:
llvm/trunk/lib/Target/X86/X86Instr64bit.td
Modified: llvm/trunk/lib/Target/X86/X86Instr64bit.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Instr64bit.td?rev=106433&r1=106432&r2=106433&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86Instr64bit.td (original)
+++ llvm/trunk/lib/Target/X86/X86Instr64bit.td Mon Jun 21 13:21:27 2010
@@ -1891,6 +1891,8 @@
(MOV64ri tjumptable :$dst)>, Requires<[FarData]>;
def : Pat<(i64 (X86Wrapper tglobaladdr :$dst)),
(MOV64ri tglobaladdr :$dst)>, Requires<[FarData]>;
+def : Pat<(i64 (X86Wrapper tglobaltlsaddr :$dst)),
+ (MOV64ri tglobaltlsaddr :$dst)>, Requires<[FarData]>;
def : Pat<(i64 (X86Wrapper texternalsym:$dst)),
(MOV64ri texternalsym:$dst)>, Requires<[FarData]>;
def : Pat<(i64 (X86Wrapper tblockaddress:$dst)),
@@ -1905,6 +1907,8 @@
(MOV64ri64i32 tjumptable :$dst)>, Requires<[SmallCode]>;
def : Pat<(i64 (X86Wrapper tglobaladdr :$dst)),
(MOV64ri64i32 tglobaladdr :$dst)>, Requires<[SmallCode]>;
+def : Pat<(i64 (X86Wrapper tglobaltlsaddr :$dst)),
+ (MOV64ri64i32 tglobaltlsaddr :$dst)>, Requires<[SmallCode]>;
def : Pat<(i64 (X86Wrapper texternalsym:$dst)),
(MOV64ri64i32 texternalsym:$dst)>, Requires<[SmallCode]>;
def : Pat<(i64 (X86Wrapper tblockaddress:$dst)),
@@ -1919,6 +1923,8 @@
(MOV64ri32 tjumptable :$dst)>, Requires<[KernelCode]>;
def : Pat<(i64 (X86Wrapper tglobaladdr :$dst)),
(MOV64ri32 tglobaladdr :$dst)>, Requires<[KernelCode]>;
+def : Pat<(i64 (X86Wrapper tglobaltlsaddr :$dst)),
+ (MOV64ri32 tglobaltlsaddr :$dst)>, Requires<[KernelCode]>;
def : Pat<(i64 (X86Wrapper texternalsym:$dst)),
(MOV64ri32 texternalsym:$dst)>, Requires<[KernelCode]>;
def : Pat<(i64 (X86Wrapper tblockaddress:$dst)),
@@ -1936,6 +1942,9 @@
def : Pat<(store (i64 (X86Wrapper tglobaladdr:$src)), addr:$dst),
(MOV64mi32 addr:$dst, tglobaladdr:$src)>,
Requires<[NearData, IsStatic]>;
+def : Pat<(store (i64 (X86Wrapper tglobaltlsaddr:$src)), addr:$dst),
+ (MOV64mi32 addr:$dst, tglobaltlsaddr:$src)>,
+ Requires<[NearData, IsStatic]>;
def : Pat<(store (i64 (X86Wrapper texternalsym:$src)), addr:$dst),
(MOV64mi32 addr:$dst, texternalsym:$src)>,
Requires<[NearData, IsStatic]>;
Added: llvm/trunk/test/CodeGen/X86/x86-64-tls-1.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/x86-64-tls-1.ll?rev=106433&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/x86-64-tls-1.ll (added)
+++ llvm/trunk/test/CodeGen/X86/x86-64-tls-1.ll Mon Jun 21 13:21:27 2010
@@ -0,0 +1,6 @@
+; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu | FileCheck %s
+ at tm_nest_level = internal thread_local global i32 0
+define i64 @z() nounwind {
+; CHECK: movl $tm_nest_level at TPOFF, %ecx
+ ret i64 and (i64 ptrtoint (i32* @tm_nest_level to i64), i64 100)
+}
More information about the llvm-commits
mailing list