[PATCH] D67566: [AArch64][GlobalISel] Tail call memory intrinsics

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 13 10:40:56 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.

Because memory intrinsics are handled differently than other calls, we need to check them for tail call eligiblity in the legalizer. This allows us to still inline them when it's beneficial to do so, but also tail call when possible.

This adds simple tail calling support for when the intrinsic is followed by a return.

It ports the attribute checks from `TargetLowering::isInTailCallPosition` into a similarly-named function in LegalizerHelper.cpp. The target-specific `isUsedByReturnOnly` hook is not ported here.

Update tailcall-mem-intrinsics.ll to show that GlobalISel can now tail call memory intrinsics.

Update legalize-memcpy-et-al.mir to have a case where we don't tail call.


https://reviews.llvm.org/D67566

Files:
  llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h
  llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
  llvm/lib/Target/AArch64/AArch64CallLowering.cpp
  llvm/test/CodeGen/AArch64/GlobalISel/legalize-memcpy-et-al.mir
  llvm/test/CodeGen/AArch64/tailcall-mem-intrinsics.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67566.220142.patch
Type: text/x-patch
Size: 8617 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190913/d5d5ab44/attachment.bin>


More information about the llvm-commits mailing list