Add an operand to memory intrinsics to denote the "tail" marker.
authorAmara Emerson <aemerson@apple.com>
Sat, 28 Sep 2019 05:33:21 +0000 (05:33 +0000)
committerAmara Emerson <aemerson@apple.com>
Sat, 28 Sep 2019 05:33:21 +0000 (05:33 +0000)
commit509a4947c911ace18560983466ba5b96f61b6bcb
tree1ac368ab327c2a68ef0c1e23ed21bc82f005bbb1
parent76f44f6b534ef5db42c028028dacc8cc91ee2001
Add an operand to memory intrinsics to denote the "tail" marker.

We need to propagate this information from the IR in order to be able to safely
do tail call optimizations on the intrinsics during legalization. Assuming
it's safe to do tail call opt without checking for the marker isn't safe because
the mem libcall may use allocas from the caller.

This adds an extra immediate operand to the end of the intrinsics and fixes the
legalizer to handle it.

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

llvm-svn: 373140
14 files changed:
llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
llvm/lib/CodeGen/MachineVerifier.cpp
llvm/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll
llvm/test/CodeGen/AArch64/GlobalISel/inline-memcpy.mir
llvm/test/CodeGen/AArch64/GlobalISel/inline-memmove.mir
llvm/test/CodeGen/AArch64/GlobalISel/inline-memset.mir
llvm/test/CodeGen/AArch64/GlobalISel/inline-small-memcpy.mir
llvm/test/CodeGen/AArch64/GlobalISel/legalize-memcpy-et-al.mir
llvm/test/CodeGen/AArch64/GlobalISel/memcpy_chk_no_tail.ll [new file with mode: 0644]
llvm/test/CodeGen/Mips/GlobalISel/irtranslator/call.ll
llvm/test/CodeGen/Mips/GlobalISel/legalizer/dyn_stackalloc.mir
llvm/test/CodeGen/X86/GlobalISel/x86_64-irtranslator-struct-return.ll
llvm/test/MachineVerifier/test_memccpy_intrinsics.mir [new file with mode: 0644]