This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][GlobalISel] Always fall back on tail calls with -tailcallopt
ClosedPublic

Authored by paquette on Sep 5 2019, 4:25 PM.

Details

Summary

-tailcallopt requires that we perform different stack adjustments than with sibling calls. For example, the @caller_to0_from8 function in test/CodeGen/AArch64/tail-call.ll requires that we adjust SP. Without -tailcallopt, this adjustment does not happen. With it, however, it is expected.

So, to ensure that adding sibling call support doesn't break -tailcallopt, make CallLowering always fall back on possible tail calls when -tailcallopt is passed in.

Update test/CodeGen/AArch64/tail-call.ll with a GlobalISel line to make sure that we get the correct code for tail calls with -tailcallopt.

Diff Detail

Repository
rL LLVM

Event Timeline

paquette created this revision.Sep 5 2019, 4:25 PM
aemerson accepted this revision.Sep 6 2019, 9:40 AM

LGTM.

This revision is now accepted and ready to land.Sep 6 2019, 9:40 AM
This revision was automatically updated to reflect the committed changes.