[AArch64][GlobalISel] Support tail calling with swiftself parameters
authorJessica Paquette <jpaquette@apple.com>
Thu, 12 Sep 2019 23:00:59 +0000 (23:00 +0000)
committerJessica Paquette <jpaquette@apple.com>
Thu, 12 Sep 2019 23:00:59 +0000 (23:00 +0000)
commit0c283cb50418e56fc3ad92d552480273751534d5
tree91873eee09003154c956be70893c95faaf2963d9
parentf7d2376b98728a10143bd3bb715f07b01ee2f5d1
[AArch64][GlobalISel] Support tail calling with swiftself parameters

Swiftself uses a callee-saved register. We can tail call when the register used
in the caller and callee is the same.

This behaviour is equivalent to that in `TargetLowering::parametersInCSRMatch`.

Update call-translator-tail-call.ll to verify that we can do this. When we
support inline assembly, we can write a check similar to the one in the
general swiftself.ll. For now, we need to verify that we get the correct COPY
instruction after call lowering.

Differential Revision: https://reviews.llvm.org/D67511

llvm-svn: 371788
llvm/lib/Target/AArch64/AArch64CallLowering.cpp
llvm/test/CodeGen/AArch64/GlobalISel/call-translator-tail-call.ll