]> granicus.if.org Git - llvm/commit
[ObjC][ARC] Upgrade calls to ARC runtime functions to intrinsic calls if
authorAkira Hatanaka <ahatanaka@apple.com>
Thu, 8 Aug 2019 16:59:31 +0000 (16:59 +0000)
committerAkira Hatanaka <ahatanaka@apple.com>
Thu, 8 Aug 2019 16:59:31 +0000 (16:59 +0000)
commit0d8b491b7ee98de3486532829f712010d752cd66
treef342596346db25b9ec86526aeb99546e981b3312
parent66d11c88dc79a3ec8df49e51378b30fb164e7e69
[ObjC][ARC] Upgrade calls to ARC runtime functions to intrinsic calls if
the bitcode has the arm64 retainAutoreleasedReturnValue marker

The ARC middle-end passes stopped optimizing or transforming bitcode
that has been compiled with old compilers after we started emitting
calls to ARC runtime functions as intrinsic calls instead of normal
function calls in the front-end and made changes to teach the ARC
middle-end passes about those intrinsics (see r349534). This patch
converts calls to ARC runtime functions that are not intrinsic functions
to intrinsic function calls if the bitcode has the arm64
retainAutoreleasedReturnValue marker. Checking for the presence of the
marker is necessary to make sure we aren't changing ARC function calls
that were originally MRR message sends (see r349952).

rdar://problem/53280660

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368311 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/AutoUpgrade.h
lib/Bitcode/Reader/BitcodeReader.cpp
lib/IR/AutoUpgrade.cpp
test/Bitcode/upgrade-arc-runtime-calls.bc [new file with mode: 0644]
test/Bitcode/upgrade-arc-runtime-calls.ll [new file with mode: 0644]
test/Bitcode/upgrade-clang-arc-use.ll
test/Bitcode/upgrade-mrr-runtime-calls.bc [new file with mode: 0644]