This is an archive of the discontinued LLVM Phabricator instance.

ARM] Fix Neon vector type alignment to 64-bit
ClosedPublic

Authored by javed.absar on May 15 2017, 10:10 AM.

Details

Summary

The maximum alignment for ARM NEON data types should be 64-bits as specified in ARM procedure call standard document Sec. A.2 Notes [1]. This patch fixes it from its current larger natural default values.

[1] http://infocenter.arm.com/help/topic/com.arm.doc.ihi0042f/IHI0042F_aapcs.pdf

Diff Detail

Repository
rL LLVM

Event Timeline

javed.absar created this revision.May 15 2017, 10:10 AM
olista01 accepted this revision.May 22 2017, 9:14 AM
olista01 added a subscriber: olista01.

LGTM

This revision is now accepted and ready to land.May 22 2017, 9:14 AM
rengolin requested changes to this revision.May 22 2017, 9:20 AM

Wait, Stephen had a concern, we need his feedback on my reply before approving.

This revision now requires changes to proceed.May 22 2017, 9:20 AM
srhines requested changes to this revision.May 22 2017, 9:21 AM
srhines added inline comments.
lib/Basic/Targets.cpp
5300 ↗(On Diff #99019)

This should not be set for Android targets. Doing so would break our existing ABI.

Ah, I just found the email thread, looks like it never reached phabricator. Sorry for the confusion.

Ah, I just found the email thread, looks like it never reached phabricator. Sorry for the confusion.

Np. Phab should really do something useful when it's copied in the thread... :)

rengolin added inline comments.May 22 2017, 9:30 AM
lib/Basic/Targets.cpp
5300 ↗(On Diff #99019)

Regardless of the merits, being practical, I think we should make this condition to the environment, to make sure that at least Android keeps its original alignment.

Docs updates and future changes to the ABI should be handled separately.

javed.absar edited edge metadata.

Hi all:
I have made the changes (excluding Android) as recommended. Please have a look if it is now fine.
Thanks
--Javed

Hi all:
I have made the changes (excluding Android) as recommended. Please have a look if it is now fine.

Hi Javed, looks good, but please add a comment so people understand why Android is different.

@srhines, does that look good to you?

cheers,
--renato

rengolin accepted this revision.May 23 2017, 9:07 AM

Approving, so that when Steve does the same, the review is free to commit.

srhines added inline comments.May 23 2017, 10:37 AM
lib/Basic/Targets.cpp
5300 ↗(On Diff #99019)

A comment would be good here, and arm-abi-vector.c needs to have rules for checking Android now too. As it stands, there is no test for this code path, which would be bad. I think just keeping the old CHECK's as ANDROID should be fine.

javed.absar updated this revision to Diff 100052.EditedMay 24 2017, 2:14 AM

Hi.
I have added the comment for Android 128-bit alignement.
Also, arm-ab-vector.c do have checks for Android (please see line line 151,157), so should be fine.
--Javed

srhines accepted this revision.May 24 2017, 8:48 AM

Thanks for fixing this up for Android.

This revision is now accepted and ready to land.May 24 2017, 8:48 AM
This revision was automatically updated to reflect the committed changes.