This is an archive of the discontinued LLVM Phabricator instance.

Add support for nest attribute to ARM backend
ClosedPublic

Authored by scross99 on Jul 12 2015, 10:51 AM.

Details

Reviewers
rengolin
asl
Summary

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

Register r12 ('ip') 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.

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

Diff Detail

Repository
rL LLVM

Event Timeline

scross99 retitled this revision from to Add support for nest attribute to ARM backend.
scross99 updated this object.
scross99 added a reviewer: asl.
scross99 added a subscriber: llvm-commits.
rengolin accepted this revision.Jul 12 2015, 11:17 AM
rengolin added a reviewer: rengolin.

As similar to AArch64, this patch looks good to me.

Committed as r241996.

cheers,
--renato

This revision is now accepted and ready to land.Jul 12 2015, 11:17 AM
rengolin closed this revision.Jul 12 2015, 11:17 AM