[X86] Avoid %fs:(%eax) references in x32 mode
authorHarald van Dijk <harald@gigawatt.nl>
Wed, 16 Dec 2020 22:39:57 +0000 (22:39 +0000)
committerHarald van Dijk <harald@gigawatt.nl>
Wed, 16 Dec 2020 22:39:57 +0000 (22:39 +0000)
commit09d0e7a7c153820f66597ac431d4453e272f204e
tree963056e059b6941986bfa76fa1fce2a33c79cd89
parent150fe05db4417c3ed9e4470b7bbd1a6aee7fe505
[X86] Avoid %fs:(%eax) references in x32 mode

The ABI explains that %fs:(%eax) zero-extends %eax to 64 bits, and adds
that the TLS base address, but that the TLS base address need not be
at the start of the TLS block, TLS references may use negative offsets.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D93158
llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
llvm/test/CodeGen/X86/pic.ll
llvm/test/CodeGen/X86/tls-pie.ll