[LLVMdev] LLC Bug x86 with thread local storage

Patrick Marlier
Mon, 21 Jun 2010 09:56:06 -0000

Hello,

This bug affects all LLVM versions from 2.6 to trunk :
http://llvm.org/bugs/show_bug.cgi?id=5081

The workaround I found is to add this :

Index: lib/Target/X86/X86Instr64bit.td
==================================================================---
lib/Target/X86/X86Instr64bit.td     (revision 105882)
+++ lib/Target/X86/X86Instr64bit.td     (working copy)
@@ -1832,6 +1832,8 @@
            (MOV64ri64i32 tjumptable  :$dst)>, Requires<[SmallCode]>;
  def : Pat<(i64 (X86Wrapper tglobaladdr :$dst)),
            (MOV64ri64i32 tglobaladdr :$dst)>, Requires<[SmallCode]>;
+def : Pat<(i64 (X86Wrapper tglobaltlsaddr :$dst)),
+          (MOV64ri32 tglobaltlsaddr :$dst)>, Requires<[SmallCode]>;
  def : Pat<(i64 (X86Wrapper texternalsym:$dst)),
            (MOV64ri64i32 texternalsym:$dst)>, Requires<[SmallCode]>;
  def : Pat<(i64 (X86Wrapper tblockaddress:$dst)),

Unfortunately, I am 100% confident with this modification since I am not
an expert of LLVM and I doubt a bit about the conversion for 32 bit to
64bit.

If someone could approve it or help me with this bug it will be wonderful.

Thank you,
Patrick Marlier.

-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20100621/63a62c0a/attachment.html>