[all-commits] [llvm/llvm-project] 18ce61: Use PC-relative address for x32 TLS address

Harald van Dijk via All-commits all-commits at lists.llvm.org
Wed Dec 2 14:25:19 PST 2020


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 18ce612353795da6838aade2b933503cbe3cf9b9
      https://github.com/llvm/llvm-project/commit/18ce612353795da6838aade2b933503cbe3cf9b9
  Author: H.J. Lu <hjl.tools at gmail.com>
  Date:   2020-12-02 (Wed, 02 Dec 2020)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelDAGToDAG.cpp

  Log Message:
  -----------
  Use PC-relative address for x32 TLS address

Since x32 supports PC-relative address, it shouldn't use EBX for TLS
address.  Instead of checking N.getValueType(), we should check
Subtarget->is32Bit().  This fixes PR 22676.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D16474


  Commit: c9be4ef184c1a8cb042ae846f9f1818b3ffcddb0
      https://github.com/llvm/llvm-project/commit/c9be4ef184c1a8cb042ae846f9f1818b3ffcddb0
  Author: Harald van Dijk <harald at gigawatt.nl>
  Date:   2020-12-02 (Wed, 02 Dec 2020)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/lib/Target/X86/X86InstrCompiler.td
    M llvm/lib/Target/X86/X86MCInstLower.cpp
    M llvm/test/CodeGen/X86/pic.ll

  Log Message:
  -----------
  [X86] Add TLS_(base_)addrX32 for X32 mode

LLVM has TLS_(base_)addr32 for 32-bit TLS addresses in 32-bit mode, and
TLS_(base_)addr64 for 64-bit TLS addresses in 64-bit mode. x32 mode wants 32-bit
TLS addresses in 64-bit mode, which were not yet handled. This adds
TLS_(base_)addrX32 as copies of TLS_(base_)addr64, except that they use
tls32(base)addr rather than tls64(base)addr, and then restricts
TLS_(base_)addr64 to 64-bit LP64 mode, TLS_(base_)addrX32 to 64-bit ILP32 mode.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D92346


Compare: https://github.com/llvm/llvm-project/compare/32c501dd88b6...c9be4ef184c1


More information about the All-commits mailing list