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

Hans Wennborg hans at chromium.org
Fri May 25 13:51:05 PDT 2012


On Wed, May 23, 2012 at 5:44 PM, Hans Wennborg <hans at chromium.org> wrote:
> Taking another stab at this.
>
> The attached patch implements support for the local-dynamic TLS model on x86.
>
> The lowering code will generate calls to get the address for the TLS
> block for each variable access. Later, a MachineFunctionPass is used
> to remove all such calls except one, achieving the goal of at most one
> call to __get_tls_addr per function.
>
> Again, I'm new to codegen, so any comments and suggestions are much
> appreciated. Please review.

Sorry for all the self replies.

I just realized that moving the __get_tls_addr call to the top of the
function isn't very nice if there are execution paths that wouldn't
otherwise have to call it.

Attached is a new patch that will not move the calls around, but
removes all calls except the first on each execution path. It also
doesn't add the pass when CodeGenOpt::None is used.

Please take a look.

Thanks,
Hans
-------------- next part --------------
A non-text attachment was scrubbed...
Name: local-dynamic3.patch
Type: application/octet-stream
Size: 25961 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120525/6542e889/attachment.obj>


More information about the llvm-commits mailing list