This is an archive of the discontinued LLVM Phabricator instance.

Add support for nest attribute to AArch64 backend
AbandonedPublic

Authored by • scross99 on Jun 19 2015, 6:19 PM.

Details

Reviewers
t.p.northover
Summary

The nest attribute is currently supported on the x86 (32-bit) and x86-64 backends, but not on ARM (32-bit) or AArch64. This patch adds support for nest to the AArch64 backend.

Register x18 is used by GCC for this purpose (see https://github.com/gcc-mirror/gcc/blob/7c62dfbbcd3699efcbbadc9fb3aa14f23a123add/gcc/testsuite/gcc.dg/cwsc1.c ) and hence is used here. As discussed on the GCC mailing list (see http://www.mail-archive.com/gcc@gcc.gnu.org/msg76966.html ) the register choice is an ABI issue and so choosing the same register as GCC means __builtin_call_with_static_chain is compatible.

A slight complexity to this issue is that x18 is reserved as the 'platform register' on iOS and Mac (see https://developer.apple.com/library/ios/documentation/Xcode/Conceptual/iPhoneOSABIReference/Articles/ARM64FunctionCallingConventions.html ) and no register has been selected by GCC yet, so nest remains unsupported for those platforms.

Relevant LLVM mailing list discussion: http://comments.gmane.org/gmane.comp.compilers.llvm.devel/86370

Diff Detail

Event Timeline

• scross99 retitled this revision from to Add support for nest attribute to AArch64 backend.
• scross99 updated this object.
• scross99 edited the test plan for this revision. (Show Details)
• scross99 added a reviewer: t.p.northover.
• scross99 added a subscriber: Unknown Object (MLST).Jun 19 2015, 6:20 PM
• scross99 abandoned this revision.Jun 19 2015, 6:27 PM