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 calling replaceAllUsesWith, manually bitcast the arguments and return values before and after calling the intrinsic functions.
rdar://problem/54125406
I probably missed this from previous commit, shouldn't this function return bool?