[objc-arc] Added ImpreciseAutoreleaseSet to track autorelease calls that were once...
authorMichael Gottesman <mgottesman@apple.com>
Wed, 24 Apr 2013 22:18:18 +0000 (22:18 +0000)
committerMichael Gottesman <mgottesman@apple.com>
Wed, 24 Apr 2013 22:18:18 +0000 (22:18 +0000)
commit3f4613310deac06c5a43c6ff76e7f9ab1e93503c
treef47e912fc4678d4a09e95b7df9ce1d1e16f5a412
parent0eb5e45e4bd0099187009ef43aa63d2cb861560a
[objc-arc] Added ImpreciseAutoreleaseSet to track autorelease calls that were once autoreleaseRV instructions.

Due to the semantics of ARC, we must be extremely conservative with autorelease
calls inserted by the frontend since ARC gaurantees that said object will be in
the autorelease pool after that point, an optimization invariant that the
optimizer must respect.

On the other hand, we are allowed significantly more flexibility with
autoreleaseRV instructions.

Often times though this flexibility is disrupted by early transformations which
transform objc_autoreleaseRV => objc_autorelease if said instruction is no
longer being used as part of an RV pair (generally due to inlining). Since we
can not tell the difference in between an autorelease put into place by the
frontend and one created through said ``strength reduction'' we can not perform
these optimizations.

The addition of this set gets around said issues by allowing us to differentiate
in between said two cases.

rdar://problem/13697741.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180222 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/ObjCARC/ObjCARCOpts.cpp