[PATCH] D67361: [AArch64][GlobalISel] Support sibling calls with mismatched calling conventions

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 9 10:34:49 PDT 2019


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

Add support for sib/tail calling calls whose calling convention differs from the caller's.

- Port over `CCState::resultsCombatible` from CallingConvLower.cpp into CallLowering. This is used to verify that the way the caller and callee CC handle incoming arguments matches up.

- Add `CallLowering::analyzeCallResult`. This is basically a port of `CCState::AnalyzeCallResult`, but using `ArgInfo` rather than `ISD::InputArg`.

- Add `AArch64CallLowering::doCallerAndCalleePassArgsTheSameWay`. This checks that the calling conventions are compatible, and that the caller and callee preserve the same registers.

For testing:

- Update call-translator-tail-call.ll to show that we can now handle mismatched calling conventions.

- Add a GISel line to tailcall-ccmismatch.ll to show that we will not tail call when the regmasks don't line up.


https://reviews.llvm.org/D67361

Files:
  llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h
  llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
  llvm/lib/Target/AArch64/AArch64CallLowering.cpp
  llvm/lib/Target/AArch64/AArch64CallLowering.h
  llvm/test/CodeGen/AArch64/GlobalISel/call-translator-tail-call.ll
  llvm/test/CodeGen/AArch64/tailcall-ccmismatch.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67361.219389.patch
Type: text/x-patch
Size: 11554 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190909/a3b93ba4/attachment.bin>


More information about the llvm-commits mailing list