[PATCH] D67681: [AArch64][GlobalISel] Support lowering musttail calls

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 17 15:03:05 PDT 2019


paquette created this revision.
paquette added a reviewer: aemerson.
Herald added subscribers: Petar.Avramovic, hiraditya, kristof.beyls, rovka.
Herald added a project: LLVM.

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.

Delete call-translator-musttail.ll, since it was just verifying that we don't tail call. Move the now-passing test to call-translator-tail-call.ll.

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.


https://reviews.llvm.org/D67681

Files:
  llvm/lib/Target/AArch64/AArch64CallLowering.cpp
  llvm/test/CodeGen/AArch64/GlobalISel/call-translator-musttail.ll
  llvm/test/CodeGen/AArch64/GlobalISel/call-translator-tail-call.ll
  llvm/test/CodeGen/AArch64/vararg-tallcall.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67681.220579.patch
Type: text/x-patch
Size: 4897 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190917/e493e51f/attachment.bin>


More information about the llvm-commits mailing list