mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-25 00:29:20 +00:00
Add some codegen patterns for x86_64-linux-gnu tls codegen matching.
Based on a patch by Patrick Marlier! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106433 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9cfcfeb24b
commit
18fb00b4b9
@ -1891,6 +1891,8 @@ def : Pat<(i64 (X86Wrapper tjumptable :$dst)),
|
||||
(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 @@ def : Pat<(i64 (X86Wrapper tjumptable :$dst)),
|
||||
(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 @@ def : Pat<(i64 (X86Wrapper tjumptable :$dst)),
|
||||
(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 tjumptable:$src)), addr:$dst),
|
||||
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]>;
|
||||
|
6
test/CodeGen/X86/x86-64-tls-1.ll
Normal file
6
test/CodeGen/X86/x86-64-tls-1.ll
Normal file
@ -0,0 +1,6 @@
|
||||
; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu | FileCheck %s
|
||||
@tm_nest_level = internal thread_local global i32 0
|
||||
define i64 @z() nounwind {
|
||||
; CHECK: movl $tm_nest_level@TPOFF, %ecx
|
||||
ret i64 and (i64 ptrtoint (i32* @tm_nest_level to i64), i64 100)
|
||||
}
|
Loading…
Reference in New Issue
Block a user