[PATCH] D16474: Use PC-relative address for x32 TLS address
H.J. Lu via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 25 13:25:36 PST 2016
On Mon, Jan 25, 2016 at 1:16 PM, Rafael EspĂndola
<rafael.espindola at gmail.com> wrote:
> On 25 January 2016 at 13:07, H.J Lu <hjl.tools at gmail.com> wrote:
>> hjl.tools added a comment.
>>
>> Since llvm doesn't support TLS for x32:
>>
>> [hjl at gnu-mic-2 X86]$ cat x32-tls-1.ll
>> @x = thread_local global i32 0, align 4
>>
>> define i32* @get_x() {
>> entry:
>>
>> ret i32* @x
>>
>> }
>> [hjl at gnu-mic-2 X86]$ /export/build/gnu/llvm-clang/build-x86_64-linux/bin/llc -relocation-model=pic -mtriple=x86_64-linux-gnux32 < x32-tls-1.ll
>> .text
>> .file "<stdin>"
>> LLVM ERROR: Cannot select: 0x29507a0: ch,glue = X86ISD::TLSADDR 0x28fc140, TargetGlobalTLSAddress:i32<i32* @x> 0 [TF=7]
>>
>> 0x2950670: i32 = TargetGlobalTLSAddress<i32* @x> 0 [TF=7]
>>
>> In function: get_x
>> [hjl at gnu-mic-2 X86]$
>>
>> I don't know how to create a test for this change.
>
> Your patches fixes the error? If so you can add the test to
> llvm/test/CodeGen/X86. Just run llc and FileCheck to see it is
> printing the expected result.
There are many x32 TLS issues. This patch doesn't fix all of them
nor fixes llvm crash.
--
H.J.
More information about the llvm-commits
mailing list