<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm/test/Transforms/ObjCARC, branch master</title>
<subtitle>http://llvm.org</subtitle>
<id>https://git.amat.us/llvm/atom/test/Transforms/ObjCARC?h=master</id>
<link rel='self' href='https://git.amat.us/llvm/atom/test/Transforms/ObjCARC?h=master'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/llvm/'/>
<updated>2013-05-13T23:49:42Z</updated>
<entry>
<title>[objc-arc-opts] In the presense of an alloca unconditionally remove RR pairs if and only if we are both KnownSafeBU/KnownSafeTD rather than just either or.</title>
<updated>2013-05-13T23:49:42Z</updated>
<author>
<name>Michael Gottesman</name>
<email>mgottesman@apple.com</email>
</author>
<published>2013-05-13T23:49:42Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/llvm/commit/?id=acfb3584c58159ec20a8379c864c9d644f8d967e'/>
<id>urn:sha1:acfb3584c58159ec20a8379c864c9d644f8d967e</id>
<content type='text'>
In the presense of a block being initialized, the frontend will emit the
objc_retain on the original pointer and the release on the pointer loaded from
the alloca. The optimizer will through the provenance analysis realize that the
two are related (albiet different), but since we only require KnownSafe in one
direction, will match the inner retain on the original pointer with the guard
release on the original pointer. This is fixed by ensuring that in the presense
of allocas we only unconditionally remove pointers if both our retain and our
release are KnownSafe (i.e. we are KnownSafe in both directions) since we must
deal with the possibility that the frontend will emit what (to the optimizer)
appears to be unbalanced retain/releases.

An example of the miscompile is:

  %A = alloca
  retain(%x)
  retain(%x) &lt;--- Inner Retain
  store %x, %A
  %y = load %A
  ... DO STUFF ...
  release(%y)
  call void @use(%x)
  release(%x) &lt;--- Guarding Release

getting optimized to:

  %A = alloca
  retain(%x)
  store %x, %A
  %y = load %A
  ... DO STUFF ...
  release(%y)
  call void @use(%x)

rdar://13750319

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181743 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
</entry>
<entry>
<title>[objc-arc] Apply the RV optimization to retains next to calls in ObjCARCContract instead of ObjCARCOpts.</title>
<updated>2013-04-29T06:53:53Z</updated>
<author>
<name>Michael Gottesman</name>
<email>mgottesman@apple.com</email>
</author>
<published>2013-04-29T06:53:53Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/llvm/commit/?id=f11a6856cc28875133cef0f7bbad2b7de3a83776'/>
<id>urn:sha1:f11a6856cc28875133cef0f7bbad2b7de3a83776</id>
<content type='text'>
Turning retains into retainRV calls disrupts the data flow analysis in
ObjCARCOpts. Thus we move it as late as we can by moving it into
ObjCARCContract.

We leave in the conversion from retainRV -&gt; retain in ObjCARCOpt since
it enables the dataflow analysis.

rdar://10813093

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180698 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
</entry>
<entry>
<title>[objc-arc] Test cleanups.</title>
<updated>2013-04-27T05:25:54Z</updated>
<author>
<name>Michael Gottesman</name>
<email>mgottesman@apple.com</email>
</author>
<published>2013-04-27T05:25:54Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/llvm/commit/?id=2c2e85536d5020db3f64ab73b56ebe1bfd9aeb73'/>
<id>urn:sha1:2c2e85536d5020db3f64ab73b56ebe1bfd9aeb73</id>
<content type='text'>
Mainly adding paranoid checks for the closing brace of a function to
help with FileCheck error readability. Also some other minor changes.

No actual CHECK changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180668 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
</entry>
<entry>
<title>[objc-arc] Cleaned up tail-call-invariant-enforcement.ll.</title>
<updated>2013-04-21T02:59:44Z</updated>
<author>
<name>Michael Gottesman</name>
<email>mgottesman@apple.com</email>
</author>
<published>2013-04-21T02:59:44Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/llvm/commit/?id=899b2f9d0b3805ff360236a5de61637dc64bcdfd'/>
<id>urn:sha1:899b2f9d0b3805ff360236a5de61637dc64bcdfd</id>
<content type='text'>
Specifically:

