[all-commits] [llvm/llvm-project] a39c19: Convert TLS IE to LE in the normal or medium code ...

Zhaoxin Yang via All-commits all-commits at lists.llvm.org
Mon Jan 20 19:35:25 PST 2025


  Branch: refs/heads/users/ylzsx/r-tls-ie-to-le-norelax
  Home:   https://github.com/llvm/llvm-project
  Commit: a39c190e5c8351227178b6e5041bbd97fc6926a9
      https://github.com/llvm/llvm-project/commit/a39c190e5c8351227178b6e5041bbd97fc6926a9
  Author: yangzhaoxin <yangzhaoxin at loongson.cn>
  Date:   2025-01-20 (Mon, 20 Jan 2025)

  Changed paths:
    M lld/ELF/Arch/LoongArch.cpp
    M lld/ELF/Relocations.cpp

  Log Message:
  -----------
  Convert TLS IE to LE in the normal or medium code model.

Original code sequence:
 * pcalau12i $a0, %ie_pc_hi20(sym)
 * ld.d      $a0, $a0, %ie_pc_lo12(sym)

The code sequence converted is as follows:
 * lu12i.w   $a0, %ie_pc_hi20(sym)  # le_hi20 != 0, otherwise NOP
 * ori $a0   $a0, %ie_pc_lo12(sym)

FIXME: When relaxation enables, redundant NOP can be removed. This will
be implemented in a future patch.

Note: In the normal or medium code model, original code sequence with
relocations can appear interleaved, because converted code sequence
calculates the absolute offset. However, in extreme code model, to
identify the current code model, the first four instructions with
relocations must appear consecutively.


  Commit: 78a16b0b149cf48ff4f0ec193d808cfe19840bd3
      https://github.com/llvm/llvm-project/commit/78a16b0b149cf48ff4f0ec193d808cfe19840bd3
  Author: yangzhaoxin <yangzhaoxin at loongson.cn>
  Date:   2025-01-20 (Mon, 20 Jan 2025)

  Changed paths:
    M lld/test/ELF/loongarch-tls-ie.s

  Log Message:
  -----------
  Test loongarch-tls-ie.s pass.


  Commit: 4f2dca46f8f3e10cbda7cae0f79a654e41996d60
      https://github.com/llvm/llvm-project/commit/4f2dca46f8f3e10cbda7cae0f79a654e41996d60
  Author: yangzhaoxin <yangzhaoxin at loongson.cn>
  Date:   2025-01-20 (Mon, 20 Jan 2025)

  Changed paths:
    A lld/test/ELF/loongarch-relax-tls-ie.s

  Log Message:
  -----------
  Add test loongarch-relax-tls-ie.s


  Commit: 81d44f2dd1b6ba343acdebecfc9d69583cb2c6ef
      https://github.com/llvm/llvm-project/commit/81d44f2dd1b6ba343acdebecfc9d69583cb2c6ef
  Author: yangzhaoxin <yangzhaoxin at loongson.cn>
  Date:   2025-01-20 (Mon, 20 Jan 2025)

  Changed paths:
    M lld/ELF/Relocations.cpp

  Log Message:
  -----------
  modify RE_LOONGARCH_GOT.


Compare: https://github.com/llvm/llvm-project/compare/a39c190e5c83%5E...81d44f2dd1b6

To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list