[AArch64][GlobalISel] Tail call memory intrinsics
authorJessica Paquette <jpaquette@apple.com>
Fri, 13 Sep 2019 20:25:58 +0000 (20:25 +0000)
committerJessica Paquette <jpaquette@apple.com>
Fri, 13 Sep 2019 20:25:58 +0000 (20:25 +0000)
commit23e464e39563a885be487af9ca37487ff47c4531
tree8aff0a3410fed8bf0511933b03fa0676258f090c
parentb64af0b5e20e3646b3b304724878fa2489b8a931
[AArch64][GlobalISel] Tail call memory intrinsics

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.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371893 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/GlobalISel/CallLowering.h
lib/CodeGen/GlobalISel/LegalizerHelper.cpp
lib/Target/AArch64/AArch64CallLowering.cpp
test/CodeGen/AArch64/GlobalISel/legalize-memcpy-et-al.mir
test/CodeGen/AArch64/tailcall-mem-intrinsics.ll