1. Added checks that unwind is being properly added to various instructions.
2. Fixed the declaration/calling of objc_release to have a return type of void.
3. Moved all checks to precede the functions and added checks to ensure that the
checks would only match inside the specific function that we are attempting to
check.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179973 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
</entry>
<entry>
<title>[objc-arc] Check that objc-arc-expand properly handles all strictly forwarding calls and does not touch calls which are not strictly forwarding (i.e. objc_retainBlock).</title>
<updated>2013-04-21T01:57:46Z</updated>
<author>
<name>Michael Gottesman</name>
<email>mgottesman@apple.com</email>
</author>
<published>2013-04-21T01:57:46Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/llvm/commit/?id=bf9cac7ebb7860ed7b768e1c8e2f7c02feb4a8b5'/>
<id>urn:sha1:bf9cac7ebb7860ed7b768e1c8e2f7c02feb4a8b5</id>
<content type='text'>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179972 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
</entry>
<entry>
<title>[objc-arc] Renamed the test file clang-arc-used-intrinsic-removed-if-isolated.ll -&gt; intrinsic-use-isolated.ll to match the other test file intrinsic-use.ll.</title>
<updated>2013-04-21T01:42:24Z</updated>
<author>
<name>Michael Gottesman</name>
<email>mgottesman@apple.com</email>
</author>
<published>2013-04-21T01:42:24Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/llvm/commit/?id=755aabc04eb2f5f947208fce97d11c413996b12f'/>
<id>urn:sha1:755aabc04eb2f5f947208fce97d11c413996b12f</id>
<content type='text'>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179971 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
</entry>
<entry>
<title>[objc-arc] Do not mismatch up retains inside a for loop with releases outside said for loop in the presense of differing provenance caused by escaping blocks.</title>
<updated>2013-04-18T05:39:45Z</updated>
<author>
<name>Michael Gottesman</name>
<email>mgottesman@apple.com</email>
</author>
<published>2013-04-18T05:39:45Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/llvm/commit/?id=0556900b260eed881a2f47a2b5267ae3a7cc7ae0'/>
<id>urn:sha1:0556900b260eed881a2f47a2b5267ae3a7cc7ae0</id>
<content type='text'>
This occurs due to an alloca representing a separate ownership from the
original pointer. Thus consider the following pseudo-IR:

  objc_retain(%a)
  for (...) {
    objc_retain(%a)
    %block &lt;- %a
    F(%block)
    objc_release(%block)
  }
  objc_release(%a)

From the perspective of the optimizer, the %block is a separate
provenance from the original %a. Thus the optimizer pairs up the inner
retain for %a and the outer release from %a, resulting in segfaults.

This is fixed by noting that the signature of a mismatch of
retain/releases inside the for loop is a Use/CanRelease top down with an
None bottom up (since bottom up the Retain-CanRelease-Use-Release
sequence is completed by the inner objc_retain, but top down due to the
differing provenance from the objc_release said sequence is not
completed). In said case in CheckForCFGHazards, we now clear the state
of %a implying that no pairing will occur.

Additionally a test case is included.

rdar://12969722

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179747 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
</entry>
<entry>
<title>Streamline arc-annotation test (removing some cases which do not add any extra coverage) and set it up to use FileCheck variables to make the test more robust.</title>
<updated>2013-04-18T04:34:06Z</updated>
<author>
<name>Michael Gottesman</name>
<email>mgottesman@apple.com</email>
</author>
<published>2013-04-18T04:34:06Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/llvm/commit/?id=fd4ce16b7a39dab22e8cfc9a8a43d78502cc6598'/>
<id>urn:sha1:fd4ce16b7a39dab22e8cfc9a8a43d78502cc6598</id>
<content type='text'>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179745 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
</entry>
<entry>
<title>An objc_retain can serve as a use for a different pointer.</title>
<updated>2013-04-05T22:54:32Z</updated>
<author>
<name>Michael Gottesman</name>
<email>mgottesman@apple.com</email>
</author>
<published>2013-04-05T22:54:32Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/llvm/commit/?id=e8b3c2e48aa597f08d029ecaed6c1f7ae3a1d111'/>
<id>urn:sha1:e8b3c2e48aa597f08d029ecaed6c1f7ae3a1d111</id>
<content type='text'>
This is the counterpart to commit r160637, except it performs the action
in the bottomup portion of the data flow analysis.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178922 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
</entry>
<entry>
<title>Properly model precise lifetime when given an incomplete dataflow sequence.</title>
<updated>2013-04-05T22:54:28Z</updated>
<author>
<name>Michael Gottesman</name>
<email>mgottesman@apple.com</email>
</author>
<published>2013-04-05T22:54:28Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/llvm/commit/?id=e7ce2b3f75da1cdb657753592b73cda4252817ef'/>
<id>urn:sha1:e7ce2b3f75da1cdb657753592b73cda4252817ef</id>
<content type='text'>
The normal dataflow sequence in the ARC optimizer consists of the following
states:

    Retain -&gt; CanRelease -&gt; Use -&gt; Release

The optimizer before this patch stored the uses that determine the lifetime of
the retainable object pointer when it bottom up hits a retain or when top down
it hits a release. This is correct for an imprecise lifetime scenario since what
we are trying to do is remove retains/releases while making sure that no
``CanRelease'' (which is usually a call) deallocates the given pointer before we
get to the ``Use'' (since that would cause a segfault).

If we are considering the precise lifetime scenario though, this is not
correct. In such a situation, we *DO* care about the previous sequence, but
additionally, we wish to track the uses resulting from the following incomplete
sequences:

  Retain -&gt; CanRelease -&gt; Release   (TopDown)
  Retain &lt;- Use &lt;- Release          (BottomUp)

*NOTE* This patch looks large but the most of it consists of updating
test cases. Additionally this fix exposed an additional bug. I removed
the test case that expressed said bug and will recommit it with the fix
in a little bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178921 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
</entry>
</feed>
