This is an archive of the discontinued LLVM Phabricator instance.

[LoongArch] Add support for emulated TLS model
AbandonedPublic

Authored by wangleiat on Jan 6 2023, 11:34 PM.

Details

Summary

This will ensure that the emulated TLS code should be generated when
useEmulatedTLS() is true.

Diff Detail

Event Timeline

wangleiat created this revision.Jan 6 2023, 11:34 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 6 2023, 11:34 PM
wangleiat requested review of this revision.Jan 6 2023, 11:34 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 6 2023, 11:34 PM
MaskRay requested changes to this revision.Jan 10 2023, 6:11 PM

Emulated TLS is legacy code that we should not support. If ELF TLS works well, stick with ELF TLS.

This revision now requires changes to proceed.Jan 10 2023, 6:11 PM
wangleiat added a comment.EditedJan 10 2023, 9:18 PM

Emulated TLS is legacy code that we should not support. If ELF TLS works well, stick with ELF TLS.

Thank you for your comments.
For this support, the main purposes are:

  1. Make the emulated-tls option work properly.
  2. Make lli handle TLV correctly under LoongArch.

For the second point, it may be necessary at present. I try to remove EmulatedTLS support from the targets(x86_64/aarch64) that supports jit, and jit will not be able to handle TLV correctly.

wangleiat abandoned this revision.Jan 28 2023, 10:36 PM

It is a pity that emulated tls cannot be supported.

It is a pity that emulated tls cannot be supported.

Disagree. Nearly two years ago I objected to RISC-V adding emulated TLS as well.
Cutting corners is easy for porters but is not good for the long-term maintanance of the project.
I am unfamiliar with lib/ExecutionEngine/ but it appears to support ELF TLS for some other ports.