[PATCH] D70370: llvm/ObjCARC: Eliminate inlined AutoreleaseRV calls

Duncan P. N. Exon Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 18 18:53:07 PST 2019


dexonsmith updated this revision to Diff 229957.
dexonsmith added a comment.

In D70370#1750591 <https://reviews.llvm.org/D70370#1750591>, @dexonsmith wrote:

> In D70370#1750378 <https://reviews.llvm.org/D70370#1750378>, @ahatanak wrote:
>
> > It wasn't clear to me, but is the pair deleted only if there are no instructions that return false for `isSafeBetweenRVCalls` in between?
>
>
> I thought it was okay to skip over all opaque calls, but I've changed the code to check for this.


I talked to @ahatanak in person and I believe we should compromise.  I feel confident that skipping over non-ARC intrinsics and non-call/invoke instructions is safe.  Skipping those is sufficient to skip any function teardown logic that the inliner could leave behind.  Importantly, this will also catch intrinsics that get added to function epilogues in the future, without having to update a static list in the ARC optimizer.

While I suspect that skipping opaque function calls is also sound, I'm not as confident and it's not relevant in practice.

@ahatanak, you were going to keep thinking about this.  Please confirm once you've had a chance to think it through.

@rjmccall, WDYT?


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

https://reviews.llvm.org/D70370

Files:
  llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp
  llvm/test/Transforms/ObjCARC/inlined-autorelease-return-value.ll
  llvm/test/Transforms/ObjCARC/unsafe-claim-rv.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70370.229957.patch
Type: text/x-patch
Size: 22725 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191119/cf3ce8db/attachment.bin>


More information about the llvm-commits mailing list