]> granicus.if.org Git - llvm/commit
Do not call replaceAllUsesWith to upgrade calls to ARC runtime functions
authorAkira Hatanaka <ahatanaka@apple.com>
Mon, 12 Aug 2019 23:53:23 +0000 (23:53 +0000)
committerAkira Hatanaka <ahatanaka@apple.com>
Mon, 12 Aug 2019 23:53:23 +0000 (23:53 +0000)
commita1e74cca28e0dcb9cf929b88ef3dc88ff72a2a7f
tree45dfaa90c626c84ef7294348cb9f686ef0e053cd
parent8d482fe28a8b8d172c74c63fe80f795821cd2d75
Do not call replaceAllUsesWith to upgrade calls to ARC runtime functions
to intrinsic calls

This fixes a bug in r368311.

It turns out that the ARC runtime functions in the IR can have pointer
parameter types that are not i8* or i8**. Instead of RAUWing normal
functions with intrinsics, manually bitcast the arguments before passing
them to the intrinsic functions and bitcast the return value back to the
type of the original call instruction.

rdar://problem/54125406

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368634 91177308-0d34-0410-b5e6-96231b3b80d8
lib/IR/AutoUpgrade.cpp
test/Bitcode/upgrade-arc-runtime-calls.bc
test/Bitcode/upgrade-arc-runtime-calls.ll
test/Bitcode/upgrade-mrr-runtime-calls.bc