[PATCH] D92808: [ObjC][ARC] Use operand bundle 'clang.arc.rv' instead of explicitly emitting retainRV or claimRV calls in the IR

Duncan P. N. Exon Smith via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 11 11:04:09 PST 2021


dexonsmith added a comment.

In D92808#2555868 <https://reviews.llvm.org/D92808#2555868>, @ahatanak wrote:

> For example, if SCCP just does a normal RAUW on the following call, which is taken from the example I posted,
>
>   %r = call i8* @foo() [ "clang.arc.rv"(i64 1, i8* %r) ]
>
> will become
>
>   %r = call i8* @foo() [ "clang.arc.rv"(i64 1, i8* @g0) ]
>
> `%r` doesn't have an explicit use in the IR anymore, so passes like deadargelim can change the return type of the function to `void`.

Is that a problem? It seems like this keeps all the information ARC needs. This could be lowered to:

  call void @foo()
  call @unsafeClaimAutoreleasedReturnValue(i8* @g0)

The ARC optimizer and ARC lowering both need to know about this case, but I don't see why deadargelim needs to know anything special.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D92808/new/

https://reviews.llvm.org/D92808



More information about the cfe-commits mailing list