[llvm-commits] [llvm] r66725 - in /llvm/trunk: lib/Target/X86/X86InstrInfo.td test/CodeGen/X86/tls11.ll test/CodeGen/X86/tls12.ll
Rafael Espindola
rafael.espindola at gmail.com
Wed Mar 11 15:40:06 PDT 2009
Author: rafael
Date: Wed Mar 11 17:40:04 2009
New Revision: 66725
URL: http://llvm.org/viewvc/llvm-project?rev=66725&view=rev
Log:
optimize i8 and i16 tls values.
Added:
llvm/trunk/test/CodeGen/X86/tls11.ll
llvm/trunk/test/CodeGen/X86/tls12.ll
Modified:
llvm/trunk/lib/Target/X86/X86InstrInfo.td
Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.td?rev=66725&r1=66724&r2=66725&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrInfo.td (original)
+++ llvm/trunk/lib/Target/X86/X86InstrInfo.td Wed Mar 11 17:40:04 2009
@@ -2937,6 +2937,24 @@
(load (add X86TLStp, (X86Wrapper tglobaltlsaddr:$src))))]>,
SegGS;
+let AddedComplexity = 15 in
+def TLS_ext16_gs_ri : I<0x8B, Pseudo, (outs GR32:$dst), (ins i32imm:$src),
+ "movzwl\t%gs:${src:mem}, $dst",
+ [(set GR32:$dst,
+ (extloadi32i16
+ (add X86TLStp,
+ (X86Wrapper tglobaltlsaddr:$src))))]>,
+ SegGS;
+
+let AddedComplexity = 15 in
+def TLS_ext8_gs_ri : I<0x8B, Pseudo, (outs GR32:$dst), (ins i32imm:$src),
+ "movzbl\t%gs:${src:mem}, $dst",
+ [(set GR32:$dst,
+ (extloadi32i8
+ (add X86TLStp,
+ (X86Wrapper tglobaltlsaddr:$src))))]>,
+ SegGS;
+
def TLS_tp : I<0x8B, Pseudo, (outs GR32:$dst), (ins),
"movl\t%gs:0, $dst",
[(set GR32:$dst, X86TLStp)]>, SegGS;
Added: llvm/trunk/test/CodeGen/X86/tls11.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/tls11.ll?rev=66725&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/tls11.ll (added)
+++ llvm/trunk/test/CodeGen/X86/tls11.ll Wed Mar 11 17:40:04 2009
@@ -0,0 +1,10 @@
+; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu > %t
+; RUN: grep {movzwl %gs:i at NTPOFF, %eax} %t
+
+ at i = thread_local global i16 15
+
+define i16 @f() {
+entry:
+ %tmp1 = load i16* @i
+ ret i16 %tmp1
+}
Added: llvm/trunk/test/CodeGen/X86/tls12.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/tls12.ll?rev=66725&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/tls12.ll (added)
+++ llvm/trunk/test/CodeGen/X86/tls12.ll Wed Mar 11 17:40:04 2009
@@ -0,0 +1,10 @@
+; RUN: llvm-as < %s | llc -march=x86 -mtriple=i386-linux-gnu > %t
+; RUN: grep {movzbl %gs:i at NTPOFF, %eax} %t
+
+ at i = thread_local global i8 15
+
+define i8 @f() {
+entry:
+ %tmp1 = load i8* @i
+ ret i8 %tmp1
+}
More information about the llvm-commits
mailing list