[CodeGen] Mark calls to objc_autorelease as tail
authorAkira Hatanaka <ahatanaka@apple.com>
Tue, 10 Nov 2020 21:46:53 +0000 (13:46 -0800)
committerAkira Hatanaka <ahatanaka@apple.com>
Tue, 10 Nov 2020 21:48:25 +0000 (13:48 -0800)
commit874b0a0b9db93f5d3350ffe6b5efda2d908415d0
tree8f3f7be5dee826703ca8ecc21f12992fdbd69159
parent53a0d45db6d0f33dfbb724c99ce2560ae25473c2
[CodeGen] Mark calls to objc_autorelease as tail

This enables a method sending an autorelease message to an object and
returning the object in MRR to avoid adding the object to an autorelease
pool if a call to objc_retainAutoreleasedReturnValue in the caller
function accepts the hand off of the retain count.

rdar://problem/50678052

Differential Revision: https://reviews.llvm.org/D91111
clang/lib/CodeGen/CGObjC.cpp
clang/test/CodeGenObjC/convert-messages-to-runtime-calls.m