llvm-project/llvm/test/Transforms/ObjCARC
Akira Hatanaka 73ceb50d85 [ObjCARC] Do not turn a call to @objc_autoreleaseReturnValue into a call
to @objc_autorelease if its operand is a PHI and the PHI has an
equivalent value that is used by a return instruction.

For example, ARC optimizer shouldn't replace the call in the following
example, as doing so breaks the AutoreleaseRV/RetainRV optimization:

  %v1 = bitcast i32* %v0 to i8*
  br label %bb3
bb2:
  %v3 = bitcast i32* %v2 to i8*
  br label %bb3
bb3:
  %p = phi i8* [ %v1, %bb1 ], [ %v3, %bb2 ]
  %retval = phi i32* [ %v0, %bb1 ], [ %v2, %bb2 ] ; equivalent to %p
  %v4 = tail call i8* @objc_autoreleaseReturnValue(i8* %p)
  ret i32* %retval

Also, make sure ObjCARCContract replaces @objc_autoreleaseReturnValue's
operand uses with its value so that the call gets tail-called.

rdar://problem/15894705

llvm-svn: 323009
2018-01-19 23:51:13 +00:00
..
allocas.ll Remove the obsolete offset parameter from @llvm.dbg.value 2017-07-28 20:21:02 +00:00
apelim.ll
basic.ll [ObjCARC] Do not move a release that has the clang.imprecise_release tag 2017-10-16 16:46:59 +00:00
cfg-hazards.ll
clang-arc-use-barrier.ll
comdat-ipo.ll
contract-end-of-use-list.ll
contract-marker.ll
contract-replace-arg-use.ll [ObjCARC] Do not turn a call to @objc_autoreleaseReturnValue into a call 2018-01-19 23:51:13 +00:00
contract-storestrong-ivar.ll
contract-storestrong.ll
contract-testcases.ll
contract.ll
empty-block.ll
ensure-that-exception-unwind-path-is-visited.ll Remove the obsolete offset parameter from @llvm.dbg.value 2017-07-28 20:21:02 +00:00
escape.ll
expand.ll
gvn.ll
intrinsic-use-isolated.ll
intrinsic-use.ll
invoke-2.ll ObjCARC: do not increment past the end of the BB 2017-10-24 00:09:10 +00:00
invoke.ll
move-and-form-retain-autorelease.ll
move-and-merge-autorelease.ll
nested.ll Remove alignment argument from memcpy/memmove/memset in favour of alignment attributes (Step 1) 2018-01-19 17:13:12 +00:00
path-overflow.ll
pointer-types.ll
post-inlining.ll
pr12270.ll
provenance.ll
retain-block-side-effects.ll
retain-not-declared.ll
rle-s2l.ll
rv.ll [ObjCARC] Do not turn a call to @objc_autoreleaseReturnValue into a call 2018-01-19 23:51:13 +00:00
split-backedge.ll
tail-call-invariant-enforcement.ll
unsafe-claim-rv.ll
weak-contract.ll
weak-copies.ll
weak-dce.ll
weak.ll