This is an archive of the discontinued LLVM Phabricator instance.

AArch64: allocate 4-byte slot for arm64_32 pointers during tail call.
ClosedPublic

Authored by t.p.northover on Jun 28 2021, 6:55 AM.

Details

Reviewers
fhahn
Summary

Currently we use the i64 type for pointers on arm64_32 which ends up with overlapping objects and eventually causes an assertion failure in PrologEpilogInserter.

This uses the LocVT instead for arm64_32 pointers (the only type in AArch64CallingConvention.td that actually selects Trunc as an option).

Diff Detail

Event Timeline

t.p.northover created this revision.Jun 28 2021, 6:55 AM
t.p.northover requested review of this revision.Jun 28 2021, 6:55 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 28 2021, 6:55 AM
fhahn accepted this revision.Jul 9 2021, 2:22 AM
fhahn added a subscriber: fhahn.

LGTM thanks! As mentioned in the commit message, this should match the definition in AArch64CallingConvention.td which demotes pointers back to i32.

llvm/test/CodeGen/AArch64/swifttail-arm64_32.ll
6

The test ensures we do not crash in PrologEpilogInserter any longer, but it might be good to include check lines for the function & call setups?

This revision is now accepted and ready to land.Jul 9 2021, 2:22 AM
t.p.northover closed this revision.Jul 13 2021, 3:10 AM

Thanks, 7802f62b3f2c with a better test.