This is an archive of the discontinued LLVM Phabricator instance.

[LLVM][OHOS] Use emulated TLS for OHOS platform
ClosedPublic

Authored by kpdev42 on Mar 3 2023, 1:45 AM.

Details

Summary

Both Linux and LiteOS for all OpenHarmony targets use emulated TLS

~~~

Huawei RRI, OS Lab

Diff Detail

Event Timeline

kpdev42 created this revision.Mar 3 2023, 1:45 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 3 2023, 1:45 AM
kpdev42 requested review of this revision.Mar 3 2023, 1:45 AM

Both Linux and LiteOS for all OpenHarmony targets use emulated TLS

What does the LiteOS triple look like, should it be tested too?

kpdev42 updated this revision to Diff 504635.Mar 13 2023, 7:01 AM

The only supported arch for liteos is arm32

This revision is now accepted and ready to land.Mar 13 2023, 7:52 AM

Though one last thing, should MIPS be mentioned here? https://reviews.llvm.org/D145227 adds targets for MIPS as well, do you not use emulated TLS there?

jrtc27 requested changes to this revision.Mar 13 2023, 10:13 AM
jrtc27 added inline comments.
llvm/test/CodeGen/RISCV/emutls.ll
1 ↗(On Diff #504635)

NACK for this test, just add your RUN lines to the one in the patch that adds emutls support to RISC-V.

llvm/test/CodeGen/RISCV/emutls_generic.ll
1 ↗(On Diff #504635)

NACK to this too, duplicates

This revision now requires changes to proceed.Mar 13 2023, 10:13 AM
kpdev42 added inline comments.Mar 20 2023, 5:02 AM
llvm/test/CodeGen/RISCV/emutls.ll
1 ↗(On Diff #504635)

Excuse me, do you mean that it is better to prepare a separate patch for RISC-V, right?

jrtc27 added inline comments.Mar 20 2023, 9:16 AM
llvm/test/CodeGen/RISCV/emutls.ll
1 ↗(On Diff #504635)

D143708 adds emulated TLS support (which I assume is what you're using, since this patch doesn't modify the backend to support it) and includes a test for that. You are not adding emulated TLS support here, you're just changing a default, so you shouldn't be writing your own (worse) test for emulated TLS code generation, you should just be adding RUN lines to the test in the patch you're basing this on.

kpdev42 updated this revision to Diff 511359.Apr 6 2023, 4:01 AM

Updated after D143708 landed

kpdev42 marked 2 inline comments as done.Apr 6 2023, 4:02 AM

@jrtc27 Patch was updated, please take a look

Though one last thing, should MIPS be mentioned here? https://reviews.llvm.org/D145227 adds targets for MIPS as well, do you not use emulated TLS there?

Is still outstanding, otherwise no objections.

jrtc27 added a comment.Apr 6 2023, 5:20 AM

One remaining nit as far as I can tell

llvm/test/CodeGen/ARM/emutls.ll
5 ↗(On Diff #511359)

Leave this line alone

kpdev42 updated this revision to Diff 512157.Apr 10 2023, 8:25 AM

Address review comments

This patch adds too many RUN lines. I don't think enumerating every combination for your target triple makes good use of the number of RUN lines. Every RUN line adds a small overhead for all users.
I think adding a line to llvm/test/CodeGen/X86/emutls-pic.ll testing that emulated TLS is used by default is sufficient.

MaskRay requested changes to this revision.Apr 11 2023, 4:52 PM
This revision now requires changes to proceed.Apr 11 2023, 4:52 PM
kpdev42 updated this revision to Diff 513516.Apr 14 2023, 3:26 AM

Address review comment

MaskRay accepted this revision.Apr 14 2023, 11:37 AM
kpdev42 marked an inline comment as done.Apr 17 2023, 3:17 AM

@jrtc27 Please take a look

jrtc27 accepted this revision.Apr 17 2023, 6:55 AM
This revision is now accepted and ready to land.Apr 17 2023, 6:55 AM
This revision was automatically updated to reflect the committed changes.