aboutsummaryrefslogtreecommitdiff
path: root/lib/Target
diff options
context:
space:
mode:
authorLauro Ramos Venancio <lauro.venancio@gmail.com>2007-04-23 01:28:10 +0000
committerLauro Ramos Venancio <lauro.venancio@gmail.com>2007-04-23 01:28:10 +0000
commitede1d78969d77c4729a56501f93586b63a7005a7 (patch)
treedc552547140593fc02e60f03e4e2aafcce5d24df /lib/Target
parent47f96bf24687b5068aec7166cb8b3ac33ae964ae (diff)
X86 TLS: optimize the implementation of "local exec" model.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36359 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r--lib/Target/X86/X86InstrInfo.td13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/Target/X86/X86InstrInfo.td b/lib/Target/X86/X86InstrInfo.td
index 1885547ebc..c330bf9908 100644
--- a/lib/Target/X86/X86InstrInfo.td
+++ b/lib/Target/X86/X86InstrInfo.td
@@ -2467,9 +2467,15 @@ def TLS_addr : I<0, Pseudo, (ops GR32:$dst, i32imm:$sym),
Imp<[EBX],[]>;
let AddedComplexity = 10 in
-def TLS_gs : I<0, Pseudo, (ops GR32:$dst, GR32:$src),
- "movl %gs:($src), $dst",
- [(set GR32:$dst, (load (add X86TLStp, GR32:$src)))]>;
+def TLS_gs_rr : I<0, Pseudo, (ops GR32:$dst, GR32:$src),
+ "movl %gs:($src), $dst",
+ [(set GR32:$dst, (load (add X86TLStp, GR32:$src)))]>;
+
+let AddedComplexity = 15 in
+def TLS_gs_ri : I<0, Pseudo, (ops GR32:$dst, i32imm:$src),
+ "movl %gs:${src:mem}, $dst",
+ [(set GR32:$dst,
+ (load (add X86TLStp, (X86Wrapper tglobaltlsaddr:$src))))]>;
def TLS_tp : I<0, Pseudo, (ops GR32:$dst),
"movl %gs:0, $dst",
@@ -2491,6 +2497,7 @@ def DWARF_LOC : I<0, Pseudo, (ops i32imm:$line, i32imm:$col, i32imm:$file),
// ConstantPool GlobalAddress, ExternalSymbol, and JumpTable
def : Pat<(i32 (X86Wrapper tconstpool :$dst)), (MOV32ri tconstpool :$dst)>;
def : Pat<(i32 (X86Wrapper tjumptable :$dst)), (MOV32ri tjumptable :$dst)>;
+def : Pat<(i32 (X86Wrapper tglobaltlsaddr:$dst)), (MOV32ri tglobaltlsaddr:$dst)>;
def : Pat<(i32 (X86Wrapper tglobaladdr :$dst)), (MOV32ri tglobaladdr :$dst)>;
def : Pat<(i32 (X86Wrapper texternalsym:$dst)), (MOV32ri texternalsym:$dst)>;