This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Support selecting TPIDR_EL[1-3] as the thread base
ClosedPublic

Authored by philip.derrin on Mar 20 2019, 10:44 PM.

Details

Summary

Add an -mtp=el[0-3] option to select which of the AArch64 thread ID registers will be used for the TLS base pointer.

This is a followup to D54685 which added subtarget features to enable accesses to the privileged thread ID registers.

Diff Detail

Repository
rC Clang

Event Timeline

philip.derrin created this revision.Mar 20 2019, 10:44 PM
olista01 added a subscriber: olista01.

Is there an existing compiler which this option is trying to be compatible with? GCC for AArch64 doesn't currently have an option for this, so we don't have to worry about compatibility with that. If possible, I'd prefer for the option to be "-mtp=", to match the option accepted by clang and GCC for AArch32.

Is there an existing compiler which this option is trying to be compatible with? GCC for AArch64 doesn't currently have an option for this, so we don't have to worry about compatibility with that. If possible, I'd prefer for the option to be "-mtp=", to match the option accepted by clang and GCC for AArch32.

No, there's no existing option as far as I'm aware.

I'm happy to use -mtp=, as long as it is ok for it to remain in Group<m_arm_Features_Group> and to list values for both AArch32 and AArch64. It looks like these things only affect value completion and documentation; is that correct?

philip.derrin edited the summary of this revision. (Show Details)

Merged -mtpidr= with existing AArch32 option -mtp=

olista01 accepted this revision.Mar 29 2019, 6:00 AM

I can't see any other uses of the option groups, or any way to put an option into two groups, so this LGTM.

I'll commit it for you as before.

This revision is now accepted and ready to land.Mar 29 2019, 6:00 AM
This revision was automatically updated to reflect the committed changes.