This is an archive of the discontinued LLVM Phabricator instance.

ARM: support mandatory tail calls
AbandonedPublic

Authored by t.p.northover on May 17 2021, 4:31 AM.

Details

Reviewers
jroelofs
paquette
Summary

This is obviously mostly for swifttailcc, but it's trivial to being tailcc and fastcc along for the ride so I did those too.

The code is pretty closely modelled on how AArch64 handles this because most RISC backends will need approximately the same behaviour, so there are a few main components:

  • Track how much stack space the callee is expected to restore on return (and do it).
  • In the tail call case arguments might not simply be stored to sp + N, but to an object at a fixed offset from the stack on function entry. We use a fixed frame-index for this, which naturally reserves the space so callee-saved registers won't be placed there.
  • The tail call itself needs to track how much stack space it actually needs (because different tail calls vary this).

Diff Detail

Unit TestsFailed

Event Timeline

t.p.northover created this revision.May 17 2021, 4:31 AM
t.p.northover requested review of this revision.May 17 2021, 4:31 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 17 2021, 4:31 AM
t.p.northover abandoned this revision.May 17 2021, 4:39 AM

Bother, I subscribed llvm-commits-test instead of llvm-commits. I'll make a new one.