llvm/test/Transforms/ObjCARC
Michael Gottesman acfb3584c5 [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.
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) <--- Inner Retain
  store %x, %A
  %y = load %A
  ... DO STUFF ...
  release(%y)
  call void @use(%x)
  release(%x) <--- 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
2013-05-13 23:49:42 +00:00
..
allocas.ll [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. 2013-05-13 23:49:42 +00:00
apelim.ll [objc-arc] Test cleanups. 2013-04-27 05:25:54 +00:00
arc-annotations.ll 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. 2013-04-18 04:34:06 +00:00
basic.ll [objc-arc] Test cleanups. 2013-04-27 05:25:54 +00:00
cfg-hazards.ll [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. 2013-04-18 05:39:45 +00:00
contract-marker.ll [objc-arc] Test cleanups. 2013-04-27 05:25:54 +00:00
contract-storestrong-ivar.ll Set the "tail" flag on pattern-matched objc_storeStrong calls. 2012-01-19 19:14:36 +00:00
contract-storestrong.ll [objc-arc] Test cleanups. 2013-04-27 05:25:54 +00:00
contract-testcases.ll [objc-arc] Test cleanups. 2013-04-27 05:25:54 +00:00
contract.ll [objc-arc] Apply the RV optimization to retains next to calls in ObjCARCContract instead of ObjCARCOpts. 2013-04-29 06:53:53 +00:00
empty-block.ll When eliminating unnecessary retain+autorelease on return values, 2011-09-29 22:27:34 +00:00
ensure-that-exception-unwind-path-is-visited.ll Use references to attribute groups on the call/invoke instructions. 2013-02-22 09:09:42 +00:00
escape.ll Use references to attribute groups on the call/invoke instructions. 2013-02-22 09:09:42 +00:00
expand.ll [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). 2013-04-21 01:57:46 +00:00
gvn.ll [objc-arc] Test cleanups. 2013-04-27 05:25:54 +00:00
intrinsic-use-isolated.ll [objc-arc] Renamed the test file clang-arc-used-intrinsic-removed-if-isolated.ll -> intrinsic-use-isolated.ll to match the other test file intrinsic-use.ll. 2013-04-21 01:42:24 +00:00
intrinsic-use.ll [objc-arc] Test cleanups. 2013-04-27 05:25:54 +00:00
invoke.ll [objc-arc] Test cleanups. 2013-04-27 05:25:54 +00:00
lit.local.cfg Replace all instances of dg.exp file with lit.local.cfg, since all tests are run with LIT now and now Dejagnu. dg.exp is no longer needed. 2012-02-16 06:28:33 +00:00
move-and-form-retain-autorelease.ll Use references to attribute groups on the call/invoke instructions. 2013-02-22 09:09:42 +00:00
move-and-merge-autorelease.ll [objc-arc] Apply the RV optimization to retains next to calls in ObjCARCContract instead of ObjCARCOpts. 2013-04-29 06:53:53 +00:00
nested.ll Use references to attribute groups on the call/invoke instructions. 2013-02-22 09:09:42 +00:00
no-objc-arc-exceptions.ll [ObjCARC] Strength reduce objc_retainBlock -> objc_retain if the objc_retainBlock is optimizable. 2013-03-28 20:11:19 +00:00
path-overflow.ll Detect overflow in the path count computation. rdar://12277446. 2012-09-12 20:45:17 +00:00
pointer-types.ll It turns out that clang does use pointer-to-function types to 2011-12-14 19:10:53 +00:00
post-inlining.ll
pr12270.ll Tests: rewrite 'opt ... %s' to 'opt ... < %s' so that opt does not emit a ModuleID 2012-12-30 02:33:22 +00:00
retain-block-alloca.ll Use references to attribute groups on the call/invoke instructions. 2013-02-22 09:09:42 +00:00
retain-block-escape-analysis.ll Properly model precise lifetime when given an incomplete dataflow sequence. 2013-04-05 22:54:28 +00:00
retain-block-load.ll Just like in regular escape analysis, loads and stores through 2012-02-13 22:57:02 +00:00
retain-block-side-effects.ll Use references to attribute groups on the call/invoke instructions. 2013-02-22 09:09:42 +00:00
retain-block.ll Non optimizable objc_retainBlock calls are not forwarding. 2013-03-28 20:11:30 +00:00
retain-not-declared.ll Updated test0 of retain-not-declared.ll to reflect the fact that objc-arc-expand runs before objc-arc/objc-arc-contract. 2013-03-29 22:44:59 +00:00
rle-s2l.ll Use references to attribute groups on the call/invoke instructions. 2013-02-22 09:09:42 +00:00
rv.ll [objc-arc] Apply the RV optimization to retains next to calls in ObjCARCContract instead of ObjCARCOpts. 2013-04-29 06:53:53 +00:00
split-backedge.ll Use references to attribute groups on the call/invoke instructions. 2013-02-22 09:09:42 +00:00
tail-call-invariant-enforcement.ll [objc-arc] Cleaned up tail-call-invariant-enforcement.ll. 2013-04-21 02:59:44 +00:00
weak-contract.ll
weak-copies.ll Use references to attribute groups on the call/invoke instructions. 2013-02-22 09:09:42 +00:00
weak-dce.ll Fix replacing all the users of objc weak runtime routines 2012-05-18 22:17:29 +00:00
weak.ll