[llvm-commits] [PATCH] Implement local-dynamic TLS model for x86 (PR3985)

Hans Wennborg hans at chromium.org
Fri May 18 10:16:55 PDT 2012


On Thu, May 17, 2012 at 4:03 PM, Hans Wennborg <hans at chromium.org> wrote:
> Hi all,
>
> The attached patch implements the local-dynamic TLS model for x86.
>
> I'm new to the codegen parts, so a thorough review would be very welcome.
>
> For example, I'm not sure if caching the node for the TLS block base
> address in X86MachineFunctionInfo is the right place.

Turns out this needs more work. It crashes compiling compiler-rt, and
I reduced it to this:

target triple = "x86_64-unknown-linux-gnu"
@a = internal thread_local global i32 zeroinitializer, align 1
@b = internal thread_local global i32 zeroinitializer, align 1
declare i32 @g(i32*)
declare i32 @h(i32*, i32*)
define void @f() nounwind {
entry:
  %call = call i32 @g(i32* @a)
  %call1 = call i32 @h(i32* @a, i32* @b)
  ret void
}

Which will cause a crash when compiled with:

$ llc -relocation-model=pic -fast-isel a.ll

I'll keep trying to figure out what's going wrong. If anyone can see
any obvious mistakes in my code, that would be very welcome :)

 - Hans



More information about the llvm-commits mailing list