]> granicus.if.org Git - llvm/commit
[AArch64][GlobalISel] Support lowering musttail calls
authorJessica Paquette <jpaquette@apple.com>
Wed, 18 Sep 2019 22:42:25 +0000 (22:42 +0000)
committerJessica Paquette <jpaquette@apple.com>
Wed, 18 Sep 2019 22:42:25 +0000 (22:42 +0000)
commit99507c0d65cbd3ab2bc138a69608a4de3fd89b3b
treed9d8b68dbe167554071b0153f877dfc8e92750fd
parentcb7b458c96a9b880cfaa55d6e9b53733ea966b51
[AArch64][GlobalISel] Support lowering musttail calls

Since we now lower most tail calls, it makes sense to support musttail.

Instead of always falling back to SelectionDAG, only fall back when a musttail
call was not able to be emitted as a tail call. Once we can handle most
incoming and outgoing arguments, we can change this to a `report_fatal_error`
like in ISelLowering.

Remove the assert that we don't have varargs and a musttail, and replace it
with a return false. Implementing this requires that we implement
`saveVarArgRegisters` from AArch64ISelLowering, which is an entirely different
patch.

Add GlobalISel lines to vararg-tallcall.ll to make sure that we produce correct
code. Right now we only fall back, but eventually this will be relevant.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372273 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AArch64/AArch64CallLowering.cpp
test/CodeGen/AArch64/GlobalISel/call-translator-musttail.ll
test/CodeGen/AArch64/GlobalISel/call-translator-tail-call.ll
test/CodeGen/AArch64/vararg-tallcall.ll